Skip to content

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

Merged
plbossart merged 1 commit into
thesofproject:topic/sof-devfrom
kv2019i:topic/oss-emul-bug
Jan 10, 2020
Merged

plbossart merged 1 commit into
thesofproject:topic/sof-devfrom
kv2019i:topic/oss-emul-bug

Conversation

@kv2019i

@kv2019i kv2019i commented Jan 10, 2020

Copy link
Copy Markdown
Collaborator

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

@juimonen juimonen left a comment

Copy link
Copy Markdown

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"...

Comment thread sound/soc/sof/pcm.c 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

kv2019i commented Jan 10, 2020

Copy link
Copy Markdown
Collaborator Author

@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.

@plbossart plbossart left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown

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