I'm asking mainly out of curiosity, partially because the linux audio stack always confuses the heck out of me and maybe because I wan't to implement something that enhances the behavior.

My question is: which piece of software mutes the audio output when I unplug the headphones from my laptop? I.e. which code actually pushes the "mute" button for me? How does it do this?

Secondary question would be how to listen for such events without brainlessly reading some log file every x miliseconds?

  • 1
    pulseaudio wiki.archlinux.org/index.php/PulseAudio/Troubleshooting Commented Feb 1, 2017 at 1:21
  • 1
    Does this question help?
    – dirkt
    Commented Feb 1, 2017 at 9:29
  • @dirkt yeah, the answer on acpi gives a solution to the second question. I'll post the rest of my findings here later. Commented Feb 1, 2017 at 11:16
  • 1
    Note that it's a bit hardware dependent - ACPI is always hardware specific, listen for the /dev/input events of type EV_SW (e.g. on Intel HDA hardware) is very portable.
    – dirkt
    Commented Feb 1, 2017 at 11:52


You must log in to answer this question.

Browse other questions tagged .