badaix / snapcast

Synchronous multiroom audio player
GNU General Public License v3.0
6.22k stars 455 forks source link

Snapclient sounds like /dev/urandom just got piped into my speaker #1170

Closed kerta1n closed 7 months ago

kerta1n commented 1 year ago

Describe the bug On occasion, all Snapclients's FIFO pipe breaks and it sounds like static at max volume.

Steps to Reproduce

  1. No real method to predict this behavior, may be memory related, as FIFO pipe is mounted in ram (/tmp/librespot.pipe), unlikely though since memtest86 reported 0 errors

Environment details

log from Snapserver:

2023-10-21 22-06-54.841 [Info] (librespot_playback::player) <Not The Boy> (104947 ms) loaded
2023-10-21 22-06-54.842 [Info] (LibrespotStream) metadata: <Not The Boy>
2023-10-21 22-06-56.755 [Info] (librespot_playback::player) Loading <Yessirskiii> with Spotify URI <spotify:track:59JWp4PjZ9TRM8cmtaDYB1>
2023-10-21 22-06-56.987 [Info] (librespot_playback::player) <Yessirskiii> (219340 ms) loaded
2023-10-21 22-06-56.987 [Info] (LibrespotStream) metadata: <Yessirskiii>
2023-10-21 22-07-00.443 [Info] (PcmStream) State changed: Spotify, state: playing => idle
2023-10-21 22-07-00.443 [Info] (Server) onStateChanged (Spotify): idle

log from a snapclient:

2023-10-21 21-59-56.490 [Info] (Stream) pBuffer->full() && (abs(median_) > 2): 2726
2023-10-21 22-00-07.200 [Info] (Stream) pBuffer->full() && (abs(median_) > 2): 3043
2023-10-21 22-00-17.909 [Info] (Stream) pBuffer->full() && (abs(median_) > 2): 2645
2023-10-21 22-00-28.618 [Info] (Stream) pBuffer->full() && (abs(median_) > 2): 2770
2023-10-21 22-00-39.328 [Info] (Stream) pBuffer->full() && (abs(median_) > 2): 2778
2023-10-21 22-00-39.648 [Info] (Stream) Exception: Not enough frames available, requested frames: 969, available: 360
2023-10-21 22-00-39.649 [Info] (Alsa) Failed to get chunk
2023-10-21 22-00-42.827 [Warn] (Alsa) snd_pcm_avail_delay failed: Broken pipe (-32), avail: 969, delay: 2794, using snd_pcm_avail amd snd_pcm_delay.
2023-10-21 22-00-42.830 [Warn] (Alsa) snd_pcm_delay failed: Broken pipe (-32), avail: -32, delay: 2794
2023-10-21 22-00-55.050 [Info] (Stream) pShortBuffer->full() && (abs(shortMedian_) > 5): 5220
2023-10-21 22-01-07.025 [Info] (Stream) pShortBuffer->full() && (abs(shortMedian_) > 5): 5019
2023-10-21 22-01-19.050 [Info] (Stream) pShortBuffer->full() && (abs(shortMedian_) > 5): 5001