Forum Linux.embarqué Détection de branchement USB avec Udev qui ne fonctionne pas

Posté par  . Licence CC By‑SA.
1
19
avr.
2021

Bonjour à tous,

J'ai parcouru de nombreuses pages webs afin de trouver une solution à mon problème, en vain.

Je cherche à lancer un script que j'ai fait quand je branche un périphérique audio USB sur ma cible (embarquée, imx6, etc.). In fine j'aimerais lancer mon script lorsque n'importe quel périphérique usb de type audio (qui utilise snd-usb-audio comme driver) est branché.
Cependant, mon script n'est jamais lancé.
J'ai essayé de remonter le problème sous différents angles : détection par driver (snd_audio_usb), puis pour une carte son spécifique avec l'idVendor puis même carrément juste quand je branche n'importe quoi sur ma prise USB (clé usb, souris). J'ai essayé de placer mon script à divers endroits : /usr/bin, /etc/udev/scripts, /etc/udev/rules (juste à coté de la règle), /home/root/… ou encore /sbin. Sans succès.
Après plusieurs heures, je me dis qu'il y a peut-être un problème d'utilisateur mais ça reste une supposition et je ne sais pas trop comment gérer ça.

Si quelqu'un a une quelconque idée, ça serait merveilleux.

Je vous donne ce que j'ai écrit.

Fichier udev rules usb-audio.rules :

ACTION!="add", GOTO="End" SUBSYSTEMS!="usb", GOTO="End" ATTRS{idVendor}=="0d8c", RUN+="/etc/udev/scripts/usb-audio.sh" 
LABEL ="End"

J'ai tenté une version plus simple aussi :

KERNELS=="usb1",ACTION=="add", SUBSYSTEMS=="usb", DEVPATH=="/devices/soc0/soc/2100000.aips-bus/2184000.usb/ci_hdrc.0/usb1/1-1/1-1:1.0/sound/card1/pcmC1D0c", RUN+="/etc/udev/scripts/usb-audio.sh"

J'ai changé le devpath avec /devices/soc0/soc/2100000.aips-bus/2184000.usb/ci_hdrc.0/usb1/1-1/1-1:1.0/sound/card1/ ou même juste sans DEVPATH.
J'ai essayé sans "KERNEL" et avec un deuxième SUBSYSTEM : SUBSYSTEM=SOUND

Coté script, j'ai testé, il fonctionne si je l'appelle à la main.

Coté test j'ai ça :

root@machine:/etc/udev/rules.d# udevadm test usb-audio.rules
calling: test
version 232
This program is for debugging only, it does not run any program
specified by a RUN key. It may show incorrect results, because
some values may be different, or not available at a simulation run.
=== trie on-disk ===
tool version:          232
file size:         8446385 bytes
header size             80 bytes
strings            1848513 bytes
nodes              6597792 bytes
Load module index
Found container virtualization none
timestamp of '/etc/systemd/network' changed
timestamp of '/lib/systemd/network' changed
Parsed configuration file /lib/systemd/network/99-default.link
Created link configuration context.
timestamp of '/etc/udev/rules.d' changed
Reading rules file: /etc/udev/rules.d/10-imx.rules
Reading rules file: /lib/udev/rules.d/50-firmware.rules
Reading rules file: /lib/udev/rules.d/50-udev-default.rules
Reading rules file: /lib/udev/rules.d/60-block.rules
Reading rules file: /lib/udev/rules.d/60-cdrom_id.rules
Reading rules file: /lib/udev/rules.d/60-drm.rules
Reading rules file: /lib/udev/rules.d/60-evdev.rules
Reading rules file: /lib/udev/rules.d/60-persistent-alsa.rules
Reading rules file: /lib/udev/rules.d/60-persistent-input.rules
Reading rules file: /lib/udev/rules.d/60-persistent-storage-tape.rules
Reading rules file: /lib/udev/rules.d/60-persistent-storage.rules
Reading rules file: /lib/udev/rules.d/60-persistent-v4l.rules
Reading rules file: /lib/udev/rules.d/60-serial.rules
Reading rules file: /lib/udev/rules.d/64-btrfs.rules
Reading rules file: /lib/udev/rules.d/70-mouse.rules
Reading rules file: /etc/udev/rules.d/70-persistent-net.rules
Reading rules file: /lib/udev/rules.d/70-power-switch.rules
Reading rules file: /lib/udev/rules.d/70-touchpad.rules
Reading rules file: /lib/udev/rules.d/70-uaccess.rules
Reading rules file: /lib/udev/rules.d/71-seat.rules
Reading rules file: /lib/udev/rules.d/73-seat-late.rules
Reading rules file: /lib/udev/rules.d/75-net-description.rules
Reading rules file: /lib/udev/rules.d/75-probe_mtd.rules
Reading rules file: /lib/udev/rules.d/78-sound-card.rules
Reading rules file: /lib/udev/rules.d/80-drivers.rules
Reading rules file: /lib/udev/rules.d/80-libinput-device-groups.rules
Reading rules file: /lib/udev/rules.d/80-net-setup-link.rules
Reading rules file: /lib/udev/rules.d/90-alsa-restore.rules
Reading rules file: /lib/udev/rules.d/90-libinput-model-quirks.rules
Reading rules file: /lib/udev/rules.d/90-pulseaudio.rules
Reading rules file: /lib/udev/rules.d/90-vconsole.rules
Reading rules file: /lib/udev/rules.d/99-systemd.rules
Reading rules file: /etc/udev/rules.d/automount.rules
Reading rules file: /etc/udev/rules.d/autonet.rules
Reading rules file: /etc/udev/rules.d/localextra.rules
Reading rules file: /etc/udev/rules.d/touchscreen.rules
Reading rules file: /etc/udev/rules.d/usb-audio.rules
Reading rules file: /etc/udev/rules.d/usb-cameras.rules
Reading rules file: /etc/udev/rules.d/wayland-tsc2046-calibration.rules
rules contain 24576 bytes tokens (2048 * 12 bytes), 11956 bytes strings
1850 strings (23514 bytes), 1223 de-duplicated (12186 bytes), 628 trie nodes used
sd-device: syspath '/sysusb-audio.rules' is not a subdirectory of /sys
unable to open device '/sysusb-audio.rules' <------------- ERREUR
Unload module index
Unloaded link configuration context.

Avec cette étrange erreur à la fin (avec <------- rajouté). J'ai tenté de googler cette erreur mais sans succès.

Quand je fais un udevadm monitor -p j'obtiens ceci quand je branche une petite carte son USB que j'ai :

[ 2396.939499] usb 1-1: new full-speed USB device number 4 using ci_hdrc
KERNEL[2397.164823] add      /devices/soc0/soc/2100000.aips-bus/2184000.usb/ci_hdrc.0/usb1/1-1 (usb)
ACTION=add
BUSNUM=001
DEVNAME=/dev/bus/usb/001/004
DEVNUM=004
DEVPATH=/devices/soc0/soc/2100000.aips-bus/2184000.usb/ci_hdrc.0/usb1/1-1
DEVTYPE=usb_device
MAJOR=189
MINOR=3
PRODUCT=d8c/13c/100
SEQNUM=2086
SUBSYSTEM=usb
TYPE=0/0/0
KERNEL[2397.175979] add      /devices/soc0/soc/2100000.aips-bus/2184000.usb/ci_hdrc.0/usb1/1-1/1-1:1.0 (usb)
ACTION=add
DEVPATH=/devices/soc0/soc/2100000.aips-bus/2184000.usb/ci_hdrc.0/usb1/1-1/1-1:1.0
DEVTYPE=usb_interface
INTERFACE=1/1/0
MODALIAS=usb:v0D8Cp013Cd0100dc00dsc00dp00ic01isc01ip00in00
PRODUCT=d8c/13c/100
SEQNUM=2087
SUBSYSTEM=usb
TYPE=0/0/0
KERNEL[2397.263313] add      /devices/soc0/soc/2100000.aips-bus/2184000.usb/ci_hdrc.0/usb1/1-1/1-1:1.0/sound/card1 (sound)
ACTION=add
DEVPATH=/devices/soc0/soc/2100000.aips-bus/2184000.usb/ci_hdrc.0/usb1/1-1/1-1:1.0/sound/card1
SEQNUM=2088
SUBSYSTEM=sound
KERNEL[2397.265742] add      /devices/soc0/soc/2100000.aips-bus/2184000.usb/ci_hdrc.0/usb1/[ 2397.232485] input: C-Media Electronics Inc.       USB PnP Sound Device as /devices/soc0/soc/2100000.aips-bus/2184000.usb/ci_hdrc.0/usb1/1-1/1-1:1.3/0003:0D8C:013C.0003/input/input4
1-1/1-1:1.0/sound/card1/controlC1 (sound)
ACTION=add
DEVNAME=/dev/snd/controlC1
DEVPATH=/devices/soc0/soc/2100000.aips-bus/2184000.usb/ci_hdrc.0/usb1/1-1/1-1:1.0/sound/card1/controlC1
MAJOR=116
MINOR=32
SEQNUM=2089
SUBSYSTEM=sound
KERNEL[2397.269908] add      /devices/soc0/soc/2100000.aips-bus/2184000.usb/ci_hdrc.0/usb1/1-1/1-1:1.0/sound/card1/pcmC1D0p (sound)
ACTION=add
DEVNAME=/dev/snd/pcmC1D0p
DEVPATH=/devices/soc0/soc/2100000.aips-bus/2184000.usb/ci_hdrc.0/usb1/1-1/1-1:1.0/sound/card1/pcmC1D0p
MAJOR=116
MINOR=48
SEQNUM=2090
SUBSYSTEM=sound
KERNEL[2397.273493] add      /devices/soc0/soc/2100000.aips-bus/2184000.usb/ci_hdrc.0/usb1/1-1/1-1:1.0/sound/card1/pcmC1D0c (sound)
ACTION=add
DEVNAME=/dev/snd/pcmC1[ 2397.311439] hid-generic 0003:0D8C:013C.0003: input: USB HID v1.00 Device [C-Media Electronics Inc.       USB PnP Sound Device] on usb-ci_hdrc.0-1/input3
D0c
DEVPATH=/devices/soc0/soc/2100000.aips-bus/2184000.usb/ci_hdrc.0/usb1/1-1/1-1:1.0/sound/card1/pcmC1D0c
MAJOR=116
MINOR=56
SEQNUM=2091
SUBSYSTEM=sound
KERNEL[2397.275874] add      /devices/soc0/soc/2100000.aips-bus/2184000.usb/ci_hdrc.0/usb1/1-1/1-1:1.1 (usb)
ACTION=add
DEVPATH=/devices/soc0/soc/2100000.aips-bus/2184000.usb/ci_hdrc.0/usb1/1-1/1-1:1.1
DEVTYPE=usb_interface
DRIVER=snd-usb-audio
INTERFACE=1/2/0
MODALIAS=usb:v0D8Cp013Cd0100dc00dsc00dp00ic01isc02ip00in01
PRODUCT=d8c/13c/100
SEQNUM=2092
SUBSYSTEM=usb
TYPE=0/0/0
KERNEL[2397.278113] add      /devices/soc0/soc/2100000.aips-bus/2184000.usb/ci_hdrc.0/usb1/1-1/1-1:1.2 (usb)
ACTION=add
DEVPATH=/devices/soc0/soc/2100000.aips-bus/2184000.usb/ci_hdrc.0/usb1/1-1/1-1:1.2
DEVTYPE=usb_interface
DRIVER=snd-usb-audio
INTERFACE=1/2/0
MODALIAS=usb:v0D8Cp013Cd0100dc00dsc00dp00ic01isc02ip00in02
PRODUCT=d8c/13c/100
SEQNUM=2093
SUBSYSTEM=usb
TYPE=0/0/0```

```sh
KERNEL[2397.280425] add      /devices/soc0/soc/2100000.aips-bus/2184000.usb/ci_hdrc.0/usb1/1-1/1-1:1.3 (usb)
ACTION=add
DEVPATH=/devices/soc0/soc/2100000.aips-bus/2184000.usb/ci_hdrc.0/usb1/1-1/1-1:1.3
DEVTYPE=usb_interface
INTERFACE=3/0/0
MODALIAS=usb:v0D8Cp013Cd0100dc00dsc00dp00ic03isc00ip00in03
PRODUCT=d8c/13c/100
SEQNUM=2094
SUBSYSTEM=usb
TYPE=0/0/0
KERNEL[2397.288344] add      /devices/soc0/soc/2100000.aips-bus/2184000.usb/ci_hdrc.0/usb1/1-1/1-1:1.3/0003:0D8C:013C.0003 (hid)
ACTION=add
DEVPATH=/devices/soc0/soc/2100000.aips-bus/2184000.usb/ci_hdrc.0/usb1/1-1/1-1:1.3/0003:0D8C:013C.0003
HID_ID=0003:00000D8C:0000013C
HID_NAME=C-Media Electronics Inc.       USB PnP Sound Device
HID_PHYS=usb-ci_hdrc.0-1/input3
HID_UNIQ=
MODALIAS=hid:b0003g0001v00000D8Cp0000013C
SEQNUM=2095
SUBSYSTEM=hid
KERNEL[2397.292701] add      /devices/soc0/soc/2100000.aips-bus/2184000.usb/ci_hdrc.0/usb1/1-1/1-1:1.3/0003:0D8C:013C.0003/input/input4 (input)
ACTION=add
DEVPATH=/devices/soc0/soc/2100000.aips-bus/2184000.usb/ci_hdrc.0/usb1/1-1/1-1:1.3/0003:0D8C:013C.0003/input/input4
EV=13
KEY=78 0 e0000 0 0 0
MODALIAS=input:b0003v0D8Cp013Ce0100-e0,1,4,k71,72,73,A3,A4,A5,A6,ram4,lsfw
MSC=10
NAME="C-Media Electronics Inc.       USB PnP Sound Device"
PHYS="usb-ci_hdrc.0-1/input3"
PRODUCT=3/d8c/13c/100
PROP=0
SEQNUM=2096
SUBSYSTEM=input
UNIQ=""
KERNEL[2397.372400] add      /devices/soc0/soc/2100000.aips-bus/2184000.usb/ci_hdrc.0/usb1/1-1/1-1:1.3/0003:0D8C:013C.0003/input/input4/event0 (input)
ACTION=add
DEVNAME=/dev/input/event0
DEVPATH=/devices/soc0/soc/2100000.aips-bus/2184000.usb/ci_hdrc.0/usb1/1-1/1-1:1.3/0003:0D8C:013C.0003/input/input4/event0
MAJOR=13
MINOR=64
SEQNUM=2097
SUBSYSTEM=input
UDEV  [2397.406268] add      /devices/soc0/soc/2100000.aips-bus/2184000.usb/ci_hdrc.0/usb1/1-1 (usb)
ACTION=add
BUSNUM=001
DEVNAME=/dev/bus/usb/001/004
DEVNUM=004
DEVPATH=/devices/soc0/soc/2100000.aips-bus/2184000.usb/ci_hdrc.0/usb1/1-1
DEVTYPE=usb_device
DRIVER=usb
ID_BUS=usb
ID_MODEL=USB_PnP_Sound_Device
ID_MODEL_ENC=USB\x20PnP\x20Sound\x20Device
ID_MODEL_FROM_DATABASE=CM108 Audio Controller
ID_MODEL_ID=013c
ID_REVISION=0100
ID_SERIAL=C-Media_Electronics_Inc._USB_PnP_Sound_Device
ID_USB_INTERFACES=:010100:010200:030000:
ID_VENDOR=C-Media_Electronics_Inc.
ID_VENDOR_ENC=C-Media\x20Electronics\x20Inc.\x20\x20\x20\x20\x20\x20
ID_VENDOR_FROM_DATABASE=C-Media Electronics, Inc.
ID_VENDOR_ID=0d8c
MAJOR=189
MINOR=3
PRODUCT=d8c/13c/100
SEQNUM=2086
SUBSYSTEM=usb
TYPE=0/0/0
USEC_INITIALIZED=2397404984
UDEV  [2397.436641] add      /devices/soc0/soc/2100000.aips-bus/2184000.usb/ci_hdrc.0/usb1/1-1/1-1:1.0 (usb)
ACTION=add
DEVPATH=/devices/soc0/soc/2100000.aips-bus/2184000.usb/ci_hdrc.0/usb1/1-1/1-1:1.0
DEVTYPE=usb_interface
ID_MODEL_FROM_DATABASE=CM108 Audio Controller
ID_VENDOR_FROM_DATABASE=C-Media Electronics, Inc.
INTERFACE=1/1/0
MODALIAS=usb:v0D8Cp013Cd0100dc00dsc00dp00ic01isc01ip00in00
PRODUCT=d8c/13c/100
SEQNUM=2087
SUBSYSTEM=usb
TYPE=0/0/0
USEC_INITIALIZED=2397434502
UDEV  [2397.447076] add      /devices/soc0/soc/2100000.aips-bus/2184000.usb/ci_hdrc.0/usb1/1-1/1-1:1.1 (usb)
ACTION=add
DEVPATH=/devices/soc0/soc/2100000.aips-bus/2184000.usb/ci_hdrc.0/usb1/1-1/1-1:1.1
DEVTYPE=usb_interface
DRIVER=snd-usb-audio
ID_MODEL_FROM_DATABASE=CM108 Audio Controller
ID_VENDOR_FROM_DATABASE=C-Media Electronics, Inc.
INTERFACE=1/2/0
MODALIAS=usb:v0D8Cp013Cd0100dc00dsc00dp00ic01isc02ip00in01
PRODUCT=d8c/13c/100
SEQNUM=2092
SUBSYSTEM=usb
TYPE=0/0/0
USEC_INITIALIZED=2397444997
UDEV  [2397.468465] add      /devices/soc0/soc/2100000.aips-bus/2184000.usb/ci_hdrc.0/usb1/1-1/1-1:1.2 (usb)
ACTION=add
DEVPATH=/devices/soc0/soc/2100000.aips-bus/2184000.usb/ci_hdrc.0/usb1/1-1/1-1:1.2
DEVTYPE=usb_interface
DRIVER=snd-usb-audio
ID_MODEL_FROM_DATABASE=CM108 Audio Controller
ID_VENDOR_FROM_DATABASE=C-Media Electronics, Inc.
INTERFACE=1/2/0
MODALIAS=usb:v0D8Cp013Cd0100dc00dsc00dp00ic01isc02ip00in02
PRODUCT=d8c/13c/100
SEQNUM=2093
SUBSYSTEM=usb
TYPE=0/0/0
USEC_INITIALIZED=2397466492
UDEV  [2397.800899] add      /devices/soc0/soc/2100000.aips-bus/2184000.usb/ci_hdrc.0/usb1/1-1/1-1:1.0/sound/card1 (sound)
ACTION=add
DEVPATH=/devices/soc0/soc/2100000.aips-bus/2184000.usb/ci_hdrc.0/usb1/1-1/1-1:1.0/sound/card1
ID_FOR_SEAT=sound-platform-ci_hdrc_0-usb-0_1_1_0
ID_PATH=platform-ci_hdrc.0-usb-0:1:1.0
ID_PATH_TAG=platform-ci_hdrc_0-usb-0_1_1_0
SEQNUM=2088
SUBSYSTEM=sound
SYSTEMD_WANTS=sound.target
TAGS=:systemd:seat:
USEC_INITIALIZED=2397470283
KERNEL[2397.801432] change   /devices/soc0/soc/2100000.aips-bus/2184000.usb/ci_hdrc.0/usb1/1-1/1-1:1.0/sound/card1 (sound)
ACTION=change
DEVPATH=/devices/soc0/soc/2100000.aips-bus/2184000.usb/ci_hdrc.0/usb1/1-1/1-1:1.0/sound/card1
SEQNUM=2098
SUBSYSTEM=sound
UDEV  [2397.801840] add      /devices/soc0/soc/2100000.aips-bus/2184000.usb/ci_hdrc.0/usb1/1-1/1-1:1.3 (usb)
ACTION=add
DEVPATH=/devices/soc0/soc/2100000.aips-bus/2184000.usb/ci_hdrc.0/usb1/1-1/1-1:1.3
DEVTYPE=usb_interface
ID_MODEL_FROM_DATABASE=CM108 Audio Controller
ID_VENDOR_FROM_DATABASE=C-Media Electronics, Inc.
INTERFACE=3/0/0
MODALIAS=usb:v0D8Cp013Cd0100dc00dsc00dp00ic03isc00ip00in03
PRODUCT=d8c/13c/100
SEQNUM=2094
SUBSYSTEM=usb
TYPE=0/0/0
USEC_INITIALIZED=2397472252
UDEV  [2397.802471] add      /devices/soc0/soc/2100000.aips-bus/2184000.usb/ci_hdrc.0/usb1/1-1/1-1:1.3/0003:0D8C:013C.0003 (hid)
ACTION=add
DEVPATH=/devices/soc0/soc/2100000.aips-bus/2184000.usb/ci_hdrc.0/usb1/1-1/1-1:1.3/0003:0D8C:013C.0003
HID_ID=0003:00000D8C:0000013C
HID_NAME=C-Media Electronics Inc.       USB PnP Sound Device
HID_PHYS=usb-ci_hdrc.0-1/input3
HID_UNIQ=
MODALIAS=hid:b0003g0001v00000D8Cp0000013C
SEQNUM=2095
SUBSYSTEM=hid
USEC_INITIALIZED=2397507417
UDEV  [2397.803068] add      /devices/soc0/soc/2100000.aips-bus/2184000.usb/ci_hdrc.0/usb1/1-1/1-1:1.0/sound/card1/pcmC1D0p (sound)
ACTION=add
DEVNAME=/dev/snd/pcmC1D0p
DEVPATH=/devices/soc0/soc/2100000.aips-bus/2184000.usb/ci_hdrc.0/usb1/1-1/1-1:1.0/sound/card1/pcmC1D0p
MAJOR=116
MINOR=48
SEQNUM=2090
SUBSYSTEM=sound
TAGS=:uaccess:
USEC_INITIALIZED=2397505286
UDEV  [2397.803932] add      /devices/soc0/soc/2100000.aips-bus/2184000.usb/ci_hdrc.0/usb1/1-1/1-1:1.0/sound/card1/pcmC1D0c (sound)
ACTION=add
DEVNAME=/dev/snd/pcmC1D0c
DEVPATH=/devices/soc0/soc/2100000.aips-bus/2184000.usb/ci_hdrc.0/usb1/1-1/1-1:1.0/sound/card1/pcmC1D0c
MAJOR=116
MINOR=56
SEQNUM=2091
SUBSYSTEM=sound
TAGS=:uaccess:
USEC_INITIALIZED=2397554296
UDEV  [2397.804783] add      /devices/soc0/soc/2100000.aips-bus/2184000.usb/ci_hdrc.0/usb1/1-1/1-1:1.3/0003:0D8C:013C.0003/input/input4 (input)
ACTION=add
DEVPATH=/devices/soc0/soc/2100000.aips-bus/2184000.usb/ci_hdrc.0/usb1/1-1/1-1:1.3/0003:0D8C:013C.0003/input/input4
EV=13
ID_BUS=usb
ID_FOR_SEAT=input-platform-ci_hdrc_0-usb-0_1_1_3
ID_INPUT=1
ID_INPUT_KEY=1
ID_MODEL=USB_PnP_Sound_Device
ID_MODEL_ENC=USB\x20PnP\x20Sound\x20Device
ID_MODEL_ID=013c
ID_PATH=platform-ci_hdrc.0-usb-0:1:1.3
ID_PATH_TAG=platform-ci_hdrc_0-usb-0_1_1_3
ID_REVISION=0100
ID_SERIAL=C-Media_Electronics_Inc._USB_PnP_Sound_Device
ID_TYPE=hid
ID_USB_DRIVER=usbhid
ID_USB_INTERFACES=:010100:010200:030000:
ID_USB_INTERFACE_NUM=03
ID_VENDOR=C-Media_Electronics_Inc.
ID_VENDOR_ENC=C-Media\x20Electronics\x20Inc.\x20\x20\x20\x20\x20\x20
ID_VENDOR_ID=0d8c
KEY=78 0 e0000 0 0 0
MODALIAS=input:b0003v0D8Cp013Ce0100-e0,1,4,k71,72,73,A3,A4,A5,A6,ram4,lsfw
MSC=10
NAME="C-Media Electronics Inc.       USB PnP Sound Device"
PHYS="usb-ci_hdrc.0-1/input3"
PRODUCT=3/d8c/13c/100
PROP=0
SEQNUM=2096
SUBSYSTEM=input
TAGS=:seat:
UNIQ=""
USEC_INITIALIZED=2397567029
UDEV  [2397.806766] add      /devices/soc0/soc/2100000.aips-bus/2184000.usb/ci_hdrc.0/usb1/1-1/1-1:1.0/sound/card1/controlC1 (sound)
ACTION=add
DEVLINKS=/dev/snd/by-id/usb-C-Media_Electronics_Inc._USB_PnP_Sound_Device-00 /dev/snd/by-path/platform-ci_hdrc.0-usb-0:1:1.0
DEVNAME=/dev/snd/controlC1
DEVPATH=/devices/soc0/soc/2100000.aips-bus/2184000.usb/ci_hdrc.0/usb1/1-1/1-1:1.0/sound/card1/controlC1
ID_BUS=usb
ID_MODEL=USB_PnP_Sound_Device
ID_MODEL_ENC=USB\x20PnP\x20Sound\x20Device
ID_MODEL_ID=013c
ID_PATH=platform-ci_hdrc.0-usb-0:1:1.0
ID_PATH_TAG=platform-ci_hdrc_0-usb-0_1_1_0
ID_REVISION=0100
ID_SERIAL=C-Media_Electronics_Inc._USB_PnP_Sound_Device
ID_TYPE=audio
ID_USB_DRIVER=snd-usb-audio
ID_USB_INTERFACES=:010100:010200:030000:
ID_USB_INTERFACE_NUM=00
ID_VENDOR=C-Media_Electronics_Inc.
ID_VENDOR_ENC=C-Media\x20Electronics\x20Inc.\x20\x20\x20\x20\x20\x20
ID_VENDOR_ID=0d8c
MAJOR=116
MINOR=32
SEQNUM=2089
SUBSYSTEM=sound
TAGS=:uaccess:
USEC_INITIALIZED=2397546404
UDEV  [2398.142519] change   /devices/soc0/soc/2100000.aips-bus/2184000.usb/ci_hdrc.0/usb1/1-1/1-1:1.0/sound/card1 (sound)
ACTION=change
DEVPATH=/devices/soc0/soc/2100000.aips-bus/2184000.usb/ci_hdrc.0/usb1/1-1/1-1:1.0/sound/card1
ID_BUS=usb
ID_FOR_SEAT=sound-platform-ci_hdrc_0-usb-0_1_1_0
ID_ID=usb-C-Media_Electronics_Inc._USB_PnP_Sound_Device-00
ID_MODEL=USB_PnP_Sound_Device
ID_MODEL_ENC=USB\x20PnP\x20Sound\x20Device
ID_MODEL_FROM_DATABASE=CM108 Audio Controller
ID_MODEL_ID=013c
ID_PATH=platform-ci_hdrc.0-usb-0:1:1.0
ID_PATH_TAG=platform-ci_hdrc_0-usb-0_1_1_0
ID_REVISION=0100
ID_SERIAL=C-Media_Electronics_Inc._USB_PnP_Sound_Device
ID_TYPE=audio
ID_USB_DRIVER=snd-usb-audio
ID_USB_INTERFACES=:010100:010200:030000:
ID_USB_INTERFACE_NUM=00
ID_VENDOR=C-Media_Electronics_Inc.
ID_VENDOR_ENC=C-Media\x20Electronics\x20Inc.\x20\x20\x20\x20\x20\x20
ID_VENDOR_FROM_DATABASE=C-Media Electronics, Inc.
ID_VENDOR_ID=0d8c
SEQNUM=2098
SOUND_INITIALIZED=1
SUBSYSTEM=sound
SYSTEMD_WANTS=sound.target
TAGS=:systemd:seat:
USEC_INITIALIZED=2397470283
UDEV  [2398.146002] add      /devices/soc0/soc/2100000.aips-bus/2184000.usb/ci_hdrc.0/usb1/1-1/1-1:1.3/0003:0D8C:013C.0003/input/input4/event0 (input)
ACTION=add
DEVLINKS=/dev/input/by-path/platform-ci_hdrc.0-usb-0:1:1.3-event /dev/input/by-id/usb-C-Media_Electronics_Inc._USB_PnP_Sound_Device-event-if03
DEVNAME=/dev/input/event0
DEVPATH=/devices/soc0/soc/2100000.aips-bus/2184000.usb/ci_hdrc.0/usb1/1-1/1-1:1.3/0003:0D8C:013C.0003/input/input4/event0
ID_BUS=usb
ID_INPUT=1
ID_INPUT_KEY=1
ID_MODEL=USB_PnP_Sound_Device
ID_MODEL_ENC=USB\x20PnP\x20Sound\x20Device
ID_MODEL_ID=013c
ID_PATH=platform-ci_hdrc.0-usb-0:1:1.3
ID_PATH_TAG=platform-ci_hdrc_0-usb-0_1_1_3
ID_REVISION=0100
ID_SERIAL=C-Media_Electronics_Inc._USB_PnP_Sound_Device
ID_TYPE=hid
ID_USB_DRIVER=usbhid
ID_USB_INTERFACES=:010100:010200:030000:
ID_USB_INTERFACE_NUM=03
ID_VENDOR=C-Media_Electronics_Inc.
ID_VENDOR_ENC=C-Media\x20Electronics\x20Inc.\x20\x20\x20\x20\x20\x20
ID_VENDOR_ID=0d8c
LIBINPUT_DEVICE_GROUP=3/d8c/13c/100:usb-ci_hdrc.0-1
MAJOR=13
MINOR=64
SEQNUM=2097
SUBSYSTEM=input
USEC_INITIALIZED=2397706931

Je suis infiniement désolée pour l'immense pavé (pour un premier post en plus…). J'espère ne pas m'être trompée d'endroit pour poser ma question.

Merci à vous :)

  • # piste

    Posté par  . Évalué à 4.

    1°) tu remarqueras quand /etc/udev/rules.d les fichiers sont ranger par ordre de numero croissant pour qu'ils soient lu dans l'ordre

    probable que ton usb-audio.rules soient pris APRES les autres
    mais ce n'est peut-être pas ce que tu souhaites…

    2°) d'après l'extrait

    Reading rules file: /etc/udev/rules.d/usb-audio.rules
    Reading rules file: /etc/udev/rules.d/usb-cameras.rules
    Reading rules file: /etc/udev/rules.d/wayland-tsc2046-calibration.rules
    rules contain 24576 bytes tokens (2048 * 12 bytes), 11956 bytes strings
    1850 strings (23514 bytes), 1223 de-duplicated (12186 bytes), 628 trie nodes used
    sd-device: syspath '/sysusb-audio.rules' is not a subdirectory of /sys
    unable to open device '/sysusb-audio.rules' <------------- ERREUR

    il semble vouloir chercher usb-audio.rules dans le /sys/
    peut-être que tu ne devrais pas appeler ton fichier de la sorte, d'après ce qu'on trouve sur internet à propos du syspath non trouvé, c'est que le nom de la regle prête à confusion avec d'autres regles.

    essai deja un truc plus perso comme par exemple : myusbaudio.rules

    • [^] # Re: piste

      Posté par  . Évalué à 1.

      Bonjour,
      Merci pour ta piste.
      J'ai tenté de changer le nom en my-usb-audio.rules puis d'ajouter "01-" au nom. J'ai toujours la même erreur. Il cherche toujours dans /sys

      sd-device: syspath '/sys01-my-usb-audio.rules' is not a subdirectory of /sys
      unable to open device '/sys01-my-usb-audio.rules'
      
  • # Autre piste

    Posté par  . Évalué à 1.

    La commande "udevadm test " attend un chemin vers un device en paramètre (udevadm test [options] [devpath]), pas un fichier .rules donc udev cherche un device qui s'appelle "usb-audio.rules" dans le dossier /sys d'où l'erreur (voir la page de man de la commande udevadm).

Suivre le flux des commentaires

Note : les commentaires appartiennent à celles et ceux qui les ont postés. Nous n’en sommes pas responsables.