Re: ALSA +udev + Identify two identical audio devices

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I’m replying to myself to share the blog post I wrote detailing the steps I took to get it to work.  I hope it’s useful for someone else out there: http://bit.ly/ypCcZ0 .  Again, many thanks to Adrian Knoth and Florian Faber for all the help.

best,
Miguel Negrão
A 08/12/2011, às 16:36, Miguel Negrao escreveu:

> Hi all,
> 
> I’m trying to configure a linux pc with 2 RME HDSPM soundcards[1]. I manage to get sound perfectly, and I also managed to merge the two sound cards into one using .asoundrc. My problem is that the cards are identical and at every boot they get a random order. I was trying to follow [2] to try to give them a name based on the hardware location of the pci cards.
> 
> I created a file which I placed in /etc/udev/rules.d/85-wfs-script.rules with the following:
> 
> SUBSYSTEM!="sound", GOTO="wfs_pci_cards"
> ACTION!="add", GOTO="wfs_pci_cards"
> 
> DEVPATH=="/devices/pci0000:00/0000:00:14.4/0000:02:0e.0/sound/card?", ATTR{id}="HDSPM_1"
> DEVPATH=="/devices/pci0000:00/0000:00:14.4/0000:02:09.0/sound/card?", ATTR{id}="HDSPM_2"
> 
> LABEL="wfs_pci_cards"
> 
> Then when I reboot or reload the driver I get one of them with the correct name and the other one with “default”
> 
> /proc/asound/cards
> 0 [default    	]: HDSPM - HDSPM MADI
>                  	RME HDSPM MADI at 0xfdce0000, irq 16
> 1 [HDSPM_1    	]: HDSPM - HDSPM MADI
>                  	RME HDSPM MADI at 0xfdcd0000, irq 17
> 
> Which one gets the “default” name is random and changes every time I boot. I tried changing the number 85 to all sorts of numbers, to change the order in which the rule is run,  but it doesn’t really make a difference. Running udevd --debug and reloading the driver reports :
> 
> 1323357358.505334 [3088] udev_rules_apply_to_event: ATTR '/sys/devices/pci0000:00/0000:00:14.4/0000:02:09.0/sound/card0/id' writing 'HDSPM_2' /etc/udev/rules.d/90-wfs-pci-cards.rules:5
> 1323357358.505393 [3088] udev_rules_apply_to_event: error opening ATTR{/sys/devices/pci0000:00/0000:00:14.4/0000:02:09.0/sound/card0/id} for writing: No such file or directory
> 
> Btw, the file is there, and doing "more /sys/devices/pci0000:00/0000:00:14.4/0000:02:09.0/sound/card0/id” yields “default” or “default_1”.
> 
> How can I stop the “default” name overriding the names that I set in the .rules file ? Any help appreciated !!!!
> 
> best regards,
> -- 
> Miguel Negrão // ZLB
> http://www.friendlyvirus.org/artists/zlb/
> 
> [1] http://www.mjmwired.net/kernel/Documentation/sound/alsa/hdspm.txt
> [2] http://alsa.opensrc.org/Udev#Identify_two_identical_audio_devices
> 
> 
> 
> 
> ------------------------------------------------------------------------------
> Cloud Services Checklist: Pricing and Packaging Optimization
> This white paper is intended to serve as a reference, checklist and point of 
> discussion for anyone considering optimizing the pricing and packaging model 
> of a cloud services business. Read Now!
> http://www.accelacomm.com/jaw/sfnl/114/51491232/
> _______________________________________________
> Alsa-user mailing list
> Alsa-user@xxxxxxxxxxxxxxxxxxxxx
> https://lists.sourceforge.net/lists/listinfo/alsa-user

-- 
Miguel Negrão // ZLB
http://www.friendlyvirus.org/artists/zlb/




------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Alsa-user mailing list
Alsa-user@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/alsa-user



[Index of Archives]     [ALSA Devel]     [Linux Audio Users]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]

  Powered by Linux