Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is there any way to increase the ALSA buffer size?

When running this command:

ffmpeg -f alsa -ac 2 -i hw:1 -ar 44100 -b 64k output.mp3

I get a "ALSA buffer xrun" before my system locks up

Input #0, alsa, from 'hw:1':
  Duration: N/A, start: 2480.999037, bitrate: N/A
  Stream #0.0: Audio: pcm_s16le, 48000 Hz, 2 channels, s16, 1536 kb/s
Output #0, mp3, to 'lastzzz.mp3':
  Metadata:
    TSSE            : Lavf53.21.1
    Stream #0.0: Audio: libmp3lame, 44100 Hz, 2 channels, s16, 64 kb/s
Stream mapping:
  Stream #0.0 -> #0.0
Press ctrl-c to stop encoding
[alsa @ 0x1c04660] ALSA buffer xrun.

Here is my version of ALSA:

pi@raspberrypi ~ $ cat /proc/asound/version
 Advanced Linux Sound Architecture Driver Version 1.0.25.

Just to make sure:

pi@raspberrypi ~ $ sudo apt-get install alsa
 Reading package lists... Done
 Building dependency tree
 Reading state information... Done
 Note, selecting 'alsa-base' instead of 'alsa'
 alsa-base is already the newest version.
 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
share|improve this question
    
"locks up"? I'd guess this is the cause of the xrun. –  CL. Mar 21 '13 at 20:13
    
yes, running top in a separate window shows the cpu gradually increasing until it reaches 100% cpu –  hinekyle Mar 21 '13 at 20:19
    
Which process eats the CPU? –  CL. Mar 22 '13 at 7:48
    
the ffmpeg process has an increasing cpu load until it reaches 100% and I think it is because of the "Alsa buffer xrun" –  hinekyle Mar 22 '13 at 12:20

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.