Re: [AD] get_audio_stream_buffer |
[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]
Elias Pschernig wrote:
I made a quick look at Allegro sources. There is a function oss_update in uoss.c. If I get it right, it is periodically called to feed data to oss to produce sound. Maybe there are some race conditions and if this function is called when my code is inside of get_audio_stream_buffer, something bad can happen? I did not see any thread synchronization code in get_audio_stream_buffer function.
That is quite right. I noticed that too and thought it may have been related to an audio stream problem I had (though that turned out to be unrelated). It would actually be very easy to add a mutex lock for the audio streams (I did it with OSS before, but since it wasn't related to my problem, I let the code revert back to normal). The problem is we'd need to create a couple global functions for the mixer (one to remotely lock the mutex, and another to unlock it). EAsy enough I suppose. I'll work on a patch for you to test (you are using the CVS version, yes?).
Once the problem occurs, get into gdb with ctrl-c, and I don't know, try "info threads" and "bt" - maybe something gives a hint what is wrong.
Actually, I find ctrl+z to be a better way to stop it. Control-Z sends SIGSTOP, where Control-C sends SIGINT.
- Kitty Cat
Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |