How does Gnome desktop detect microphone usage?

Hello :slight_smile:
I am playing with dbus signal in python for myself. I am not a dev and i have been very disconnected to how thing work now.

I wanted to detect my microphone being open, i know dbus is amazing for that but while scanning it with bustle, i could not see anything regarding microphone.

Gnome desktop show a little microphone when the mic is in use, and i was wondering, if it’s not a dbus state, how does it get that data ?

As much as i can read some code, i can no-longer navigate in repository full of individual file without getting lost, so i didn’t manage to start looking :frowning:

Maybe you could help me understand the source of that state, and how to use it myself ?

This is done using the pulseaudio API by looking at the available source outputs. It might be easier to look at how pactl list source-outputs is implemented than looking at the code in gnome-shell/gnome-volume-control.

Thanks you for the lead :slight_smile:
With Pipewire replacing pulseaudio, i wasn’t looking at something specific like that. i didn’t realize that it’s a standard

I’ll try to understand how thing a layed out in the gnome repo because i have no idea how to find something in them right now :'D

1 Like