libudev-zero icon indicating copy to clipboard operation
libudev-zero copied to clipboard

add SOUND_INITIALIZED property and pipewire fix

Open capezotte opened this issue 1 year ago • 7 comments

Adds the SOUND_INITIALIZED property Pipewire looks for when adding sound cards and re-reverts (everts?) https://github.com/illiliti/libudev-zero/commit/4510b27a9b589a0ce82fef776c2648e19e79f2a4 so it can find card[0-9].

Fixes #26 without patching Pipewire.

  • [ ] Should scan_devices be rewritten so it starts its search at /sys/class/sound? Adding the parent in add_device feels weird.

capezotte avatar Apr 15 '24 17:04 capezotte

Tested on Alpine Edge: Works great!

xplshn avatar Apr 15 '24 18:04 xplshn

No longer applies

sewnie avatar May 16 '24 18:05 sewnie

It's for the Git master (it doesn't apply to the tagged 1.0.3 due to #62).

capezotte avatar May 16 '24 19:05 capezotte

If we add this special handling, does it mean that any future requests that introduce more special cased code but for a different property should be added as well? Considering that there is no guarantee that pipewire won't depend on some yet another obscure property someday, I afraid going that route will turn this project into "support pipewire at all cost". Personally, I'd rather stay sensible and support minimal subset of properties enough to run desktop even if that means not supporting some app by default.

illiliti avatar Jun 06 '24 01:06 illiliti

Well, it'd mean not supporting sound in ANY flatpak program, and it'd also mean no support for most games, web browsers and such. I think it is okay as long as it is kept track of. Adding small tweaks that make such big projects work is okay with me.

xplshn avatar Jun 06 '24 01:06 xplshn

Would reworking this PR into a generic "fetch properties from a directory" patch work? Then users can select whether they want to support SOUND_INITIALIZED (or even all the sucky additional properties that are redundant with pci.ids and other files) without bloating libudev-zero itself.

(I still think SOUND_INTIALIZED is not that bad of an idea; it does solve a race condition when hotplugging devices, and saves audio software from having to check the creation of controlC themselves).

capezotte avatar Jun 06 '24 12:06 capezotte

How would this "fetch properties from a directory" work? I'm not sure I follow, but I think everyone'd be happy if Libudev-zero could actually replace udev (without breaking one of the most important functionalities of udev, handling audio)

xplshn avatar Jun 06 '24 12:06 xplshn