Recording with 16kHz sampling rate
Moderator: flatmax
Recording with 16kHz sampling rate
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.
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.
Re: Recording with 16kHz sampling rate
Hi,
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?
Thanks.
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?
Thanks.
Re: Recording with 16kHz sampling rate
The sampling rate is set by the "arecord" command. See https://linux.die.net/man/1/arecord. I don't use "Jack" so no comment on that interaction.
Re: Recording with 16kHz sampling rate
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 :
https://github.com/raspberrypi/linux/co ... 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 :
https://github.com/Hexxeh/rpi-firmware/ ... 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.
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 :
https://github.com/raspberrypi/linux/co ... 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 :
https://github.com/Hexxeh/rpi-firmware/ ... 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.
Check out our audiophile quality crossovers : https://bit.ly/2kb1nzZ
Please review the Zero sound card on Amazon USA : https://www.amazon.com/dp/B075V1VNDD
---
Check out our new forum on github : https://github.com/Audio-Injector
Please review the Zero sound card on Amazon USA : https://www.amazon.com/dp/B075V1VNDD
---
Check out our new forum on github : https://github.com/Audio-Injector
Re: Recording with 16kHz sampling rate
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:
viewtopic.php?f=5&t=3108
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?
Thanks
viewtopic.php?f=5&t=3108
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?
Thanks
Re: Recording with 16kHz sampling rate
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.
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.
Re: Recording with 16kHz sampling rate
Hello again,
I tried changing the kernel of raspberry pi as in here, hoping to get 16kHz sampling rate to work on the audioinjector:
viewtopic.php?f=5&t=3108
After this, I managed to get jackd to start with 8kHz and 16kHz. However, when I connect the microphone input to the playback (with jack_connect) the sound output that I get is terrible and also works for only one speaker.
I am still trying to understand why the cirrus audio card works just fine with 16kHz and the audioinjector fails. I tried also changing the kernel file according to the one corresponding to the rpi cirrus but I get the same result.
If anyone has found a solution for this, please share it. The support for the audioinjector is terrible so far so in case nobody bothers to find a solution for this the sound card will still be useless.
I tried changing the kernel of raspberry pi as in here, hoping to get 16kHz sampling rate to work on the audioinjector:
viewtopic.php?f=5&t=3108
After this, I managed to get jackd to start with 8kHz and 16kHz. However, when I connect the microphone input to the playback (with jack_connect) the sound output that I get is terrible and also works for only one speaker.
I am still trying to understand why the cirrus audio card works just fine with 16kHz and the audioinjector fails. I tried also changing the kernel file according to the one corresponding to the rpi cirrus but I get the same result.
If anyone has found a solution for this, please share it. The support for the audioinjector is terrible so far so in case nobody bothers to find a solution for this the sound card will still be useless.
Re: Recording with 16kHz sampling rate
What happened when you use plughw ?
plughw will resample the audio from whatever sample rate it is down to 16 kHz.
plughw will resample the audio from whatever sample rate it is down to 16 kHz.
Check out our audiophile quality crossovers : https://bit.ly/2kb1nzZ
Please review the Zero sound card on Amazon USA : https://www.amazon.com/dp/B075V1VNDD
---
Check out our new forum on github : https://github.com/Audio-Injector
Please review the Zero sound card on Amazon USA : https://www.amazon.com/dp/B075V1VNDD
---
Check out our new forum on github : https://github.com/Audio-Injector
Re: Recording with 16kHz sampling rate
As I mentioned above:
So it works, but I'm trying to find a solution to get real audio out of this with 16 kHz.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.
UPDATE: Apparently, it works properly after tweaking the kernel and using plughw in the command of jackd. Now I can get 16 kHz audio using the audioinjector soundcard!
Who is online
Users browsing this forum: No registered users and 4 guests