Skip to content
Snippets Groups Projects
Commit ad38d533 authored by deuce's avatar deuce
Browse files

Ignore the result of snd_pcm_drain() rather than waiting for it to work.

Call snd_pcm_prepare() before every sample.

Should fix bug #2
https://sourceforge.net/p/syncterm/tickets/2/
parent 7303bfcc
Branches
Tags
No related merge requests found
......@@ -633,10 +633,8 @@ xptone_complete_locked(void)
#ifdef USE_ALSA_SOUND
if(handle_type==SOUND_DEVICE_ALSA) {
if(!alsa_device_open_failed) {
while(alsa_api->snd_pcm_drain(playback_handle))
SLEEP(1);
}
if(!alsa_device_open_failed)
alsa_api->snd_pcm_drain(playback_handle);
}
#endif
......@@ -825,6 +823,7 @@ do_xp_play_sample(const unsigned char *sampo, size_t sz, int *freed)
int ret;
int written=0;
alsa_api->snd_pcm_prepare(playback_handle);
while(written < sz) {
ret=alsa_api->snd_pcm_writei(playback_handle, samp+written, sz-written);
if(ret < 0) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment