]> err.no Git - systemd/commitdiff
sound: include ALSA sound card id in ID_ID property
authorLennart Poettering <lennart@poettering.net>
Thu, 5 Nov 2009 03:32:41 +0000 (04:32 +0100)
committerLennart Poettering <lennart@poettering.net>
Thu, 5 Nov 2009 03:32:41 +0000 (04:32 +0100)
If two USB sound cards that have the same serial number are plugged in
make sure ID_ID is unique at least during runtime, by including the ALSA
card id in the ID_ID string.

Fixes issues like this one:
http://pulseaudio.org/ticket/661

rules/rules.d/78-sound-card.rules

index f40921d9d11d66da78db3e5173b63d472f8cfadd..0f0cf64d7c037ef2cd0ecdc4e920e3cb5b1013e0 100644 (file)
@@ -48,8 +48,8 @@ SUBSYSTEMS=="pci", ENV{ID_BUS}="pci", ENV{ID_VENDOR_ID}="$attr{vendor}", ENV{ID_
 
 LABEL="skip_pci"
 
-ENV{ID_SERIAL}=="?*", ENV{ID_IFACE}=="?*", ENV{ID_ID}="$env{ID_BUS}-$env{ID_SERIAL}-$env{ID_IFACE}"
-ENV{ID_SERIAL}=="?*", ENV{ID_IFACE}=="", ENV{ID_ID}="$env{ID_BUS}-$env{ID_SERIAL}"
+ENV{ID_SERIAL}=="?*", ENV{ID_IFACE}=="?*", ENV{ID_ID}="$env{ID_BUS}-$env{ID_SERIAL}-$env{ID_IFACE}-$attr{id}"
+ENV{ID_SERIAL}=="?*", ENV{ID_IFACE}=="", ENV{ID_ID}="$env{ID_BUS}-$env{ID_SERIAL}-$attr{id}"
 
 ENV{ID_PATH}=="", IMPORT{program}="path_id %p/controlC%n"