Page 1 of 1

using arecord on new stereo sound card

Posted: Tue Oct 10, 2017 3:05 am
by kenski1
I was trying to use "arecord" at an 8 Khz rate (it wouldn't do 16Khz) and got an error that the hardware parameters couldn't be set up in alsa.

My Debian Raspberry PI OS version is 4.9.53_v7+, which is what came out of using

What version of the OS are others using that work?

The seems to work.

Re: using arecord on new stereo sound card

Posted: Wed Oct 11, 2017 10:08 pm
by flatmax
Hi there,

Thanks for the info.

OK - so here is the good news, you can make low sample rate recording in one of two ways :
[NOTE This should be dsnoop not dmix ... see reply further down in this thread.]
1] Using the dmix plugin for example this form should work :

Code: Select all

arecord -dplug:dmix -r 8000 -c 2 /tmp/test.wav
You can use the plug:dmix device with other applications as well to get arbitrary sample rates and channels.

2] Using an older kernel, as outlined in this post.

The reason why it doesn't work currently is to do with a recent driver update which for an unknown reason completely breaks the functionality of bit clocking when the driver is being used as a stand alone two channel device. In my opinion it is way to conservatively and restrictive. Here is the rapsberry pi linux kernel issue related to this topic :

Hope that helps,
p.s. when I get a chance, I will find a work around for this problem.

Re: using arecord on new stereo sound card

Posted: Sat Oct 14, 2017 1:28 pm
by kenski1
I couldn't get arecord -dplug:dmix -r 8000 -c 2 /tmp/test.wav to work with my version of firmware.

Rolling back to version 4.9.14 : ( sudo rpi-update b30461d2621e71eb9b8845b38738af177b9181ed) does allow use of 8000 Hz sample rat
However, trying to record at 16000 Hz with arecord -Dhw:0,0 doesn't work, neither does using arecord dplug:dmix work.

Re: using arecord on new stereo sound card

Posted: Thu Oct 19, 2017 8:49 pm
by flatmax

This is the command to record, using dsnoop, not dmix :

Code: Select all

arecord -Dplug:dsnoop -r8000 -c 2 -f S32_LE /tmp/test.wav
I think the 16 kHz problem is another one due to the "upgrade" in the bcm i2s kernel driver.

If you want to hack support for 8 kHz natively, please follow this post :