On my Raspberry Pi 3B+, after about 5-10 mins of piping different files to the speaker, I get an error like:
Error: write() failed: 3192
But it's perfectly reasonable for a write() to write fewer bytes than requested (e.g. if the audio device's buffer fills up), so this PR fixes the code so it doesn't panic in this situation and just retries the write of the remaining bytes.
On my Raspberry Pi 3B+, after about 5-10 mins of piping different files to the speaker, I get an error like:
But it's perfectly reasonable for a write() to write fewer bytes than requested (e.g. if the audio device's buffer fills up), so this PR fixes the code so it doesn't panic in this situation and just retries the write of the remaining bytes.
Now my Pi plays flawlessly.