RFC: propose helper script interface for writing rules
Proposes the use of a helper script to allow setting udev properties as a replacement for udev rules. For example setting ACP_IGNORE=1 on the visense pcm in apple silicon macs.
#!/bin/sh -e
if printf '%s\n' "$SYSNAME" | grep '^pcmC.*D2c$'
then
printf 'ACP_IGNORE=1\n'
fi
@illiliti Will this not be merged into master/main?
@illiliti Will this not be merged into master/main?
I like the idea, so it is highly likely I'll merge this. Just need to sort out issues with code.
Addressed all comments and added an example rules script to contrib with the SOUND_INITIALIZED and ACP_IGNORE stuff. Note: this on its own will not fix pipewire since pipewire still depends on the enumeration of parent devices
Note: this on its own will not fix pipewire since pipewire still depends on the enumeration of parent devices
One could access parent device via $SYSPATH/../ or $SYSPATH/device/, so unless I'm missing something it is indeed possible to fix pipewire.
Note: this on its own will not fix pipewire since pipewire still depends on the enumeration of parent devices
One could access parent device via
$SYSPATH/../or$SYSPATH/device/, so unless I'm missing something it is indeed possible to fix pipewire.
The problem with pipewire is it enumerates the following devices
/sys/devices/platform/sound/sound/card0/pcmC0D0p
/sys/devices/platform/sound/sound/card0/pcmC0D1p
/sys/devices/virtual/sound/timer
/sys/devices/platform/sound/sound/card0/pcmC0D0c
/sys/devices/platform/sound/sound/card0/pcmC0D2c
/sys/devices/platform/sound/sound/card0/controlC0
however the following is intended. card0 is missing. this is due to scan_devices working on /sys/dev/{char,block} but card? does not have an associated character or block device so isn't enumerated.
/sys/devices/platform/sound/sound/card0
/sys/devices/platform/sound/sound/card0/pcmC0D0p
/sys/devices/platform/sound/sound/card0/pcmC0D1p
/sys/devices/virtual/sound/timer
/sys/devices/platform/sound/sound/card0/pcmC0D0c
/sys/devices/platform/sound/sound/card0/pcmC0D2c
/sys/devices/platform/sound/sound/card0/controlC0
Ah! Right. Forgot about this one. Well, we could switch our enumeration approach to appease pipewire. Let's keep it for later.
@illiliti any plans to merge this or work on it?
Hopefully yes
Do I understand correctly that every script would run for every event received by every process subscribed to events?
Hi sorry about the delay on this. I am very very busy at the moment.