* Persistent device naming, alsa
@ blinux-list
` blinux-list
0 siblings, 1 reply; 2+ messages in thread
From: blinux-list @ UTC (permalink / raw)
I have a USB audio device that I use for system sounds via pulse, and speech.
In my default.pa, I have
set-default-sink alsa_output.usb-C-Media_Electronics_Inc._USB_Audio_Device-00.analog-stereo
I also have onboard audio, to which my surround speakers are connected.
For my mpv, I can use this line in ~/.config/mpv/mpv.conf:
audio-device=pulse/alsa_output.pci-0000_00_1f.3.analog-stereo
That's the onboard card.
I also use pianobar, which uses libao, to produce its audio. The problem is that
dev=hw:0
changes on each boot. I need a way to specify a device by it's name somewhere, so that I can call it in application, even if it's hw ID changes.
What can I do there?
^ permalink raw reply [flat|nested] 2+ messages in thread
* Persistent device naming, alsa
Persistent device naming, alsa blinux-list
@ ` blinux-list
0 siblings, 0 replies; 2+ messages in thread
From: blinux-list @ UTC (permalink / raw)
On Tue, 14 Sep 2021, Linux for blind general discussion wrote:
> I have a USB audio device that I use for system sounds via pulse, and speech.
> In my default.pa, I have
> set-default-sink alsa_output.usb-C-Media_Electronics_Inc._USB_Audio_Device-00.analog-stereo
> I also have onboard audio, to which my surround speakers are connected.
> For my mpv, I can use this line in ~/.config/mpv/mpv.conf:
> audio-device=pulse/alsa_output.pci-0000_00_1f.3.analog-stereo
> That's the onboard card.
> I also use pianobar, which uses libao, to produce its audio. The problem is that
> dev=hw:0
> changes on each boot. I need a way to specify a device by it's name somewhere, so that I can call it in application, even if it's hw ID changes.
> What can I do there?
You can set an option for the ALSA modules for your cards to specify the
card number, so that it doesn't change.
Put the following in a file in /etc/modprobe.d ending in .conf (e.g.
/etc/modprobe.d/alsa.conf):
options snd-usb-audio index=0
You may need to set the other one to 1 as it will likely be detected
first.
There is a good discussion of setting default soundcards and the various
ways it can be done at
https://wiki.archlinux.org/title/Advanced_Linux_Sound_Architecture#Set_the_default_sound_card
HTH,
Geoff.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~ UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
Persistent device naming, alsa blinux-list
` blinux-list
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).