Thread: [Alsa-user] arecord: set_params:1239: Channels count non available
Brought to you by:
perex
|
From: Roger <rog...@gm...> - 2014-03-17 14:31:13
|
I keep getting the following error whenever specifying -c 1 or --channels=1, or
specifying any number of channels less than two channels when using an ASUS
Essence STX soundcard and recording using the microphone line having a TRS
jack. (Whether using the rear or front/case microphone jack.)
$ arecord --device=hw:0,0 --format S16_LE --rate 44100 -c1 /tmp/test.wav
arecord: set_params:1239: Channels count non available
It would appear the snd_virtuoso driver is hard-coded to always record both
left and right channels even though when a TRS jack is inserted.
If I'm not mistaken, the jacks are wired to detect when a TS or TRS phone jack
is inserted. Upon insertion of a TS jack, both left and right channels are
present with no (5 volt) line voltage present and a line input source is
asserted.
When a TRS phono jack is inserted; left, right, and 5 volt line voltage is
present and a microphone is then asserted as the source of input.
(It's very likely this hardware does have integral TS/TRS female jack inputs,
but I have not confirmed this.)
Some Possibilities:
1) The snd_virtuoso driver is hard coded to only provide Line Input, or left
and right channels?
2) The snd_virtuoso driver isn't allowing, or arecord isn't allowing to only
record the Left Channel, as a mono input source is usually assumed?
3) Dot .asoundrc file has been removed, and the error persists when using
defaults.
4) Also notice the "Channels count non available" error should read, "Channel
count not available"
=== Attempt to Hack Around Problem ===
Trying to use "--separate-channels", but the error still persists with trying
to record anything less than one channel.
I've also tried to hack around this issue with channel mapping, only having
arecord record the left channel, but I'm haven't checked the correctness of
this configuration.
# Still can't record just mono!
#pcm_slave.mono {
# type route table {
# # Copy both input channels to output channel 0 (Left).
# 0.0 1
# 1.0 1
# # Send nothing to output channel 1 (Right).
# 0.1 0
# 1.1 0
# }
#}
$ arecord -D mono --device=hw:0,0 -f S16_LE -c1 /tmp/test.wav -v
--
Roger
http://rogerx.freeshell.org/
|
|
From: Roger <rog...@gm...> - 2014-03-17 14:34:53
|
$ aplay -l **** List of PLAYBACK Hardware Devices **** card 0: STX [Xonar STX], device 0: Multichannel [Multichannel] Subdevices: 1/1 Subdevice #0: subdevice #0 card 0: STX [Xonar STX], device 1: Digital [Digital] Subdevices: 1/1 Subdevice #0: subdevice #0 card 1: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0] Subdevices: 1/1 Subdevice #0: subdevice #0 card 1: NVidia [HDA NVidia], device 7: HDMI 1 [HDMI 1] Subdevices: 1/1 Subdevice #0: subdevice #0 card 1: NVidia [HDA NVidia], device 8: HDMI 2 [HDMI 2] Subdevices: 1/1 Subdevice #0: subdevice #0 card 1: NVidia [HDA NVidia], device 9: HDMI 3 [HDMI 3] Subdevices: 1/1 Subdevice #0: subdevice #0 (Recording from HW 0,0; or "Card 0: STX [Xonar STX], device 0") $ amixer Simple mixer control 'Master',0 Capabilities: pvolume pswitch pswitch-joined Playback channels: Front Left - Front Right Limits: Playback 135 - 255 Mono: Front Left: Playback 255 [100%] [0.00dB] [on] Front Right: Playback 255 [100%] [0.00dB] [on] Simple mixer control 'Headphones Impedance',0 Capabilities: penum Items: '< 64 ohms' '64-300 ohms' '300-600 ohms' Item0: '< 64 ohms' Simple mixer control 'Line',0 Capabilities: cswitch cswitch-joined Capture channels: Mono Mono: Capture [off] Simple mixer control 'Mic',0 Capabilities: cvolume cvolume-joined cswitch cswitch-joined Capture channels: Mono Limits: Capture 0 - 31 Mono: Capture 31 [100%] [12.00dB] [on] Simple mixer control 'Mic Boost (+20dB)',0 Capabilities: pswitch pswitch-joined Playback channels: Mono Mono: Playback [on] Simple mixer control 'Mic Source',0 Capabilities: cenum Items: 'Mic Jack' 'Front Panel' Item0: 'Front Panel' Simple mixer control 'IEC958',0 Capabilities: pswitch pswitch-joined Playback channels: Mono Mono: Playback [on] Simple mixer control 'IEC958 Loopback',0 Capabilities: pswitch pswitch-joined Playback channels: Mono Mono: Playback [off] Simple mixer control 'IEC958 Validity Check',0 Capabilities: cswitch cswitch-joined Capture channels: Mono Mono: Capture [off] Simple mixer control 'Aux',0 Capabilities: cvolume cswitch cswitch-joined Capture channels: Front Left - Front Right Limits: Capture 0 - 31 Front Left: Capture 31 [100%] [12.00dB] [off] Front Right: Capture 31 [100%] [12.00dB] [off] Simple mixer control 'Analog Input Monitor',0 Capabilities: pvolume pvolume-joined pswitch pswitch-joined Playback channels: Mono Limits: Playback 0 - 1 Mono: Playback 1 [100%] [0.00dB] [off] Simple mixer control 'Analog Output',0 Capabilities: enum Items: 'Speakers' 'Headphones' 'FP Headphones' Item0: 'Speakers' Simple mixer control 'DAC Filter',0 Capabilities: penum Items: 'Sharp Roll-off' 'Slow Roll-off' Item0: 'Sharp Roll-off' Simple mixer control 'Digital Input Monitor',0 Capabilities: pvolume pvolume-joined pswitch pswitch-joined Playback channels: Mono Limits: Playback 0 - 1 Mono: Playback 1 [100%] [0.00dB] [off] -- Roger http://rogerx.freeshell.org/ |
|
From: Roger <rog...@gm...> - 2014-03-17 15:16:09
|
The following source code file seems to be related for ASUS Xonar STX cards,
supposedly defining Line & Mic inputs, and their capabilities.
/usr/src/linux/sound/pci/oxygen/xonar_pcm179x.c
A little more grepping/searching, I find xonar_wm87x6.c seems to specify the
mic/line channel profiles, which is then linked into virtuoso.c; Of which is
likely not used by the STX card?
/usr/src/linux/sound/pci/oxygen/xonar_wm87x6.c
{
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Line Capture Switch",
.info = snd_ctl_boolean_mono_info,
.get = wm8776_input_mux_get,
.put = wm8776_input_mux_put,
.private_value = 1 << 0,
},
{
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Mic Capture Switch",
.info = snd_ctl_boolean_mono_info,
.get = wm8776_input_mux_get,
.put = wm8776_input_mux_put,
.private_value = 1 << 1,
},
WM8776_BIT_SWITCH("Front Mic Capture Switch",
WM8776_ADCMUX, 1 << 2, 0, 0),
WM8776_BIT_SWITCH("Aux Capture Switch",
WM8776_ADCMUX, 1 << 3, 0, 0),
--
Roger
http://rogerx.freeshell.org/
|
|
From: Roger <rog...@gm...> - 2014-03-17 15:54:32
|
=== Audacity ===
FYI: Audacity does have mixer/mixing options for selecting or recording only a
Mono channel for the mic/microphone channel.
ie. "1 (Mono) Input Channel" or "2 (Stereo) Input Channels"
=== Traceback into arecord (or aplay.c) ===
A little further into the source code of alsa-utils:
alsa-utils-1.0.27.2/aplay/aplay.c
@ Line 1238:
err = snd_pcm_hw_params_set_channels(handle, params, hwparams.channels);
if (err < 0) {
error(_("Channels count non available"));
prg_exit(EXIT_FAILURE);
=== English Grammar Corrections ===
1) Concerning the incorrect usage of the word " non ", the following should
find all occurances of the word " non " which imply " not ":
fgrep /var/tmp/portage/media-sound/alsa-utils-1.0.27.2 -r -e " non "
2) Although "Channel count" is the correct English grammar form, I think the
programmeres intentions were to make explicit reference to the variable
"channels", or "--channels".
Following should find all occurances of the incorrect plural usage of
"Channels", but I do not think this requires any correction!
fgrep /var/tmp/portage/media-sound/alsa-utils-1.0.27.2 -r -e "Channels count"
--
Roger
http://rogerx.freeshell.org/
|
|
From: James Courtier-D. <jam...@gm...> - 2014-03-17 21:46:41
|
On 17 March 2014 14:30, Roger <rog...@gm...> wrote: > I keep getting the following error whenever specifying -c 1 or --channels=1, or > specifying any number of channels less than two channels when using an ASUS > Essence STX soundcard and recording using the microphone line having a TRS > jack. (Whether using the rear or front/case microphone jack.) > > $ arecord --device=hw:0,0 --format S16_LE --rate 44100 -c1 /tmp/test.wav > > arecord: set_params:1239: Channels count non available > This due to one of two reasons: 1) The hardware cannot do it. 2) The hardware can do it, but the device driver has not implemented support for it yet. Have you tried using plug devices or the default e.g arecord --device=plughw:0,0 --format S16_LE --rate 44100 -c1 /tmp/test.wav This will give you 1 channel, and alsa lib will do the down-mixing 2->1 for you. James |
|
From: Roger <rog...@gm...> - 2014-03-17 22:05:57
|
> On Mon, Mar 17, 2014 at 09:46:25PM +0000, James Courtier-Dutton wrote: >On 17 March 2014 14:30, Roger <rog...@gm...> wrote: >> I keep getting the following error whenever specifying -c 1 or --channels=1, or >> specifying any number of channels less than two channels when using an ASUS >> Essence STX soundcard and recording using the microphone line having a TRS >> jack. (Whether using the rear or front/case microphone jack.) >> >> $ arecord --device=hw:0,0 --format S16_LE --rate 44100 -c1 /tmp/test.wav >> >> arecord: set_params:1239: Channels count non available >> >This due to one of two reasons: >1) The hardware cannot do it. >2) The hardware can do it, but the device driver has not implemented >support for it yet. I'm guessing the later, the driver is hard coded, so people recording using the line-in input avoid the problem of only being able to record the left channel. Hard-coding for recording both channels, and then requiring users to strip or merge the right channel with the left channel later. >Have you tried using plug devices or the default >e.g >arecord --device=plughw:0,0 --format S16_LE --rate 44100 -c1 /tmp/test.wav > >This will give you 1 channel, and alsa lib will do the down-mixing 2->1 for you. Exactly one answer I was looking for. A quick substitution via arecord to just record mono, whether or not using downmixing, as I was already trying within the dot asoundrc file. Verified Audacity does show only one track within the /tmp/test.wav, and likely can now also stuff something into a dot asoundrc file using the above example, but will likely use a Bash alias within the .bashrc file. alias arecord-mic-2s="arecord --channels=1 --device=plughw:0,0 --duration=2 --format S16_LE --rate 48000 --vumeter=mono /tmp/test.wav && aplay /tmp/test.wav" Works like a charm! Thanks! -- Roger http://rogerx.freeshell.org/ |
|
From: Clemens L. <cla...@go...> - 2014-03-18 08:03:11
|
Roger wrote: > I keep getting the following error whenever specifying -c 1 or --channels=1, or > specifying any number of channels less than two channels when using an ASUS > Essence STX soundcard and recording using the microphone line having a TRS > jack. The CMI8788 chip supports only channel pairs. > If I'm not mistaken, the jacks are wired to detect when a TS or TRS phone jack > is inserted. There is no such detection. When "Line" is selected as capture source, the input jack is routed directly to the ADC; when any other sources are selected, the inputs are routed through the analog section of the CMI9780 chip, which then acts as a microphone preamp and mixer. Regards, Clemens |
|
From: Roger <rog...@gm...> - 2014-03-18 15:39:28
|
> On Tue, Mar 18, 2014 at 08:47:38AM +0100, Clemens Ladisch wrote: >Roger wrote: >> I keep getting the following error whenever specifying -c 1 or --channels=1, or >> specifying any number of channels less than two channels when using an ASUS >> Essence STX soundcard and recording using the microphone line having a TRS >> jack. > >The CMI8788 chip supports only channel pairs. > >> If I'm not mistaken, the jacks are wired to detect when a TS or TRS phone jack >> is inserted. > >There is no such detection. When "Line" is selected as capture source, >the input jack is routed directly to the ADC; when any other sources are >selected, the inputs are routed through the analog section of the >CMI9780 chip, which then acts as a microphone preamp and mixer. Thanks for the clarification. I think I just noticed this yesterday after plugging in a XLR microphone using a TS (or two conductor) phono jack into the combo Microphone/Line Input of the Xonar card. Since the microphone worked, I speculated 5 volts was still somehow getting to the microphone in some fashion, regardless of using a TS or TRS connector. Further testing has also proven the microphone boost has not affect to the line input or when switching to Line. This has helped greatly, as I'm now set to further test using a ART Tube MP Studio (V3) pre-amp for amplifying my XLR microphone connected to the switched Line/Microphone Input of the Xonar card. -- Roger http://rogerx.freeshell.org/ |