Gentoo Archives: gentoo-user

From: Leandro Melo de Sales <leandroal@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] (SOLVED) Usb sound and ALSA
Date: Tue, 31 Oct 2006 05:08:25
Message-Id: 5bc4c4570610302104y7fa6264bla3f434735f32a5e7@mail.gmail.com
1 Hi...
2 just to document. There are two options:
3
4 1) I created ~/.asoundrc file (as suggested by Richard) but with some
5 modification as shown next (I don't know if all this option is
6 necessary, but the sound is perfect):
7
8 ----- ~/.asoundrc
9
10 pcm.card0 {
11 type hw
12 card 1
13 }
14
15 pcm.!default {
16 type plug
17 slave.pcm "dmixer"
18 }
19
20 pcm.!output {
21 type dmix
22 ipc_key 1024
23 ipc_key_add_uid 1
24 slave {
25 pcm "card0"
26 period_time 0
27 period_size 1024
28 buffer_size 8192
29 rate 192000
30 }
31 bindings {
32 0 0
33 1 1
34 }
35 }
36
37 pcm.!input {
38 type dsnoop
39 ipc_key 28889
40 ipc_key_add_uid 1
41 slave {
42 pcm "card0"
43 channels 2
44 period_time 0
45 period_size 1024
46 rate 192000
47 }
48
49 pcm.!duplex {
50 type asym
51 playback.pcm "output"
52 capture.pcm "input"
53 }
54
55 pcm.!default {
56 type plug
57 slave.pcm "duplex"
58 }
59
60 pcm.dsp0 {
61 type plug
62 slave.pcm "duplex"
63 }
64
65 ctl.mixer0 {
66 type hw
67 card 0
68 }
69
70 pcm.jackplug {
71 type plug
72 slave { pcm "jack" }
73 }
74
75 pcm.jack {
76 type jack
77 playback_ports {
78 0 alsa_pcm:playback_1
79 1 alsa_pcm:playback_2
80 }
81 capture_ports {
82 0 alsa_pcm:capture_1
83 1 alsa_pcm:capture_2
84 }
85 }
86
87 2) change alsa configuration module to put my card1 to card0 and card0
88 to card1 (don't forget to restart alsa daemon):
89
90 ------ /etc/modules.d/alsa
91 alias /dev/mixer snd-mixer-oss
92 alias /dev/dsp snd-pcm-oss
93 alias /dev/midi snd-seq-oss
94
95 alias snd-card-0 snd-usb-audio
96 alias sound-slot-0 snd-usb-audio
97 alias snd-card-1 snd-intel8x0
98 alias sound-slot-1 snd-intel8x0
99 options snd-usb-audio index=0
100 options snd-intel8x0 index=1
101 ------------------------------------
102
103 ... snd-intel8x0 is the module alias for my internal sound card and
104 snd-usb-audio for my external usb audio device.
105
106 BTW, thanks Richard.
107
108 []s
109 Leandro.
110
111 --
112 Leandro Melo de Sales.
113 Computer Science MSc Candidate
114 Distributed System Lab - lsd.ufcg.edu.br
115 Pervasive Computing Lab - embedded.ufcg.edu.br
116 Federal University of Campina Grande - UFCG
117 083 33101404 (extension 208)
118
119 2006/10/31, Leandro Melo de Sales <leandroal@×××××.com>:
120 > Hi,
121 >
122 > After I click on Apply button the Alsa Device Configuration section
123 > become enabled, but when I specify hw1,0 in Stereo text field and play
124 > a song amarok shows the message: "Audio output unavailable; the device
125 > is busy.".
126 >
127 > /proc/asound/ # ls
128 > ASM5X0 Modem card1 cards hwdep oss seq version
129 > ICH6 card0 card2 devices modules pcm timers
130 >
131 > the file ASM5X0 is a symbolic link to card2.
132 >
133 > /proc/asound/ # cat cards
134 > 0 [ICH6 ]: ICH4 - Intel ICH6
135 > Intel ICH6 with unknown codec at 0xc8000800, irq 18
136 > 1 [Modem ]: ICH-MODEM - Intel ICH6 Modem
137 > Intel ICH6 Modem at 0x3400, irq 18
138 > 2 [ASM5X0 ]: USB-Audio - AS-M5X0
139 > Gradiente AS-M5X0 at usb-0000:00:1d.1-1, full speed
140 >
141 > I also tried to specify hw2,0 but the message is the same, device is busy! :(
142 >
143 > But a good news is that if I do:
144 >
145 > mpg123 -a /dev/sound/dsp1 music.mp3
146 >
147 > ... the file is played on my usb device perfectly!!! So, this is the
148 > proof that kernel recognize the device and I just don't know how
149 > switch alsa default device do /dev/sound/dsp1.
150 >
151 > Any clue? Thank you,
152 >
153 > Leandro.
154 >
155 > 2006/10/31, Leandro Melo de Sales <leandroal@×××××.com>:
156 > > Hi... The device is configured and I type cat xxx > /dev/sound/dsp1
157 > > and I got an strange sound, but this prove that the device was
158 > > recognized by the kernel. I also can control volume of the second
159 > > audio device through alsamixer. The question is: how can I specify (on
160 > > alsa) that the default device is /dev/sound/dsp1 or something like
161 > > that?
162 > > I tried to do what you said on Amarok, but the "Alsa Device
163 > > Configuration" section is disabled, why?
164 > >
165 > > []s
166 > > Leandro.
167 > >
168 > > 2006/10/31, Richard Fish <bigfish@××××××××××.org>:
169 > > > On 10/30/06, Leandro Melo de Sales <leandroal@×××××.com> wrote:
170 > > > > Hi list...
171 > > > >
172 > > > > I have an usb sound system from Gradiente company (an eletronic
173 > > > > device factory) and I plugged it on my system. dmesg command shows
174 > > > > this:
175 > > > >
176 > > > > input: Gradiente AS-M5X0 as /class/input/input3
177 > > > > input: USB HID v1.00 Device [Gradiente AS-M5X0] on usb-0000:00:1d.1-1
178 > > > >
179 > > > > But when I play a mp3 media the sound is not forwarded to my usb
180 > > > > device, instand, the sound is still played through my integrated
181 > > > > laptop device.
182 > > > > On windows I use it without problem. So, what do I have to do to
183 > > > > forward the sound to my usb device?
184 > > >
185 > > > Probably windows is disabling any existing sound card or at least
186 > > > making the USB the "default" sound device. Unfortunately there is no
187 > > > equivalent with alsa currently.
188 > > >
189 > > > So assuming that you've got the alsa drivers loaded for this device
190 > > > (/proc/asound/cards should contain two entries), you can usually
191 > > > specify alsa device as "hw1,0". The exact method for doing this
192 > > > depends on what app you are using. For example on amarok with the
193 > > > xine it is under Configure Amarok... -> Engine -> ALSA Device
194 > > > Configuration. If you enter hw1,0 for Stereo there, then 2 channel
195 > > > audio should be played on the first pcm of the second sound card.
196 > > >
197 > > > You should also be able to do this with a .asoundrc file, with an entry like:
198 > > >
199 > > > pcm.default {
200 > > > type hw
201 > > > card 1
202 > > > device 1
203 > > > }
204 > > >
205 > > > The above is really primitive, without any dmix plugin (software
206 > > > mixing), so only one app could use the device at a time unless it does
207 > > > hardware mixing. Mostly this is just to give you an idea of where to
208 > > > look! ;-)
209 > > >
210 > > > -Richard
211 > > > --
212 > > > gentoo-user@g.o mailing list
213 > > >
214 > > >
215 >
216 --
217 gentoo-user@g.o mailing list