I am trying to record 4 channels with arecord but the last two are all zeros. I have a Behringer UMC404HD which is a 4 channel audio ADC with a USB port. I’m connecting it to machines running different flavors of linux (CentOS, Raspian, ubuntu and Pop!_OS). Only the CentOS one works correctly, giving me 4 channels; the others all seem to accept 4 channels but the last two channels are all 0s.
On the PopOS machine I used
arecord -l
**** List of CAPTURE Hardware Devices ****
card 1: Generic [HD-Audio Generic], device 0: ALC293 Analog [ALC293 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 2: U192k [UMC404HD 192k], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0
and got this
arecord --dump-hw-params -D plughw:2,0 -c 4 -r 96000 -t raw -f S32_LE | hexdump | more
Recording raw data 'stdin' : Signed 32 bit Little Endian, Rate 96000 Hz, Channels 4
HW Params of device "plughw:2,0":
--------------------
ACCESS: MMAP_INTERLEAVED MMAP_NONINTERLEAVED MMAP_COMPLEX RW_INTERLEAVED RW_NONINTERLEAVED
FORMAT: S8 U8 S16_LE S16_BE U16_LE U16_BE S24_LE S24_BE U24_LE U24_BE S32_LE S32_BE U32_LE U32_BE FLOAT_LE FLOAT_BE FLOAT64_LE FLOAT64_BE MU_LAW A_LAW IMA_ADPCM S20_LE S20_BE U20_LE U20_BE S24_3LE S24_3BE U24_3LE U24_3BE S20_3LE S20_3BE U20_3LE U20_3BE S18_3LE S18_3BE U18_3LE U18_3BE
SUBFORMAT: STD
SAMPLE_BITS: [4 64]
FRAME_BITS: [4 640000]
CHANNELS: [1 10000]
RATE: [4000 4294967295)
PERIOD_TIME: [125 743039)
PERIOD_SIZE: (0 3191328204)
PERIOD_BYTES: (0 4294967295)
PERIODS: (0 4294967295]
BUFFER_TIME: [1 4294967295]
BUFFER_SIZE: [1 4294967294]
BUFFER_BYTES: [1 4294967295]
TICK_TIME: ALL
--------------------
0000000 5600 0061 7900 1afb 0000 0000 0000 0000
0000010 1a00 0049 1c00 1b29 0000 0000 0000 0000
0000020 5300 004b e100 1b44 0000 0000 0000 0000
0000030 eb00 005b 5300 1b50 0000 0000 0000 0000
...
0000160 f300 fff5 f000 1071 0000 0000 0000 0000
I’ve tried both -D hw:2,0 and -D plughw:2,0 to no avail.
The CentOS works fine although the device is different:
arecord -l
output is
arecord --dump-hw-params -D plughw:1,0 -c 4 -r 96000 -t raw -f S32_LE | hexdump | more
Recording raw data 'stdin' : Signed 32 bit Little Endian, Rate 96000 Hz, Channels 4
HW Params of device "plughw:1,0":
--------------------
ACCESS: MMAP_INTERLEAVED MMAP_NONINTERLEAVED MMAP_COMPLEX RW_INTERLEAVED RW_NONINTERLEAVED
FORMAT: S8 U8 S16_LE S16_BE U16_LE U16_BE S24_LE S24_BE U24_LE U24_BE S32_LE S32_BE U32_LE U32_BE FLOAT_LE FLOAT_BE FLOAT64_LE FLOAT64_BE MU_LAW A_LAW IMA_ADPCM S20_LE S20_BE U20_LE U20_BE S24_3LE S24_3BE U24_3LE U24_3BE S20_3LE S20_3BE U20_3LE U20_3BE S18_3LE S18_3BE U18_3LE U18_3BE
SUBFORMAT: STD
SAMPLE_BITS: [4 64]
FRAME_BITS: [4 640000]
CHANNELS: [1 10000]
RATE: [4000 4294967295)
PERIOD_TIME: [125 743039)
PERIOD_SIZE: (0 3191328204)
PERIOD_BYTES: (0 4294967295)
PERIODS: (0 4294967295]
BUFFER_TIME: [1 4294967295]
BUFFER_SIZE: [1 4294967294]
BUFFER_BYTES: [1 4294967295]
TICK_TIME: ALL
--------------------
0000000 f800 005a eb00 1b39 6300 272a 2200 0274
0000010 bc00 0073 4500 1b4e 1400 2605 2900 0235
...
From what I can tell the only difference is the output: all zeros for the last two channels in the PopOS machine and content for the last two channels in the CentOS example. (The RPI and Ubuntu machine behaved the same as the PopOS device).
On a whim, I tried joining the audio group but it did not help.
Thoughts? any advice on what i can try to debug this further? Thanks!
2
Answers
Resolved! It turns out I needed to enable all the channels using AlsaMixer. The missing channels were enabled by using F4 for capture then selecting the channel and hitting the space bar.
You can have udev run a script to automatically enable capture on all inputs and set volume. https://gitlab.com/sbyrne/umc404hd-autocapture