]> git.alsa-project.org Git - alsa-lib.git/commit
pcm: dmix: Fix resume with multiple instances
authorTakashi Iwai <tiwai@suse.de>
Fri, 6 Sep 2024 08:05:56 +0000 (10:05 +0200)
committerTakashi Iwai <tiwai@suse.de>
Fri, 6 Sep 2024 08:13:29 +0000 (10:13 +0200)
commit2adc30e9838daf62312f32a0a93129d64b1668b3
treea41e8c2818e4e9207bd6f79a7b59dd25057a0368
parent3b9f3b9431fe7adeca0bd3917f26a8877a1ee7e6
pcm: dmix: Fix resume with multiple instances

The fix for PCM dmix suspend/resume checks spcm->info bit of
SND_PCM_INFO_RESUME for applying a workaround for drivers with the
full resume support.  This assumed that scpm->info is exposed from the
underlying slave PCM device.

The above is true for the first opened instance, but for the second
opened instance, it's a copy from the saved data in shmem.  And, we
dropped SND_PCM_INFO_RESUME bit there to assure not to expose the full
resume capability to applications.  This resulted in the
inconsistencies, and when the second instance is resumed at first, it
misses the snd_pcm_resume() call, hence the driver doesn't react
properly any longer.

For addressing it, we keep SND_PCM_INFO_RESUME bit in shmptr->s.info
bits as is, while dropping the bit exposed to apps in
snd_pcm_direct_hw_refine() and *_hw_params() callbacks.

Fixes: 6d1d620eadf3 ("pcm: dmix: resume workaround for buggy driver")
Reported-and-tested-by: Chancel Liu <chancel.liu@nxp.com>
Closes: https://lore.kernel.org/DB9PR04MB94988752ED7C43B399E0BC00E3942@DB9PR04MB9498.eurprd04.prod.outlook.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
src/pcm/pcm_direct.c