Recording with 16kHz sampling rate

Moderator: flatmax

Post Reply
Posts: 2
Joined: Wed Nov 28, 2018 7:27 pm

Recording with 16kHz sampling rate

Post by Mortis19 » Wed Nov 28, 2018 7:32 pm

Hello all,

I've recently purchased the audioinjector stereo soundcard for my Raspberry Pi Model 3 B+. I set up everything and I'm trying to record with jackd and a 16kHz sampling rate but it doesn't seem to be working. Specifically I get these ALSA errors when I try to start the jackd server:
ALSA: cannot set hardware parameters for capture
ALSA: cannot configure capture channel
Cannot initialize driver
JackServer: :Open failed with -1
Failed to open server

However, the jack server starts successfully with 48kHz sampling rate for example, isn't the 16kHz sampling rate supported by the audioinjector sound card? I've also updated everything and with my previous cirrus audio card I was able to record at 16kHz sampling rate.

Posts: 2
Joined: Fri Jan 11, 2019 12:49 pm

Re: Recording with 16kHz sampling rate

Post by trekh » Fri Jan 11, 2019 1:00 pm


I'm also having issues recording at rates of 16khz and 8khz. 32khz and above work. I'm using the ALSA arecord which produces 16khz but it's downsampled from 32khz.

Did you have any luck getting 16khz to work?


Posts: 22
Joined: Tue Jun 27, 2017 4:07 pm

Re: Recording with 16kHz sampling rate

Post by wh7qq » Mon Jan 14, 2019 7:09 am

The sampling rate is set by the "arecord" command. See I don't use "Jack" so no comment on that interaction.

Posts: 608
Joined: Sat Jul 23, 2016 11:39 pm

Re: Recording with 16kHz sampling rate

Post by flatmax » Mon Jan 14, 2019 1:18 pm

The simplest way to make 16kHz work is to use plughw:0 like so :
arecord -v -D plughw:0 -r 16000 -c 2 -f S32_LE test.wav

Another way to do this is to revert the firmware ....

This kernel patch to the i2s driver regressed low sample rate functionality : ... d4cf211cd7

That patch was from the 7th of May 2017. Which means you can get this functionality back by installing an earlier firmware such as this one : ... c1b5c5532f

To do this run the following command :
sudo rpi-update e153ffdab6292509c38521896175dac1b5c5532f

You can reboot and see the version :
pi@raspberrypi:~ $ cat /proc/version
Linux version 4.9.25-v7+ (dc4@dc4-XPS13-9333) (gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611) ) #995 SMP Thu May 4 15:52:25 BST 2017

I notice that trying to record at 16kHz reverts to 8kHz for some reason.
Checkout the next kickstarter campaign - the Ultra 2 :
Please review the Zero sound card on Amazon USA :
Check out our new forum on github :

Posts: 2
Joined: Fri Jan 11, 2019 12:49 pm

Re: Recording with 16kHz sampling rate

Post by trekh » Thu Jan 17, 2019 2:35 pm

I'm just using arecord to test functionality, my actual use is with a Golang ALSA library that doesn't have re-sampling functionality. I need to record frequencies up to 4kHz and the smallest file size is preferable. I was initially hoping to record in 8kHz directly but I've read the other forum post:

about it requiring kernel hacking which I was able to do but it still isn't optimal for my use. Reverting to a previous kernel version is also not an option in my case.

Recording in 16kHz and down-sampling 2x is the next best option, I'll just have to implement down-sampling in the Go library. It seems that the 16kHz issue isn't the same as the 8kHz one because I tried your suggestion of reverting the firmware to 4.9.25 and that fixed the 8kHz rate but not the 16kHz. The 16kHz rate didn't work after kernel hacking to modify the i2s driver either. Do you think it would be possible to find a way to get 16kHz to work with the current i2s driver?


Posts: 2
Joined: Wed Nov 28, 2018 7:27 pm

Re: Recording with 16kHz sampling rate

Post by Mortis19 » Sun Jan 27, 2019 1:03 am

I still haven't achieved running the jackd server with 16kHz sampling rate using the audioinjector card. For me reverting the firmware is not an option right now but it's really annoying that the soundcard can't work with 16kHz sampling rate (while the cirrus audiocard works fine). Have you found any solutions so far?

EDIT: The plughw option works for the jackd server but the quality of the sound input is terrible...
Apart from this, I tried portaudio and it seems to be working for 16kHz.

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests