1

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 https://wiki.archlinux.org/index.php/PulseAudio/Troubleshooting – Ipor Sircer Feb 01 '17 at 01:21
  • 1
    Does [this question](http://unix.stackexchange.com/questions/25776/detecting-headphone-connection-disconnection-in-linux) help? – dirkt Feb 01 '17 at 09:29
  • @dirkt yeah, the answer on acpi gives a solution to the second question. I'll post the rest of my findings here later. – Błażej Michalik Feb 01 '17 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 Feb 01 '17 at 11:52

0 Answers0