Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ASoC: SOF: fix PCM playback through ALSA OSS emulation #1690

Merged
merged 1 commit into from
Jan 10, 2020

Conversation

kv2019i
Copy link
Collaborator

@kv2019i kv2019i commented Jan 10, 2020

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 a problem in SOF PCM code where code does
not support repeatedly calling hw_params(), withoout
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 resource and eventual
failure of DSP PCM_PARAMS IPC.

Fixes: #1510

Copy link

@juimonen juimonen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks neat and clean to me. Some typos in commit message like "withoout"...

sound/soc/sof/pcm.c Show resolved Hide resolved
@kv2019i kv2019i force-pushed the topic/oss-emul-bug branch from b3ddca2 to cbab060 Compare January 10, 2020 14:15
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: thesofproject#1510
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
@kv2019i kv2019i force-pushed the topic/oss-emul-bug branch from cbab060 to f1e767f Compare January 10, 2020 14:19
@kv2019i
Copy link
Collaborator Author

kv2019i commented Jan 10, 2020

@juimonen wrote:

Looks neat and clean to me. Some typos in commit message like "withoout"...

Oops. Thanks! It seems default codespell file for checkpatch is quite limited for typos like this. Oh well, there was at least one another bizarre sentence in the commit. Now fixed.

Copy link
Member

@plbossart plbossart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, thanks @kv2019i

@plbossart plbossart merged commit 4678f54 into thesofproject:topic/sof-dev Jan 10, 2020
@tokyovigilante
Copy link

Great, thanks! Will give it a roll ASAP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Playback via ALSA OSS emulation fails to hw_params (xournalpp)
5 participants