From: "Ingo Müller" <alsa@ingomueller.net>
To: Alsa Dev <alsa-devel@lists.sourceforge.net>
Subject: Re: Naming two identical USB devices (need help)
Date: Sat, 10 Feb 2007 18:53:13 +0100 [thread overview]
Message-ID: <45CE0689.8060302@ingomueller.net> (raw)
In-Reply-To: <1171060928.13387.10.camel@localhost>
Hi!
I thought about your problem again and I think I made a small progress!
I was able to set the cards number to any number I want using a udev
rule, so I could use that card with plughw:n,0 where n was the number of
my choise. I didn't use a udev rule that makes a lot of sense, but I'm
sure that there is a possibility to create a rule that depends on the
usb port your usb sound card is plugged in. Here is what I did:
I looked at the devices that where created before I did anything:
ingo@ingo-desktop:~$ls -l /dev/snd/
insgesamt 0
crw-rw---- 1 root audio 116, 11 2007-02-10 18:26 controlC0
crw-rw---- 1 root audio 116, 3 2007-02-10 18:26 hwC0D0
crw-rw---- 1 root audio 116, 13 2007-02-10 18:26 hwC0D2
crw-rw---- 1 root audio 116, 4 2007-02-10 18:26 midiC0D0
crw-rw---- 1 root audio 116, 14 2007-02-10 18:26 midiC0D1
crw-rw---- 1 root audio 116, 15 2007-02-10 18:26 midiC0D2
crw-rw---- 1 root audio 116, 10 2007-02-10 18:26 pcmC0D0c
crw-rw---- 1 root audio 116, 9 2007-02-10 18:26 pcmC0D0p
crw-rw---- 1 root audio 116, 8 2007-02-10 18:26 pcmC0D1c
crw-rw---- 1 root audio 116, 7 2007-02-10 18:26 pcmC0D2c
crw-rw---- 1 root audio 116, 6 2007-02-10 18:26 pcmC0D2p
crw-rw---- 1 root audio 116, 5 2007-02-10 18:26 pcmC0D3p
crw-rw---- 1 root audio 116, 12 2007-02-10 18:26 seq
crw-rw---- 1 root audio 116, 2 2007-02-10 18:26 timer
The I looked at the udev rules, that created these devices (in
/etc/udev/rules.d/20-names.rules):
# Sound devices, group under /dev/snd
KERNEL=="controlC[0-9]*", NAME="snd/%k"
KERNEL=="hwC[D0-9]*", NAME="snd/%k"
KERNEL=="midiC[D0-9]*", NAME="snd/%k"
KERNEL=="pcmC[D0-9cp]*", NAME="snd/%k"
KERNEL=="seq", NAME="snd/%k"
KERNEL=="timer", NAME="snd/%k"
These rules only "move" the sound devices to the snd/ directory. In
order to change the name of the created devices, I created a rule for
every device that has been created before, using its name from the first
ls command, and changed the card number (still moving it to snd/), here
it is number 3.
KERNEL=="controlC0", NAME="snd/controlC3"
KERNEL=="hwC0D0", NAME="snd/hwC3D0"
KERNEL=="hwC0D2", NAME="snd/hwC3D2"
KERNEL=="midiC0D0", NAME="snd/midiC3D0"
KERNEL=="midiC0D1", NAME="snd/midiC3D1"
KERNEL=="midiC0D2", NAME="snd/midiC3D2"
KERNEL=="pcmC0D0c", NAME="snd/pcmC3D0c"
KERNEL=="pcmC0D0p", NAME="snd/pcmC3D0p"
KERNEL=="pcmC0D1c", NAME="snd/pcmC3D1c"
KERNEL=="pcmC0D2c", NAME="snd/pcmC3D2c"
KERNEL=="pcmC0D2p", NAME="snd/pcmC3D2p"
KERNEL=="pcmC0D3p", NAME="snd/pcmC3D3p"
The result: My card was not card 0 anymore ("Karte 0"), but card 3
("Karte 3") and I was able to use it with plughw:3,0.
ingo@ingo-desktop:~$aplay -l
**** Liste von PLAYBACK Geräten ****
Karte 3: Live [SBLive! Platinum [CT4760P]], Gerät 0: emu10k1 [ADC
Capture/Standard PCM Playback]
Untergeordnete Geräte: 32/32
Untergeordnetes Gerät '0: subdevice #0
Untergeordnetes Gerät '1: subdevice #1
Untergeordnetes Gerät '2: subdevice #2
Untergeordnetes Gerät '3: subdevice #3
...
That means that there is a way to influence the number of the card with
udev! Now, everything you have to do is find a udev rule that matches a
certain usb port. As you can run external programs with udev, there must
be a way to do that.
I'm going to play with udev now, too, so if I find something, I'll tell
you. In return, it would be awesome if you could write down - even it is
only short - a howto about how to manage two identical devices, once we
got it working.
Regards, Ingo
Jean-Michel Pouré schrieb:
> Hello,
>
> My need is very basic.
>
> I am using two Terratec Aureon USB MK2 devices.
> But this could be any case where two devices are the same.
>
> My question is:
>
> Is there a way to make sure that each physical device always has the
> same name: plughw:0,0 (first identical card) and plughw:1,0 (second
> identical card). This would allow me to plug the cards and forget the
> plugs.
>
> Presently, numbers change on every reboot or if I hotplug devices.
>
> I read on the wiki that it was possible to load modules in a precise
> order. But it seems to be working in case of several ***different***
> devices, not several identical devices:
> http://alsa.opensrc.org/MultipleCards
>
> Any idea? Is there a way to use Udev?
>
> If it is not possible in the current state of Alsa, I will send back one
> device to the retailer, in which case I need your kind advice quickly.
>
> Kind regards,
> Jean-Michel Pouré
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Alsa-devel mailing list
Alsa-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-devel
next prev parent reply other threads:[~2007-02-10 17:53 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-09 22:42 Naming two identical USB devices (need help) Jean-Michel Pouré
2007-02-10 2:25 ` Lee Revell
2007-02-10 9:02 ` Jean-Michel Pouré
2007-02-10 17:53 ` Ingo Müller [this message]
2007-02-10 18:18 ` Ingo Müller
2007-02-10 19:31 ` Jean-Michel Pouré
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=45CE0689.8060302@ingomueller.net \
--to=alsa@ingomueller.net \
--cc=alsa-devel@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.