You are not logged in.
Pages: 1
I've got Arch running a Macbook Pro 2.2 with Xfce on top. I have an external (USB) sound card that sits between the computer and my speakers/headphones/etc.
I can make the external card work by changing the value of
defaults.pcm.card
in /usr/share/alsa/alsa.conf and restarting alsa. I have to do this every time I plug the thing in, and I have to change it back whenever I unplug it, or else no sound.
Is there a better way? Is there a way to change the active sound card without changing the default in alsa.conf?
Thanks,
Mike
Last edited by mkscrg (2010-05-06 23:10:48)
Offline
Pulseaudio allows you to insert the sound-card on-the-fly and move the streams of current programs from one to the other, or have both on (and different apps playing to each one) at the same time.
Of course, you could also set up a script which watches for the device appearing and then modifies your .asoundrc (or copies a different one) but why repeat someone else's work?
Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.
Offline
Pulseaudio allows you to insert the sound-card on-the-fly and move the streams of current programs from one to the other, or have both on (and different apps playing to each one) at the same time.
Of course, you could also set up a script which watches for the device appearing and then modifies your .asoundrc (or copies a different one) but why repeat someone else's work?
i don't consider adding another framework/daemon a sane solution for something as simple as changing soundcards.
p.s., OSS4 can do this with a single command, since it's default soundcard is symlinked to /dev/dsp/ (you can force overwrite this with another card). i'm not sure whether it supports the MBP2,2 though, but i believe it does.
Last edited by litemotiv (2010-05-11 12:23:12)
ᶘ ᵒᴥᵒᶅ
Offline
here's a nice udev rule for alsa i found online:
# Default to using additional (USB) sound cards when they are available.
KERNEL=="pcmC[D0-9cp]*", ACTION=="add", PROGRAM="/bin/sh -c 'K=%k; K=$${K#pcmC}; K=$${K%%D*}; echo defaults.ctl.card $$K > /etc/asound.conf; echo defaults.pcm.card $$K >>/etc/asound.conf'"
KERNEL=="pcmC[D0-9cp]*", ACTION=="remove", PROGRAM="/bin/sh -c 'echo defaults.ctl.card 0 > /etc/asound.conf; echo defaults.pcm.card 0 >>/etc/asound.conf'"
(source)
ᶘ ᵒᴥᵒᶅ
Offline
Since I used ubuntu years ago I use asoundconf. I wonder why it still is not in the official alsa package or even here in the repo. It's in aur.
It doesn't get more simple:
chris@chrispc ~ % asoundconf list
aNames of available sound cards:
NVidia
HDMI
SAA7134
chris@chrispc ~ % asoundconf set-default-card NVidia
chris@chrispc ~ %
It creates a ~/.asoundrc which includes ~/.asoundrc.asoundcomf which holds the real configuration done by asoundconf.
Programs that output sound while soundcard being changed may need to be restarted, if just restarting the audiostream does not reopen the audio device. With pulseaudio it would indeed work on the fly.
Last edited by Cdh (2010-05-11 15:20:35)
฿ 18PRsqbZCrwPUrVnJe1BZvza7bwSDbpxZz
Offline
There's a graphical interface for asoundconf, listed in the KDE Menu with the name Default-Sound-Card. It's installed at the same time u install the text interface.
Greetings.
Offline
Pages: 1