Gentoo Archives: gentoo-user

From: Michael <confabulate@××××××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] ALSA wizard...
Date: Thu, 23 Apr 2020 16:54:04
Message-Id: 36087914.10thIPus4b@lenovo.localdomain
In Reply to: Re: [gentoo-user] ALSA wizard... by Jorge Almeida
1 On Thursday, 23 April 2020 10:46:29 BST Jorge Almeida wrote:
2 > On Thu, Apr 23, 2020 at 9:19 AM Michael <confabulate@××××××××.com> wrote:
3 > > I recall you having problems recording with this device before, but since
4 > > you're now a step ahead let's have another go at this, in case I may be
5 > > able to help.
6 >
7 > Yes, this is not the same issue (the former problem was: I wasn't
8 > getting anything from the RCA output; maybe it isn't supposed to--no
9 > documentation provided with the device--or that part is broken;
10 > anyway, I gave up on the RCA; the device works fine as a USB sound
11 > card)
12
13 It may be the RCA signal is detected by the PC as a different interface, in
14 addition to the USB sound card, depending on how it is amplified and processed
15 before it arrives at the PC.
16
17 What you show below as your dmesg output only presents the USB interface
18 detection. I would think there would be more in advance of those lines,
19 mentioning vendorID and productID. Anyway, if you're happy with it as a USB
20 device carry on.
21
22
23 > > > > The setup:
24 > > > > -- a microphone connected to an audio interface, which connects to an
25 > > > > USB port in the computer. The interface works like a USB sound card,
26 > > > > at least regarding sound capture. It works: I can record my voice with
27 > > > > arecord into a wav file, and then play the file with aplay.
28 > > > > -- a (motherboard) sound card with a toslink output connected to an
29 > > > > external DAC/amplifier. It works: playing wav, youtube, etc.
30 > > > >
31 > > > > The problem:
32 > > > > I need to use it for voice chat. I tried slack and discord (the latter
33 > > > > both via browser and app--there's a package in portage--, the former
34 > > > > only via browser). No sound, neither outbound nor inbound.
35 > > > > None of these programs provides a way to tell them which devices to
36 > > > > use, so I assume they just go for some default.
37 > >
38 > > Yes, this is the case or you're missing some audio module/driver/firmware,
39 > > which is probably unlikely for a device which presents itself over a USB
40 > > interface.
41 >
42 > Yes, and the device works for recording; the playing together with the
43 > other card (for output) is the problem, which I believe is a matter of
44 > having an appropriate .asoundrc (the syntax of which beats me)
45
46 OK, have a look at the end of this message for an example.
47
48
49 > > If an application like vlc allows you to get audio output by
50 > > switching devices, then you know you will have to change the order of your
51 > > cards as they are detected by the kernel.
52 >
53 > the kernel consistently detects the MO card and the USB card in the
54 > same order (MO: card 0, USB: card 1).
55 >
56 > > QUESTION: I am not familiar with your hardware, but is dmesg *only*
57 > > identifying it as a USB device? I'm asking this because you may need to
58 > > additionally configure e.g. a serial/parallel interface to the device for
59 > > controlling it, or at least adding yourself to some user group, if USB
60 > > alone won't suffice.
61 >
62 > [ 726.441114] input: Burr-Brown from TI USB Audio CODEC
63 > as
64 > /devices/pci0000:00/0000:00:14.0/usb1/1-10/1-10:1.3/0003:08BB:2902.0005/inp
65 > ut/input21 [ 726.492970] hid-generic 0003:08BB:2902.0005: input,hidraw3:
66 > USB HID v1.00 Device [Burr-Brown from TI USB Audio CODEC ] on
67 > usb-0000:00:14.0-10/input3
68 > [ 726.493002] usb 1-10: authorized to connect
69 >
70 >
71 > I'm in the group "audio" and the permissions of /dev/snd/* are right (0660)
72
73 Not relevant, but if the RCA is detected as a serial modem or what not, you
74 may need to also be in dialup group.
75
76
77 > > > > I don't have a .asoundrc file. Contents of /etc/alsa/conf.d/ are not
78 > > > > customized.
79 > >
80 > > OK, this is noteworthy, you may need to do some tweaking in such a file,
81 > > depending which audio card is detected first and what controls are made
82 > > available.
83 > >
84 > > > > sysdefault:CARD=PCH
85 > >
86 > > OK, this shows your audio card on the MoBo is picked up by default as the
87 > > first card.
88 > >
89 > > > > HDA Intel PCH, Generic Analog
90 > > > > Default Audio Device
91 > > > >
92 > > > > front:CARD=PCH,DEV=0
93 > > > >
94 > > > > HDA Intel PCH, Generic Analog
95 > > > > Front speakers
96 > > > >
97 > > > > usbstream:CARD=PCH
98 > > > >
99 > > > > HDA Intel PCH
100 > > > > USB Stream Output
101 > > > >
102 > > > > sysdefault:CARD=CODEC
103 > >
104 > > This is what you want to configure as the default audio device.
105 >
106 > Only for capturing, not for playing!
107
108 Apologies, I had misunderstood what you're after.
109
110
111 > > In the first instance create a new file (for system-wide settings):
112 > > /etc/asound.conf.
113 > >
114 > > Add in it:
115 > >
116 > > defaults.pcm.card 1
117 > > defaults.pcm.device 0
118 > > defaults.ctl.card 1
119 > >
120 > > which hopefully will make your second card configured to be the default.
121 >
122 > But that will make the USB card the default for both input and output.
123 > The USB card should take care of the input (microphone) and the MB
124 > card should deal with the output (digital signal sent to external
125 > DAC/amplifier via toslink cable).
126 >
127 > > More detailed settings and tweaking can be found here:
128 > >
129 > > https://www.alsa-project.org/main/index.php/Asoundrc
130 >
131 > I know that page. It doesn't give a hint about how set defaults with
132 > input and output through different cards.
133 >
134 > Thanks
135 >
136 > Jorge
137
138 OK, I believe you need to use the "asym" alsa plugin to combine input from one
139 card and output through another. I have not used this before - I'd probably
140 opt for jackd instead. Some experimentation may be necessary to get the
141 manual setup as you want it. Have a look at this page:
142
143 https://github.com/opensrc/alsa/blob/master/lib/md/Asym.md
144
145 Essentially, you define two cards, for two different functions, then use the
146 asym plugin to combine them. Something like this?
147
148 # Specify the MoBo card as the default
149 pcm.!default {
150 type hw
151 card PCH
152 }
153
154 # Retain controls on this card for alsamixer and applications
155 ctl.!default {
156 type hw
157 card PCH
158 }
159
160 # Now the USB device
161 ctl.!USB{
162 type hw
163 card CODEC
164 format "S16_LE"
165 channels 1
166 rate 44100
167 #more options here
168 }
169
170 # Join the I/O devices
171 pcm.duplex{
172 type asym
173 playback.pcm "default"
174 capture.pcm "USB"
175 }
176
177 See how the above works and consult the asym page for further tweakerage.

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-user] ALSA wizard... Jorge Almeida <jjalmeida@×××××.com>