opencardev / snd-i2s_rpi

Linux kernel driver/DKMS for the Adafruit I2S MEMS Microphone
43 stars 27 forks source link

Unable to capture mono (single channel) audio #3

Open pnbv opened 4 years ago

pnbv commented 4 years ago

After adding sofvol in .asoundrc I can't change channel count from 2 to 1. I get this message from arecord:

$ arecord -D dmic_sv -c1 -r 44100 -f S32_LE -t wav mono audio/test.wav 
Recording WAVE 'mono' : Signed 32 bit Little Endian, Rate 44100 Hz, Mono
arecord: set_params:1270: Broken configuration for this PCM: no configurations available

This is the working .asoundrc file, if change is made here to "channels 1" the above error happens:

#This section makes a reference to your I2S hardware, adjust the card name
# to what is shown in arecord -l after card x: before the name in []
#You may have to adjust channel count also but stick with default first
pcm.dmic_hw {
    type hw
    card sndrpii2scard
    channels 2
    format S32_LE
}

#This is the software volume control, it links to the hardware above and after
# saving the .asoundrc file you can type alsamixer, press F6 to select
# your I2S mic then F4 to set the recording volume and arrow up and down
# to adjust the volume
# After adjusting the volume - go for 50 percent at first, you can do
# something like 
# arecord -D dmic_sv -c2 -r 48000 -f S32_LE -t wav -V mono -v myfile.wav
pcm.dmic_sv {
    type softvol
    slave.pcm dmic_hw
    control {
        name "Boost Capture Volume"
        card sndrpii2scard
    }
    min_dB -3.0
    max_dB 30.0
}

I'm able to record stereo audio with dead right channel, though.