Any success using udev rules on a soundcard?

Optimize your system for ultimate performance.

Moderators: khz, MattKingUSA

Post Reply
arifd
Established Member
Posts: 65
Joined: Sun Nov 29, 2020 11:09 am

Any success using udev rules on a soundcard?

Post by arifd »

I want to run a script that starts up a pulseaudio device, but runs my soundcard's input through some signal processing first.

If I manually call the script it works every time. But if I write a udev script to do it automatically, I think it's getting triggered too early, and the device can't be found etc.

here's my udev

Code: Select all

ACTION=="add",SUBSYSTEMS=="usb",ATTRS{idProduct}=="8211",ATTRS{idVendor}=="1235",RUN+="/path/to/script"
Anyone have any ideas? If I `sleep` in my script, it seems everything gets delayed, so I can't even sleep... Maybe I can fork the script and run the sleep in a separate thread?
erlkönig
Established Member
Posts: 6
Joined: Tue May 31, 2022 8:58 am

Re: Any success using udev rules on a soundcard?

Post by erlkönig »

What happens if you try

Code: Select all

RUN+="sleep x && /path/to/script"
?
arifd
Established Member
Posts: 65
Joined: Sun Nov 29, 2020 11:09 am

Re: Any success using udev rules on a soundcard?

Post by arifd »

Then the script never runs :)

For more information, I have reduced the script to something more simple:

Code: Select all

arecord -D "$(audio_src)" -f S32_LE -r 96000 -c 2 --buffer-size 2048 | aplay >> /tmp/arif 2>&1
echo "" >> /tmp/arif
`audio_src` is a function that extracts "hw:2,0" (correctly) from a given name

This is the error that gets logged

Code: Select all

ALSA lib pcm_dmix.c:1075:(snd_pcm_dmix_open) unable to open slave
aplay: main:852: audio open error: No such file or directory

ALSA lib pcm_dmix.c:1075:(snd_pcm_dmix_open) unable to open slave
aplay: main:852: audio open error: No such file or directory
ALSA lib pcm_dmix.c:1075:(snd_pcm_dmix_open) unable to open slave
aplay: main:852: audio open error: No such file or directory
ALSA lib pcm_dmix.c:1075:(snd_pcm_dmix_open) unable to open slave
aplay: main:852: audio open error: No such file or directory
ALSA lib pcm_dmix.c:1075:(snd_pcm_dmix_open) unable to open slave
aplay: main:852: audio open error: No such file or directory




ALSA lib pcm_dmix.c:1075:(snd_pcm_dmix_open) unable to open slave
aplay: main:852: audio open error: No such file or directory

ALSA lib pcm_dmix.c:1075:(snd_pcm_dmix_open) unable to open slave
aplay: main:852: audio open error: No such file or directory
ALSA lib pcm_dmix.c:1075:(snd_pcm_dmix_open) unable to open slave
aplay: main:852: audio open error: No such file or directory
ALSA lib pcm_dmix.c:1075:(snd_pcm_dmix_open) unable to open slave
aplay: main:852: audio open error: No such file or directory



interesting how many times that event is fired, although that is fine, but also curious that the two lines, although being one after the other in the bash script, do not occur in serial in the logs, thus suggesting that the order of operations is non-deterministic. There are race conditions.

Anyway, for this simple case it should not matter
arifd
Established Member
Posts: 65
Joined: Sun Nov 29, 2020 11:09 am

Re: Any success using udev rules on a soundcard?

Post by arifd »

If I run

Code: Select all

udevadm monitor --property
which logs events. This is the log when i switch on my device.

It confirms the multiple calls udev triggers to my script. I really want just to listen for the last event. But I can't seem to write any rules that capture it successfully...

Code: Select all

monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
KERNEL - the kernel uevent

KERNEL[3428.130870] add      /devices/pci0000:00/0000:00:02.1/0000:01:00.0/usb1/1-14/1-14.3 (usb)
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:02.1/0000:01:00.0/usb1/1-14/1-14.3
SUBSYSTEM=usb
DEVNAME=/dev/bus/usb/001/010
DEVTYPE=usb_device
PRODUCT=1235/8211/645
TYPE=239/2/1
BUSNUM=001
DEVNUM=010
SEQNUM=4756
MAJOR=189
MINOR=9

KERNEL[3428.144616] add      /devices/pci0000:00/0000:00:02.1/0000:01:00.0/usb1/1-14/1-14.3/1-14.3:1.0 (usb)
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:02.1/0000:01:00.0/usb1/1-14/1-14.3/1-14.3:1.0
SUBSYSTEM=usb
DEVTYPE=usb_interface
PRODUCT=1235/8211/645
TYPE=239/2/1
INTERFACE=1/1/32
MODALIAS=usb:v1235p8211d0645dcEFdsc02dp01ic01isc01ip20in00
SEQNUM=4757

KERNEL[3428.265612] add      /devices/pci0000:00/0000:00:02.1/0000:01:00.0/usb1/1-14/1-14.3/1-14.3:1.0/sound/card2 (sound)
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:02.1/0000:01:00.0/usb1/1-14/1-14.3/1-14.3:1.0/sound/card2
SUBSYSTEM=sound
SEQNUM=4758

KERNEL[3428.265738] add      /devices/pci0000:00/0000:00:02.1/0000:01:00.0/usb1/1-14/1-14.3/1-14.3:1.0/sound/card2/pcmC2D0p (sound)
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:02.1/0000:01:00.0/usb1/1-14/1-14.3/1-14.3:1.0/sound/card2/pcmC2D0p
SUBSYSTEM=sound
DEVNAME=/dev/snd/pcmC2D0p
DEVTYPE=pcm
SEQNUM=4759
MAJOR=116
MINOR=10

KERNEL[3428.265798] add      /devices/pci0000:00/0000:00:02.1/0000:01:00.0/usb1/1-14/1-14.3/1-14.3:1.0/sound/card2/pcmC2D0c (sound)
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:02.1/0000:01:00.0/usb1/1-14/1-14.3/1-14.3:1.0/sound/card2/pcmC2D0c
SUBSYSTEM=sound
DEVNAME=/dev/snd/pcmC2D0c
DEVTYPE=pcm
SEQNUM=4760
MAJOR=116
MINOR=11

KERNEL[3428.265853] add      /devices/pci0000:00/0000:00:02.1/0000:01:00.0/usb1/1-14/1-14.3/1-14.3:1.0/sound/card2/controlC2 (sound)
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:02.1/0000:01:00.0/usb1/1-14/1-14.3/1-14.3:1.0/sound/card2/controlC2
SUBSYSTEM=sound
DEVNAME=/dev/snd/controlC2
SEQNUM=4761
MAJOR=116
MINOR=12

KERNEL[3428.265914] bind     /devices/pci0000:00/0000:00:02.1/0000:01:00.0/usb1/1-14/1-14.3/1-14.3:1.0 (usb)
ACTION=bind
DEVPATH=/devices/pci0000:00/0000:00:02.1/0000:01:00.0/usb1/1-14/1-14.3/1-14.3:1.0
SUBSYSTEM=usb
DEVTYPE=usb_interface
DRIVER=snd-usb-audio
PRODUCT=1235/8211/645
TYPE=239/2/1
INTERFACE=1/1/32
MODALIAS=usb:v1235p8211d0645dcEFdsc02dp01ic01isc01ip20in00
SEQNUM=4762

KERNEL[3428.268609] add      /devices/pci0000:00/0000:00:02.1/0000:01:00.0/usb1/1-14/1-14.3/1-14.3:1.1 (usb)
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:02.1/0000:01:00.0/usb1/1-14/1-14.3/1-14.3:1.1
SUBSYSTEM=usb
DEVTYPE=usb_interface
DRIVER=snd-usb-audio
PRODUCT=1235/8211/645
TYPE=239/2/1
INTERFACE=1/2/32
MODALIAS=usb:v1235p8211d0645dcEFdsc02dp01ic01isc02ip20in01
SEQNUM=4763

KERNEL[3428.268713] bind     /devices/pci0000:00/0000:00:02.1/0000:01:00.0/usb1/1-14/1-14.3/1-14.3:1.1 (usb)
ACTION=bind
DEVPATH=/devices/pci0000:00/0000:00:02.1/0000:01:00.0/usb1/1-14/1-14.3/1-14.3:1.1
SUBSYSTEM=usb
DEVTYPE=usb_interface
DRIVER=snd-usb-audio
PRODUCT=1235/8211/645
TYPE=239/2/1
INTERFACE=1/2/32
MODALIAS=usb:v1235p8211d0645dcEFdsc02dp01ic01isc02ip20in01
SEQNUM=4764

KERNEL[3428.271923] add      /devices/pci0000:00/0000:00:02.1/0000:01:00.0/usb1/1-14/1-14.3/1-14.3:1.2 (usb)
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:02.1/0000:01:00.0/usb1/1-14/1-14.3/1-14.3:1.2
SUBSYSTEM=usb
DEVTYPE=usb_interface
DRIVER=snd-usb-audio
PRODUCT=1235/8211/645
TYPE=239/2/1
INTERFACE=1/2/32
MODALIAS=usb:v1235p8211d0645dcEFdsc02dp01ic01isc02ip20in02
SEQNUM=4765

KERNEL[3428.272071] bind     /devices/pci0000:00/0000:00:02.1/0000:01:00.0/usb1/1-14/1-14.3/1-14.3:1.2 (usb)
ACTION=bind
DEVPATH=/devices/pci0000:00/0000:00:02.1/0000:01:00.0/usb1/1-14/1-14.3/1-14.3:1.2
SUBSYSTEM=usb
DEVTYPE=usb_interface
DRIVER=snd-usb-audio
PRODUCT=1235/8211/645
TYPE=239/2/1
INTERFACE=1/2/32
MODALIAS=usb:v1235p8211d0645dcEFdsc02dp01ic01isc02ip20in02
SEQNUM=4766

KERNEL[3428.274858] add      /devices/pci0000:00/0000:00:02.1/0000:01:00.0/usb1/1-14/1-14.3/1-14.3:1.3 (usb)
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:02.1/0000:01:00.0/usb1/1-14/1-14.3/1-14.3:1.3
SUBSYSTEM=usb
DEVTYPE=usb_interface
PRODUCT=1235/8211/645
TYPE=239/2/1
INTERFACE=255/1/32
MODALIAS=usb:v1235p8211d0645dcEFdsc02dp01icFFisc01ip20in03
SEQNUM=4767

KERNEL[3428.275004] bind     /devices/pci0000:00/0000:00:02.1/0000:01:00.0/usb1/1-14/1-14.3 (usb)
ACTION=bind
DEVPATH=/devices/pci0000:00/0000:00:02.1/0000:01:00.0/usb1/1-14/1-14.3
SUBSYSTEM=usb
DEVNAME=/dev/bus/usb/001/010
DEVTYPE=usb_device
DRIVER=usb
PRODUCT=1235/8211/645
TYPE=239/2/1
BUSNUM=001
DEVNUM=010
SEQNUM=4768
MAJOR=189
MINOR=9

UDEV  [3428.439534] add      /devices/pci0000:00/0000:00:02.1/0000:01:00.0/usb1/1-14/1-14.3 (usb)
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:02.1/0000:01:00.0/usb1/1-14/1-14.3
SUBSYSTEM=usb
DEVNAME=/dev/bus/usb/001/010
DEVTYPE=usb_device
PRODUCT=1235/8211/645
TYPE=239/2/1
BUSNUM=001
DEVNUM=010
SEQNUM=4756
USEC_INITIALIZED=3428281280
ID_VENDOR=Focusrite
ID_VENDOR_ENC=Focusrite
ID_VENDOR_ID=1235
ID_MODEL=Scarlett_Solo_USB
ID_MODEL_ENC=Scarlett\x20Solo\x20USB
ID_MODEL_ID=8211
ID_REVISION=0645
ID_SERIAL=Focusrite_Scarlett_Solo_USB_Y714EQM05351E6
ID_SERIAL_SHORT=Y714EQM05351E6
ID_BUS=usb
ID_USB_INTERFACES=:010120:010220:ff0120:
ID_VENDOR_FROM_DATABASE=Focusrite-Novation
ID_MODEL_FROM_DATABASE=Scarlett Solo (3rd Gen.)
ID_PATH=pci-0000:01:00.0-usb-0:14.3
ID_PATH_TAG=pci-0000_01_00_0-usb-0_14_3
DRIVER=usb
MAJOR=189
MINOR=9

UDEV  [3428.507926] add      /devices/pci0000:00/0000:00:02.1/0000:01:00.0/usb1/1-14/1-14.3/1-14.3:1.2 (usb)
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:02.1/0000:01:00.0/usb1/1-14/1-14.3/1-14.3:1.2
SUBSYSTEM=usb
DEVTYPE=usb_interface
DRIVER=snd-usb-audio
PRODUCT=1235/8211/645
TYPE=239/2/1
INTERFACE=1/2/32
MODALIAS=usb:v1235p8211d0645dcEFdsc02dp01ic01isc02ip20in02
SEQNUM=4765
USEC_INITIALIZED=3428446118
ID_USB_CLASS_FROM_DATABASE=Miscellaneous Device
ID_USB_PROTOCOL_FROM_DATABASE=Interface Association
ID_VENDOR_FROM_DATABASE=Focusrite-Novation
ID_MODEL_FROM_DATABASE=Scarlett Solo (3rd Gen.)
ID_PATH=pci-0000:01:00.0-usb-0:14.3:1.2
ID_PATH_TAG=pci-0000_01_00_0-usb-0_14_3_1_2

UDEV  [3428.509216] add      /devices/pci0000:00/0000:00:02.1/0000:01:00.0/usb1/1-14/1-14.3/1-14.3:1.1 (usb)
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:02.1/0000:01:00.0/usb1/1-14/1-14.3/1-14.3:1.1
SUBSYSTEM=usb
DEVTYPE=usb_interface
DRIVER=snd-usb-audio
PRODUCT=1235/8211/645
TYPE=239/2/1
INTERFACE=1/2/32
MODALIAS=usb:v1235p8211d0645dcEFdsc02dp01ic01isc02ip20in01
SEQNUM=4763
USEC_INITIALIZED=3428443988
ID_USB_CLASS_FROM_DATABASE=Miscellaneous Device
ID_USB_PROTOCOL_FROM_DATABASE=Interface Association
ID_VENDOR_FROM_DATABASE=Focusrite-Novation
ID_MODEL_FROM_DATABASE=Scarlett Solo (3rd Gen.)
ID_PATH=pci-0000:01:00.0-usb-0:14.3:1.1
ID_PATH_TAG=pci-0000_01_00_0-usb-0_14_3_1_1

UDEV  [3428.510193] add      /devices/pci0000:00/0000:00:02.1/0000:01:00.0/usb1/1-14/1-14.3/1-14.3:1.0 (usb)
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:02.1/0000:01:00.0/usb1/1-14/1-14.3/1-14.3:1.0
SUBSYSTEM=usb
DEVTYPE=usb_interface
PRODUCT=1235/8211/645
TYPE=239/2/1
INTERFACE=1/1/32
MODALIAS=usb:v1235p8211d0645dcEFdsc02dp01ic01isc01ip20in00
SEQNUM=4757
USEC_INITIALIZED=3428445406
ID_USB_CLASS_FROM_DATABASE=Miscellaneous Device
ID_USB_PROTOCOL_FROM_DATABASE=Interface Association
ID_VENDOR_FROM_DATABASE=Focusrite-Novation
ID_MODEL_FROM_DATABASE=Scarlett Solo (3rd Gen.)
ID_PATH=pci-0000:01:00.0-usb-0:14.3:1.0
ID_PATH_TAG=pci-0000_01_00_0-usb-0_14_3_1_0
DRIVER=snd-usb-audio

UDEV  [3428.510410] bind     /devices/pci0000:00/0000:00:02.1/0000:01:00.0/usb1/1-14/1-14.3/1-14.3:1.1 (usb)
ACTION=bind
DEVPATH=/devices/pci0000:00/0000:00:02.1/0000:01:00.0/usb1/1-14/1-14.3/1-14.3:1.1
SUBSYSTEM=usb
DEVTYPE=usb_interface
DRIVER=snd-usb-audio
PRODUCT=1235/8211/645
TYPE=239/2/1
INTERFACE=1/2/32
MODALIAS=usb:v1235p8211d0645dcEFdsc02dp01ic01isc02ip20in01
SEQNUM=4764
USEC_INITIALIZED=3428443988
ID_USB_CLASS_FROM_DATABASE=Miscellaneous Device
ID_USB_PROTOCOL_FROM_DATABASE=Interface Association
ID_VENDOR_FROM_DATABASE=Focusrite-Novation
ID_MODEL_FROM_DATABASE=Scarlett Solo (3rd Gen.)
ID_PATH=pci-0000:01:00.0-usb-0:14.3:1.1
ID_PATH_TAG=pci-0000_01_00_0-usb-0_14_3_1_1

UDEV  [3428.510516] bind     /devices/pci0000:00/0000:00:02.1/0000:01:00.0/usb1/1-14/1-14.3/1-14.3:1.2 (usb)
ACTION=bind
DEVPATH=/devices/pci0000:00/0000:00:02.1/0000:01:00.0/usb1/1-14/1-14.3/1-14.3:1.2
SUBSYSTEM=usb
DEVTYPE=usb_interface
DRIVER=snd-usb-audio
PRODUCT=1235/8211/645
TYPE=239/2/1
INTERFACE=1/2/32
MODALIAS=usb:v1235p8211d0645dcEFdsc02dp01ic01isc02ip20in02
SEQNUM=4766
USEC_INITIALIZED=3428446118
ID_USB_CLASS_FROM_DATABASE=Miscellaneous Device
ID_USB_PROTOCOL_FROM_DATABASE=Interface Association
ID_VENDOR_FROM_DATABASE=Focusrite-Novation
ID_MODEL_FROM_DATABASE=Scarlett Solo (3rd Gen.)
ID_PATH=pci-0000:01:00.0-usb-0:14.3:1.2
ID_PATH_TAG=pci-0000_01_00_0-usb-0_14_3_1_2

UDEV  [3428.535057] add      /devices/pci0000:00/0000:00:02.1/0000:01:00.0/usb1/1-14/1-14.3/1-14.3:1.3 (usb)
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:02.1/0000:01:00.0/usb1/1-14/1-14.3/1-14.3:1.3
SUBSYSTEM=usb
DEVTYPE=usb_interface
PRODUCT=1235/8211/645
TYPE=239/2/1
INTERFACE=255/1/32
MODALIAS=usb:v1235p8211d0645dcEFdsc02dp01icFFisc01ip20in03
SEQNUM=4767
USEC_INITIALIZED=3428445844
ID_USB_CLASS_FROM_DATABASE=Miscellaneous Device
ID_USB_PROTOCOL_FROM_DATABASE=Interface Association
ID_VENDOR_FROM_DATABASE=Focusrite-Novation
ID_MODEL_FROM_DATABASE=Scarlett Solo (3rd Gen.)
ID_PATH=pci-0000:01:00.0-usb-0:14.3:1.3
ID_PATH_TAG=pci-0000_01_00_0-usb-0_14_3_1_3

UDEV  [3428.587567] add      /devices/pci0000:00/0000:00:02.1/0000:01:00.0/usb1/1-14/1-14.3/1-14.3:1.0/sound/card2 (sound)
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:02.1/0000:01:00.0/usb1/1-14/1-14.3/1-14.3:1.0/sound/card2
SUBSYSTEM=sound
SEQNUM=4758
USEC_INITIALIZED=3428511932
ID_PATH=pci-0000:01:00.0-usb-0:14.3:1.0
ID_PATH_TAG=pci-0000_01_00_0-usb-0_14_3_1_0
ID_FOR_SEAT=sound-pci-0000_01_00_0-usb-0_14_3_1_0
TAGS=:seat:
CURRENT_TAGS=:seat:

KERNEL[3428.588908] change   /devices/pci0000:00/0000:00:02.1/0000:01:00.0/usb1/1-14/1-14.3/1-14.3:1.0/sound/card2 (sound)
ACTION=change
DEVPATH=/devices/pci0000:00/0000:00:02.1/0000:01:00.0/usb1/1-14/1-14.3/1-14.3:1.0/sound/card2
SUBSYSTEM=sound
SYNTH_UUID=0
SEQNUM=4769

UDEV  [3428.645524] add      /devices/pci0000:00/0000:00:02.1/0000:01:00.0/usb1/1-14/1-14.3/1-14.3:1.0/sound/card2/pcmC2D0c (sound)
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:02.1/0000:01:00.0/usb1/1-14/1-14.3/1-14.3:1.0/sound/card2/pcmC2D0c
SUBSYSTEM=sound
DEVNAME=/dev/snd/pcmC2D0c
DEVTYPE=pcm
SEQNUM=4760
USEC_INITIALIZED=3428588842
MAJOR=116
MINOR=11
TAGS=:uaccess:
CURRENT_TAGS=:uaccess:

UDEV  [3428.648529] add      /devices/pci0000:00/0000:00:02.1/0000:01:00.0/usb1/1-14/1-14.3/1-14.3:1.0/sound/card2/controlC2 (sound)
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:02.1/0000:01:00.0/usb1/1-14/1-14.3/1-14.3:1.0/sound/card2/controlC2
SUBSYSTEM=sound
DEVNAME=/dev/snd/controlC2
SEQNUM=4761
USEC_INITIALIZED=3428589106
ID_VENDOR=Focusrite
ID_VENDOR_ENC=Focusrite
ID_VENDOR_ID=1235
ID_MODEL=Scarlett_Solo_USB
ID_MODEL_ENC=Scarlett\x20Solo\x20USB
ID_MODEL_ID=8211
ID_REVISION=0645
ID_SERIAL=Focusrite_Scarlett_Solo_USB_Y714EQM05351E6
ID_SERIAL_SHORT=Y714EQM05351E6
ID_TYPE=audio
ID_BUS=usb
ID_USB_INTERFACES=:010120:010220:ff0120:
ID_USB_INTERFACE_NUM=00
ID_USB_DRIVER=snd-usb-audio
ID_PATH=pci-0000:01:00.0-usb-0:14.3:1.0
ID_PATH_TAG=pci-0000_01_00_0-usb-0_14_3_1_0
SYSTEMD_WANTS=sound.target
SYSTEMD_USER_WANTS=sound.target
MAJOR=116
MINOR=12
DEVLINKS=/dev/snd/by-path/pci-0000:01:00.0-usb-0:14.3:1.0 /dev/snd/by-id/usb-Focusrite_Scarlett_Solo_USB_Y714EQM05351E6-00
TAGS=:uaccess:systemd:
CURRENT_TAGS=:uaccess:systemd:

UDEV  [3428.673267] add      /devices/pci0000:00/0000:00:02.1/0000:01:00.0/usb1/1-14/1-14.3/1-14.3:1.0/sound/card2/pcmC2D0p (sound)
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:02.1/0000:01:00.0/usb1/1-14/1-14.3/1-14.3:1.0/sound/card2/pcmC2D0p
SUBSYSTEM=sound
DEVNAME=/dev/snd/pcmC2D0p
DEVTYPE=pcm
SEQNUM=4759
USEC_INITIALIZED=3428589052
MAJOR=116
MINOR=10
TAGS=:uaccess:
CURRENT_TAGS=:uaccess:

UDEV  [3428.674581] bind     /devices/pci0000:00/0000:00:02.1/0000:01:00.0/usb1/1-14/1-14.3/1-14.3:1.0 (usb)
ACTION=bind
DEVPATH=/devices/pci0000:00/0000:00:02.1/0000:01:00.0/usb1/1-14/1-14.3/1-14.3:1.0
SUBSYSTEM=usb
DEVTYPE=usb_interface
DRIVER=snd-usb-audio
PRODUCT=1235/8211/645
TYPE=239/2/1
INTERFACE=1/1/32
MODALIAS=usb:v1235p8211d0645dcEFdsc02dp01ic01isc01ip20in00
SEQNUM=4762
USEC_INITIALIZED=3428445406
ID_USB_CLASS_FROM_DATABASE=Miscellaneous Device
ID_USB_PROTOCOL_FROM_DATABASE=Interface Association
ID_VENDOR_FROM_DATABASE=Focusrite-Novation
ID_MODEL_FROM_DATABASE=Scarlett Solo (3rd Gen.)
ID_PATH=pci-0000:01:00.0-usb-0:14.3:1.0
ID_PATH_TAG=pci-0000_01_00_0-usb-0_14_3_1_0

UDEV  [3428.677409] bind     /devices/pci0000:00/0000:00:02.1/0000:01:00.0/usb1/1-14/1-14.3 (usb)
ACTION=bind
DEVPATH=/devices/pci0000:00/0000:00:02.1/0000:01:00.0/usb1/1-14/1-14.3
SUBSYSTEM=usb
DEVNAME=/dev/bus/usb/001/010
DEVTYPE=usb_device
DRIVER=usb
PRODUCT=1235/8211/645
TYPE=239/2/1
BUSNUM=001
DEVNUM=010
SEQNUM=4768
USEC_INITIALIZED=3428281280
ID_VENDOR=Focusrite
ID_VENDOR_ENC=Focusrite
ID_VENDOR_ID=1235
ID_MODEL=Scarlett_Solo_USB
ID_MODEL_ENC=Scarlett\x20Solo\x20USB
ID_MODEL_ID=8211
ID_REVISION=0645
ID_SERIAL=Focusrite_Scarlett_Solo_USB_Y714EQM05351E6
ID_SERIAL_SHORT=Y714EQM05351E6
ID_BUS=usb
ID_USB_INTERFACES=:010120:010220:ff0120:
ID_VENDOR_FROM_DATABASE=Focusrite-Novation
ID_MODEL_FROM_DATABASE=Scarlett Solo (3rd Gen.)
ID_PATH=pci-0000:01:00.0-usb-0:14.3
ID_PATH_TAG=pci-0000_01_00_0-usb-0_14_3
MAJOR=189
MINOR=9

UDEV  [3428.678728] change   /devices/pci0000:00/0000:00:02.1/0000:01:00.0/usb1/1-14/1-14.3/1-14.3:1.0/sound/card2 (sound)
ACTION=change
DEVPATH=/devices/pci0000:00/0000:00:02.1/0000:01:00.0/usb1/1-14/1-14.3/1-14.3:1.0/sound/card2
SUBSYSTEM=sound
SYNTH_UUID=0
SEQNUM=4769
USEC_INITIALIZED=3428511932
ID_PATH=pci-0000:01:00.0-usb-0:14.3:1.0
ID_PATH_TAG=pci-0000_01_00_0-usb-0_14_3_1_0
ID_FOR_SEAT=sound-pci-0000_01_00_0-usb-0_14_3_1_0
SOUND_INITIALIZED=1
ID_USB_CLASS_FROM_DATABASE=Miscellaneous Device
ID_USB_PROTOCOL_FROM_DATABASE=Interface Association
ID_VENDOR_FROM_DATABASE=Focusrite-Novation
ID_MODEL_FROM_DATABASE=Scarlett Solo (3rd Gen.)
ID_VENDOR=Focusrite
ID_VENDOR_ENC=Focusrite
ID_VENDOR_ID=1235
ID_MODEL=Scarlett_Solo_USB
ID_MODEL_ENC=Scarlett\x20Solo\x20USB
ID_MODEL_ID=8211
ID_REVISION=0645
ID_SERIAL=Focusrite_Scarlett_Solo_USB_Y714EQM05351E6
ID_SERIAL_SHORT=Y714EQM05351E6
ID_TYPE=audio
ID_BUS=usb
ID_USB_INTERFACES=:010120:010220:ff0120:
ID_USB_INTERFACE_NUM=00
ID_USB_DRIVER=snd-usb-audio
ID_ID=usb-Focusrite_Scarlett_Solo_USB_Y714EQM05351E6-00
TAGS=:seat:
CURRENT_TAGS=:seat:
erlkönig
Established Member
Posts: 6
Joined: Tue May 31, 2022 8:58 am

Re: Any success using udev rules on a soundcard?

Post by erlkönig »

instead of

Code: Select all

ATTRS{idProduct}=="8211",ATTRS{idVendor}=="1235",
have you tried being triggered by a serial?

Code: Select all

ATTRS{serial}=="xxx"
arifd
Established Member
Posts: 65
Joined: Sun Nov 29, 2020 11:09 am

Re: Any success using udev rules on a soundcard?

Post by arifd »

I solved it! Was a bit tricky, and I gotta go now, but later I'll write up the tricky details that may trip the next person wanting to do something similar
erlkönig
Established Member
Posts: 6
Joined: Tue May 31, 2022 8:58 am

Re: Any success using udev rules on a soundcard?

Post by erlkönig »

Cool! I'm very interested in the solution, as i'm working on a similar Problem on mounting a Harddrive.
Post Reply