You are not logged in.

#1 2015-04-23 00:47:11

necbot
Member
Registered: 2013-12-05
Posts: 59

[Solved] Have to unplug and plug my headphones back in for audio.

I primarily listen to music through my headphones, I don't even have a set of speakers attached to my computer.  As such, my headphones are always plugged into the front audio port of my computer case.  This has never been a problem, in the past if I started my computer with my headphones already plugged in, audio worked through them perfectly.  This all changed after I ran an update  Now when I turn on my computer I get no audio through my headphones.  In order to get them to work I have to unplug them and then plug them back in.  How do I fix this?  I'm using Pulse audio.

Last edited by necbot (2015-05-03 12:14:33)

Offline

#2 2015-04-23 08:40:50

berbae
Member
From: France
Registered: 2007-02-12
Posts: 1,302

Re: [Solved] Have to unplug and plug my headphones back in for audio.

necbot wrote:

In order to get them to work I have to unplug them and then plug them back in.

Post what appears in 'journalctl -xb' when you do this.
And look for errors about sound, before that in the journal.

Offline

#3 2015-04-23 15:13:54

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,803

Re: [Solved] Have to unplug and plug my headphones back in for audio.

I am not at a computer that has Alsa or Pulseaudio installed, so this is from memory...

Open up Alsamixer,  check the "Sound Card" (or something to that effect).  It might be set to Pulse. Change it to your analog audio system.  Look for a control called auto mute. try changing that setting and see what happens.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#4 2015-04-23 15:39:37

fabertawe
Member
From: Lloegr
Registered: 2009-11-24
Posts: 279

Re: [Solved] Have to unplug and plug my headphones back in for audio.

I have a similar problem using ALSA but only at boot. "Auto-Mute Mode" has been disabled but "Headphone" volume is always reset to zero even after an "alsactl store". I have to use

amixer set Headphone playback 87

at startup. Not sure it's any use to you but at least check for an auto-mute mode as ewaller said.


Ryzen 9 5950X, X570S Aorus Pro AX, RX 6600, Arch x86_64

Offline

#5 2015-04-26 04:11:37

necbot
Member
Registered: 2013-12-05
Posts: 59

Re: [Solved] Have to unplug and plug my headphones back in for audio.

Okay, I think I'm on the right track.  I opened up alsamixer and I saw that auto-mute was enabled.  I disabled it.  My headphone volume was set to 0 and headphones were muted so I unmuted them and set the volume to 50.  Then I ran "sudo alsactl store" and rebooted.  Auto-mute was disabled but the headphone volume was back down to zero and it was muted again.  I tried running fabertawe's command...

amixer set Headphone playback 87

But I got this error....

amixer: Unable to find simple control 'Headphone',0

I'm almost there,  I just need to keep the volume/mute changes for headphones permanent.

Last edited by necbot (2015-04-26 04:12:12)

Offline

#6 2015-04-26 07:56:44

Knute
Member
From: Minot, ND
Registered: 2009-03-17
Posts: 604

Re: [Solved] Have to unplug and plug my headphones back in for audio.

You could add the command to reset your volume to your startup files.  Some will call that a hack, but I don't care.  It fixes the issue.


Knute

Offline

#7 2015-04-26 12:47:42

fabertawe
Member
From: Lloegr
Registered: 2009-11-24
Posts: 279

Re: [Solved] Have to unplug and plug my headphones back in for audio.

necbot wrote:

I tried running fabertawe's command...

amixer set Headphone playback 87

But I got this error....

amixer: Unable to find simple control 'Headphone',0

I'm almost there,  I just need to keep the volume/mute changes for headphones permanent.

Just change "Headphone" to whatever it's called with your soundcard. Try it in the terminal to see what works.


Ryzen 9 5950X, X570S Aorus Pro AX, RX 6600, Arch x86_64

Offline

#8 2015-04-26 13:06:45

robg
Member
Registered: 2015-03-05
Posts: 218

Re: [Solved] Have to unplug and plug my headphones back in for audio.

Try: amixer set Master playback 87

This shouldn't differentiate between speakers, headphones, e.t.c.

Offline

#9 2015-05-02 20:59:26

necbot
Member
Registered: 2013-12-05
Posts: 59

Re: [Solved] Have to unplug and plug my headphones back in for audio.

@robg
When I try "amixer set Master playback 87" it turns the volume down to 0% on everything.  Everything in alsamixer drops to 0.... PCM, Master, Headphone etc.

@fabertawe
I can see it in alsamixer as "Headphone".  However, the output of your command is always "amixer: Unable to find simple control 'Headphone',0".  The command "amixer -l" says...


Simple mixer control 'Master',0
  Capabilities: pvolume pswitch pswitch-joined
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 65536
  Mono:
  Front Left: Playback 87 [0%] [on]
  Front Right: Playback 87 [0%] [on]
Simple mixer control 'Capture',0
  Capabilities: cvolume cswitch cswitch-joined
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 65536
  Front Left: Capture 65540 [100%] [on]
  Front Right: Capture 65540 [100%] [on]

Offline

#10 2015-05-02 21:49:21

necbot
Member
Registered: 2013-12-05
Posts: 59

Re: [Solved] Have to unplug and plug my headphones back in for audio.

Okay, I made some progress.  I opened alsamixer and unmuted my headphones and set the volumes the way I liked them.  I then ran...

alsactl --file ~/.config/asound.state store

now when I reboot I just have to run....

alsactl --file ~/.config/asound.state restore

and sound works on my headphones fine without having to unplug/plug them.  The problem is that I can only get this command to run in a terminal!  I tried crontab -e and added...

@reboot alsactl --file ~/.config/asound.state restore

This didn't work. I tried making the following file...  ~/.config/autostart/alsarestore.desktop  the contents are...

[Desktop Entry]
Type=Application
Terminal=true
Name=alsarestore
Exec=alsactl --file ~/.config/asound.state restore

This also doesn't work.  How do I run this command at startup?

EDIT:
I figured it out.  During the update I installed some additional applications that required pulseaudio.  I didn't even realize pulse was installed.....  When I opened pavucontrol I saw that the audio was being piped out the wrong output for headphones.  I switched it and everything has been fine ever since.

Last edited by necbot (2015-05-02 21:59:31)

Offline

Board footer

Powered by FluxBB