150

I have a Dell Studio XPS 1647 and headphones do not work (though , internal speakers work like a charm) , I have dual boot Windows 7 and headphones work perfectly fine ...

I also tried -adding in options snd-hda-intel model=eapd probe_mask=1 position_fix=1.

I've experienced this with Oneric Ocelot and the latest Precise Pangolin (LTS).

Braiam
  • 67,791
  • 32
  • 179
  • 269
  • 1
    // , Please add output for the following command: $ lspci | grep Audio. This will show your audio chipset, among other things, e.g. 00:1b.0 Audio device: Intel Corporation 7 Series/C210 Series Chipset Family High Definition Audio Controller (rev 04) – Nathan Basanese Sep 13 '16 at 05:42

14 Answers14

254

I've tried all these responses. Here is the ONLY way that worked for me (and it was remarkably quick... after spending hours on all the other suggestions!). Go into Terminal, and simply key this in:

$ alsactl restore

And that's that! :)

Pepe Lebuntu
  • 3,282
  • Did you reboot after running this? – mwangi Dec 02 '16 at 14:08
  • No, but I do need to close and restart all the programs using audio - or in the case of a tab in a browser (ie, a youtube clip or something), reload the tab. – Pepe Lebuntu Dec 04 '16 at 23:09
  • 11
    Ok. I had to do a full shutdown and not a restart. Only then did it work for me. I'm using an ASUS K56--30 – mwangi Dec 06 '16 at 09:24
  • 1
    Just this worked for me on an ASUS F555U. Thank you. – mechanical_meat Jan 09 '17 at 03:23
  • 1
    worked for me on dell xps 16.04 (after upgrade from 14.04) – oliv Mar 02 '17 at 19:37
  • 18
    This worked on my XPS 13 9360 (Ubuntu 16.04.2). Headphones started working immediately after that. My unit looses the headphone irregularly. – sola Mar 22 '17 at 00:28
  • 1
    That worked with me (HP Probook i7-6500) –  Apr 29 '17 at 18:49
  • 2
    Also worked instantly on a Dell Latitude 3580. – MikaelF Jan 15 '18 at 04:42
  • 4
    Work for me on acer swift 3. Funny that I did not need to restart or anything, sound was instantly turn on as soon as I hit enter. – Tg. Apr 20 '18 at 01:45
  • 1
    I cannot confirm that this is the only fix that works, but it did work for me, and is definitely a very simple fix. Although it fixed the sound of a midi keyboard through qsynth to the headphones, the ubuntu build-in audio test still does not work. – Roland Apr 26 '18 at 22:03
  • 7
    This didn't work for me on Ubuntu 18.04 with an hp spectre 360. I got an error when running the command: alsactl: state_lock:125: file /var/lib/alsa/asound.state lock error: File exists alsactl: load_state:1683: Cannot open /var/lib/alsa/asound.state for reading: File exists – Marses Sep 07 '18 at 21:24
  • @Limok Palantaemon Use sudo alsactl restore and it should work. – abc Nov 04 '18 at 00:34
  • 2
    @MosheRabaev I tried it. The command no longer gives the "Cannot open" error, however unfortunately it doesn't fix the problem :P. Thanks for the help though. I've been reading up on my issue, and basically it seems like it's something specific to my line of laptops (HP x360). Several people much more knowledgeable than me have been trying to fix it for years, apparently it's something very "close the hardware" and way too technical for me. To others who have the same problem, check out this thread (but leave your hopes at the door ): https://bugzilla.kernel.org/show_bug.cgi?id=189331 – Marses Nov 05 '18 at 11:00
  • In my case (Ubuntu 18.04.1 LTS on Dell Latitude E5440) the problem was skypeforlinux. The headphones stopped working after having a videocall. After removing skypeforlinux, they worked again. – rbarriuso Dec 06 '18 at 08:47
  • 1
    It worked for me! – Eduardo Santana Mar 03 '19 at 01:47
  • 1
    This worked for me too! – Leo Jul 17 '19 at 15:33
  • 2
    Just upgraded to 5.0 via the 18.04.3 HWE opt-in --- broke my headphones, and this saved the day~! Thank you very much!! – rm-vanda Aug 12 '19 at 20:43
  • 1
    I had only one ear working.. used this command and it worked like a charm (not sure why), but it worked. – Bhikkhu Subhuti Oct 12 '19 at 23:59
  • 1
    @PepeLebuntu Worked for me in Linux Mint-Tina. Thanks – YourPalNurav Oct 23 '19 at 15:43
  • 1
    Works without reboot. This shold be the accepted answer. – zeljko_a Dec 21 '19 at 10:51
  • 2
    Year 2020, still works :) – Entea May 03 '20 at 16:52
  • 1
    What should be the expected output of this command? – David Kariuki May 07 '20 at 16:12
  • 1
    It works better after a complete shutdown. – David Kariuki May 07 '20 at 16:22
  • Works once in hp spectre x360 nvidia but not anymore – David Kariuki May 11 '20 at 12:22
  • 2
    ubuntu studio 20.04 just installed in a dell XPS 15, and found this problem. You're my hero! – joseLuís May 16 '20 at 18:52
  • This worked like a charm. My headphone stopped working after attending one meeting over Microsoft Teams. I had to join the other meeting using my phone. This fix worked like a charm. Thanks for sharing.!! – Arjun Panicker Sep 09 '21 at 10:57
  • 1
    sudo alsactl restore @ArjunPanicker – Sanaullah Ahmad Oct 11 '21 at 08:04
  • It worked for me, could someone explain what it exactly does behind the scenes ? Shouldn't it work out of the box then ? – Sharthak Ghosh Jan 22 '22 at 16:17
  • ubuntu 20 select the sound output to headphones then run this command alsactl restore thanks – Jehad Nasser Apr 12 '22 at 19:55
  • On Ubuntu 22, alsactl restore fixed the audio jack issue, but sound was also coming out of the speaker. Had to unplug and plug in again the jack for sound to be correctly emitted via headphones only – George Aristy Aug 17 '23 at 14:24
81

I had the same problem. Following these instructions got my headphones working.

Open the terminal and enter the following commands:

cd /usr/share/pulseaudio/alsa-mixer/paths/
sudo cp analog-output-headphones.conf analog-output-headphones.bak
sudo nano analog-output-headphones.conf

Look for the section called [Element Speaker] and change it so that it looks like this:

[Element Speaker]
switch = on
volume = ignore

Save the changes and exit nano.

Create a backup of the corrected analog-output-headphones.conf:

sudo cp analog-output-headphones.conf analog-output-headphones.fixed

Now you can restore the fix if a future installation or update overwrites it.

Reboot.

After rebooting, you may need to remove and reinsert the headphone plug to get it to work. After it's working, though, you will be able to remove and insert the plug, and behavior will be as expected.

41

I finally got my headphones to work. Run the following command in the terminal:

sudo nano /etc/modprobe.d/alsa-base.conf

Scroll down and add these lines to the end of the file:

# Keep snd-pcsp from being loaded as first soundcard
options snd-pcsp index=-2
alias snd-card-0 snd-hda-intel
alias sound-slot-0 snd-hda-intel
options snd-hda-intel model=dell-m6-amic

Then save, reboot and test the sound using the headphones and speakers.

karel
  • 114,770
30

i had same issue after installing 16.06 ubuntu gnome in my dell xps. then i solve this issue by .......

sudo apt-get install pavucontrol

after install pavucontrol. open it by simply typing terminal pavucontrol.

then go to -> Output Devices tab -> change port

in my case seleted port was Headphones(plugged in) by default after plug headphone

enter image description here

change port Headphones(plugged in) to speakers (unavailable).

enter image description here


this is a temporary fix.after rebooting your pc you have to do this again.

habibun
  • 631
13

The solution in a comment above by buzypy worked for me, without any of the other stuff:

sudo alsa force-reload

then reopen pavucontrol and change to the option Headphones (unplugged) and restart the program that was playing the sound.

It's problems like this that make people not want to use Ubuntu!

mjp
  • 449
4

I had to do the following:

  1. Exit out of google chrome (I'm trying to get music to play in a tab)
  2. in a terminal, run killall chrome -- will probably say "none found" or whatever
  3. kill pulseaudio with pulseaudio -k at a terminal. (it should restart silently in the background, but if not, try pulseaudio -d)
  4. now run sudo alsa force-reload (Thanks @mjp!!)
Lotus
  • 161
2

I just recently upgraded to Ubuntu 20.04(KDE) and faced the same issue. None of the answers gave a permanent fix. The closest fix was by Pepe Lebuntu.

alsactl restore

However I had to do this everytime I replugged my headphones which became annoying. So I made an acpi event which triggers this command when headphones are plugged.

To do so create a file in the directory /etc/acpi/events

cd /etc/acpi/events
sudo nano headphone-fix

And add the following lines in the file

event=jack/headphone HEADPHONE plug
action=alsactl restore

Save and exit then restart the acpi service using

sudo service acpid restart

Replug your headphones and it should now be working everytime you plug it back

2

I had the same issue. I did as below

  • Go to Settings
  • Click on Sound settings under hardware section
  • Click output tab (automatically selected by system)
  • On the bottom side: set the output volume to 100%

Thanks to https://superuser.com/questions/357623/headset-is-not-working-with-ubuntu-11-10

2

On my laptop, a Lenovo G465, the sound was working well: each time I plugged the headphones, it would be detected and sound was piped through the headphones and muting the speakers. Suddenly it stopped working. Something weird happened without any changes or installation or whatsoever. I read that someone had to use alsamixer to activate it: lo and behold: I tinkered with the volumes and mutings and suddenly it started working again as before!!! I have no explanation, honestly.

fabricator4
  • 8,375
Max
  • 21
1

In my case, for a Dell E5450, it was resolved after runnning:

sudo modprobe snd-hda-codec-idt
k0pernikus
  • 6,115
1

To day I got it in easy way:

How to using headphone in Ubuntu:

  1. Install update for Ubuntu.
  2. Install GNOME alsa mixer.
  3. Plug in both of back speakers and front headphone.
  4. In ALSA: mute your front column, unmute in Headphone.
  5. Go to Sound setting: unmute your sound that was made by ALSA.
  6. Click the Test Sound button to go to Test Sound in Sound settings, check left and right ==> ONLY HEADPHONE has sound, Speaker will be silent.

enter image description here

enter image description here

enter image description here

IMG:

karel
  • 114,770
nobjta_9x_tq
  • 121
  • 4
0

None of the previous answers posted fixed my issue on Ubuntu 18.04 LTS nor on 16.04 LTS. My computer uses a Clevo motherboard and luckily a developer known as Unrud created an easy fix called "init-headphone", which for the Ubuntu distro it is called "init-headphone-ubuntu". Basically, you just install the ".deb" package for Ubuntu and that's it, with no restart required (at least this was true for me).

To be clear, at this time, Unrud did not specifically create an 18.04 package, so I used Unrud's 16.04 (Xenial) package on 18.04 and it worked like a charm!

0

During boot, I was passing the parameter acpi=off (see Booting Ubuntu with "acpi=off" grub parameter).

After removing acpi=off, the headphones worked again.

toliveira
  • 349
0

Out of the box, sound was available via the headphone jack, into which I plugged either headphones or computer speakers.

Then I ran

$ pulseaudio

That disable audio to the headphone jack and enabled sound coming through the monitor (connected via HDMI).

$ pactl exit

turned off pulseaudio, disabling the monitor sound and re-enabling the jack.

(I wish things like this were clear from the man pages or whatever.)

Rick James
  • 201
  • 1
  • 4