Bugzilla – Bug 958439
Noise in headphones when shutting down or rebooting
Last modified: 2016-05-10 00:23:26 UTC
Created attachment 658764 [details] video recording of reboot with noise When I reboot or poweroff with headphones plugged in there is about 4s of noise at the very end of the reboot sequence. Most of the times it is like white noise but sometimes its different. When headphones are not plugged in I don't hear a similar noise from the laptop speaker. I first noticed this with Factory kernel 4.3.0-2 but I've tested with 4.0 and 3.12.50 and the same noise is present. I don't have a very good setup to record the sound but I've included a video to try to capture it. The offending sound starts at ~15s. The machine is a ThinkPad X1 Carbon 2nd (Generation). The cound card in use, described by `pacmd info`, is: name: <alsa_card.pci-0000_00_1b.0> driver: <module-alsa-card.c> owner module: 8 properties: alsa.card = "2" alsa.card_name = "HDA Intel PCH" alsa.long_card_name = "HDA Intel PCH at 0xf0534000 irq 48" alsa.driver_name = "snd_hda_intel" device.bus_path = "pci-0000:00:1b.0" sysfs.path = "/devices/pci0000:00/0000:00:1b.0/sound/card2" device.bus = "pci" device.vendor.id = "8086" device.vendor.name = "Intel Corporation" device.product.id = "9c20" device.product.name = "8 Series HD Audio Controller" device.form_factor = "internal" device.string = "2" device.description = "Built-in Audio" module-udev-detect.discovered = "1" device.icon_name = "audio-card-pci" profiles: input:analog-stereo: Analog Stereo Input (priority 60, available: unknown) output:analog-stereo: Analog Stereo Output (priority 6000, available: unknown) output:analog-stereo+input:analog-stereo: Analog Stereo Duplex (priority 6060, available: unknown) off: Off (priority 0, available: unknown) active profile: <output:analog-stereo+input:analog-stereo> sinks: alsa_output.pci-0000_00_1b.0.analog-stereo/#2: Built-in Audio Analog Stereo sources: alsa_output.pci-0000_00_1b.0.analog-stereo.monitor/#3: Monitor of Built-in Audio Analog Stereo alsa_input.pci-0000_00_1b.0.analog-stereo/#4: Built-in Audio Analog Stereo ports: analog-input-internal-mic: Internal Microphone (priority 8900, latency offset 0 usec, available: unknown) properties: device.icon_name = "audio-input-microphone" analog-input-mic: Microphone (priority 8700, latency offset 0 usec, available: no) properties: device.icon_name = "audio-input-microphone" analog-output-speaker: Speakers (priority 10000, latency offset 0 usec, available: no) properties: device.icon_name = "audio-speakers" analog-output-headphones: Headphones (priority 9000, latency offset 0 usec, available: yes) properties: device.icon_name = "audio-headphones"
Could you provide alsa-info.sh output? Run the script with --no-upload option and attach to Bugzilla.
Created attachment 658843 [details] alsa-info.sh output
Could you try to pass the following option to snd-hda-intel? options snd-hda-intel model=,tpt440-dock The comma after "model=" is no typo, it means the second entry.
I've set this option, reloaded the module and rebooted, the noise was still there at reboot. Rebooted once more, the noise was still there. I noticed different "ports" so I would say the option was effective but did not solve the problem: root@f1:~# journalctl -b -4 | grep snd Dec 08 15:09:05 f1 kernel: snd_hda_intel 0000:00:03.0: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915]) Dec 08 15:09:05 f1 kernel: snd_hda_codec_realtek hdaudioC1D0: autoconfig for ALC3232: line_outs=1 (0x14/0x0/0x0/0x0/0x0) type:speaker Dec 08 15:09:05 f1 kernel: snd_hda_codec_realtek hdaudioC1D0: speaker_outs=0 (0x0/0x0/0x0/0x0/0x0) Dec 08 15:09:05 f1 kernel: snd_hda_codec_realtek hdaudioC1D0: hp_outs=1 (0x15/0x0/0x0/0x0/0x0) Dec 08 15:09:05 f1 kernel: snd_hda_codec_realtek hdaudioC1D0: mono: mono_out=0x0 Dec 08 15:09:05 f1 kernel: snd_hda_codec_realtek hdaudioC1D0: inputs: Dec 08 15:09:05 f1 kernel: snd_hda_codec_realtek hdaudioC1D0: Mic=0x1a Dec 08 15:09:05 f1 kernel: snd_hda_codec_realtek hdaudioC1D0: Internal Mic=0x12 Dec 08 15:09:05 f1 kernel: usbcore: registered new interface driver snd-usb-audio root@f1:~# journalctl -b | grep snd Dec 09 10:02:42 f1 kernel: snd_hda_intel 0000:00:03.0: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915]) Dec 09 10:02:42 f1 kernel: snd_hda_codec_realtek hdaudioC1D0: autoconfig for ALC3232: line_outs=1 (0x14/0x0/0x0/0x0/0x0) type:speaker Dec 09 10:02:42 f1 kernel: snd_hda_codec_realtek hdaudioC1D0: speaker_outs=0 (0x0/0x0/0x0/0x0/0x0) Dec 09 10:02:42 f1 kernel: snd_hda_codec_realtek hdaudioC1D0: hp_outs=2 (0x16/0x15/0x0/0x0/0x0) Dec 09 10:02:42 f1 kernel: snd_hda_codec_realtek hdaudioC1D0: mono: mono_out=0x0 Dec 09 10:02:42 f1 kernel: snd_hda_codec_realtek hdaudioC1D0: inputs: Dec 09 10:02:42 f1 kernel: snd_hda_codec_realtek hdaudioC1D0: Dock Mic=0x19 Dec 09 10:02:42 f1 kernel: snd_hda_codec_realtek hdaudioC1D0: Mic=0x1a Dec 09 10:02:42 f1 kernel: snd_hda_codec_realtek hdaudioC1D0: Internal Mic=0x12 Dec 09 10:02:42 f1 kernel: usbcore: registered new interface driver snd-usb-audio
OK, then try the patch found in bug 958504, and use "tpt440" instead of "tpt440-dock" in model option. I don't think this would make difference, but to be sure. Is the problem only at reboot/shutdown? If so, does it any change if you mute the output before reboot/shutdown?
(In reply to Takashi Iwai from comment #5) > OK, then try the patch found in bug 958504, and use "tpt440" instead of > "tpt440-dock" in model option. I don't think this would make difference, > but to be sure. Takashi, you rule! With 9a811230481243f384b8036c6a558bfdbd961f78 and the tpt440 module parameter there is no more noise at shutdown and it also gets rid of some poping at startup. > > Is the problem only at reboot/shutdown? If so, does it any change if you > mute the output before reboot/shutdown? Yes, it's only at reboot/shutdown. I also tested unloading snd_hda_intel but it did not produce the noise then. I tested muting before testing the patch above and muting did not help.
Great, could you then try the patch below on top of the current stable branch? Don't forget to remove model option, too. Once when confirmed to work, I'll merge this fix to upstream.
Created attachment 658943 [details] Fix patch
The patch fixes the issue of the noise at reboot most of the time. I still noticed it 2 times over ~12 reboots. I'm almost sure I was testing the right kernel with the right patch at those times but I doubt myself. More importantly, I've noticed that with the patch I no longer have a console beep! The "Beep" channel in alsamixer is no longer there. If I remove the "spec->gen.mixer_nid = 0;" then the noise at reboot is fixed and I still have the console beep. In addition, I've noticed another very similar issue that could perhaps be dealt with while we're working on this: when I physically plug in the headphones, there is the same popping and noise that I could hear at shutdown. This is always there, with or without the patch.
OK, then we should apply the shutup fixup generically to all thinkpad models. Could you try the two patches below instead of the previous one? About the noise at HP plug: you can try the below in addition. --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -4200,6 +4200,7 @@ static void alc_fixup_tpt440_dock(struct hda_codec *codec\ , if (action == HDA_FIXUP_ACT_PRE_PROBE) { spec->shutup = alc_no_shutup; /* reduce click noise */ spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP; + spec->gen.auto_mute_via_amp = 1; codec->power_save_node = 0; /* avoid click noises */ snd_hda_apply_pincfgs(codec, pincfgs); }
Created attachment 658984 [details] Revised fix patch #1
Created attachment 658985 [details] Revised fix patch #2
I tested with 9a81123 plus the patches from comment 11 and comment 12. This time I was careful to pick the correct kernel and I observed the result over ten boots: no click at startup no noise at reboot no click at startup noise at reboot *** noise at startup *** no noise at reboot no click at startup no noise at reboot noise at startup *** no noise at reboot no click at startup no noise at reboot no click at startup no noise at reboot no click at startup noise at reboot *** noise at startup *** no noise at reboot no noise at startup no noise at reboot Considering that without the patches there is always a click at startup and some noise at shutdown, I would say that this is an improvement but it is not perfect. I feel like the two times when there was a noise at reboot, it came a little bit later. Comparing to the video in comment 0 where the noise occurs while the kernel log is still displayed, now the noise occured after the monitor went dark. Afterwards, I added the patch in comment 10. It did not improve the noise when plugging in the headphones however.
If the issue still occurs intermittently, this might be because of the power status at reboot/shutdown. Could you try the patch below in addition to previous two?
Created attachment 659213 [details] Patch to power down codec to D3 at reboot/shutdown
I tested with 9a81123 plus the patches from comment 11, 12 and 15. Like I did previously, I tested over ten reboots and I'm happy to report that this time it was flawless: no noise at reboot, no click at startup. The noise when plugging in headphones is also gone. Well done.
The fixes are merged to upstream and backported to openSUSE-42.1, stable and master branches now. Let's close.
Thank you for your help in debugging this issue.
openSUSE-SU-2016:0280-1: An update that solves 10 vulnerabilities and has 18 fixes is now available. Category: security (important) Bug References: 865096,865259,913996,950178,950998,952621,954324,954532,954647,955422,956708,957152,957988,957990,958439,958463,958504,958510,958886,958951,959190,959399,960021,960710,961263,961509,962075,962597 CVE References: CVE-2015-7550,CVE-2015-8539,CVE-2015-8543,CVE-2015-8550,CVE-2015-8551,CVE-2015-8552,CVE-2015-8569,CVE-2015-8575,CVE-2015-8767,CVE-2016-0728 Sources used: openSUSE Leap 42.1 (src): kernel-debug-4.1.15-8.1, kernel-default-4.1.15-8.1, kernel-docs-4.1.15-8.3, kernel-ec2-4.1.15-8.1, kernel-obs-build-4.1.15-8.2, kernel-obs-qa-4.1.15-8.1, kernel-obs-qa-xen-4.1.15-8.1, kernel-pae-4.1.15-8.1, kernel-pv-4.1.15-8.1, kernel-source-4.1.15-8.1, kernel-syms-4.1.15-8.1, kernel-vanilla-4.1.15-8.1, kernel-xen-4.1.15-8.1
openSUSE-SU-2016:1008-1: An update that solves 15 vulnerabilities and has 26 fixes is now available. Category: security (important) Bug References: 814440,884701,949936,951440,951542,951626,951638,953527,954018,954404,954405,954876,958439,958463,958504,959709,960561,960563,960710,961263,961500,961509,962257,962866,962977,963746,963765,963767,963931,965125,966137,966179,966259,966437,966684,966693,968018,969356,969582,970845,971125 CVE References: CVE-2015-1339,CVE-2015-7799,CVE-2015-7872,CVE-2015-7884,CVE-2015-8104,CVE-2015-8709,CVE-2015-8767,CVE-2015-8785,CVE-2015-8787,CVE-2015-8812,CVE-2016-0723,CVE-2016-2069,CVE-2016-2184,CVE-2016-2383,CVE-2016-2384 Sources used: openSUSE Leap 42.1 (src): kernel-debug-4.1.20-11.1, kernel-default-4.1.20-11.1, kernel-docs-4.1.20-11.3, kernel-ec2-4.1.20-11.1, kernel-obs-build-4.1.20-11.2, kernel-obs-qa-4.1.20-11.1, kernel-obs-qa-xen-4.1.20-11.1, kernel-pae-4.1.20-11.1, kernel-pv-4.1.20-11.1, kernel-source-4.1.20-11.1, kernel-syms-4.1.20-11.1, kernel-vanilla-4.1.20-11.1, kernel-xen-4.1.20-11.1