[haiku-development] OpenSound media node update

I started rewriting the buffer handling of the OpenSound media node to
use one thread per channel instead of a single thread polling each of
them in sequence, which didn't work well with timeouts on a semaphore,
and consumed a lot of cpu for nothing.
It now spawns a thread for each used channel and just loops on read()
or write() on the device, blocking when the buffer is full, letting OSS
handle buffering and timing on its own.
It's not yet finished but seems promising.
It seems less prone to missing buffers, but since it just floods the
driver there are on average many more buffers waiting, so the latency
is higher and not yet accounted for correctly.

So it should feel much smoother but not lip-sync yet.
Recording should work as well.

Before I commit I wanted some input on that, so feel free to try the
patch.

cd trunk
wget http://revolf.free.fr/beos/patches/opensound.tmp.002.diff.txt
patch -p0 < opensound.tmp.002.diff.txt

For haiku just update your image (but make sure you remove the media
addon that comes with the OSS package as it installs in ~/config and
would conflict)
It might actually work now in QEMU, but I didn't try yet.

For BeOS:
TARGET_PLATFORM=r5 jam -q opensound.media_addon
Here as well, make sure you install it over the version that comes with
the OSS zip.

François.

Other related posts: