Re: [AD] get_audio_stream_buffer |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
Chris wrote:
Threaded systems should be fine, though the time between getting the
buffer and freeing it must be kept to an absolute minimum (as it is now).
This should say, the entire timer where you use the audio stream
functions should be kept as fast as possible. No other timers, including
the sound driver ones, can run while this one is.
Although my advice is still the same. Do the threading yourself (there
are pthreads available for Win32, and Linux/Unix usually comes with
them), and keep the audio stream within one thread.
I'm using DUMB library for background music (it uses
get_audio_stream_buffer) and all the music code works in its own thread.
But sound is initialized in the main thread and sound effects are
somtimes played from the main thread using play_sample function.
Looks like there are some problems with this approach in Linux. After
playing music for some time in a loop, the game just starts making noise
and becomes unresponsive. Time needed to wait before this problem shows
up varies from about 15 minutes to several hours.
I will try to make a smaller testcase and experiment with it.