ALSA: "write failed (Broken pipe)"/ "audio output is starving" with Cirrus Logic Sound Fusion CS46x
Hi all.
I get bad playback while trying to playback anything that contains audio. To try to simplify things, I make a test wave file using:
sox -t nul /dev/null -w -s -c 2 -r 44100 sine.wav synth 60 sine
Then I play the wave file using vlc (with debug enabled). The terminal shows:
VLC media player 0.8.6 Janus
[00000289] logger interface: using logger...
[00000327] alsa audio output error: write failed (Broken pipe)
[00000327] alsa audio output error: write failed (Broken pipe)
[00000327] alsa audio output error: write failed (Broken pipe)
[00000327] alsa audio output error: write failed (Broken pipe)
[00000327] alsa audio output error: write failed (Broken pipe)
[00000327] alsa audio output error: write failed (Broken pipe)
[00000327] alsa audio output error: write failed (Broken pipe)
[00000327] alsa audio output error: write failed (Broken pipe)
[00000280] main playlist: stopping playback
I have attached the debug file - it shows messages such as:
main debug: audio output is starving (11621), playing silence
main debug: audio output is starving (11768), playing silence
main debug: audio output is starving (11781), playing silence
main debug: audio output is starving (11696), playing silence
main debug: audio output is starving (11774), playing silence
main debug: audio output is starving (11764), playing silence
main debug: audio output is starving (11741), playing silence
main debug: audio output is starving (11801), playing silence
main debug: audio output is starving (11788), playing silence
main debug: audio output is starving (11686), playing silence
main debug: audio output is starving (11709), playing silence
alsa debug: recovered from buffer underrun
main debug: audio output is starving (17278), playing silence
alsa debug: recovered from buffer underrun
main debug: audio output is starving (20847), playing silence
alsa debug: recovered from buffer underrun
main debug: audio output is starving (16509), playing silence
alsa debug: recovered from buffer underrun
main debug: audio output is starving (20060), playing silence
alsa debug: recovered from buffer underrun
main debug: audio output is starving (15745), playing silence
alsa debug: recovered from buffer underrun
main debug: audio output is starving (19300), playing silence
alsa debug: recovered from buffer underrun
main debug: audio output is starving (22995), playing silence
alsa debug: recovered from buffer underrun
main debug: audio output is starving (18570), playing silence
alsa debug: recovered from buffer underrun
I've tried playback using "aplay -M -v -v sine.wav", and aplay doesn't seem to have the same problems. In case this is something to do with the way in which vlc opens the alsa audio device, I've compared the contents of /proc/asound/card0/pcm0p/sub0 when I use vlc vs. when I use aplay. The diff between the two folders is:
diff vlc/status aplay/status
2,6c2,6
< trigger_time: 1175951065.503949747
< tstamp : 1175951068.048784816
< delay : 13200
< avail : 3184
< avail_max : 3184
---
> trigger_time: 1175951093.564144210
> tstamp : 1175951095.554611204
> delay : 16160
> avail : 224
> avail_max : 720
8,9c8,9
< hw_ptr : 112240
< appl_ptr : 125440
---
> hw_ptr : 87776
> appl_ptr : 103936
diff vlc/sw_params aplay/sw_params
6c6
< start_threshold: 1
---
> start_threshold: 16384
I think this may be related to my audio hardware, as I've seen people with similar problems here: http://forum.videolan.org/viewtopic.php?t=32788 (their suggested workaround is to use oss).
Hardware is IBM Thinkpad T21 lspci: Multimedia audio controller: Cirrus Logic CS 4614/22/24/30 [CrystalClear SoundFusion Audio Accelerator] (rev 01) lspci -n: 0401: 1013:6003 (rev 01)
Software: Ubuntu 0704 (Feisty) Linux: 2.6.20 (SMP) Alsa version: 1.0.13
Apologies if I've assigned this to the wrong component ("Audio output core"). Is there any kind of minimal C program that I can compile and run to just open the audio device in the same way that vlc does, so that I can determine whether this is really is a vlc problem or an alsa problem?
Thanks, Jaime