Created attachment 120721 [details] alsa-info.sh in kernel ok (3.11.6) I have a problem with the kernel 3.12 and the sound card. With 3.11.6 and no model set: - All ok. There is PCM in mixer and when plugging headphones, the laptop speakers turn off and sound comes out of the headphones. When unplugging headphones, the laptop speakers turn back on. With 3.12.* or 3.11 and model set (any model): - with or without headphones sound comes out of the laptop speakers and there is no sound in the headphones. PCM is not present in mixer and the sound is low. Taking evidence by putting the options file HD-Audio-Models.txt, I have found that even with the 3.11 the same thing happens, setting any option on my sound card. With modprobe file empty it's all ok. Sorry for my bad english Thanks
you have to post the output of alsa-info.sh in 3.12 diff -u working_info and non_working_info using hda-emu it seem that Front Mix Amp is muted Node 0x11 [Audio Selector] wcaps 0x30010d: Stereo Amp-Out Amp-Out caps: ofs=0x17, nsteps=0x1f, stepsize=0x05, mute=1 Amp-Out vals: [0x80 0x80] Connection: 1 0x03
Attachment files. hda-emu does not compile Making all in kernel make[1]: Entering directory `/tmp/hda-emu/kernel' CC hda_codec.o hda_codec.c:37:22: fatal error: hda_jack.h: File o directory non esistente #include "hda_jack.h" ^ compilation terminated. make[1]: *** [hda_codec.o] Errore 1 make[1]: Leaving directory `/tmp/hda-emu/kernel' make: *** [all-recursive] Errore 1 but the file is present in the same directory of hda_codec.c and other files. I can not fix
Created attachment 120831 [details] alsa-info.sh in kernel ok (3.11.6) today
Created attachment 120841 [details] alsa-info.sh in kernel KO (3.12.6) today
Created attachment 120851 [details] Diff from alsa-info.sh 3.11 and 3.12
ad1981 only has one audio output node 0x03 and does not support alt analog device APLAY **** List of PLAYBACK Hardware Devices **** card 0: Intel [HDA Intel], device 0: AD1981 Analog [AD1981 Analog] Subdevices: 1/1 Subdevice #0: subdevice #0 card 0: Intel [HDA Intel], device 2: AD1981 Alt Analog [AD1981 Alt Analog] Subdevices: 1/1 Subdevice #0: subdevice #0 @@ -170,1 +175,1 @@ - 0x03 0x0e* --- + 0x03* 0x0e the main difference is the headphone and speaker directly connected to audio output instead of front amp mixer does it work when you enable loopback mixing ? Simple mixer control 'Loopback Mixing',0 Capabilities: enum Items: 'Disabled' 'Enabled' Item0: 'Disabled'
hda_codec_setup_stream is called twice in kernel 3.12 > hda-emu does not compile you need to specify the directory of hda driver source configure --with-hdadir for 3.11 > PCM 0 p 44100 2 16 Open PCM AD198x Analog for play Available PCM parameters: channels: 2/2 formats: S16_LE S32_LE rates: 8000 11025 16000 22050 32000 44100 48000 Prepare PCM, rate=44100, channels=2, format=16 bits PCM format_val = 0x4011 hda_codec_setup_stream: NID=0x3, stream=0x1, channel=0, format=0x4011 send: NID=0x3, VERB=0xf06(get_channel_streamid), PARM=0x0 receive: 0x0 send: NID=0x3, VERB=0x706(set_channel_streamid), PARM=0x10 send: NID=0x3, VERB=0xa00(get_stream_format), PARM=0x0 receive: 0x0 send: NID=0x3, VERB=0x240(set_stream_format), PARM=0x11 PCM Clean up hda_codec_cleanup_stream: NID=0x3 send: NID=0x3, VERB=0x706(set_channel_streamid), PARM=0x0 send: NID=0x3, VERB=0x200(set_stream_format), PARM=0x0 Close PCM for 3.12 >PCM 0 p 44100 2 16 Open PCM AD1981 Analog for play Available PCM parameters: channels: 2/2 formats: S16_LE S32_LE rates: 8000 11025 16000 22050 32000 44100 48000 Prepare PCM, rate=44100, channels=2, format=16 bits PCM format_val = 0x4011 hda_codec_setup_stream: NID=0x3, stream=0x1, channel=0, format=0x4011 send: NID=0x3, VERB=0xf06(get_channel_streamid), PARM=0x0 receive: 0x0 send: NID=0x3, VERB=0x706(set_channel_streamid), PARM=0x10 send: NID=0x3, VERB=0xa00(get_stream_format), PARM=0x0 receive: 0x0 send: NID=0x3, VERB=0x240(set_stream_format), PARM=0x11 hda_codec_setup_stream: NID=0x3, stream=0x1, channel=0, format=0x4011 PCM Clean up hda_codec_cleanup_stream: NID=0x3 send: NID=0x3, VERB=0x706(set_channel_streamid), PARM=0x0 send: NID=0x3, VERB=0x200(set_stream_format), PARM=0x0 hda_codec_cleanup_stream: NID=0x3 Close PCM
(In reply to Raymond from comment #7) > hda_codec_setup_stream is called twice in kernel 3.12 > > > > hda-emu does not compile > > you need to specify the directory of hda driver source > > configure --with-hdadir yes, I did ./configure --with-hdadir=/usr/src/linux-3.12.6/sound/pci/hda
Amp-Out vals: [0x80 0x80] are muted for both headphone and speaker use hda-analyzer to unmute Node 0x05 [Pin Complex] wcaps 0x400187: Stereo Amp-In Amp-Out Control: name="Speaker Playback Volume", index=0, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Control: name="Speaker Playback Switch", index=0, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Control: name="Speaker Phantom Jack", index=0, device=0 Amp-In caps: ofs=0x00, nsteps=0x03, stepsize=0x27, mute=0 Amp-In vals: [0x00 0x00] Amp-Out caps: ofs=0x3d, nsteps=0x3f, stepsize=0x05, mute=1 Amp-Out vals: [0x80 0x80] Pincap 0x0001173f: IN OUT HP EAPD Detect Trigger ImpSense Vref caps: HIZ 50 GRD 80 EAPD 0x2: EAPD Pin Default 0x92174110: [Fixed] Speaker at Int Front Conn = Analog, Color = Green DefAssociation = 0x1, Sequence = 0x0 Misc = NO_PRESENCE Pin-ctls: 0x40: OUT VREF_HIZ Unsolicited: tag=00, enabled=0 Connection: 2 0x03* 0x0e Node 0x06 [Pin Complex] wcaps 0x400185: Stereo Amp-Out Control: name="Headphone Playback Volume", index=0, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Control: name="Headphone Playback Switch", index=0, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Control: name="Headphone Jack", index=0, device=0 Amp-Out caps: ofs=0x3d, nsteps=0x3f, stepsize=0x05, mute=1 Amp-Out vals: [0x80 0x80] Pincap 0x0000001f: OUT HP Detect Trigger ImpSense Pin Default 0x0321201f: [Jack] HP Out at Ext Left Conn = 1/8, Color = Grey DefAssociation = 0x1, Sequence = 0xf Pin-ctls: 0xc0: OUT HP Unsolicited: tag=01, enabled=1 Connection: 2 0x03* 0x0e
alt analog device should not be created when hda codec only has one Audio Output bug in function indep_hp_possible() https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/commit/sound/pci/hda/hda_generic.c?id=55a63d4da3b8850480a1c5b222f77c739e30e346
(In reply to Raymond from comment #9) > Amp-Out vals: [0x80 0x80] are muted for both headphone and speaker > > use hda-analyzer to unmute > > # python hda-analyzer.py Using temporary directory: /dev/shm/hda-analyzer You may remove this directory when finished or if you like to download the most recent copy of hda-analyzer tool. File cached /dev/shm/hda-analyzer/hda_analyzer.py File cached /dev/shm/hda-analyzer/hda_guilib.py File cached /dev/shm/hda-analyzer/hda_codec.py File cached /dev/shm/hda-analyzer/hda_proc.py File cached /dev/shm/hda-analyzer/hda_graph.py File cached /dev/shm/hda-analyzer/hda_mixer.py Downloaded all files, executing hda_analyzer.py Traceback (most recent call last): File "/dev/shm/hda-analyzer/hda_analyzer.py", line 546, in <module> sys.exit(main(sys.argv)) File "/dev/shm/hda-analyzer/hda_analyzer.py", line 523, in main if read_nodes(sys.argv[1:]) == 0: File "/dev/shm/hda-analyzer/hda_analyzer.py", line 89, in read_nodes read_nodes2(c.card, i) File "/dev/shm/hda-analyzer/hda_analyzer.py", line 60, in read_nodes2 c = HDACodec(card, codec) File "/dev/shm/hda-analyzer/hda_codec.py", line 1041, in __init__ self.parse_proc() File "/dev/shm/hda-analyzer/hda_codec.py", line 1140, in parse_proc self.proc_codec = HDACodecProc(self.card, self.device, file) File "/dev/shm/hda-analyzer/hda_proc.py", line 479, in __init__ self.parse(proc_file) File "/dev/shm/hda-analyzer/hda_proc.py", line 667, in parse node.add_device(line[10:]) File "/dev/shm/hda-analyzer/hda_proc.py", line 265, in add_device self.wrongfile('more than one PCM device?') File "/dev/shm/hda-analyzer/hda_proc.py", line 143, in wrongfile raise ValueError, "wrong proc file format (%s)" % msg ValueError: wrong proc file format (more than one PCM device?) instead with the kernel 3:11 the program works correctly
(In reply to Raymond from comment #10) > alt analog device should not be created when hda codec only has one Audio > Output > > bug in function indep_hp_possible() > > https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/commit/sound/ > pci/hda/hda_generic.c?id=55a63d4da3b8850480a1c5b222f77c739e30e346 This patch is already in the kernel? To which version? Testing it gives me this: # patch -p1 -i 55a63d4da3b8850480a1c5b222f77c739e30e346.patch patching file sound/pci/hda/hda_generic.c Hunk #1 FAILED at 995. Hunk #2 succeeded at 1524 with fuzz 1 (offset 132 lines). Hunk #3 succeeded at 1720 with fuzz 2 (offset 138 lines). Hunk #4 succeeded at 1940 with fuzz 2 (offset 142 lines). 1 out of 4 hunks FAILED -- saving rejects to file sound/pci/hda/hda_generic.c.rej and then CC [M] sound/pci/hda/hda_generic.o sound/pci/hda/hda_generic.c:1528:13: error: redefinition of ‘indep_hp_possible’ static bool indep_hp_possible(struct hda_codec *codec) ^ sound/pci/hda/hda_generic.c:1491:13: note: previous definition of ‘indep_hp_possible’ was here static bool indep_hp_possible(struct hda_codec *codec) ^ sound/pci/hda/hda_generic.c:1491:13: warning: ‘indep_hp_possible’ defined but not used [-Wunused-function] make[3]: *** [sound/pci/hda/hda_generic.o] Errore 1 make[2]: *** [sound/pci/hda] Errore 2 make[1]: *** [sound/pci] Errore 2 make: *** [sound] Errore 2
the patch did not fix the problem since the function should check the number of DAC https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/plain/Documentation/sound/alsa/HD-Audio.txt you can use hint to disable independent hp by early patching indep_hp = 0
do your notebook really have Line in jack ? Node 0x09 [Pin Complex] wcaps 0x400187: Stereo Amp-In Amp-Out Amp-In caps: ofs=0x00, nsteps=0x03, stepsize=0x27, mute=0 Amp-In vals: [0x00 0x00] Amp-Out caps: ofs=0x3d, nsteps=0x3f, stepsize=0x05, mute=1 Amp-Out vals: [0xbf 0xbf] Pincap 0x00001737: IN OUT Detect Trigger ImpSense Vref caps: HIZ 50 GRD 80 Pin Default 0x0181302e: [Jack] Line In at Ext Rear Conn = 1/8, Color = Blue DefAssociation = 0x2, Sequence = 0xe Pin-ctls: 0x20: IN VREF_HIZ Unsolicited: tag=00, enabled=0 Connection: 2 0x03* 0x0e
(In reply to Raymond from comment #13) > the patch did not fix the problem since the function should check the number > of DAC > > > https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/plain/ > Documentation/sound/alsa/HD-Audio.txt > > you can use hint to disable independent hp by early patching > > > indep_hp = 0 oh yes, with indep_hp = 0 it's ok in 3.12 thanks So it is a bug in the 3.12 kernel code? After I try also with the kernel 3.11 and the option indep_hp = 0. Now I testing only 3.12 with this option
https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/commit/?id=bd450dcc357646cc277c560ab24b35f940efa585 it is a regression of this patch you have to fixup node 0x09 if your laptop does not have line in Jack to reenable auto mic
(In reply to Raymond from comment #16) > https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/commit/ > ?id=bd450dcc357646cc277c560ab24b35f940efa585 > > it is a regression of this patch > > you have to fixup node 0x09 if your laptop does not have line in Jack to > reenable auto mic thanks
The patch below will be merged to sound git tree.
Created attachment 121801 [details] Disable indep_hp for AD1981
(In reply to Takashi Iwai from comment #19) > Created attachment 121801 [details] > Disable indep_hp for AD1981 I'm sorry for the delay. I tested today with the patch and it works. Thanks
OK, thanks for confirmation.
I'm still facing a similar pb with internal mic with this coded on 3.13(hp 6710b, Vendor Id: 0x11d41981, Subsystem Id: 0x103c30c0, Revision Id: 0x100200). When I'm trying to record from imic I get highly-amplified white noise. In amixer I see that external mic is enabled while internal mic is not. I don't have any external mic to try though. Dichotomy lead to guilty commit bd450dcc3 which was mentioned here so I belive I lack some quirk. Do you want me to provide some logs? Thanks.
do the notebook really have Line in or just dock mic ? control.9 { iface MIXER name 'Capture Source' value Mic comment { access 'read write' type ENUMERATED count 1 item.0 Mic item.1 'Dock Mic' item.2 Mix } } node 0xc Microphone Mixer Allows selective mixing of the front/rear microphone sources to a single combined signal. Node 0x0c [Audio Mixer] wcaps 0x200101: Stereo Connection: 2 0x1e 0x1f node 0xe Analog Mixer Selectively mixes analog input signals into a single signal. Node 0x0e [Audio Mixer] wcaps 0x200101: Stereo Connection: 8 0x0d 0x11 0x12 0x13 0x1a 0x1b 0x1c 0x1d node 0x15 Record Selector Chooses which signal is recorded by the record ADC. Also contains the record gain controls. Node 0x15 [Audio Selector] wcaps 0x30010d: Stereo Amp-Out Control: name="Capture Volume", index=0, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Control: name="Capture Switch", index=0, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Amp-Out caps: ofs=0x00, nsteps=0x0f, stepsize=0x05, mute=1 Amp-Out vals: [0x08 0x08] Connection: 8 0x0c 0x09 0x0e 0x0f 0x19 0x05 0x18* 0x17 control.14 { iface MIXER name 'Capture Source' value 'Internal Mic' comment { access 'read write' type ENUMERATED count 1 item.0 Mic item.1 'Internal Mic' item.2 Line } } input path: depth=5 :08:1e:0c:15:04 input path: depth=3 :18:15:04 input path: depth=3 :09:15:04 input path: depth=3 :0e:15:04
you have to post the output of alsa-info.sh capture volume and all boost only have gain are you using pulseaudio ?
-/* toggle input of built-in and mic jack appropriately */ -static void ad1981_hp_automic(struct hda_codec *codec) -{ - static const struct hda_verb mic_jack_on[] = { - {0x1f, AC_VERB_SET_AMP_GAIN_MUTE, 0xb080}, - {0x1e, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000}, - {} - }; - static const struct hda_verb mic_jack_off[] = { - {0x1e, AC_VERB_SET_AMP_GAIN_MUTE, 0xb080}, - {0x1f, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000}, - {} - }; - unsigned int present; - - present = snd_hda_jack_detect(codec, 0x08); - if (present) - snd_hda_sequence_write(codec, mic_jack_on); - else - snd_hda_sequence_write(codec, mic_jack_off); -} - -static const struct hda_input_mux ad1981_hp_capture_source = { - .num_items = 3, - .items = { - { "Mic", 0x0 }, - { "Dock Mic", 0x1 }, - { "Mix", 0x2 }, - }, -}; - the previous code use Mic mixer, analog mixer and assume node 0x09 is dock mic
Created attachment 124281 [details] alsa-info output on hp6710b Yes, there is a line-in in this laptop. I'm not using pulseaudio. Currently I'm running vanilla 3.13+patch mentioned in the comment #19(which does not make any difference).
function ad1981_hp_automic() was used to mute the mic/internal mic input into microphone mixer but the capture source is used to select input source from mic mixer, line in and analog mixer 1E Front Microphone Mute Audio selector Mute control for Port B (front microphone) into microphone mixer. 1F Rear Microphone Mute 3 Audio selector Mute control for Port F (rear microphone) into the microphone mixer. mix can be added back using Hint by early patching add_stereo_mix_input = 1 the current implementation does not mute the node 0x1e and node 0x1f when mic/internal mic is not used Node 0x1e [Audio Selector] wcaps 0x30010d: Stereo Amp-Out Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1 Amp-Out vals: [0x00 0x00] Connection: 1 0x08 Node 0x1f [Audio Selector] wcaps 0x30010d: Stereo Amp-Out Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1 Amp-Out vals: [0x80 0x80] Connection: 1 0x18 the driver did not know node 0x1e and node 0x1f are the input mute switch of the mic mixer node 0x1c
I had tried early patching but it didn't help(I verified that the patch was applied).
the driver still miss the code which mute the front mic mute and rear mic mute when capture source was changed static const struct hda_verb mic_jack_on[] = { - {0x1f, AC_VERB_SET_AMP_GAIN_MUTE, 0xb080}, - {0x1e, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000}, - {} - }; - static const struct hda_verb mic_jack_off[] = { - {0x1e, AC_VERB_SET_AMP_GAIN_MUTE, 0xb080}, - {0x1f, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000}, - {} - };
you can use hda-analyzer or hda-verb to mute/unmute node 0x1e and 0x1f
node 0x14 Analog Power-Down Power widget Power control on the analog mixer and associated amplifiers. the windows driver setup this power widget
Hi Raymond, I have tried following patch and now I can get the capture from the internal mic. Though the levels are not correct and seems like the wrong gains are used. Maybe I'll try to get a diff of hwdeps between 3.11 and 3.13 ... Patch: [verb] 0x1e 0x300 0xb080 0x1f 0x300 0xb000
it is because Mic mixer in the first entry in the connection list and node 0x18 and node 0x09 are also in the list input path: depth=5 :08:1e:0c:15:04 input path: depth=3 :18:15:04 input path: depth=3 :09:15:04 input path: depth=3 :0e:15:04 Node 0x15 [Audio Selector] wcaps 0x30010d: Stereo Amp-Out Control: name="Capture Volume", index=0, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Control: name="Capture Switch", index=0, device=0 ControlAmp: chs=3, dir=Out, idx=0, ofs=0 Amp-Out caps: ofs=0x00, nsteps=0x0f, stepsize=0x05, mute=1 Amp-Out vals: [0x0c 0x0c] Connection: 8 0x0c* 0x09 0x0e 0x0f 0x19 0x05 0x18 0x17
Yes, basically I had to enable internal mic manually in alsamixer. Honestly I didn't know that I can do that with <space>. Facepalm. Thanks for your help!