Gentoo Archives: gentoo-user

From: Michael <confabulate@××××××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] USB sound
Date: Wed, 29 Apr 2020 19:42:13
Message-Id: 3341227.LM0AJKV5NW@lenovo.localdomain
In Reply to: Re: [gentoo-user] USB sound by Peter Humphrey
1 On Wednesday, 29 April 2020 16:24:31 BST Peter Humphrey wrote:
2 > On Wednesday, 29 April 2020 10:15:09 BST Peter Humphrey wrote:
3 > > I'm still puzzled at why creating an asound.conf enabled - phonon? - to
4 > > pick the right device. Alsa is not installed here, apart from alsa-lib;
5 > > no applications.
6 >
7 > Well, that was a hostage to fortune. Today, after a reboot and power cycle
8 > for maintenance work, I'm back to having no sound.
9 >
10 > I suspected the devices of having been detected in the wrong order, but
11 > /proc/ asound/cards seemed to be pointing to the right one. Besides, it
12 > seemed unlikely that a USB device would be found and set up before the
13 > device in the display controller.
14
15 The PCI card 0 is initialised before USB hotplugging takes place. Therefore
16 the asound.conf content would be parsed by alsa and the appropriate audio card
17 # (USB) would/should be set as the default device. However, the device
18 initialisation sequencing logic can be upset.
19
20 It is possible things will get messy if you have a second USB audio device, in
21 your case a webcam. I don't know if USB devices are always hotplugged in a
22 predictable order, but I guess plugging/unplugging USB devices could change
23 the order in which they are being detected and consequently their numbering.
24 Therefore your card number in asound.conf could end up referencing the other
25 USB device.
26
27
28 > Next was to blacklist all the intel* modules and reboot again. Just the one
29 > card found now, the USB device. Still no sound.
30
31 The fact there is no intel-snd module shows your sound problem is not related
32 to the PCI device. I expect the snd-usb-audio module was loaded though?
33
34 There are three kernel/alsa centric solutions I can think of, but may be more.
35
36 The first and simpler is to name your USB device in asound.conf not by card
37 number, but by the name it is recognised as. Run:
38
39 cat /proc/asound/cards
40
41 then look at the name enclosed in [square brackets] after the card number and
42 use that. There may be other naming conventions but unless I search for it
43 I'm not sure what to advise. Obviouisly if you have two USB devices
44 identified as "USB" this solution won't work.
45
46 Another way is manage the order in which the USB devices are ordered when the
47 module initialises them. Create a /etc/module.d/alsa.conf file and add this:
48
49 alias snd-card-0 snd-usb-audio
50 alias snd-card-1 snd-usb-audio
51 options snd-usb-audio index=0,1 vid=0xAAAA,0xBBBB pid=0xCCCC,0xDDDD
52
53 Where vendor and product IDs can be obtained and entered in the desired order
54 by looking at the corresponding device output of lsusb.
55
56 A third way is to create some udev rule(s) in /etc/udev/rules.d/ - see here
57 for syntax:
58
59 https://alsa.opensrc.org/Udev
60
61 and here for different examples:
62
63 https://github.com/dh1tw/remoteAudio/wiki/Persistent-USB-Mapping-of-Audio-devices-(Linux)
64
65
66 > Have I to go the PulseAudio route after all?
67
68 You do not *have to*, but if you find the PulseAudio server and associated
69 GUI/CLI tools are convenient for you, then you can set up USE=pulseaudio and
70 use that to mix your sound sinks and sources devices with.
71
72 As Canek has already posted in most cases it just works. However, I must
73 confess I had a spate of pa processes racing up to 100% CPU and annoyingly
74 respawning each time I tried to kill it. An update eventually fixed this
75 problem and it worked fine ever since.

Attachments

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

Replies

Subject Author
Re: [gentoo-user] USB sound Peter Humphrey <peter@××××××××××××.uk>