symeboy
Posts: 8
Joined: Mon Mar 09, 2015 9:28 pm

ALSA sample rate

Tue Mar 10, 2015 11:09 pm

Hi, Ive got ALSA running with a USB microphone, recording seems to work OK. Problem is that the microphone can handle up to a sample rate of 250Khz and ALSA wont let me go above 192Khz...

pi@raspberrypi ~ $ sudo arecord -d 10 -D plughw:1,0 -r 192 -c 1 /boot/testwavs/test.wav
Recording WAVE '/boot/testwavs/test.wav' : Unsigned 8 bit, Rate 192000 Hz, Mono

OK

pi@raspberrypi ~ $ sudo arecord -d 10 -D plughw:1,0 -r 250 -c 1 /boot/testwavs/test.wav
arecord: main:568: bad speed value 250000

Note error

Ive tried every option I can find of tinkering with ~/.asoundrc and usually end up with this error
arecord: set_params:1145: Unable to install hw params:

I'm very new to the pi and Linux so I'm just fumbling around now and would really appreciate help. I know Sox is an option but I want to eventually use python scripts and would probably be better using ALSA if I can because there seems to be more example code for me to steal out there for ALSA! :D

I'm using the latest version of Raspbian and the the Raspberry Pi 2 B

Thanks in advance

User avatar
PeterO
Posts: 5879
Joined: Sun Jul 22, 2012 4:14 pm

Re: ALSA sample rate

Wed Mar 11, 2015 9:40 am

Alsacap is a little application that prints out the capabilities of an ALSA device...

http://www.volkerschatz.com/noise/alsacap.tgz

What does it say for your device ?

PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

Return to “Troubleshooting”