60

The problem is that I can hear the sound from my laptop's speakers even if I plugged in my headphones. Headphones is just standard stereo headphones. And the most interesting thing is that all was working just a week ago.

I tried to play with pulseaudio and alsamixer settings - no results.

Ilay
  • 877

17 Answers17

52

Follow these steps to automatically mute your speakers when plugging in headphones:

  1. Open Terminal (Ctrl+Alt+T)
  2. Type: alsamixer and press Enter/Return
  3. Select the correct sound device by pressing F6
  4. Navigate to the right with (Right Arrow key) until you highlight Auto-Mute
  5. Press (Up Arrow key) and select Enabled (or Line Out)
  6. Press Esc to exit
27

Original Solution

  1. Go to Realtek official site, accept the disclaimer, then download the audio driver for linux/unix. You need to select version 3 for Kernel 3 or later.

  2. Setup necessary tools to compile this driver.

    sudo apt-get install build-essential gcc make

  3. Extract the downloaded file, run sudo ./install file from a terminal after going to the extracted folder to compile the driver.

  4. Read the Readme.txt file for more information.

  5. Install gnome-alsamixer by this command.

     sudo apt-get install gnome-alsamixer
    
  6. Open the gnome-alsamixer by typing alsamixer in the dash.

  7. Select the "Auto mute mode" in the new window.

Reboot and see whether it fixed now. (Step 6 and 7 might not necessary). Automute will automatically enabled upon restart


Solution 2:

I have just found another solution:

(It worked for me with Only S/PDIF profile, Sound from both headphone and speaker and not being able to switch profile)

  1. Add this ppa by the command

      sudo apt-add-repository ppa:ubuntu-audio-dev/alsa-daily
    
  2. Update packages list. by

     sudo apt-get update
    
  3. Then install "alsa-hda-dkms" package:

      sudo apt-get install alsa-hda-dkms
    

Reboot, And See the result!

Anwar
  • 77,855
7

I also had this problem on my HP laptop. I found a post and take one of the advice, which suggests adding two lines to the bottom of the file /etc/modprobe.d/alsa-base.conf:

options snd-hda-intel model=laptop
options snd-hda-intel position_fix=1 enable=yes

save it and reboot. It works for me!

David Foerster
  • 36,890
  • 56
  • 97
  • 151
hiqhan
  • 79
4

Had this issue on XUbuntu 12.04, reviewed this page, installed the gnome-alsamixer package, ran gnome-alsamixer, checked the "Headphone Jack Sense" option in the gnome-alsamixer GUI screen that came up, verified the problem is resolved. Thanks!

Bob
  • 41
2

The command sudo apt-get install gnome-alsa-mixer did the trick for me on my Compaq nw8000.

I could enable the Headphone Jack Sense option and now it switches the audio to the headphone when I plug-in my head phones.

Lucio
  • 19,191
  • 32
  • 112
  • 191
2

I had the same problem on 13.04 with an Asus X201E, and tried the gnome-alsamixer solution but it failed as the gnome-alsamixer crashed with "No idea what to do for mixer element "Auto-Mute Mode"!". So I opened the command line alsamixer and navigated to the Auto-Mute Mode using the arrows (only Auto-Mut is visible in the terminal window) and set it from Disabled to Enabled. Now connecting the headphones mutes the internal speakers.

asterx
  • 21
2

What worked for me was to run alsamixer and enable the auto-mute option. I did this while the headphones were connected and everything started working perfectly.

Vishal
  • 156
1

18.04

None of these answers above worked for me in 18.04 I tried a number of them from re-installing pulse audio through to alsamixer in terminal etc. But none worked. Everything was up to date.

My Issue was:

Dual sound out of headphones (low volume) and Speakers (120% volume) (crazy loud volume out of my Amp (s/pdif)), when selecting "Headphones - Built-in Audio" in Sound settings (3rd box in my picture). When selecting s/pdif it would go to normal Audio level out of my speakers. Very strange as it was working fine for months and started this for no reason a week ago after an update.

An answer above provided an elaborate way to install Gnome Alsa Mixer, but I just did:

sudo apt-get install gnome-alsamixer

I have actioned many things, so hard to say what was the perfect sequence of events, but with this install of Gnome Alsa Mixer

Auto-Mute Mode had little effect I turned off all IEC958 settings, not sure what they do, but the setting that stopped the crazy behaviour (headphones and speakers at full volume) was turning OFF "IEC956 Default-PCM" as per 1st box in picture using the Gnome Alsa Mixer

Extra Question about how Gnome Alsa Mixer works here waiting for an answer:

How does the GNome Alsa Mixer Work with my settings

I  then

TheArchitecta
  • 321
  • 4
  • 8
1

This one worked for me perfectly.

  1. Edit /etc/modprobe.d/alsa-base.conf as super-user with you favourite text editor, e. g.:

    sudo gedit /etc/modprobe.d/alsa-base.conf
    
  2. At the end of the file paste the following:

    alias snd-card-0 snd-hda-intel
    options snd-hda-intel model=dell-m4-1 enable_msi=1
    
  3. Save and Reboot.

If this does not work, change in the second line the part about model=dell-m4-1 to model=hp-m4.

David Foerster
  • 36,890
  • 56
  • 97
  • 151
1

after upgrading from 15.04 -> 15.10 and now on 16.10 (where problem started)

the only resolution that worked for me was to do a full reinstall

dpkg -l | grep 'alsa-'
apt-get install --reinstall  alsa-base alsa-utils
0

Try plugging in your headphones properly. This happened to me once and then after fixing that pin of the headphones correctly it worked properly.

Pranit Bauva
  • 1,101
0

I had the same exact problem with a fresh install of Xubuntu. I tried a buch of things including typing alsamixer in terminal. The option was not there for me to turn on the Headphone Jack Sense. I installed gnome-alsamixer and found the Headphone Jack Sense option, checked it and alas no audio from the pc speakers while headphones are plugged in. This worked for me.

Jason
  • 1
0

Running alsamixer in terminal worked for me, set it to Auto Mute and you should find your machine will play sound through one or the other rather than both

David Foerster
  • 36,890
  • 56
  • 97
  • 151
0

in alsamixer, try using arrow key Up, then turn everything up to 100% and you will see the right bar turns up. After that turn down arrow key to % you like. Now it should be down together and your right speaker will work on both sides.

Jens Erat
  • 5,131
  • 7
  • 33
  • 37
0

On an Asus X551MA I was having this problem as soon as I replaced Windows with Ubuntu 14.04. Even if I muted the speakers in aslamixer, they would come back on unexpectedly.

When I got to step three in this troubleshooting procedure, that seems to have fixed everything. It's a long complicated command which installed various packages, so I'm not sure which part(s) were really necessary:

sudo apt-get update;sudo apt-get dist-upgrade; sudo apt-get install pavucontrol linux-sound-base alsa-base alsa-utils lightdm ubuntu-desktop linux-image-`uname -r` libasound2; sudo apt-get -y --reinstall install linux- sound-base alsa-base alsa-utils lightdm ubuntu-desktop linux-image-`uname -r` libasound2; killall pulseaudio; rm -r ~/.pulse*; ubuntu-support-status; sudo usermod -aG `cat /etc/group | grep -e '^pulse:' -e '^audio:' -e '^pulse- access:' -e '^pulse-rt:' -e '^video:' | awk -F: '{print $1}' | tr '\n' ',' | sed 's:,$::g'` `whoami`
Brian Z
  • 712
0

Simply just go to the alsamixer (alsamixer in terminal) and use the right/left arrow keys to navigate to the speakers setting and click M. This will disable the speakers but not the headphones.

Rhys
  • 1
0

This worked for me (Ubuntu 14.04 LTS running on Compaq NC6120 laptop):

  1. Ctrl+Alt+T (to open terminal)
  2. Type alsamixer
  3. Press until you get to the "Headphone Jack Sense" option
  4. Press m to enable (automatically mute the speakers when headphone is plugged in)
TheOdd
  • 3,012
XqRG
  • 1
  • 2