[alsa-devel] Clevo P170HM / Sager NP8170 audio
Raymond Yau
superquad.vortex2 at gmail.com
Fri Dec 2 01:52:40 CET 2011
2011/12/2 Julian Sikorski <belegdol at gmail.com>:
>>>>> There is a bug in hda-emu which cannot detect two playback switches
>>>>> "Front" and "Side" create at same switch pin
>>>>>
>>>>> Try add the following to dump the value of switch pin
>>>>>
>>>>> In function alc_auto_create_multi_out_ctls()
>>>>>
>>>>>
>>>>> + printk(KERN_INFO "%s playback volume %x pin %x\n",name,vol,pin);
>>>>> err = alc_auto_add_stereo_vol(codec, name, index, vol);
>>>>> if (err < 0)
>>>>> return err;
>>>>> + printk(KERN_INFO "%s playback switch %x\n",name,sw);
>>>>> err = alc_auto_add_stereo_sw(codec, name, index, sw);
>>>>> if (err < 0)
>>>>> return err;
>>>>
>>>> This is what is shown in /var/log/messages:
>>>>
>>>> Nov 28 11:59:27 snowball2 kernel: [ 19.156689] Front playback volume 2
>>>> pin 14
>>>> Nov 28 11:59:27 snowball2 kernel: [ 19.156695] Front playback switch 14
Node 0x14 [Pin Complex] wcaps 0x40058d: Stereo Amp-Out
Control: name="Front 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: [0x00 0x00]
Pincap 0x0001003e: IN OUT HP EAPD Detect Trigger
EAPD 0x2: EAPD
Pin Default 0x99130110: [Fixed] Speaker at Int ATAPI
Conn = ATAPI, Color = Unknown
DefAssociation = 0x1, Sequence = 0x0
Misc = NO_PRESENCE
Pin-ctls: 0x40: OUT
Unsolicited: tag=00, enabled=0
Power states: D0 D1 D2 D3
Power: setting=D0, actual=D0
>>>> Nov 28 11:59:27 snowball2 kernel: [ 19.156789] Surround playback
>>>> volume 3 pin 1a
>>>> Nov 28 11:59:27 snowball2 kernel: [ 19.156794] Surround playback switch 1a
>>>> Nov 28 11:59:27 snowball2 kernel: [ 19.156956] Side playback volume 5
>>>> pin 17
>>>> Nov 28 11:59:27 snowball2 kernel: [ 19.156960] Side playback switch 17
>>>>
Node 0x17 [Pin Complex] wcaps 0x40058d: Stereo Amp-Out
Control: name="Side Playback Switch", index=0, device=0
ControlAmp: chs=3, dir=Out, idx=0, ofs=0
Control: name="Line-Out Jack", index=0, device=0
Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1
Amp-Out vals: [0x00 0x00]
Pincap 0x00000036: IN OUT Detect Trigger
Pin Default 0x01011013: [Jack] Line Out at Ext Rear
Conn = 1/8, Color = Black
DefAssociation = 0x1, Sequence = 0x3
Pin-ctls: 0x40: OUT
Unsolicited: tag=02, enabled=1
Power states: D0 D1 D2 D3
Power: setting=D0, actual=D0
Connection: 1
0x0f
>>>>>
>>>>>>>>>>>>> Plug the front speaker cables into the Headphone-Out Jack.
>>>>>>>>>>>>>
>>>>>>>>>>>>> • Line-In Jack = Rear Speaker Out
>>>>>>>>>>>>> • Microphone-In Jack = Center/Subwoofer Speaker Out
>>>>>>>>>>>>> • S/PDIF-Out Jack = Side Speaker Out (for 7.1 Surround Sound Only)
>>>>>
>>>>>
>>>>> Method 1) HP Playback volume for HP jack and Speaker Playback Volume
>>>>>
>>>>>
>>>>> fix the "Side Playback Switch" and "Front playback Switch"
>>>>>
>>>>> In function alc_auto_create_multi_out_ctls()
>>>>>
>>>>> else
>>>>> - pin = cfg->line_out_pins[i];
>>>>> + if (cfg->speaker_pins[0] &&
>>>>> + get_defcfg_location(snd_hda_codec_get_pincfg(codec, cfg->hp_pins[0])) ==
>>>>> get_defcfg_location(snd_hda_codec_get_pincfg(codec, cfg->line_out_pins[0])))
>>>>> + pin = cfg->speaker_pins[0];
>>>>> + else
>>>>> + pin = cfg->line_out_pins[i];
>>>>>
>>>>> add "Headpone Playback Volume" by using dac 0x25
>>>>>
>>>>> In function alc_auto_fill_dac_nids() and the end of previous patch in
>>>>> previous email
>>>>>
>>>>> spec->multi_ios++;
>>>>> spec->multiout.num_dacs++;
>>>>> }
>>>>> + spec->multiout.hp_out_nid[0] = alc_auto_look_for_dac(codec, cfg->hp_pins[0]);
>>>>> return 0;
>>>>>
>>>>>
>>>>>>>>>>>>> • S/PDIF-Out Jack = Side Speaker Out (for 7.1 Surround Sound Only)
>>>>>
>>>>> assign dac spec->alt_dac_nid for creating alt playback device
>>>>>
>>>>> aplay -Dhw:0,2 any.wav
>>>>>
>>>>> Try either a) or b) but not both
>>>>> a) use "side jack" for "alt playback" but device 2 be disabled when
>>>>> channel mode is 8ch
>>>>>
>>>>> In function alc_auto_fill_dac_nids()
>>>>>
>>>>> + spec->alt_dac_nid = spec->private_dac_nids[3];
>>>>> return 0;
>>>>>
>>>>> in function alc_set_multi_io()
>>>>>
>>>>>
>>>>> } else {
>>>>> + if ( i < 2 ) {
>>>>> - if (get_wcaps(codec, nid) & AC_WCAP_OUT_AMP)
>>>>> snd_hda_codec_amp_stereo(codec, nid, HDA_OUTPUT, 0,
>>>>> HDA_AMP_MUTE, HDA_AMP_MUTE);
>>>>> - snd_hda_codec_update_cache(codec, nid, 0,
>>>>> AC_VERB_SET_PIN_WIDGET_CONTROL,
>>>>> spec->multi_io[idx].ctl_in);
>>>>>
>>>>> + if (get_wcaps(codec, nid) & AC_WCAP_OUT_AMP)
>>>>> snd_hda_codec_amp_stereo(codec, nid, HDA_OUTPUT, 0,
>>>>> HDA_AMP_MUTE, HDA_AMP_MUTE);
>>>>> + snd_hda_codec_update_cache(codec, nid, 0,
>>>>> AC_VERB_SET_PIN_WIDGET_CONTROL,
>>>>> spec->multi_io[idx].ctl_in);
>>>>> + }
>>>>>
>>>>
>>>> With the above version and everything is almost perfect:
>>>>
>>>> http://www.alsa-project.org/db/?f=35d300b2eaec79699ec37febc6321687a894be50
>>>>
>>>> * mute for side channel is present and functions correctly
>>>> * auto-mute situation is unchanged, but I don't think it matters
>>>> * speaker/HP controls are much neater
>>>> - front mute and slider control the internal speakers
>>>> - headphone mute and slider control the headphone jack
>>>>
>>>> The only nitpick would be that the alt device does not work:
>>>
>>
>> I tried 0001-Add-Multistreaming-Playback-using-Front-Panel-Headph.patch,
>> but unfortunately it does not apply on top of current kernels anymore,
>> and it is not trivial enough for me to fix.
>> Anyway, in my opinion it does not make a lot of sense, as the jacks are
>> 2 cm away from each other and I don't see a use case where someone would
>> want to play a different sound on each of them.
>>
Pincap 0x00000036: IN OUT Detect Trigger
Pin Default 0x01011013: [Jack] Line Out at Ext Rear
As the pincaps of "side" jack does not support HP, so it cannot used
as dual headphone
it is strange that alt_device cannot be create if you have assign a
valid dac to spec->alt_dac_nid
>>>>
>>>> $ aplay -l
>>>> **** List of PLAYBACK Hardware Devices ****
>>>> card 0: PCH [HDA Intel PCH], device 0: ALC892 Analog [ALC892 Analog]
>>>> Subdevices: 1/1
>>>> Subdevice #0: subdevice #0
>>>> card 0: PCH [HDA Intel PCH], device 1: ALC892 Digital [ALC892 Digital]
>>>> Subdevices: 1/1
>>>> Subdevice #0: subdevice #0
>>>> card 1: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0]
>>>> Subdevices: 1/1
>>>> Subdevice #0: subdevice #0
>>>> card 1: NVidia [HDA NVidia], device 7: HDMI 0 [HDMI 0]
>>>> Subdevices: 1/1
>>>> Subdevice #0: subdevice #0
>>>> card 1: NVidia [HDA NVidia], device 8: HDMI 0 [HDMI 0]
>>>> Subdevices: 1/1
>>>> Subdevice #0: subdevice #0
>>>> card 1: NVidia [HDA NVidia], device 9: HDMI 0 [HDMI 0]
>>>> Subdevices: 1/1
>>>> Subdevice #0: subdevice #0
>>>>
How many hdmi connectors on your nvidia ?
More information about the Alsa-devel
mailing list