Based on this example
we can solve the problem.
If your sound card can't control the volume on the hardware side or the driver
doesn't support this feature of your sound card, a possible workaround is to
define a new virtual pcm device in the ~/.asoundrc
file, which controls the volume
on the software side.
First we need to know the name of our soundcard, thus
aplay -L
is the helpful command here. The actual card name will be displayed after CARD=
and the device name (number) after DEV=
.
We can test the device with
speaker-test -D <card name> -c <channel count> -twav
Now we create a new softvol
device by adding
pcm.softvol {
type softvol
slave {
pcm "<card name>,<device name>"
}
control {
name "<control name>"
card "<card name>"
}
}
to ~/.asoundrc
. (If the file doesn't exist, we have to create the file)
In this case should be Master
, please see additional information on control names in the link above.
Now we test the new device with
speaker-test -D softvol -c <channel count> -twav
Open alsamixer, you should see the new control Master
now and should be able to change the volume using alsamixer.
It may be necessary to additionally set the device as default in /etc/asound.conf
with:
pcm.!default {
type hw
card <card name>
}
ctl.!default {
type hw
card <card name>
}
Note that this is different from the suggestion in the link above, but that's what OP reported to work.
Now we need to set Jack interface device to softvol
and can use e.g.
amixer -q sset Master 5%+
amixer -q sset Master 5%-
amixer -q sset Master 50%
to increase or decrease the output volume by 5% respectively or set to 50%, fixed.
Amixer needs to "open" the device the first time before the Master volume commands are accessible. Start a sound-test with speaker-test -D softvol -c <channel count> -twav
while jackd
is not running and then use sudo alsactl store
to save the Master-volume state. Otherwise, a sound must be played through softvol
after each reboot for the volume control to work.
go to the file /etc/modprobe.d/alsa-base.conf and if
A) This file only have 43 lines of code, add those two:
options snd-hda-intel position fix=1
options snd-hda-intel model=,dell-headset-multi
B) This file have 44 lines of code just add:
options snd-hda-intel model=,dell-headset-multi
And reboot. If still doesn't work try without the coma.
Best Answer
Traditional stereo headphones have only three leads, while ones with a microphone and/or the "button" have four. In order for the microphone or the button to work on your machine, the headphone jack must also have four leads (which is unlikely) and the drivers you're using must also support the fourth lead.
It is unlikely that the manufacturer would provide hardware without driver support, so if you still have the manufacturer-provided OS installed, you could boot into that and test the button there. If it works there but not in Ubuntu, then it's probably a lack of driver support.