Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FIX(client): Infinite loop and log spam on ALSA input device disconne…
…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: File descriptor in bad state, breaking the loop... 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.
- Loading branch information