I want to create a launch daemon in Mac OS to monitor the headphone jack for a connection and then force the module to stay on if a connection is detected (as it would if audio were playing, but I want the module to remain on whether or not it is being given any audio). Is this something that is going to be possible with launchd?
Background: The new MacBook Pro 13" has an issue where it creates a popping sound every time audio stops and starts on headphones. This is caused by Core Audio shutting the headphone module on and off as soon as it stops detecting output. Overriding this behaviour by having a muted audio source playing in the background solves the problem, but at the cost of CPU usage (and inconvenience). I want to create a daemon that has the same effect, but with lower/negligible cpu usage that is able to detect when headphones are connected.