[alsa-devel] RfC / [PATCH] Jack sense support for Medion E4254

Takashi Iwai tiwai at suse.de
Mon Sep 16 23:55:50 CEST 2019


On Mon, 16 Sep 2019 10:38:07 +0200,
Jan-Marek Glogowski wrote:
> 
> Hi everybody,
> 
> I recently bought the laptop. It has one jack for attaching a headset. Jack
> sense is announced by the HDA config but not working. Except for some
> positioning, and color information, the PIN config seemed to be sensible, and
> everything I tried to override, didn't result in a working jack.
> 
> Manually unmuting the jack using hda-analyser resulted in working output, so
> generally the config seemed to work.
> 
> Reading the patch-realtek code, if found ALC256_FIXUP_ASUS_HEADSET_MODE, which
> somehow changed the pin 0x19 to be associated with the 0x21 headset out pin,
> resulting in this dmesg change:
> 
> -snd_hda_codec_realtek hdaudioC0D0:      Mic=0x19
> +snd_hda_codec_realtek hdaudioC0D0:      Headset Mic=0x19

What are the initial pin config values for these?

> And for whatever reason jack sense is now working, at least for some normal
> output-only headset (currently I don't have one included a mic with me, so
> actually can't test that mic volume works correctly).
> 
> I was just wondering, if my pin values are actually correct, because they still
> define different association, as I understand it, but the ASUS fix even works
> with these wrong channels /associations 2 and 4.
> 
> So the attached patch works for me, but I'm still wondering, if this is the
> correct solution. FWIW, jack sense works fine in Windows.
> 
> Anything I might be missing here?

I don't think anything wrong here, as long as your quirk actually
works.  I can double-check if I get alsa-info.sh output (run with
--no-upload option) with hda-emu, too.


thanks,

Takashi


> 
> Jan-Marek
> 
> -------
> 
> >From 0ccc5f07d8737690bd2df6d88a5af0f1f36d0e40 Mon Sep 17 00:00:00 2001
> From: Jan-Marek Glogowski <glogow at fbihome.de>
> Date: Sun, 15 Sep 2019 16:57:28 +0200
> Subject: [PATCH] ALSA: hda/realtek: PCI quirk for Medion E4254
> 
> The laptop has a combined jack to attach headsets on the right.
> The BIOS encodes them as two different colored jacks at the front,
> but otherwise it seems to be configured ok. But any adaption of
> the pins config on its own doesn't fix the jack detection to work
> in Linux. Still Windows works correct.
> 
> This is somehow fixed by chaining ALC256_FIXUP_ASUS_HEADSET_MODE,
> which seems to register the microphone jack as a headset part and
> also results in fixing jack sensing, visible in dmesg as:
> 
> -snd_hda_codec_realtek hdaudioC0D0:      Mic=0x19
> +snd_hda_codec_realtek hdaudioC0D0:      Headset Mic=0x19
> 
> Signed-off-by: Jan-Marek Glogowski <glogow at fbihome.de>
> ---
>  sound/pci/hda/patch_realtek.c | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
> index c1ddfd2fac52..448e0146dab2 100644
> --- a/sound/pci/hda/patch_realtek.c
> +++ b/sound/pci/hda/patch_realtek.c
> @@ -5800,6 +5800,7 @@ enum {
>  	ALC256_FIXUP_ASUS_MIC_NO_PRESENCE,
>  	ALC299_FIXUP_PREDATOR_SPK,
>  	ALC294_FIXUP_ASUS_INTSPK_HEADSET_MIC,
> +	ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE,
>  };
> 
>  static const struct hda_fixup alc269_fixups[] = {
> @@ -6850,6 +6851,16 @@ static const struct hda_fixup alc269_fixups[] = {
>  		.chained = true,
>  		.chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
>  	},
> +	[ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE] = {
> +		.type = HDA_FIXUP_PINS,
> +		.v.pins = (const struct hda_pintbl[]) {
> +			{ 0x19, 0x04a11040 },
> +			{ 0x21, 0x04211020 },
> +			{ }
> +		},
> +		.chained = true,
> +		.chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
> +	},
>  };
> 
>  static const struct snd_pci_quirk alc269_fixup_tbl[] = {
> @@ -7113,6 +7124,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
>  	SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD),
>  	SND_PCI_QUIRK(0x19e5, 0x3204, "Huawei MACH-WX9", ALC256_FIXUP_HUAWEI_MACH_WX9_PINS),
>  	SND_PCI_QUIRK(0x1b7d, 0xa831, "Ordissimo EVE2 ", ALC269VB_FIXUP_ORDISSIMO_EVE2), /* Also known as Malata PC-B1303 */
> +	SND_PCI_QUIRK(0x10ec, 0x118c, "Medion EE4254 MD62100", ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE),
> 
>  #if 0
>  	/* Below is a quirk table taken from the old code.
> @@ -7280,6 +7292,7 @@ static const struct hda_model_fixup alc269_fixup_models[] = {
>  	{.id = ALC225_FIXUP_HEADSET_JACK, .name = "alc-headset-jack"},
>  	{.id = ALC295_FIXUP_CHROME_BOOK, .name = "alc-chrome-book"},
>  	{.id = ALC299_FIXUP_PREDATOR_SPK, .name = "predator-spk"},
> +	{.id = ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE, .name = "alc256-medion-headset"},
>  	{}
>  };
>  #define ALC225_STANDARD_PINS \
> -- 
> 2.20.1
> 


More information about the Alsa-devel mailing list