Ubuntu

Sound output device keeps changing when using headphones

Reported by Matthew Morgan on 2012-10-16
34
This bug affects 7 people
Affects Status Importance Assigned to Milestone
alsa-driver (Ubuntu)
Low
Unassigned

Bug Description

Recently upgraded to 12.10. Having issues with sound when using headphones plugged into the front ports. Something that doesn't happen when booting to windows - so fairly confident it's an Ubuntu issue.

When listening to any sound, music, video etc the sound levels jump up and down and click. If I open "sound" from the settings menu when playing videos or music and viewing the "output" tab I can see "headphone - built-in audio disappear and reappear (very quickly) so I'm guessing the system is jumping back to the "analogue output" and back again which is why the sound volume changes and clicks.

Worth noting I never used my headphones when 12.04 was installed so not sure if it's this OS or Ubuntu hates my hardware generally. Booted from live cd (usb) to 12.04 and there wasnt any issue.

Anyone seen this before? any advice?

Sound is built in to motherboard. I have the Gigabyte GA-X58A-UD5.

ProblemType: Bug
DistroRelease: Ubuntu 12.10
Package: gnome-control-center 1:3.4.2-0ubuntu19
ProcVersionSignature: Ubuntu 3.5.0-17.28-generic 3.5.5
Uname: Linux 3.5.0-17-generic x86_64
NonfreeKernelModules: nvidia
ApportVersion: 2.6.1-0ubuntu3
Architecture: amd64
Date: Tue Oct 16 18:07:44 2012
EcryptfsInUse: Yes
ExecutablePath: /usr/bin/gnome-control-center
InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Release amd64 (20120425)
ProcEnviron:
 LANGUAGE=en_GB:en
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_GB.UTF-8
 SHELL=/bin/bash
SourcePackage: gnome-control-center
UpgradeStatus: Upgraded to quantal on 2012-09-29 (17 days ago)
usr_lib_gnome-control-center:
 activity-log-manager-control-center 0.9.4-0ubuntu4
 deja-dup 24.0-0ubuntu1
 gnome-control-center-signon 0.0.18-0ubuntu1
 indicator-datetime 12.10.2-0ubuntu3

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gnome-control-center (Ubuntu):
status: New → Confirmed
Marcello Nuccio (marcenuc) wrote :

As suggested at http://askubuntu.com/a/206554/11223 doing:

    rm -r ~/.pulse ~/.pulse-cookie
    pkill pulse

makes the problem disappear, but only until I change the sound volume through the panel indicator.

Marcello Nuccio (marcenuc) wrote :

Looks like e duplicate of Bug #1063965

Sebastien Bacher (seb128) wrote :

seems rather an issue in the audio stack than in the control ui, reassigning to pulseaudio but it might be also or the driver...

Changed in gnome-control-center (Ubuntu):
importance: Undecided → Low
affects: gnome-control-center (Ubuntu) → pulseaudio (Ubuntu)
Raymond (superquad-vortex2) wrote :

post the output of alsa-info.sh

and

pactl list

does those mute switches turn on and off rapidly ?

alsamixer -c0

affects: pulseaudio (Ubuntu) → alsa-driver (Ubuntu)

I have since completed a complete fresh install, updated all packages and reinstalled my software.

I no longer have this issue.

- Matt

Zurd (zurd3) wrote :

I have this problem. I can boot with the live CD of Ubuntu 12.10 and reproduce the problem :
http://www.youtube.com/watch?v=8v-eYcQ_gqo&feature=youtu.be

I'm attaching 'pactl list'

Zurd (zurd3) wrote :

More information :

Problem : Clipping noise - Volume goes down and up fast randomly

In video : http://www.youtube.com/watch?v=8v-eYcQ_gqo&feature=youtu.be

Not HD and hard to see but you should be able to see those 3 windows :
1) alsamixer : Surround, Center, LFE and Side goes to 0 and backup to 100 in a split second
2) pavucontrol : Output Devices / Port : this one switches to Headphones and back to Analog Output very fast
3) KDE / System Settings / Multimedia / Phonon / Audio Hardware Setup / Device Configuration : Here it's the Connector that is switching to Headphones then back to Analog Output very fast

I uninstalled alsa and pulseaudio, same problem. I uninstalled kmix, problem disappear but I don't have sound anymore. I booted with Linux Mint 14 (both Mate and KDE), same problem right on the LiveCD. I have a dual-boot setup with Windows 7 and this one doesn't reproduce the same problem so there's no problem with my speakers or the cable.

This is my motherboard : http://ca.gigabyte.com/products/product-page.aspx?pid=4139#sp

lspci -nn | grep -i audio
    00:1b.0 Audio device [0403]: Intel Corporation 7 Series/C210 Series Chipset Family High Definition Audio Controller [8086:1e20] (rev 04)

cat /proc/asound/cards
     0 [PCH ]: HDA-Intel - HDA Intel PCH
                          HDA Intel PCH at 0xf7c30000 irq 47

Raymond (superquad-vortex2) wrote :

this usually mean the Jack detection problem

do your computer chassis have a hda front audio panel ?

Zurd (zurd3) wrote :

I do have a front audio jack on my computer case. There's a cable in my computer case going from that front audio port to my motherboard. That cable has 2 ends, without opening my case and if I remember correctly one is HDA HD and the other end is AC '97, I tried both ends and I also tried not plugging it. Same problem. I'm not entirely sure about all of this, if you think the problem is likely with this cable, let me know and I will re-test it again.

Zurd (zurd3) wrote :

I confirm, the cable has 2 ends, labeled HD AUDIO and AC'97, I tried both and without, same problem.

I tried removing the SPEAKER cable, it's a little cable for the beep sound of the motherboard, the end of this one is a little cylinder producing the beep, same problem.

In Windows, the driver I'm using, which are working are :
Sound, video and game controllers
 - High Definition Audio Device
 - Realtek High Definition Audio

But in Linux it seems it's using HDA Intel, maybe it's the wrong driver? I can also add that in alsamixer, if I try to put at 0 : Surround, Center, LFE and Side, as soon as the annoying noise comes in, it reset everything to 100.

Here's more information :

dmesg | grep -i sound
[ 4.669488] input: HDA Intel PCH HDMI/DP,pcm=7 as /devices/pci0000:00/0000:00:1b.0/sound/card0/input6
[ 4.669535] input: HDA Intel PCH HDMI/DP,pcm=3 as /devices/pci0000:00/0000:00:1b.0/sound/card0/input7
[ 4.669574] input: HDA Intel PCH Line as /devices/pci0000:00/0000:00:1b.0/sound/card0/input8
[ 4.669632] input: HDA Intel PCH Front Mic as /devices/pci0000:00/0000:00:1b.0/sound/card0/input9
[ 4.669677] input: HDA Intel PCH Rear Mic as /devices/pci0000:00/0000:00:1b.0/sound/card0/input10
[ 4.669713] input: HDA Intel PCH Front Headphone as /devices/pci0000:00/0000:00:1b.0/sound/card0/input11
[ 4.669742] input: HDA Intel PCH Line Out Side as /devices/pci0000:00/0000:00:1b.0/sound/card0/input12
[ 4.669787] input: HDA Intel PCH Line Out CLFE as /devices/pci0000:00/0000:00:1b.0/sound/card0/input13
[ 4.669817] input: HDA Intel PCH Line Out Surround as /devices/pci0000:00/0000:00:1b.0/sound/card0/input14
[ 4.669845] input: HDA Intel PCH Line Out Front as /devices/pci0000:00/0000:00:1b.0/sound/card0/input15

lsmod | grep -i snd
snd_hda_codec_hdmi 32007 1
snd_hda_codec_realtek 77876 1
snd_hda_intel 33491 3
snd_hda_codec 134212 3 snd_hda_codec_hdmi,snd_hda_codec_realtek,snd_hda_intel
snd_hwdep 13602 1 snd_hda_codec
snd_pcm 96580 3 snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec
snd_seq_midi 13324 0
snd_rawmidi 30512 1 snd_seq_midi
snd_seq_midi_event 14899 1 snd_seq_midi
snd_seq 61521 2 snd_seq_midi,snd_seq_midi_event
snd_timer 29425 2 snd_pcm,snd_seq
snd_seq_device 14497 3 snd_seq_midi,snd_rawmidi,snd_seq
snd 78734 16 snd_hda_codec_hdmi,snd_hda_codec_realtek,snd_hda_intel,snd_hda_codec,snd_hwdep,snd_pcm,snd_rawmidi,snd_seq,snd_timer,snd_seq_device
soundcore 15047 1 snd
snd_page_alloc 18484 2 snd_hda_intel,snd_pcm

Raymond (superquad-vortex2) wrote :

Pin Default 0x02214c20: [Jack] HP Out at Ext Front
    Conn = 1/8, Color = Green
    DefAssociation = 0x2, Sequence = 0x0

you can use hda-verb to set bit 8 of pin default of the front headphone to disable the unsolicited event

0x02214d20

  misc = NO_PRESENCE

Zurd (zurd3) wrote :

What does that mean in layman's term? :)

Can't find hda-verb, I installed alsa-tools, it's not in it.

Found this : http://www.alsa-project.org/main/index.php/Help_To_Debug_Intel_HDA
And this : http://www.alsa-project.org/main/index.php/HDA_Analyzer
which I just run and took a screenshot of what your talking about.

Raymond (superquad-vortex2) wrote :

https://launchpad.net/~diwic/+archive/hda

you can use hda-jack-retask to set misc bit of headphone and reboot

this disable automute and unsolicited event

Raymond (superquad-vortex2) wrote :

http://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/tree/Documentation/sound/alsa/HD-Audio.txt

check the response of hda unsol event when headphone is plugged and unplugged

Tracepoints
~~~~~~~~~~~
The hd-audio driver gives a few basic tracepoints.
`hda:hda_send_cmd` traces each CORB write while `hda:hda_get_response`
traces the response from RIRB (only when read from the codec driver).
`hda:hda_bus_reset` traces the bus-reset due to fatal error, etc,
`hda:hda_unsol_event` traces the unsolicited events, and
`hda:hda_power_down` and `hda:hda_power_up` trace the power down/up
via power-saving behavior.

Enabling all tracepoints can be done like
------------------------------------------------------------------------
  # echo 1 > /sys/kernel/debug/tracing/events/hda/enable
------------------------------------------------------------------------
then after some commands, you can traces from
/sys/kernel/debug/tracing/trace file. For example, when you want to
trace what codec command is sent, enable the tracepoint like:
------------------------------------------------------------------------
  # cat /sys/kernel/debug/tracing/trace
  # tracer: nop

Zurd (zurd3) wrote :

Thanks a lot for all the help and the information, I must admit this is all a bit over my head but with your help it's not fixed I installed hda-jack-retask (manual compile, I'm running Linux Mint) like they say here :
http://lists.freedesktop.org/archives/pulseaudio-discuss/2011-December/012342.html

Then ./hda-jack-retask and I set the Green Headphone, Front side to Override and Not connected, click Apply now, and Set as boot default. I just rebooted and it's working.

No more annoying noise now, big thank you. I hope this will be fix in future releases, this problem must drive thousands of people crazy.

Raymond (superquad-vortex2) wrote :

do you mean the unsolicited event must not be enabled for the headphone Jack ?

how about the front mic jack ?

Zurd (zurd3) wrote :

I meant "it's now fixed" instead of "it's not fixed" for my last post.

I don't know about any unsolicited event, no idea what this means in this context. I just put the Green Headphone Front side to Not connected (so disabling it) to fix the issue. That is the front mic jack. I really don't care that it's disabled and not working, I never use these ports.

robotpoet (robotpoet) wrote :

I had this problem when I had headphones connected to the front jack and simultaneously the line out at the back connected to my amp.

I solved it by using hda-jack-retask that Raymond mentioned above. Using advanced override I set "Green Headphone, Front side" > "Jack detection" to "Not present". Then "Apply now" which solved the problem immediately and also "Install boot override" which made it permanent.

Let me know if you want me to provide any information.

Raymond (superquad-vortex2) wrote :

http://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/plain/Documentation/sound/alsa/HD-Audio.txt

trace hda_unsol_event

only one event when headphone plugged and one event when headphone is plugged

check whether you receive many plugged and unplugged events

try trigger_sense=false

Hint Strings
~~~~~~~~~~~~
The codec parser have several switches and adjustment knobs for
matching better with the actual codec or device behavior. Many of
them can be adjusted dynamically via "hints" strings as mentioned in
the section above. For example, by passing `jack_detect = no` string
via sysfs or a patch file, you can disable the jack detection, thus
the codec parser will skip the features like auto-mute or mic
auto-switch. As a boolean value, either `yes`, `no`, `true`, `false`,
`1` or `0` can be passed.

The generic parser supports the following hints:

- trigger_sense (bool): indicates that the jack detection needs the
  explicit call of AC_VERB_SET_PIN_SENSE verb

Zurd (zurd3) wrote :

Now running Linux Mint 16, problem still exist.

Here's the latest step-by-step instructions on how to fix it.

sudo apt-get install bzr libgtk-3-dev binutils build-essential m4 autogen bison flex
sudo apt-get install g++
bzr branch lp:~diwic/+junk/hda-jack-retask
make
./hda-jack-retask
Check the Override checkbox in "Green Headphone, Front side" and choose "Not connected" in the drop-down.
Click Install boot override and reboot.

Raymond (superquad-vortex2) wrote :

you lost the headphone if you choose "not connected"

check the advanced override and change "jack detection" of the headphone jack to "not present"

Zurd (zurd3) wrote :

It worked, still no noise sound.

No idea if the jack on the front of my tower is working though, I think I unplugged it inside the tower when I first started to have this problem and never bothered to plug it back.

Zurd (zurd3) wrote :

Cinnamon kept crashing, I installed Mate instead so new install, same problem.

I tried by just changing the "jack detection" to "not present" but after reboot it is still at "present", thus not working as a solution. Seems like there's no solution but to put the "Green Headphone, Front Side" to "Not connected".

Raymond (superquad-vortex2) wrote :

you can use hint

jack-detect=0

by early patching to disable detection of all jacks (front and rear panel jacks)

if the problem still exist, you have to check the front audio panel connector and your computer chassis 's front audio panel

connect an AC97 front audio panel to motherboard with HDA controller is not recommended

Zurd (zurd3) wrote :

> use hint jack-detect=0

Why would I want to disable my jack rear panel? If you're talking about the green jack audio at the back, I can't, I'm using it. My computer is plugged into an amplifier which is then connected to my speakers. Even if it's not what you're talking about, it would still just be a patch that you need to do manually. We're not interested, we'd like to have a permanent fix instead that is applied automatically.

> you have to check the front audio panel connector
> connect an AC97 front audio panel to motherboard with HDA controller is not recommended

Like I said before (which I also just retested), the problem still exist when there's nothing plugged in my front audio panel connector. That is not the problem. On my motherboard, there's is a port called "F_AUDIO" and I have a cable where I can plug HD AUDIO or AC'97 in it. However, even if I do not plug this cable, I still have the problem.

I will also repeat that I do not have this problem in Windows (I have a dual-boot configuration).

As a new information, I unplugged my HDMI cable that goes to my TV in case it had anything to do with it since HDMI also carries sound. So I only had my green audio jack at the back plugged into my amplifier and the problem was still present.

If anyone has any idea as to what I can test next so that we can pinpoint where does this problem comes from, I'm all hear!

Raymond (superquad-vortex2) wrote :
Changed in alsa-driver (Ubuntu):
status: Confirmed → Incomplete
Zurd (zurd3) wrote :

file alsa-info.txt.L74fe39LaX added!

Zurd (zurd3) wrote :

Note that, in this file, it was runned on my main computer where I have already used hda-jack-retask to "solve" the problem.

I can produce another file like this one easily with a fresh linux install where there was no hda-jack-retask used if you'd like.

Launchpad Janitor (janitor) wrote :

[Expired for alsa-driver (Ubuntu) because there has been no activity for 60 days.]

Changed in alsa-driver (Ubuntu):
status: Incomplete → Expired
Zurd (zurd3) wrote :

Bug still present. Because there's no activity it shouldn't be expired.

Will report back if I still have the problem with the new Ubuntu when it's out, I think it's at the end of May.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers