To set volume level from console use the command amixer.
For example:
amixer sset Master playback 0%
Will set your level to 0%
I don't know how to change this when you plug in your headphones... but maybe someone can help you with that
After searching for a solution for damn 2 months, I was able to solve my own problem.
This problem also exists in Linux Mint, since they are both based on Debian and that means this is an issue which exists in Debian.
This post has a lot of information about the issue:
[SOLVED]Front panel headphones not working with onboard Intel HD Audio
At some point it mentions a package hda-jack-retask
. I have searched for it a little bit and found out that it resides in alsa-tools-gui
. I Installed it and then I wrote
sudo hdajackretask
In this GUI, I have overridden my front jack to headphones and installed boot override.
Now I have crystal clear sounds from my headphones and also it can detect whether they are plugged in or not! It mutes the speakers when they are plugged in.
This may not be a common issue, but it is a tough one to solve. Other solutions I found on the internet just did not work for this issue.
If anyone reading is able to get this issue solved in future versions of Debian, please contact me or show me how to report this problem.
Best Answer
In most systems if not all, ACPI can handle this event. To test that:
acpi_listen
Unplug & replug headphones, example output: (mic/ears share in same jack on my laptop)
Put
your-script.sh
in/etc/acpi/
Add an event trigger file for your script in
/etc/acpi/events/
Check the other files there to learn from.
You may need to restart
acpid
service to reload changed rules in/etc/acpi/events/
Reference:
man acpid