How do I fix hanging audio in Raspbian GNU/Linux 8.0 (jessie)?
When I playback audio using, for example, aplay, the first playback works fine. Subsequent playback will hang indefinitely. Several ctrl+c signals will restore playback for one additional play.
Reproduction steps:
(1) Download any wav:
wget http://ccrma.stanford.edu/~jos/wav/oboe-bassoon.wav
(2) Use aplay to playback the sound. First play works fine, sounds good:
$ aplay oboe-bassoon.wav
Playing WAVE 'oboe-bassoon.wav' : Signed 16 bit Little Endian, Rate
48000 Hz, Stereo
^CAborted by signal Interrupt...
aplay: pcm_write:1939: write error: Interrupted system call
Second play hangs without any playback
$ aplay oboe-bassoon.wav
Playing WAVE 'oboe-bassoon.wav' : Signed 16 bit Little Endian, Rate
48000 Hz, Stereo
I have tried loading PulseAudio daemon in verbose mode to see what might be going on. When the process hangs, I see:
D: [alsa-sink-bcm2835 ALSA] source.c: Processing rewind...
I also see a lot of these warnings:
D: [alsa-sink-bcm2835 ALSA] protocol-native.c: Implicit underrun of
'ALSA Playback'
D: [alsa-sink-bcm2835 ALSA] sink.c: Found underrun 22784 bytes ago
(1792 bytes ahead in playback buffer)
D: [alsa-sink-bcm2835 ALSA] sink.c: Found underrun 22784 bytes ago
(1792 bytes ahead in playback buffer)
D: [alsa-sink-bcm2835 ALSA] sink.c: Found underrun 22784 bytes ago
(1792 bytes ahead in playback buffer)
D: [alsa-sink-bcm2835 ALSA] sink.c: Found underrun 22784 bytes ago
(1792 bytes ahead in playback buffer)
D: [alsa-sink-bcm2835 ALSA] sink.c: Found underrun 22784 bytes ago
(1792 bytes ahead in playback buffer)
D: [alsa-sink-bcm2835 ALSA] sink.c: Found underrun 22784 bytes ago
(1792 bytes ahead in playback buffer)
D: [alsa-sink-bcm2835 ALSA] sink.c: Found underrun 22784 bytes ago
(1792 bytes ahead in playback buffer)
D: [alsa-sink-bcm2835 ALSA] sink.c: Found underrun 22784 bytes ago
(1792 bytes ahead in playback buffer)
Any ideas how to fix these hangs?