summaryrefslogtreecommitdiff
path: root/palsa.c
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <wakeroid@gmail.com>2009-11-28 15:11:11 +0100
committerGravatar Alexey Yakovenko <wakeroid@gmail.com>2009-11-28 15:11:11 +0100
commitf1d393a8b7330dfa98e3b60c634e1e597411a377 (patch)
treea37ed905af2b535f980702169ada0ba434ed88c6 /palsa.c
parent735cdcba6c0622eb7a12d5076fd1656f39ecb2d5 (diff)
fixed random alsa lock in palsa_change_rate
Diffstat (limited to 'palsa.c')
-rw-r--r--palsa.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/palsa.c b/palsa.c
index 80ec577b..e214ce5a 100644
--- a/palsa.c
+++ b/palsa.c
@@ -420,6 +420,8 @@ palsa_thread (uintptr_t context) {
}
/* deliver the data */
+ // FIXME: under some conditions, frames_to_deliver may become huge
+ // like 20M. this case is not handled here.
char buf[frames_to_deliver*4];
palsa_callback (buf, frames_to_deliver*4);
if ((err = snd_pcm_writei (audio, buf, frames_to_deliver)) < 0) {
@@ -428,7 +430,7 @@ palsa_thread (uintptr_t context) {
snd_pcm_start (audio);
}
mutex_unlock (mutex);
-// usleep (1000); // removing this causes deadlock on exit
+ usleep (1000); // this must be here to prevent mutex deadlock
}
}