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

output/alsa: handle recoverable errors in DrainInternal() #1909

Merged
merged 2 commits into from
Apr 15, 2024

Conversation

borine
Copy link
Contributor

@borine borine commented Nov 30, 2023

Fixes #1874

@MaxKellermann
Copy link
Member

Your commit message is lacking. It describes roughly what the patch does but not why and why it is necessary. It is not possible for me to understand your work without a proper explanation.

It is possible that an underrun may occur in the ALSA output
device while MPD is draining its own internal buffer. If this
happens then MPD stops playback, reporting the error EPIPE.

This commit attempts to recover the ALSA device instead of
stopping playback, so that the drain can complete and the next
song in the play queue is played.
It is not possible to prepare an ALSA device when it is is state
SND_PCM_STATE_OPEN; it is necessary to set the hardware parameters
first.

This pedantic commit corrects that error. Note that in practice
this code path cannot be encountered because MPD always sets the
hardware parameters before attempting to start playback.
@borine borine force-pushed the alsa-drain-recovery branch from 064f6fa to b1f28d6 Compare December 22, 2023 12:14
@MaxKellermann MaxKellermann merged commit 9c7b930 into MusicPlayerDaemon:master Apr 15, 2024
4 checks passed
@borine borine deleted the alsa-drain-recovery branch November 19, 2024 14:54
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.

ALSA config causes "Broken pipe" playback errors over time
2 participants