PipeWire API: how to know if a headphone is plugged?
In Pulseaudio PulseEffects has a feature where a preset can be automatically loaded depending on the default device selected by the user and also if the device is the same but a headphone is plugged.
Right now this feature is only partially working in PipeWire. If the user switches to a different card it works because the node name changes and I can use that to load a different preset just like in Pulseaudio. But for headphones this functionality is broken because I do not know how to detect if a headphone is plugged or not in PipeWire. In Pulseaudio the device has a property named
port. If it is not null then something is plugged there and an identifier name can be read. I am not sure what to search for in PipeWire.
Ironically if the user runs our Pulseaudio release in PipeWire's compatibility layer for Pulseaudio the feature works for headphones https://github.com/wwmm/pulseeffects/issues/918#issuecomment-803344737. So there is something obvious I am missing here =/