christf / snapcastc

C implementation of snapcast focussing on audio quality and ease of maintenance.
GNU General Public License v3.0
43 stars 6 forks source link

client is flooding logs with "BUFFER UNDERRUN" after playback #43

Closed markusj closed 4 years ago

markusj commented 4 years ago

Currently running on branch mixer. Clients and server run on Debian Buster, the stream is provided by Mopidy.

After playback is stopped, the client starts to spam the message "BUFFER UNDERRUN" for about 30 seconds, which is rather annoying and pollutes logfiles. Should clients not be able to avoid this if they are notified about stopped playback (#11)?

christf commented 4 years ago

This one is unfortunately not as easy:

snapcastc does not know itself if playback has indeed stopped. To snapcastc it looks like the fd is closed. This could happen because the end of the stream was reached or because the user hit stop. When hitting stop, we'd want the clients to immediately stop. On End-of-stream we'd want the last tune to play out.

For a while there was some logic that would immediately stop clients when the fd was closed but that would cut the last seconds (buffer-seconds) of the last song on the playlist, which is annoying even for not so large buffers.

It would be easy to move that message into the debug log. However this is an actualy error condition during regular operation because it means the audio buffer is empty, which is an audible issue.