Gentoo Archives: gentoo-user

From: Mark Knecht <markknecht@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Switch between sound cards?
Date: Mon, 25 Feb 2008 04:12:10
Message-Id: 5bdc1c8b0802242012s328baa32gc5d6000e0f84363b@mail.gmail.com
In Reply to: Re: [gentoo-user] Switch between sound cards? by Grant
1 On Sun, Feb 24, 2008 at 3:21 PM, Grant <emailgrant@×××××.com> wrote:
2 > > Grant,
3 > > If you want to do a complete switch then you would change your USB
4 > > card to index 0 and restart Als which would make the USB card the
5 > > default since card 0 is always the default for Alsa. On the other
6 > > hand, if you wanted to just leave the onboard card as default and send
7 > > audio from a specific application to the USB card you would tell the
8 > > application to use hw:1 explicity, either in the command line when you
9 > > start the app or in an application's config file. On my system I let
10 > > all my web/browest audio go to the onboard sound card but I send all
11 > > my CD audio directly to my good card using Aqualung and configuring it
12 > > from the command line. (Actually in my launcher.)
13 > >
14 > > to the best of my knowledge there has never been a way to simply
15 > > switch sound cards on the fly in Alsa. I've requested this sometime
16 > > back but the developers haven't shown any interest.
17 > >
18 > > Hope this helps,
19 > > Mark
20 >
21 > Hi Mark,
22 >
23 > Changing the index and restarting alsasound would be a great switching
24 > method but I can't get that to work. No matter which one I set to
25 > index=0 and which to index=1 the sound always comes out of the USB
26 > card.
27 >
28 > BTW, what sound card are you using? Here's mine, it's great:
29 >
30 > http://diyparadise.com/shop/index.php?main_page=product_info&cPath=2&products_id=82
31 >
32 > - Grant
33 >
34 >
35 >
36 >
37 > > > > > I have a USB sound card and an internal sound card in my laptop. Is
38 > > > > > there a way to switch between them while the system is booted? Is
39 > > > > > module loading/unloading via modprobe the best way to do it?
40 > > > > >
41 > > > > > - Grant
42 > > > > > --
43
44 Grant,
45 On the previous machine where I gave you the modules.d/alsa file I
46 use the onboard sound chip for most sound but my main card is a 26
47 input, 26 output RME HDSP 9652 card.
48
49 On my wife's machine, and out MythTV backend server, we use the
50 intel-hda oinboard sound chip for most audio but we also have an
51 external usb sound card that converts from USB to TOS link which I use
52 to drive our home theater receiver. I'm putting the alsa file at the
53 end of this post.
54
55 Note that on this machine when we want to play audio using Aqualung
56 through the onboard device this is the command in the Gnome launcher:
57
58 /usr/bin/aqualung -o alsa -d hw:0,0
59
60 while if we want to play through the USB device we use this:
61
62 /usr/bin/aqualung -o alsa -d hw:1,0
63
64 Not sure why you'd be having trouble. We use this technique on
65 Aqualung, mplayer, xine and MythTV. The basic idea works once you get
66 it under control.
67
68 Good luck,
69 Mark
70
71 mark@dragonfly ~ $ cat /etc/modules.d/alsa
72 # Alsa 0.9.X kernel modules' configuration file.
73 # $Header: /var/cvsroot/gentoo-x86/media-sound/alsa-utils/files/alsa-modules.conf-rc,v
74 1.4 2004/11/16 01:31:22 eradicator Exp $
75
76 # ALSA portion
77 alias char-major-116 snd
78 # OSS/Free portion
79 alias char-major-14 soundcore
80
81 ##
82 ## IMPORTANT:
83 ## You need to customise this section for your specific sound card(s)
84 ## and then run `update-modules' command.
85 ## Read alsa-driver's INSTALL file in /usr/share/doc for more info.
86 ##
87 ## ALSA portion
88 alias snd-card-0 snd-intel8x0
89 options snd-intel8x0 index=0
90
91 alias snd-card-1 snd-usb-audio
92 options snd-usb-audio index=1
93
94 ## OSS/Free portion
95 alias sound-slot-0 snd-card-0
96 alias sound-slot-1 snd-card-1
97 ##
98
99 # OSS/Free portion - card #1
100 alias sound-service-0-0 snd-mixer-oss
101 alias sound-service-0-1 snd-seq-oss
102 alias sound-service-0-3 snd-pcm-oss
103 alias sound-service-0-8 snd-seq-oss
104 alias sound-service-0-12 snd-pcm-oss
105 ## OSS/Free portion - card #2
106 alias sound-service-1-0 snd-mixer-oss
107 alias sound-service-1-3 snd-pcm-oss
108 alias sound-service-1-12 snd-pcm-oss
109
110 alias /dev/mixer snd-mixer-oss
111 alias /dev/dsp snd-pcm-oss
112 alias /dev/midi snd-seq-oss
113
114 # Set this to the correct number of cards.
115 options snd cards_limit=2
116 mark@dragonfly ~ $
117 --
118 gentoo-user@l.g.o mailing list

Replies

Subject Author
Re: [gentoo-user] Switch between sound cards? Grant <emailgrant@×××××.com>