SYMLINK+="xxx" can only be used once
I'd like to know if this is a bug or a feature. I know it's driving me nuts.
I have a system with 3 sound cards. I need to assign fixed device names to these cards. I've tried various combinations of module parameters and I've found the most reliable way is to use udev to symlink the device names using udev.
Here's the rule I am using:
#Yamaha Corporation YMF-724F
SYSFS{device}="0x000d", SYSFS{vendor}="0x1073", MODE="0660", NAME="snd/%k", SYMLINK+="soundcard/Yamaha_YMF_724F", SYMLINK+="dsp01"
What happens is that only the last SYMLINK is created. This is reproducilble; I can turn the order around and the soundcard link will be created but not the dsp one.
I can't find any examples of multiple SYMLINK creation, so I suspect this may be a feature, but I don't quite understand why it would be so.
Can anyone shed some light on this?
Thanks,
--Yan
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CIDÞVDEV
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 4 lines · Yan Seiner
SYSFS{device}="0x000d", SYSFS{vendor}="0x1073", MODE="0660", NAME="snd/%k", SYMLINK+="soundcard/Yamaha_YMF_724F", SYMLINK+="dsp01"
What happens is that only the last SYMLINK is created.
The documented udev rule syntax would be:
SYSFS{device}="0x000d", SYSFS{vendor}="0x1073", MODE="0660", NAME="snd/%k", SYMLINK+="soundcard/Yamaha_YMF_724F dsp01"
(i.e., separate the names of the wanted symlinks by spaces). But, due to the nature of ALSA, the symlinks are not really usable because ALSA library never looks at them.
Signature · 11 lines
Alexander E. Patrakov ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CIDÞVDEV _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net [email protected] https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 10 lines · Alexander E. Patrakov
Quoted 4 lines · Yan Seiner
SYSFS{device}="0x000d", SYSFS{vendor}="0x1073", MODE="0660", NAME="snd/%k", SYMLINK+="soundcard/Yamaha_YMF_724F", SYMLINK+="dsp01"
What happens is that only the last SYMLINK is created.
The documented udev rule syntax would be:
SYSFS{device}="0x000d", SYSFS{vendor}="0x1073", MODE="0660", NAME="snd/%k", SYMLINK+="soundcard/Yamaha_YMF_724F dsp01"
Thanks!
(Where is this documented? I thought I went through all of the docs... I must have missed something.)
Quoted 5 lines
(i.e., separate the names of the wanted symlinks by spaces). But, due to the nature of ALSA, the symlinks are not really usable because ALSA library never looks at them.
The apps I need to use still use OSS emulation - will that work?
I'm struggling a bit since sound cards have all sorts of mixers, dsps, etc. and I need to make sure the soundcard device names don't move around so the sound comes from the right set of speakers.... The soundcard/ symlinks are just mnemonics for me so I know what hardware I am dealing with, but obviously the dsp stuff I need to use.
If I create a name like /dev/dsp01 which has /dev/snd/mixer2, will that work or will things break in weird ways?
--Yan
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CIDÞVDEV
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Quoted 8 lines · Yan Seiner
Quoted 5 lines · Alexander E. Patrakov
(i.e., separate the names of the wanted symlinks by spaces). But, due to the nature of ALSA, the symlinks are not really usable because ALSA library never looks at them.
The apps I need to use still use OSS emulation - will that work?
No. The symlink you're creating here will point at the Alsa device, not the OSS emulation device.
You have two options. First, you could install alsa-oss and run the programs under aoss; aoss preloads a library that converts the OSS calls into their Alsa equivalents.
Second, you could load snd-pcm-oss and use the /dev/dsp* devices directly. (You can also create symlinks that point at these OSS devices if you need to; that will work.) Something like this might work for the symlinks, assuming vendor and device (and whatever else) are attributes of some parent of the /class/*/dsp* kobjects (you can use udevinfo to find out):
KERNEL=="dsp*", ATTRS{vendor}=="whatever", etc., SYMLINK+="soundcards/BLAH"
That way you'd get a soundcards/BLAH symlink pointing at the /dev/dsp device (and /dev/dsp1, /dev/dsp2, etc.). The dsp* devices won't be stable, but the symlinks will be. If you need stable dsp* devices, you'll have to use the "index" module parameter for each of your drivers, and hopefully you don't have two cards sharing a driver.
Quoted 2 lines
If I create a name like
/dev/dsp01which has/dev/snd/mixer2, will that work or will things break in weird ways?
Well, first, DSP devices are not mixers. So creating a symlink named /dev/dsp01 that points at a mixer isn't that great of an idea.
But second, that's the Alsa mixer device, not the OSS mixer. If your programs use the OSS mixer interface, they'll need to use a symlink pointing at /dev/mixer*, not /dev/snd/mixer*. In short: Forget about /dev/snd if your programs use OSS.
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel