Skip to content

alsa-udev: postpone emitting if pcm devices are busy, retry later

P V requested to merge pvir/pipewire:alsa-retry into master

There is a race condition on udev permission changes (e.g. switching VTs), when pipewire from one user closes devices, and the other process from second user tries to open them. The close/open are not ordered, so opening a device may fail in alsa-acp-device.c resulting to missing devices/profiles.

Address this by trying to open devices already in alsa-udev.c. If some devices are busy, do not emit the device info yet, but retry after a timeout. If it still fails, go ahead emitting the device, even if some profiles may be missing. The retry with delay should be enough to solve the race almost always.

See #2052 (comment 1227509)

Edited by P V

Merge request reports