Bug 109841

Summary: Sound goes AWOL after plugging headphones on Dell XPS15 9550
Product: Drivers Reporter: Martin Schrodt (kernel)
Component: Sound(ALSA)Assignee: Jaroslav Kysela (perex)
Status: NEW ---    
Severity: normal CC: cruz.fernandez, darose, josh.holbrook, kernel, superquad.vortex2, ucelsanicin
Priority: P1    
Hardware: Intel   
OS: Linux   
Kernel Version: 4.4.0-rc6 Subsystem:
Regression: No Bisected commit-id:
Attachments: Output of alsa-info.sh
dmesg
codec state after booting up with no headphones plugged (working)
codec state after plugging headphones (silent)
codec state after removing headphone plug again
codec state after booting with headphones plugged (working)
codec state after pulling (still working)
alsa-info initial
alsa-info plugged and silent
alsa-info unplugged and still silent

Description Martin Schrodt 2015-12-23 15:30:45 UTC
Created attachment 198051 [details]
Output of alsa-info.sh

I have this issue since I have the machine, tried with 4.4.0 rc4, 5 and 6.

When I boot up the machine sound is fine through the internal speakers. When I plug headphones, internal speakers go silent, but there is no sound through the headphones. When unplugging again, sound does not come back on the laptop's speakers.

If I boot up with headphones plugged, I can hear sound through them fine, and it'll correctly switch to the laptop speakers when I unplug, but once I plug in again, sound is gone until reboot.

I have attached some dumps of /proc/asound/card0/codec#0 and hope that they'll help, plus a dump of alsa-info and dmesg of a boot.

I'd be happy to provide further data to help resolve this.
Comment 1 Martin Schrodt 2015-12-23 15:31:21 UTC
Created attachment 198061 [details]
dmesg
Comment 2 Martin Schrodt 2015-12-23 15:32:09 UTC
Created attachment 198071 [details]
codec state after booting up with no headphones plugged (working)
Comment 3 Martin Schrodt 2015-12-23 15:32:37 UTC
Created attachment 198081 [details]
codec state after plugging headphones (silent)
Comment 4 Martin Schrodt 2015-12-23 15:33:02 UTC
Created attachment 198091 [details]
codec state after removing headphone plug again
Comment 5 Martin Schrodt 2015-12-23 15:33:52 UTC
Created attachment 198101 [details]
codec state after booting with headphones plugged (working)
Comment 6 Martin Schrodt 2015-12-23 15:34:22 UTC
Created attachment 198111 [details]
codec state after pulling (still working)
Comment 7 Raymond 2015-12-24 01:51:49 UTC
It is useless to post codec info without the jacks state and capture source control which determine the role of multi function combo jack

You have to post the output of alsa-info. sh
Comment 8 Raymond 2015-12-24 01:55:41 UTC
Simple mixer control 'Headphone',0 Capabilities: pvolume pswitch Playback channels: Front Left - Front Right Limits: Playback 0 - 127 Mono: Front Left: Playback 0 [0%] [-63.50dB] [off] Front Right: Playback 0 [0%] [-63.50dB] [off]
Comment 9 Raymond 2015-12-24 08:36:15 UTC
Dec 22 18:37:33 revolution kernel: WARNING: CPU: 0 PID: 842 at drivers/gpu/drm/i915/intel_pm.c:3597 skl_update_other_pipe_wm+0x1e7/0x1f0 [i915]()
Dec 22 18:37:33 revolution kernel: WARN_ON(!wm_changed)
Dec 22 18:37:33 revolution kernel: Modules linked in:
Dec 22 18:37:33 revolution kernel:  hid_cherry hid_generic uvcvideo videobuf2_vmalloc videobuf2_memops videobuf2_v4l2 videobuf2_core v4l2_common videodev btusb media btrtl usbhid cdc_ether usbnet r8152 mii bbswitch(O) bnep joydev mousedev hid_multitouch snd_hda_codec_hdmi dell_led nvram nls_iso8859_1 msr nls_cp437 vfat snd_hda_codec_realtek acpi_call(O) fat snd_hda_codec_generic dell_laptop dell_wmi i2c_designware_platform i2c_designware_core brcmfmac mxm_wmi sparse_keymap dcdbas brcmutil cfg80211 intel_rapl x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel rtsx_pci_ms memstick kvm irqbypass crct10dif_pclmul crc32_pclmul aesni_intel aes_x86_64 lrw gf128mul snd_hda_intel glue_helper ablk_helper cryptd snd_hda_codec input_leds led_class snd_hda_core snd_hwdep serio_raw snd_pcm pcspkr snd_timer snd soundcore i2c_i801
Dec 22 18:37:33 revolution kernel:  processor_thermal_device mei_me i2c_hid intel_soc_dts_iosf mei iosf_mbi intel_lpss_pci shpchp hci_uart thermal fan hid battery btbcm btqca btintel bluetooth pinctrl_sunrisepoint rfkill int3403_thermal pinctrl_intel crc16 intel_lpss_acpi dell_smo8800 wmi intel_lpss tpm_tis tpm int3402_thermal int340x_thermal_zone int3400_thermal evdev acpi_pad acpi_thermal_rel acpi_als kfifo_buf mac_hid industrialio processor fjes ac sch_fq_codel vboxnetflt(O) vboxnetadp(O) vboxdrv(O) ip_tables x_tables rtsx_pci_sdmmc mmc_core atkbd libps2 xhci_pci xhci_hcd rtsx_pci usbcore usb_common i8042 serio crc32c_generic crc32c_intel btrfs xor raid6_pq i915 video button intel_gtt i2c_algo_bit drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops drm nvme
Dec 22 18:37:33 revolution kernel: CPU: 0 PID: 842 Comm: Xorg Tainted: G        W  O    4.4.0-rc6-mainline #1
Dec 22 18:37:33 revolution kernel: Hardware name: Dell Inc. XPS 15 9550/0N7TVV, BIOS 01.00.07 11/02/2015
Dec 22 18:37:33 revolution kernel:  0000000000000000 00000000101a23e7 ffff88049e0977c8 ffffffff812c1d09
Dec 22 18:37:33 revolution kernel:  ffff88049e097810 ffff88049e097800 ffffffff81076592 ffff8804ab6e6000
Dec 22 18:37:33 revolution kernel:  ffff88049e097934 ffff8804ab6e7000 0000000000000000 ffff88049e0978a0
Dec 22 18:37:33 revolution kernel: Call Trace:
Dec 22 18:37:33 revolution kernel:  [<ffffffff812c1d09>] dump_stack+0x4b/0x72
Dec 22 18:37:33 revolution kernel:  [<ffffffff81076592>] warn_slowpath_common+0x82/0xc0
Dec 22 18:37:33 revolution kernel:  [<ffffffff8107662c>] warn_slowpath_fmt+0x5c/0x80
Dec 22 18:37:33 revolution kernel:  [<ffffffffa00fcf37>] skl_update_other_pipe_wm+0x1e7/0x1f0 [i915]
Dec 22 18:37:33 revolution kernel:  [<ffffffffa00fd19a>] skl_update_wm+0x25a/0x750 [i915]
Dec 22 18:37:33 revolution kernel:  [<ffffffff81586edb>] ? schedule_hrtimeout_range_clock.part.7+0x8b/0x100
Dec 22 18:37:33 revolution kernel:  [<ffffffffa01014de>] intel_update_watermarks+0x1e/0x30 [i915]
Dec 22 18:37:33 revolution kernel:  [<ffffffffa0165752>] intel_atomic_commit+0x462/0x1430 [i915]
Dec 22 18:37:33 revolution kernel:  [<ffffffffa003539e>] ? drm_atomic_check_only+0x18e/0x590 [drm]
Dec 22 18:37:33 revolution kernel:  [<ffffffffa00357d7>] drm_atomic_commit+0x37/0x60 [drm]
Dec 22 18:37:33 revolution kernel:  [<ffffffffa00a5fb6>] drm_atomic_helper_set_config+0x76/0xb0 [drm_kms_helper]
Dec 22 18:37:33 revolution kernel:  [<ffffffffa0023ea2>] drm_mode_set_config_internal+0x62/0x100 [drm]
Dec 22 18:37:33 revolution kernel:  [<ffffffffa0028d92>] drm_mode_setcrtc+0x3d2/0x4f0 [drm]
Dec 22 18:37:33 revolution kernel:  [<ffffffffa001a7b2>] drm_ioctl+0x152/0x540 [drm]
Dec 22 18:37:33 revolution kernel:  [<ffffffffa00289c0>] ? drm_mode_setplane+0x1b0/0x1b0 [drm]
Dec 22 18:37:33 revolution kernel:  [<ffffffff811ea948>] do_vfs_ioctl+0x298/0x480
Dec 22 18:37:33 revolution kernel:  [<ffffffff811f49c7>] ? __fget+0x77/0xb0
Dec 22 18:37:33 revolution kernel:  [<ffffffff811eaba9>] SyS_ioctl+0x79/0x90
Dec 22 18:37:33 revolution kernel:  [<ffffffff81587c6e>] entry_SYSCALL_64_fastpath+0x12/0x71
Comment 10 Martin Schrodt 2015-12-24 09:01:43 UTC
(In reply to Raymond from comment #9)
> Dec 22 18:37:33 revolution kernel: WARNING: CPU: 0 PID: 842 at
> drivers/gpu/drm/i915/intel_pm.c:3597 skl_update_other_pipe_wm+0x1e7/0x1f0

This has nothing to do with it, it's a bug with the intel driver which oopses all the time when you have an external display connected via HDMI.

Regarding alsa-info: You want me to do one before and one after plugging?
Comment 11 Martin Schrodt 2015-12-24 09:31:12 UTC
Created attachment 198141 [details]
alsa-info initial
Comment 12 Martin Schrodt 2015-12-24 09:32:12 UTC
Created attachment 198151 [details]
alsa-info plugged and silent
Comment 13 Martin Schrodt 2015-12-24 09:32:44 UTC
Created attachment 198161 [details]
alsa-info unplugged and still silent
Comment 14 Martin Schrodt 2015-12-24 09:38:45 UTC
Ok, I made a clean boot without HDMI attached to get rid of the unrelated oops.
Sorry for uploading that pile of crap before, it's hard for me to condense this.
Comment 15 Raymond 2015-12-24 15:50:19 UTC
https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/log/sound/pci/hda/patch_realtek.c?qt=grep&q=alc298


Headset support was added but there are two dell laptops need mic fix

It is strange that pin-ctls of headphone pin is zero when hp is plugged 

 


Node 0x21 [Pin Complex] wcaps 0x40058d: Stereo Amp-Out 
Control: name="Headphone Playback Switch", index=0, device=0 
ControlAmp: chs=3, dir=Out, idx=0, ofs=0 
Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1 Amp-Out vals: [0x80 0x80] 
Pincap 0x0000001c: OUT HP Detect 
Pin Default 0x411111f0: [N/A] Speaker at Ext Rear Conn = 1/8, Color = Black DefAssociation = 0xf, Sequence = 0x0 Misc = NO_PRESENCE 
Pin-ctls: 0x00: Unsolicited: tag=00, enabled=0 
Power states: D0 D1 D2 D3 EPSS Power: setting=D0, actual=D0 
Connection: 2 
0x0c* 0x0d
Comment 16 Raymond 2015-12-24 15:56:04 UTC
You only have two pins fixup but the logic seem have three pins

sys/class/sound/hwC0D0/init_pin_configs: 0x12 0x90a60130 0x13 0x40000000 0x14 0x411111f0 0x17 0x90170110 0x18 0x411111f0 0x19 0x411111f0 0x1a 0x411111f0 0x1d 0x4068a36d 0x1e 0x411111f0 0x1f 0x411111f0 0x21 0x03211020 

/sys/class/sound/hwC0D0/driver_pin_configs: 
0x18 0x01a1913c 
0x1a 0x01a1913d



https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/commit/sound/pci/hda/patch_realtek.c?id=9f502ff55321a5270c3dfbb76ac3774e6b5d8097
Comment 17 Raymond 2015-12-24 16:05:30 UTC
You have to send email to the author , it is strange that unsolicited event was not enabled at the headphone pin node 0x21

The pin default seem different

0x21 0x03211020

Pin Default 0x411111f0
Comment 18 Raymond 2015-12-24 16:58:20 UTC
control.18 { iface CARD name 'Headset Mic Phantom Jack' value true comment { access read type BOOLEAN count 1 } } 

control.19 { iface CARD name 'Headphone Mic Jack' value true comment { access read type BOOLEAN count 1 } }

It is strange the pin fixup add headphone mic phantom but driver create headphone mic jack

https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/commit/sound/pci/hda/patch_realtek.c?id=977e627684df0f60bdf2a768ec4772f42fe843fc


+	[ALC298_FIXUP_DELL1_MIC_NO_PRESENCE] = {
+		.type = HDA_FIXUP_PINS,
+		.v.pins = (const struct hda_pintbl[]) {
+			{ 0x18, 0x01a1913c }, /* use as headset mic, without its own jack detect */
+			{ 0x1a, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
+			{ }
+		},
Comment 19 Raymond 2015-12-25 15:23:38 UTC
Unsolicited event seem enabled in first alsa-info but disappearin your second alsa-info


Node 0x21 [Pin Complex] wcaps 0x40058d: Stereo Amp-Out 
Control: name="Headphone Playback Switch", index=0, device=0 
ControlAmp: chs=3, dir=Out, idx=0, ofs=0 
Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1 
Amp-Out vals: [0x80 0x80]
 Pincap 0x0000001c: OUT HP Detect 
Pin Default 0x03211020: [Jack] HP Out at Ext Left Conn = 1/8, Color = Black DefAssociation = 0x2, Sequence = 0x0 
Pin-ctls: 0xc0: OUT HP Unsolicited: tag=01, enabled=1 
Power states: D0 D1 D2 D3 EPSS Power: setting=D3, actual=D3 
Connection: 2 
0x0c* 0x0d
Comment 20 Raymond 2015-12-25 15:25:54 UTC
You can use hda-analyser to set pin-ctls to 0xc0 when the codec info loss the value
Comment 21 Raymond 2015-12-25 15:28:35 UTC
Do this node always lost the pin-ctls, pin default and unsolicited after power change from D0 to D3
Comment 22 Martin Schrodt 2015-12-31 11:27:27 UTC
I do not really understand if, and what I have to do with hda-analyser.
Could you please clarify?

I also asked a guy on the arch forum if he has problems with his audio as well, and he said, that 4.3.3 (from arch testing) works well.

https://bbs.archlinux.org/viewtopic.php?pid=1590329#p1590329
Comment 23 Raymond 2015-12-31 16:11:55 UTC
If it work before, you need to perform git bisect to find out the regression commit

Your alsa info indicate that HP pin lost pin ctls value 0xc0 after power change from D3 to D0

https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/log/sound/pci/hda?qt=grep&q=power
Comment 24 Martin Schrodt 2015-12-31 19:47:01 UTC
Is there any documentation on how to do the bisect? I suppose I need to clone the tiwai sound branch and start bisecting? Can I do the bisect with my running kernel? Is there a way to do this without building the kernel 100 times?

Can I remove all sound related modules and reinsert the ones from the bisect without rebooting? 

Also, I do not understand what "lost pin ctls" means. 
Is the power change because of tlp maybe?
Comment 25 Raymond 2016-01-01 01:47:47 UTC
Pin-ctls: 0xc0: OUT HP Unsolicited: tag=01, enabled=1 
Power states: D0 D1 D2 D3 EPSS 
Power: setting=D3, actual=D3


This seem HP power state change to D3 when headphone is not plugged


Pin-ctls: 0x00: Unsolicited: tag=00, enabled=0 
Power states: D0 D1 D2 D3 EPSS 
Power: setting=D0, actual=D0


The pin ctls should be 0xc0 HP OUT and power state = D0

You can use hda verb or hda analyser to change pin ctls of node 0x21 from 0 to 0xc0
Comment 27 Martin Schrodt 2016-06-08 10:48:02 UTC
Just i quick note:

This was resolved today: A technician came by and installed a new sound daughterboard. Problems are gone now.
Comment 28 Silas Davis 2016-06-10 11:56:52 UTC
I have a similar issue with the Dell XPS 9550 (bios 1.02.00 - A06) I'm on Arch linux and sound used to work, I will try some older kernels to try and find regression.

However the behaviour I see is that on boot the ALC3266 is shown by aplay -l, but I have no output devices. If I plug headphones then the headphones and internal speaker appear, but no internal microphone. I can unplug and plug headphone as many times as I like and the speakers and headphones still work. But I never get the internal microphone or the headset microphone to appear.

Here is my alsa-info: http://www.alsa-project.org/db/?f=44431e25c90f800e39b5ed0738a9c40fa609ca80

Please let me know if there is anything I should try.
Comment 29 David Rosenstrauch 2018-11-07 21:20:46 UTC
FYI, this is still an issue on the XPS 15 9550.  (See https://bugs.archlinux.org/task/49157 and https://bugs.launchpad.net/ubuntu/+source/alsa-driver/+bug/1575078).  Is there any fix/workaround in the works for this issue?
Comment 30 Josh Holbrook 2019-02-17 23:46:21 UTC
Hi,

I wanted to report that, while I don't see this specific manifestation of issues with this sound card, I *am* still having issues on my XPS 15 9570. In my case, sound works reliably out of headphones but does not work out of the built-in speakers.

Most of the info I've collected, as well as the particulars of my environment, are attached to this stackexchange post: https://unix.stackexchange.com/questions/500981/sound-on-dell-xps-9570-only-works-on-headphones/501261#501261