[nas] Patch for libaudiooss

Erik Inge Bolsø knan at mo.himolde.no
Fri Jul 20 10:11:11 MDT 2001


On Wed, 18 Jul 2001, Tobias Diedrich wrote:
>Hi,
>
>I tried to use libaudiooss with mplayer (www.google.com/search?q=linux+mplayer),
>which did not work for two reasons:
>
>1) The GET[OI]SPACE implementation of libaudiooss does not work

It works well enough for most programs... If the program writes between
calls, less space is available ... if it doesn't, more space is available.
But, of course, more exact emulation is a good thing, mostly.

>2) Before calling write() mplayer checks if the write would block and does
>   not call it in that case. Because libaudiooss implements the
>   NAS Eventloop in the blocking write() codepath, it is never called.

Hmm... I'm not sure if I see this problem occuring - I certainly got sound
when I tested mplayer with my only-a-little-patched-from-0.9.13 version -
granted, it was totally unsynced and unusable, but anyway.

>The solution is to use a separate thread for the Eventloop, which is what
>this patch does.
>I also emulate a fragmented buffer, because mplayer uses GETOSPACE to
>determine how much data to write to the buffer.
>
>Tested and working with mplayer, mpg123 and mp3blaster.
>
>Please try this patch, I would be especially interested to hear wether you
>still need the WINE_HACK with this.

Well, it fixes mplayer all right, but it breaks Wine and XMMS horribly, at
least. And, I suspect, most other multithreaded and/or fork()ing
programs.

If you could solve the problem without using a separate thread, and
without breaking compatibility with quite a bit of other programs like
this does, I'd be happy to take the patch :)

--
Erik I. Bolsø | email: <knan at mo.himolde.no>
The UNIX philosophy basically involves giving you enough rope to
hang yourself.  And then a couple of feet more, just to be sure.




More information about the Nas mailing list