ASoC: SOF: fix PCM playback through ALSA OSS emulation
authorKai Vehmanen <kai.vehmanen@linux.intel.com>
Fri, 10 Jan 2020 23:57:49 +0000 (17:57 -0600)
committerMark Brown <broonie@kernel.org>
Mon, 13 Jan 2020 15:00:00 +0000 (15:00 +0000)
commitcfe8191b1bbf2b41581b63eb97e56cd6bc3c34a1
tree6aa3be4971c9f51ac726ec033db3130143c5d05f
parenta40acc6bfcebb59fdf6a71c4740c46880ed5c0b4
ASoC: SOF: fix PCM playback through ALSA OSS emulation

Any app using ALSA OSS emulation on top of SOF will fail
to error from OSS SNDCTL_DSP_SETFMT ioctl. Reported initially
as an issue with xournalpp (application using PortAudio with
an OSS backend), but applies more generally to other apps
using OSS as well.

Problem is caused by SOF PCM not supporting repeated calls
to hw_params(), without matching calls to pcm_free(). This
is however exactly what the ALSA OSS PCM code is doing when
it is handling the OSS ioctls.

The problem will lead to leaking of DSP resources and eventual
failure of DSP PCM_PARAMS IPC.

BugLink: https://github.com/thesofproject/linux/issues/1510
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200110235751.3404-7-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/pcm.c