-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
FIX(client): Infinite loop and log spam on ALSA input device disconnection #6702
FIX(client): Infinite loop and log spam on ALSA input device disconnection #6702
Conversation
d478a09
to
14bb94e
Compare
…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.
14bb94e
to
d2dfcd3
Compare
💚 All backports created successfully
Questions ?Please refer to the Backport tool documentation and see the Github Action logs for details |
…and log spam on ALSA input device disconnection"
Just wanted to say thank you for this - I've been using a local patch to do something similar for a while, since the log spam would fill up my disk space and wasn't easily recoverable since the log file in question was kept open by X11, so in the end I just commented out the errors. It looks like I may not to do this any more - thank you! |
You're welcome! I kindly ask you to submit a report if you encounter any issues in the future though, as we were unaware of this one until last week. |
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:
snd_pcm_prepare()
tosnd_pcm_recover()
, which is specifically designed to recover streams.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.