19

I have a dodgy headphone port on my laptop that does not reliably detect when headphones/external speakers are plugged in. This means that the output is constantly being muted/unmuted which is rather annoying

How can I configure pulseaudio to disable the jack detection (or alternatively just force output through this jack)?

I assume it'll involve editing analog-output-headphones.conf however I can't figure out how to do so (analog-output.conf.common is of no help).

  • 2
    Have you considered/tried removing pulseaudio and just using ALSA? – goldilocks Feb 15 '14 at 13:50
  • Yes, but I kind of like the extra control that pulseaudio gives. Besides I'm sure that there is a simple solution - I just can't work out what it is. – Ross Feb 15 '14 at 18:05
  • Using ALSA would make the solution simple. So would choosing to use a different jack. Avoiding both of those options I would choose to repair the flaky jack (requires soldering iron and some experience) :) – Elder Geek Mar 26 '15 at 20:14
7

You can try suspending the headphone jack. To find the index of the headphone jack:

pactl list short sinks

Then suspend that sink:

pactl suspend-sink [SINK] 1|0

Where "SINK" is the index from the first command, and "1" will suspend and "0" will unsuspend.

Edit: Sorry, misunderstood the situation. Found an Arch thread that has a method of disabling the automatic switching. Edit /etc/pulse/default.pa (gdamjan suggests the alternate ~/.config/pulse/default.pa) to remove the following line:

load-module module-switch-on-port-available
  • 1
    Thanks, but I don't want to disable the headphones, rather force output through them - even when they don't detect a cable plugged in. – Ross Mar 22 '14 at 19:42
  • Regarding disabling: load-module module-switch-on-port-available - I have tried that but it seems to make no difference. – Ross Mar 29 '14 at 10:24
  • 1
    aletrantively try ~/.config/pulse/default.pa – gdamjan Feb 5 '15 at 18:04
  • I was trying this to get sound to come though speakers when I plug in a microphone (it is a headset mic - but I want the mic to pick up the speaker sounds for recording). When I tried removing the switch, I can get it (with a "pacmd set-sink-port" command) to output only to speaker (no sound comes out on headphones), but sound will still only come out of the speaker when nothing is plugged into the jack. Arrrggghhhh.... – anthony Dec 6 '16 at 2:35
5

I don't know how (or if) this can be directly done via PulseAudio itself, but I do know this can be done via the ALSA control named "Auto-Mute Mode", untoggling this control (with 'alsamixer' for example) should prevent your output from being automatically muted when something is plugged in in the front jack.

Changing it this way will work even if your system runs PulseAudio, as long as it uses ALSA as the backend (but I think this is the case in most Linux distros by default).

If you use 'alsamixer' to change this setting, you will have to select the right hardware device first (press F6), since the default device will likely be the PulseAudio virtual device, which doesn't have the "Auto-Mute Mode" control.

To make this setting permanent, run as root:

# alsactl store
  • Thanks for putting in the detail about changing device via F6. I spent half an hour in alsa and other config/control files trying to find something related to "AutoMute" until reading your comment, I hadn't thought to change device. – Daniel Feb 22 '18 at 1:21
1

assuming atleast one of your jacks still works without fault, i suggest you refer to this question on askubuntu - instead of depending on the faulty audio jack, i suggest you use the mic in port for the headphones.

  • I guess I didn't explain it all that clearly. The output from the jack is fine. For whatever reason there is a problem detecting if a cable is plugged in or not. This leads to pulseaudio randomly muting the stream as it thinks the plug has been removed (when it hasn’t). – Ross Mar 24 '14 at 22:39
1

Run pavucontrol. Under "Configuration" menu, select "Off" option for Built-in Audio card.

1

Just in case this is useful for someone I will describe how I solved my problem with front jacks on Ubuntu 14.04

I my case the front mic was not working properly, I tried unmuting it in alsamixer and a thousand possible solutions more, but finally what solved it was to install alsa-tools and use hdajackretask to set up the front mic as an "internal mic", then on alsamixer I just unmuted the internal mic and internal mic boost channels and adjusted their values (53 on both on my case)

1

I had the problem that the headphone detection disabled the speaker, which is apparently hooked to my headphone jack in the laptop. HDA-intel on Fujitsu Siemens Amilo 1520 here.

What should give you a clue is having the alsamixer open on your soundcard and seeing the volume controls for speaker and headphone being influenced (on plugging headphone in, speaker mutes and headphone unmutes, and vice versa).

then using the hdajackretask I selected: green headphone (rear side) - select override - and set to "internal speaker"

you can then check by actually plugging in and out the headphones if it works for your configuration (documentation is meager).

In my case this worked, and I clicked the "Install boot override" button. Reboot the system and have working sound...

(I would really like to know what it has set up under the hood, will find that out sometime later.)

1

My issue is jacksense on the front port switching to "headphones" constantly (even when front panel header is not connected) and a faulty MSI motherboard they refused me RMA on. Even when jack sense is disabled in config by commenting it out in default.pa. A terrible work around was to use the front panel and just get constant crackling. I tried all the work-arounds listed here and everywhere in google.

I tried hdajackretask which did not work on Debian Stretch, However all it needed was /lib/firmware to be created. When thats done the boot override install script it creates under /tmp correctly copies the .fw file there.

/etc/modprobe.d/hda-jack-retask.conf contains:

# This file was added by the program 'hda-jack-retask'.
# If you want to revert the changes made by this program, you can simply erase this file and reboot your computer.
options snd-hda-intel patch=hda-jack-retask.fw,hda-jack-retask.fw,hda-jack-retask.fw,hda-jack-retask.fw

(which expects the file under /lib/firmware, )

I'm not sure if other options snd-hda-intel overrides it or interferes so try disabling those if it fails.

My firmware file looks like this, not sure if I could of just used the [hint] stanza as I'm just happy to nuke the thing:

/lib/firmware/hda-jack-retask.fw

[codec]
0x10ec0892 0x1458a002 2

[pincfg]
0x11 0x99430130
0x12 0x4037c540
0x14 0x01014010
0x15 0x01011012
0x16 0x01016011
0x17 0x411111f0
0x18 0x01a19050
0x19 0x02a19060
0x1a 0x0181305f
0x1b 0x43f1413f
0x1c 0x411111f0
0x1d 0x4045e601
0x1e 0x01452140
0x1f 0x411111f0

[hints]
jack_detect=no

I cant upvote those answers or comment on them, If your reading this and you tried every other listed solution as I have, Try to retask jack to "not connected". On my hdajackretask it was called "Green headphone Front Side"

  • I've got a front panel audio port that doesn't have the jack detection pin, thus always shows as unplugged. Eventually fixed it and this answer is the best. One can not apply the settings because pulseaudio is probably using the card and stopping PA is surprisingly difficult. If one enables advanced override, it's possible to turn off jack detection on a per port basis. Also have the port priority of the non-detecting port in PA lower than detecting ports, otherwise your jack detecting line out will never be used because the broken headphone appears always connected. – TrentP Jan 31 '18 at 8:59
0

Here's the dead simple, manual override, workaround that worked for me (Mint Debian Edition with Cinnamon):

  1. Open Sound settings (you can get there from the volume control widget or System Settings)
  2. Under the default Output tab, under Device, click "Analog Output Built-in Audio"

That's it. You're done.

I spent a day and a half on this. Yes, you need to manually set the device you want to use each time, but for me two seconds doing that is better than another several days of searching and at best, it seems, setting output to one or another and changing only with a reboot. I've not seen any fix for the root problem of flaky detection.

Importantly, test sound always worked for the heapdphones or external speaker, so in my case it is a matter of flaky detection. That's presumably not the universal case. I described the symptoms in my case in greater detail elsewhere.

0

Edit /etc/pulse/default.pa

comment following:

#load-module module-switch-on-port-available
#load-module module-suspend-on-idle

and un-comment the last two lines:

set-default-sink output
set-default-source input

Now your Jack plugs will be active after boot.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.