<div dir="ltr">Hello all,<div><br></div><div>I am working on a golang software that aims at dealing (muting and unmuting) with the currently enabled microphone in a Linux system using pulseaudio.<br><br>My software is trying to use the DBUs interface to interact with pulseaudio.<br><br>If the computer has more than one microphone connected to it, I need to find the enabled one by looking at the priority property of my sources.<br><br>For example this is a trimmed output from the pacmd list-sources command:<br><br>4 source(s) available.<br>    index: 0<br>        name: <alsa_output.pci-0000_00_1f.3.analog-stereo.monitor><br>...        <br>        priority: 1030<br>...<br>    index: 1<br>        name: <alsa_input.pci-0000_00_1f.3.analog-stereo><br>...<br>        priority: 9039<br>...<br>    index: 2<br>        name: <combined.monitor><br>...<br>        priority: 1000<br>...<br>  * index: 4<br>        name: <alsa_input.usb-046d_0825_6C7C2E60-02.mono-fallback><br>...<br>        priority: 9040<br>...<br><br>In fact, in my system, the source with index 4 is the active one.<br><br>My problem: I can't find a way to get the priority property out of the DBUs interface.<br><br>According to the documentation (<a href="https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/Developer/Clients/DBus/">https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/Developer/Clients/DBus/</a>), neither the Source nor the Device Objects expose a property named Priority. The only objects having a Priority field are DevicePort and CardProfile. I got the value for those properties but their value doesn't match with the output of pacmd.<br><br>Can anybody please help me understand what I am missing here?<br><br>Thanks</div><div><br></div><div>(also posted on stackoverflow here <a href="https://stackoverflow.com/questions/66744027/how-to-get-pulseaudios-device-priority-via-dbus">https://stackoverflow.com/questions/66744027/how-to-get-pulseaudios-device-priority-via-dbus</a> )</div></div>