1

I'm trying to use Linphone with my microphone, but the sound is very choppy. After messing a bit with arecord, I discovered that while the sound on my sysdefault device is choppy, recording on front:CARD=Generic works better and with less noise.

However, front can apparently only be recorded with 2 channels active. Linphone forces mono on the input (in theory it could use stereo, but there does not seem to be a way to set this in the configuration), and so it gives an alsa error since it cannot set the channels correctly.

The same thing happens if I use arecord to force 1 channel to the device:

$ arecord -f cd -d front:CARD=Generic,DEV=0 -c 1 -V stereo /tmp/file
Recording WAVE '/tmp/file' : Signed 16 bit Little Endian, Rate 44100 Hz, Mono
arecord: set_params:1247: Channels count non available

I'm thus trying to create a device in ALSA which should downsample the microphone into a single channel, but I can't seem to be able to (I'm an ALSA newbie). I've tried using this answer, but it does not work:

pcm.front cards.pcm.front
pcm.makemono {           
        type plug      
        slave.pcm {  
                type route                     
                slave.pcm "pcm.front"
                slave.channels 2
                ttable {  
                        0.0 1  
                        1.0 1
                }                   
        }                               
}

...

$ arecord -f cd -d makemono -c1 -V stereo /tmp/file
Recording WAVE '/tmp/file' : Signed 16 bit Little Endian, Rate 44100 Hz, Mono
arecord: set_params:1247: Channels count non available

How can I do this?

Svalorzen
  • 133

1 Answers1

3

You want one software channel with two hardware channels, so you have to do the mapping in the opposite direction:

...
ttable {
    0.0 1
    0.1 1
}

And you should use the correct option to specify the device:

$ arecord --help | grep -i -- ^-d
-D, --device=NAME       select PCM by name
-d, --duration=#        interrupt after # seconds
CL.
  • 1,673