* Naming two identical USB devices (need help) @ 2007-02-09 22:42 Jean-Michel Pouré 2007-02-10 2:25 ` Lee Revell 2007-02-10 17:53 ` Ingo Müller 0 siblings, 2 replies; 6+ messages in thread From: Jean-Michel Pouré @ 2007-02-09 22:42 UTC (permalink / raw) To: Alsa Dev 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 ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Naming two identical USB devices (need help) 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 1 sibling, 1 reply; 6+ messages in thread From: Lee Revell @ 2007-02-10 2:25 UTC (permalink / raw) To: Jean-Michel Pouré; +Cc: Alsa Dev On 2/9/07, Jean-Michel Pouré <jmpoure@free.fr> wrote: > 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. > I don't think there's an easy way with any current Linux distro. Don't USB devices have some kind of hardware serial number or GUID that udev could be taught about? Lee ------------------------------------------------------------------------- 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 ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Naming two identical USB devices (need help) 2007-02-10 2:25 ` Lee Revell @ 2007-02-10 9:02 ` Jean-Michel Pouré 0 siblings, 0 replies; 6+ messages in thread From: Jean-Michel Pouré @ 2007-02-10 9:02 UTC (permalink / raw) To: Lee Revell; +Cc: alsa-devel Le vendredi 09 février 2007 à 21:25 -0500, Lee Revell a écrit : > I don't think there's an easy way with any current Linux distro. > > Don't USB devices have some kind of hardware serial number or GUID > that udev could be taught about? > > Lee Dear Alsa developpers, udevinfo can handle serial ID. It is very versatile. But then the question is, how do I use Udev to teach Alsa how to set up plughw:x,y numbers. It should be possible to rename PCMs using Udev. But how do I rename plughw:x,y. I searched on Google and the wiki without answers. I can hardly imagine that professionnal hardware with several identical cards cannot distinguish audio devices once for all. I am very happy with Alsa, and I can wait a couple of months before Alsa handles Udev better. But please inform me so that I can ship my second card back. Kind regards, Jean-Michel ------------------------------------------------------------------------- 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 ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Naming two identical USB devices (need help) 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 17:53 ` Ingo Müller 2007-02-10 18:18 ` Ingo Müller 2007-02-10 19:31 ` Jean-Michel Pouré 1 sibling, 2 replies; 6+ messages in thread From: Ingo Müller @ 2007-02-10 17:53 UTC (permalink / raw) To: Alsa Dev 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 ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Naming two identical USB devices (need help) 2007-02-10 17:53 ` Ingo Müller @ 2007-02-10 18:18 ` Ingo Müller 2007-02-10 19:31 ` Jean-Michel Pouré 1 sibling, 0 replies; 6+ messages in thread From: Ingo Müller @ 2007-02-10 18:18 UTC (permalink / raw) To: Alsa Dev Hi! I found a command that may be very usefull to create a udev rule: udevinfo -a -p $(udevinfo -q path -n <path-to-current-device-node>) If I get it right, it displays everything you can use to create udev rules (except external programs). I've run it for a non sound card usb device and it lists the usb port! If youre lucky, there is even an unique identifier - just compare the output of the two devices. Regards, Ingo Ingo Müller schrieb: > I'm going to play with udev now, too, so if I find something, I'll tell > you. ------------------------------------------------------------------------- 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 ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Naming two identical USB devices (need help) 2007-02-10 17:53 ` Ingo Müller 2007-02-10 18:18 ` Ingo Müller @ 2007-02-10 19:31 ` Jean-Michel Pouré 1 sibling, 0 replies; 6+ messages in thread From: Jean-Michel Pouré @ 2007-02-10 19:31 UTC (permalink / raw) To: Ingo Müller; +Cc: Alsa Dev Le samedi 10 février 2007 à 18:53 +0100, Ingo Müller a écrit : > 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. > Fantastic. Thank you very much for your help. I will add a page on the wiki about udev rules. Kind regards, Jean-Michel ------------------------------------------------------------------------- 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 ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2007-02-10 19:31 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 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 2007-02-10 18:18 ` Ingo Müller 2007-02-10 19:31 ` Jean-Michel Pouré
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.