Skip to content

Draft: pulse-server: use monotonic IDs in Pulse API

P V requested to merge pvir/pipewire:pulse-id into master

Pulseaudio API has an assumption that the ids are globally unique and never reused for different objects. This is not true for Pipewire IDs, which may be reused.

To fix this, allocate monotonic IDs in pipewire-pulse for each object type. That different pw_managers agree about the indices without race conditions is guaranteed by object.serial being globally unique.

To make it clear what is what, here we call Pulse IDs "index" and Pipewire IDs "pw_id".


XXX: this'll need still more testing and proofreading, but it's in runnable state now in case someone wants to test it

XXX: object.serial increases quite fast (and reaches e.g. MONITOR_TAG etc id flags). maybe it should have separate counter for each interface. This might be possible to be implement in pipewire-pulse. Use separate counters instead. So the index numbers will be allocated by pipewire-pulse, with object.serial used only as an internal key in the index map.

Edited by P V

Merge request reports