Bug 195775

Summary: Headphone not working on ALC299
Product: Drivers Reporter: Arek Burdach (arek.burdach)
Component: Sound(ALSA)Assignee: Jaroslav Kysela (perex)
Status: RESOLVED CODE_FIX    
Severity: normal CC: tiwai
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 4.12.0-rc1 Subsystem:
Regression: Yes Bisected commit-id:
Attachments: dmesg
amixer controls output
Alsa mixer info for correctly working kernel
Alsa mixer info for 4.12-rc1
Alsa mixer info for 4.12-rc1 with disabled CONFIG_SND_HDA_INPUT_BEEP
Test fix

Description Arek Burdach 2017-05-15 20:35:51 UTC
Created attachment 256541 [details]
dmesg

After plugging-in headphone jack, there is no sound. I've investigated that the problem is in Beep Playback codec (see logs of amixer controls result). After recompiling modules: snd-hda-codec, snd-hda-codec-generic and snd-hda-codec-realtek with disabled CONFIG_SND_HDA_INPUT_BEEP mode, everything works ok. This is a regression bug, because ubuntu kernel (4.10.0-20-generic) with this mode turned on works good.
Comment 1 Arek Burdach 2017-05-15 20:40:29 UTC
Created attachment 256543 [details]
amixer controls output

Most interesting is the end of file:

numid=18,iface=MIXER,name='Beep Playback Switch'

amixer: Control default snd_hctl_elem_info error: Invalid argument
Comment 2 Takashi Iwai 2017-05-16 05:24:59 UTC
Regression since which kernel version?  Please give alsa-info.sh outputs on both working and non-working kernels.  Run the script with --no-upload option and attach the outputs to Bugzilla (don't paste).
Comment 3 Arek Burdach 2017-05-16 05:36:12 UTC
Created attachment 256555 [details]
Alsa mixer info for correctly working kernel
Comment 4 Arek Burdach 2017-05-16 05:39:26 UTC
Created attachment 256557 [details]
Alsa mixer info for 4.12-rc1

During alsa-info invocation I've got:

> /usr/sbin/alsactl: get_control:247: Cannot read control info '2,0,0,Beep
> Playback Volume,0': Invalid argument
> cat: /tmp/alsa-info.a2rAnfcIyQ/alsactl.tmp: No such file or directory
> 
> Your ALSA information is in /tmp/alsa-info.txt.BjqnrFmndN

So I assume that it can be cut off
Comment 5 Arek Burdach 2017-05-16 05:40:23 UTC
Created attachment 256559 [details]
Alsa mixer info for 4.12-rc1 with disabled CONFIG_SND_HDA_INPUT_BEEP
Comment 6 Arek Burdach 2017-05-16 05:41:36 UTC
(In reply to Takashi Iwai from comment #2)
> Regression since which kernel version? 

As I wrote in description, since 4.10.0
Comment 7 Takashi Iwai 2017-05-16 06:06:16 UTC
It looks like that ALC299 has no loopback mixer while the driver tries to set.
Could you try the patch below?
Comment 8 Takashi Iwai 2017-05-16 06:06:48 UTC
Created attachment 256561 [details]
Test fix
Comment 9 Arek Burdach 2017-05-16 07:02:04 UTC
Indeed it helped. Thank you for a quick response and fix!
Comment 10 Takashi Iwai 2017-05-16 07:16:40 UTC
Thanks for a quick test!  I submitted the fix patch now to upstream.
It'll be merged to 4.12-rc2 and backported to stable kernels eventually.