]> git.alsa-project.org Git - alsa-lib.git/commit
pcm: dmix: Handle slave PCM xrun and unexpected states properly
authorTakashi Iwai <tiwai@suse.de>
Fri, 30 Oct 2015 16:13:50 +0000 (17:13 +0100)
committerTakashi Iwai <tiwai@suse.de>
Thu, 5 Nov 2015 13:37:10 +0000 (14:37 +0100)
commit8985742d91dbdd74b2f605374207473393454fff
treee1bf5fc4aa8f20ba9f0f0ece038b59ef3e8275eb
parent99dc70f023cf118f1e23125301d9fd38fb805f6d
pcm: dmix: Handle slave PCM xrun and unexpected states properly

Currently, dmix & co plugins ignore the XRUN state of the slave PCM.
It's (supposedly) because dmix deals with the PCM in a free-wheel
mode, which is equivalent with XRUN.  But, this difference (whether
the correct freewheel or XRUN) should be done by the kernel, and we
may have an XRUN state indeed (e.g. via xrun injection).

This patch fixes this lack of behavior, to handle PCM xrun and does
prepare when the slave PCM is in such a state.

Also, the patch consolidates the prepare callback for all dmix, dsnoop
and dshare plugins, and fix/cleanup a bit for dshare/dsnoop codes to
align with dsnoop code.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
src/pcm/pcm_direct.c
src/pcm/pcm_direct.h
src/pcm/pcm_dmix.c
src/pcm/pcm_dshare.c
src/pcm/pcm_dsnoop.c