mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-06 13:29:59 -05:00
pcm: direct: fix race on clearing timer events
snd_timer handling is racy: plugins clear timer queue if avail_min is not reached to force a sleep on timer. The race can happen if the expected event arrives in between the avail check and the clearing of pending events. If this race happens, the user will unnecessarily wait for one more timer event. On low latency/realtime streams this can lead to xruns and must be avoided. As a fix we recheck avail after having cleared poll events. Signed-off-by: Andreas Pape <apape@de.adit-jv.com> Signed-off-by: Jiada Wang <jiada_wang@mentor.com> Signed-off-by: Mounesh Sutar <sutar.mounesh@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
df7694d80c
commit
9219034301
2 changed files with 20 additions and 5 deletions
|
|
@ -322,7 +322,7 @@ int snd_pcm_direct_munmap(snd_pcm_t *pcm);
|
|||
int snd_pcm_direct_prepare(snd_pcm_t *pcm);
|
||||
int snd_pcm_direct_resume(snd_pcm_t *pcm);
|
||||
int snd_pcm_direct_timer_stop(snd_pcm_direct_t *dmix);
|
||||
void snd_pcm_direct_clear_timer_queue(snd_pcm_direct_t *dmix);
|
||||
int snd_pcm_direct_clear_timer_queue(snd_pcm_direct_t *dmix);
|
||||
int snd_pcm_direct_set_timer_params(snd_pcm_direct_t *dmix);
|
||||
int snd_pcm_direct_open_secondary_client(snd_pcm_t **spcmp, snd_pcm_direct_t *dmix, const char *client_name);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue