[Patches] [ python-Patches-645786 ] More linuxaudiodev fixes

noreply@sourceforge.net noreply@sourceforge.net
Fri, 29 Nov 2002 10:20:20 -0800

Patches item #645786, was opened at 2002-11-29 13:15
You can respond by visiting: 

Category: Modules
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Greg Ward (gward)
Assigned to: Nobody/Anonymous (nobody)
Summary: More linuxaudiodev fixes

Initial Comment:
This patch provides a bunch of improvements / fixes /
rearrangements / clarifications to the linuxaudiodev

* Don't put the device in non-blocking mode at open()
time; this makes
  it impossible to access blocking mode!

* Rename write() to writeall(), and add a write()
method that just
  does one write().

* Rearrange/simplify writeall(): in particular, don't
supply a timeout
  to select.  Let it block forever if it has to.

* Add a bunch of simple ioctl() wrappers: nonblock(),
  getfmts(), channels(), speed(), sync(), reset(),
post().  These
  wrap, respectively, SNDCTL_DSP_NONBLOCK, 

* Reduce flush() (which was a wrapper for the
  ioctl) to an alias for sync().

* Rearrange the lad_methods list to reflect the order
in which the
  methods are defined, and add some grouping comments.

With this patch, the module now acts sanely enough that
it's worth documenting (IMHO).  And I understand it
well enough to write some docs!


>Comment By: Greg Ward (gward)
Date: 2002-11-29 13:20

Logged In: YES 

Oops, forgot to mention: this *should* be backwards
compatible for anyone who's not trying to do funky stuff
with linuxaudiodev.  In particular, the old code opened the
device non-blocking, and its write() method guaranteed
consuming the whole buffer and blocking until that was done.
 My patch makes it open in blocking mode, and the much
simpler write() method relies on OSS's guarantee to block
and consume the whole buffer.  If that doesn't work, apps
can just use writeall() in either blocking or non-blocking mode.

Since the whole point of my changes is to allow people to do
funky stuff with linuxaudiodev (eg. writing to two devices
simultaneously), then I rather  doubt that anyone is using
it that way now.


You can respond by visiting: