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

Backport "Merge PR #6702: FIX(client): Infinite loop and log spam on ALSA input device disconnection" to 1.5.x #6706

Merged
merged 1 commit into from
Jan 16, 2025

Conversation

Krzmbrzl
Copy link
Member

Backport

This will backport the following commits from master to 1.5.x:

Questions ?

Please refer to the Backport tool documentation

…ction

A user reported that sometimes the client log gets spammed with repeated messages such as:

<W>2025-01-10 10:24:10.638 ALSAAudioInput: No such device: No such device

The error corresponds to ENODEV (19), which we treat like any other.
Since it's unrecoverable, the code gets stuck in a full speed loop until the audio engine is stopped.

This commit:

1. Switches from snd_pcm_prepare() to snd_pcm_recover(), which is specifically designed to recover streams.
2. Breaks the loop if the error is not one of the only three recoverable (EINTR, EPIPE, ESTRPIPE). Example log:

<W>2025-01-14 06:16:44.494 ALSAAudioInput encountered unrecoverable error: File descriptor in bad state -> exiting...

Please note that also ALSAAudioOutput doesn't explicitly handle fatal errors in its loop, but it shouldn't run "infinitely" at full speed because poll-based.

(cherry picked from commit d2dfcd3)
@Krzmbrzl Krzmbrzl merged commit 2e7db59 into 1.5.x Jan 16, 2025
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants