0

I followed this guide to set the default device like this:

create /etc/asound.conf with following:

defaults.pcm.card 1
defaults.ctl.card 1

But I have the problem that the ALSA card numbers are not deterministic across reboots.

So I followed this guide to change the name of my USB sound cards to something predictable. Essentially it says:

Create a file in /lib/udev/rules.d/ with a name like 85-my-usb-audio.rules and contents like the following:

DEVPATH=="/devices/pci0000:00/0000:00:12.2/usb1/1-4/1-4.3/1-4.3:1.0/sound/card?", ATTR{id}="MyDev_A"

Using the devices Use the ID string where you would otherwise use the card number, such as

aplay -D default:MyDev_A something.wav

And then I changed my /etc/asound.conf to:

defaults.pcm.card MyDev_A
defaults.ctl.card MyDev_A

I also tried

defaults.pcm.card "MyDev_A"
defaults.ctl.card "MyDev_A"

But when running for example aplay, I get errors:

ALSA lib conf.c:1207:(parse_value) card is not a string
ALSA lib conf.c:1887:(_snd_config_load_with_include) _toplevel_:2:0:Invalid argument
ALSA lib conf.c:3650:(config_file_open) /etc/asound.conf may be old or corrupted: consider to remove or fix it
ALSA lib conf.c:3572:(snd_config_hooks_call) function snd_config_hook_load returned error: Invalid argument
ALSA lib conf.c:4026:(snd_config_update_r) hooks failed, removing configuration
aplay: device_list:281: control open (0): Invalid argument
0

1 Answer 1

0

This is not a direct solution for the problem, but it's the way I went forward. Instead of assigning textual IDs, I set a fixed order of indexes for the sound cards:

I created a file /etc/modprobe.d/alsa.conf and put into it:

blacklist snd_bcm2835
blacklist snd_soc_hdmi_codec
options snd-usb-audio index=0,1 vid=0x1415,0x0d8c pid=0x2000,0x000c

The options line sets the indexes of all sound cards handled by the snd_usb_audio module.

Those indexes have to be consecutive starting at 0 and I couldn't figure out how options snd slots and indexes work together, so I just disabled all the other two audio modules with the blacklist lines so they don't take up any indexes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.