Re: [alsa-devel] Asus N751JK - push/merge patches on mailinglist
2015-09-13 16:13 GMT+08:00 Takashi Iwai tiwai@suse.de:
On Sat, 12 Sep 2015 23:09:43 +0200, Arthur Borsboom wrote:
Hi Takashi,
Previous month Raymond Yau has done great work to get the audio working
for
the Asus N751JK laptop. He developed 7 patches, which I have tested and confirmed working on this laptop.
Raymond is not responding for about two weeks (maybe on holiday?). Would you mind to post these patches on the mailinglist (the correct way) and/or merge them in a way the get into the mainline kernel a.s.a.p?
Sorry, it can't be done like that. The patches aren't yet in acceptable forms, and it needs more changes to be merged to mainline. It must be done by someone who did it originally or who has the hardware and test.
I don't have the hardware, the alternate approach is to create headset jack (SND_JACK_HEADSET) and skip the creation of headset mic phanton jack instead of headphone jack and headset mic jack since implement sense_nid and slave_nid is not easy to debug
What you need is adding "Jack Headset" to pulseaudio analog-input-headset-mic.conf since "Headset Jack" kctl already in analog-out-headphones.conf
static int get_input_jack_type(struct hda_codec *codec, hda_nid_t nid) { + struct hda_gen_spec *spec = codec->spec; + struct auto_pin_cfg *cfg = &spec->autocfg; unsigned int def_conf = snd_hda_codec_get_pincfg(codec, nid); switch (get_defcfg_device(def_conf)) { case AC_JACK_LINE_OUT: case AC_JACK_SPEAKER: return SND_JACK_LINEOUT; case AC_JACK_HP_OUT: + if (spec->hs_mic_use_hp_sense && + (nid == auto_cfg_hp_pins(cfg)[0])) + return SND_JACK_HEADSET; return SND_JACK_HEADPHONE; case AC_JACK_SPDIF_OUT: case AC_JACK_DIG_OTHER_OUT:
const struct auto_pin_cfg *cfg) { const hda_nid_t *p; + struct hda_gen_spec *spec = codec->spec; int i, err;
for (i = 0; i < cfg->num_inputs; i++) { @@ -482,6 +499,12 @@ int snd_hda_jack_add_kctls(struct hda_codec *codec, err = add_jack_kctl(codec, cfg->inputs[i].pin, cfg, "Headphone Mic"); } else + if (cfg->inputs[i].is_headset_mic && + spec->hs_mic_use_hp_sense && + !is_jack_detectable(codec, cfg->inputs[i].pin)) { + err = 0; + + } else err = add_jack_kctl(codec, cfg->inputs[i].pin, cfg, NULL); if (err < 0) @@ -489,14 +512,21 @@ int snd_hda_jack_add_kctls(struct hda_codec *codec, }
for (i = 0, p = cfg->line_out_pins; i < cfg->line_outs; i++, p++) { - err = add_jack_kctl(codec, *p, cfg, NULL); + if (is_subwoofer(codec, *p, i, cfg->line_outs) && + is_external_pin(codec, *p)) + err = add_jack_kctl(codec, *p, cfg, "Ext Subwoofer"); + else + err = add_jack_kctl(codec, *p, cfg, NULL); if (err < 0) return err; } for (i = 0, p = cfg->hp_pins; i < cfg->hp_outs; i++, p++) { if (*p == *cfg->line_out_pins) /* might be duplicated */ break; - err = add_jack_kctl(codec, *p, cfg, NULL); + if (i == 0 && spec->hs_mic_use_hp_sense) + err = add_jack_kctl(codec, *p, cfg, "Headset"); + else + err = add_jack_kctl(codec, *p, cfg, NULL); if (err < 0) return err; }
change the pin to hp pin when mic pin is headset mic
+bool is_headset_mic(struct hda_codec *codec, hda_nid_t nid) +{ + struct hda_gen_spec *spec = codec->spec; + struct auto_pin_cfg *cfg = &spec->autocfg; + int i; + + for (i = 0; i < cfg->num_inputs; i++) + if (nid == cfg->inputs[i].pin) + return cfg->inputs[i].is_headset_mic; + return false; +} +
@@ -4384,6 +4399,8 @@ void snd_hda_gen_mic_autoswitch(struct hda_codec *codec, /* don't detect pins retasked as outputs */ if (snd_hda_codec_get_pin_target(codec, pin) & AC_PINCTL_OUT_EN) continue; + if (is_headset_mic(codec, pin) && spec->hs_mic_use_hp_sense) + pin = auto_cfg_hp_pins(cfg)[0]; if (snd_hda_jack_detect_state(codec, pin) == HDA_JACK_PRESENT) { mux_select(codec, 0, spec->am_entry[i].idx); return;
I do have the hardware including the headset (combo jack), headphones (single jack), microphone (single jack). Can you specify accurately what and how I need to test?
On 17 September 2015 at 11:24, Raymond Yau superquad.vortex2@gmail.com wrote:
2015-09-13 16:13 GMT+08:00 Takashi Iwai tiwai@suse.de:
On Sat, 12 Sep 2015 23:09:43 +0200, Arthur Borsboom wrote:
Hi Takashi,
Previous month Raymond Yau has done great work to get the audio working
for
the Asus N751JK laptop. He developed 7 patches, which I have tested and confirmed working on
this
laptop.
Raymond is not responding for about two weeks (maybe on holiday?). Would you mind to post these patches on the mailinglist (the correct
way)
and/or merge them in a way the get into the mainline kernel a.s.a.p?
Sorry, it can't be done like that. The patches aren't yet in acceptable forms, and it needs more changes to be merged to mainline. It must be done by someone who did it originally or who has the hardware and test.
I don't have the hardware, the alternate approach is to create headset jack (SND_JACK_HEADSET) and skip the creation of headset mic phanton jack instead of headphone jack and headset mic jack since implement sense_nid and slave_nid is not easy to debug
What you need is adding "Jack Headset" to pulseaudio analog-input-headset-mic.conf since "Headset Jack" kctl already in analog-out-headphones.conf
static int get_input_jack_type(struct hda_codec *codec, hda_nid_t nid) {
struct hda_gen_spec *spec = codec->spec;
struct auto_pin_cfg *cfg = &spec->autocfg; unsigned int def_conf = snd_hda_codec_get_pincfg(codec, nid); switch (get_defcfg_device(def_conf)) { case AC_JACK_LINE_OUT: case AC_JACK_SPEAKER: return SND_JACK_LINEOUT; case AC_JACK_HP_OUT:
if (spec->hs_mic_use_hp_sense &&
(nid == auto_cfg_hp_pins(cfg)[0]))
return SND_JACK_HEADSET; return SND_JACK_HEADPHONE;
case AC_JACK_SPDIF_OUT: case AC_JACK_DIG_OTHER_OUT:
const struct auto_pin_cfg *cfg)
{ const hda_nid_t *p;
struct hda_gen_spec *spec = codec->spec; int i, err;
for (i = 0; i < cfg->num_inputs; i++) {
@@ -482,6 +499,12 @@ int snd_hda_jack_add_kctls(struct hda_codec *codec, err = add_jack_kctl(codec, cfg->inputs[i].pin, cfg, "Headphone Mic"); } else
if (cfg->inputs[i].is_headset_mic &&
spec->hs_mic_use_hp_sense &&
!is_jack_detectable(codec, cfg->inputs[i].pin)) {
err = 0;
} else err = add_jack_kctl(codec, cfg->inputs[i].pin, cfg, NULL); if (err < 0)
@@ -489,14 +512,21 @@ int snd_hda_jack_add_kctls(struct hda_codec *codec, }
for (i = 0, p = cfg->line_out_pins; i < cfg->line_outs; i++, p++) {
err = add_jack_kctl(codec, *p, cfg, NULL);
if (is_subwoofer(codec, *p, i, cfg->line_outs) &&
is_external_pin(codec, *p))
err = add_jack_kctl(codec, *p, cfg, "Ext Subwoofer");
else
} for (i = 0, p = cfg->hp_pins; i < cfg->hp_outs; i++, p++) { if (*p == *cfg->line_out_pins) /* might be duplicated */ break;err = add_jack_kctl(codec, *p, cfg, NULL); if (err < 0) return err;
err = add_jack_kctl(codec, *p, cfg, NULL);
if (i == 0 && spec->hs_mic_use_hp_sense)
err = add_jack_kctl(codec, *p, cfg, "Headset");
else
}err = add_jack_kctl(codec, *p, cfg, NULL); if (err < 0) return err;
change the pin to hp pin when mic pin is headset mic
+bool is_headset_mic(struct hda_codec *codec, hda_nid_t nid) +{
- struct hda_gen_spec *spec = codec->spec;
- struct auto_pin_cfg *cfg = &spec->autocfg;
- int i;
- for (i = 0; i < cfg->num_inputs; i++)
if (nid == cfg->inputs[i].pin)
return cfg->inputs[i].is_headset_mic;
- return false;
+}
@@ -4384,6 +4399,8 @@ void snd_hda_gen_mic_autoswitch(struct hda_codec *codec, /* don't detect pins retasked as outputs */ if (snd_hda_codec_get_pin_target(codec, pin) & AC_PINCTL_OUT_EN) continue;
if (is_headset_mic(codec, pin) && spec->hs_mic_use_hp_sense)
pin = auto_cfg_hp_pins(cfg)[0]; if (snd_hda_jack_detect_state(codec, pin) == HDA_JACK_PRESENT) { mux_select(codec, 0, spec->am_entry[i].idx); return;
2015-9-17 下午5:29於 "Arthur Borsboom" arthurborsboom@gmail.com寫道:
I do have the hardware including the headset (combo jack), headphones
(single jack), microphone (single jack).
Can you specify accurately what and how I need to test?
I am not sure mic jack only mode really work with pulseaudio or not since there is no headphone jack and the aggressive power saving mode may power down hp path but the driver still need hp jack sense for the mic jack
Do the internal speaker still work when using mic jack only ?
As you suspected the internal speaker silences whenever I plug in any jack.
I have specified the alt_config option to test different possibilities, however it does not get accepted the way I specify it, which is in /etc/modprobe/alsa-base.conf
options snd_hda_intel alt_config=3 options snd_hda_codec_realtek alt_config=3
Both drivers reject the option with a message like this.
snd_hda_codec_realtek: unknown parameter 'alt_config' ignored
It the option nog working, or should I specify the option differently?
On 17 September 2015 at 12:09, Raymond Yau superquad.vortex2@gmail.com wrote:
2015-9-17 下午5:29於 "Arthur Borsboom" arthurborsboom@gmail.com寫道:
I do have the hardware including the headset (combo jack), headphones
(single jack), microphone (single jack).
Can you specify accurately what and how I need to test?
I am not sure mic jack only mode really work with pulseaudio or not since there is no headphone jack and the aggressive power saving mode may power down hp path but the driver still need hp jack sense for the mic jack
Do the internal speaker still work when using mic jack only ?
As you suspected the internal speaker silences whenever I plug in any
jack.
I have specified the alt_config option to test different possibilities,
however it does not get accepted the way I specify it, which is in /etc/modprobe/alsa-base.conf
options snd_hda_intel alt_config=3 options snd_hda_codec_realtek alt_config=3
alt_config is hint not any module parameter
module paramter is related to hda controller
You have to use early patching
https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/tree/Documentat...
Alright, I understand why it didn't work. However I will never use early-patching to set hints. Let's go back to testing without hints.
Without hints, the base speaker is working, the headset is working, the headphones are working and the automatic forward and backward switching is working. The only thing not working is the usage of a dedicated microphone, which is to me not relevant. For the rest it seems to be working nicely.
Is this good enough to push the patches on the mailinglist?
On 18 September 2015 at 10:18, Raymond Yau superquad.vortex2@gmail.com wrote:
As you suspected the internal speaker silences whenever I plug in any
jack.
I have specified the alt_config option to test different possibilities,
however it does not get accepted the way I specify it, which is in /etc/modprobe/alsa-base.conf
options snd_hda_intel alt_config=3 options snd_hda_codec_realtek alt_config=3
alt_config is hint not any module parameter
module paramter is related to hda controller
You have to use early patching
https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/tree/Documentat...
participants (2)
-
Arthur Borsboom
-
Raymond Yau