[nas] Patch for libaudiooss

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


On Fri, 20 Jul 2001, Tobias Diedrich wrote:
>Erik Inge Bolsø wrote:
>> >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.
>
>The thing is that mplayer writes more than a fragment in one write,
>but libaudiooss would only decrease the number of available fragments
>by one per write regardless how big the write is.

Ah. Now that could be fixed.

>> 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 :)
>
>I don't see why using a separate thread should break multithreaded / forking
>programs, but I have not done much programming with threads in linux yet...
>So If you could explain this to me that would be good :-)

Well, there are a few issues.

1) NAS (libaudio) isn't multithread-safe itself. XMMS trying to play
sound from one thread and do mixer reading and setting in another causes
problems from time to time - my pthread_mutexes help, but are not quite
sufficient.

2) See Q120 here: http://www.lambdacs.com/cpt/FAQ.html
   ... in general, mixing threads and fork() seems to be troublesome. Thus
your creation of a soundplayer thread will probably be troublesome with
many applications that use fork().

Someone that understand the issues better than I do, please help
explaining :)

--
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