New answers tagged soundcard
From the command line, man lsof sudo lsof +D /dev/snd will list all the open files in /dev/snd, and which program has them open. See also man fuser.
The current version of your script now contains a sleep 0.25 command. sleep is timer-based so doesn't use any processing cycles while sleeping… It does use a very tiny bit of CPU to set up the timer, but sleep 1 (sleep 1 second), sleep 60 (sleep for a minute) and sleep 86400 (sleep for a day) all use the same number CPU cycles. Using ACPI however is the ...
In most systems if not all, ACPI can handle this event. To test that: Run acpi_listen Unplug & replug headphones, example output: (mic/ears share in same jack on my laptop) jack/headphone HEADPHONE unplug jack/microphone MICROPHONE unplug jack/headphone HEADPHONE plug jack/microphone MICROPHONE plug Put your-script.sh in /etc/acpi/ Add an event ...
My guess is that alsa mixer works for you too? On my system, the sounds settings are active only while pulseaudio is running. To start the daemon manually: pulseaudio -D If it gets in the way of something else you can stop it by pulseaudio -k
Top 50 recent answers are included