[alsa-devel] [PATCH] ALSA: hda - Add quirk and model 'vaio' for ALC269-based Sony Vaio E Series
Vaio E Series laptops need a slightly modified config for their ALC269. This patch adds a new 'vaio' model, plus initial quirk for them. It fixes alsa-bugs #4941, #4934 and #4945
Signed-off-by: Luca Bruno lucab@debian.org --- Documentation/sound/alsa/HD-Audio-Models.txt | 1 + sound/pci/hda/patch_realtek.c | 24 +++++++++++++++++++++++- 2 files changed, 24 insertions(+), 1 deletions(-)
diff --git a/Documentation/sound/alsa/HD-Audio-Models.txt b/Documentation/sound/alsa/HD-Audio-Models.txt index 1d38b0d..416f1f5 100644 --- a/Documentation/sound/alsa/HD-Audio-Models.txt +++ b/Documentation/sound/alsa/HD-Audio-Models.txt @@ -87,6 +87,7 @@ ALC269 eeepc-p901 ASUS Eeepc P901 S101 fujitsu FSC Amilo lifebook Fujitsu Lifebook S6420 + vaio Sony Vaio (E Series) auto auto-config reading BIOS (default)
ALC662/663/272 diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 22b7c94..c2b78a1 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -137,6 +137,7 @@ enum { ALC269VB_DMIC, ALC269_FUJITSU, ALC269_LIFEBOOK, + ALC269_VAIO, ALC269_AUTO, ALC269_MODEL_LAST /* last tag */ }; @@ -13546,6 +13547,11 @@ static struct hda_verb alc269_quanta_fl1_verbs[] = { { } };
+static struct hda_verb alc269_vaio_verbs[] = { + {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREFGRD}, + { } +}; + static struct hda_verb alc269_lifebook_verbs[] = { {0x15, AC_VERB_SET_CONNECT_SEL, 0x01}, {0x1a, AC_VERB_SET_CONNECT_SEL, 0x01}, @@ -14002,6 +14008,7 @@ static const char *alc269_models[ALC269_MODEL_LAST] = { [ALC269_DMIC] = "laptop-dmic", [ALC269_FUJITSU] = "fujitsu", [ALC269_LIFEBOOK] = "lifebook", + [ALC269_VAIO] = "vaio", [ALC269_AUTO] = "auto", };
@@ -14051,7 +14058,7 @@ static struct snd_pci_quirk alc269_cfg_tbl[] = { ALC269_DMIC), SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005HA", ALC269_DMIC), SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005HA", ALC269_DMIC), - SND_PCI_QUIRK(0x104d, 0x9071, "SONY XTB", ALC269_DMIC), + SND_PCI_QUIRK(0x104d, 0x9071, "SONY Vaio", ALC269_VAIO), SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook ICH9M-based", ALC269_LIFEBOOK), SND_PCI_QUIRK(0x152d, 0x1778, "Quanta ON1", ALC269_DMIC), SND_PCI_QUIRK(0x1734, 0x115d, "FSC Amilo", ALC269_FUJITSU), @@ -14073,6 +14080,21 @@ static struct alc_config_preset alc269_presets[] = { .channel_mode = alc269_modes, .input_mux = &alc269_capture_source, }, + [ALC269_VAIO] = { + .mixers = { alc269_laptop_mixer }, + .cap_mixer = alc269_laptop_digital_capture_mixer, + .init_verbs = { alc269_init_verbs, + alc269_vaio_verbs, + alc269_laptop_dmic_init_verbs }, + .num_dacs = ARRAY_SIZE(alc269_dac_nids), + .dac_nids = alc269_dac_nids, + .hp_nid = 0x03, + .num_channel_mode = ARRAY_SIZE(alc269_modes), + .channel_mode = alc269_modes, + .unsol_event = alc269_laptop_unsol_event, + .setup = alc269_laptop_dmic_setup, + .init_hook = alc269_laptop_inithook, + }, [ALC269_QUANTA_FL1] = { .mixers = { alc269_quanta_fl1_mixer }, .init_verbs = { alc269_init_verbs, alc269_quanta_fl1_verbs },
At Fri, 2 Apr 2010 15:54:02 +0200, Luca Bruno wrote:
Vaio E Series laptops need a slightly modified config for their ALC269. This patch adds a new 'vaio' model, plus initial quirk for them. It fixes alsa-bugs #4941, #4934 and #4945
Signed-off-by: Luca Bruno lucab@debian.org
Doesn't it work with model=auto with the latest version? I'm willing apply your quirk patch but I also would like to avoid unnecessary quirks as much as possible.
Please give alsa-info.sh output, anyway, for further analysis.
thanks,
Takashi
Documentation/sound/alsa/HD-Audio-Models.txt | 1 + sound/pci/hda/patch_realtek.c | 24 +++++++++++++++++++++++- 2 files changed, 24 insertions(+), 1 deletions(-)
diff --git a/Documentation/sound/alsa/HD-Audio-Models.txt b/Documentation/sound/alsa/HD-Audio-Models.txt index 1d38b0d..416f1f5 100644 --- a/Documentation/sound/alsa/HD-Audio-Models.txt +++ b/Documentation/sound/alsa/HD-Audio-Models.txt @@ -87,6 +87,7 @@ ALC269 eeepc-p901 ASUS Eeepc P901 S101 fujitsu FSC Amilo lifebook Fujitsu Lifebook S6420
- vaio Sony Vaio (E Series) auto auto-config reading BIOS (default)
ALC662/663/272 diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 22b7c94..c2b78a1 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -137,6 +137,7 @@ enum { ALC269VB_DMIC, ALC269_FUJITSU, ALC269_LIFEBOOK,
- ALC269_VAIO, ALC269_AUTO, ALC269_MODEL_LAST /* last tag */
}; @@ -13546,6 +13547,11 @@ static struct hda_verb alc269_quanta_fl1_verbs[] = { { } };
+static struct hda_verb alc269_vaio_verbs[] = {
- {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREFGRD},
- { }
+};
static struct hda_verb alc269_lifebook_verbs[] = { {0x15, AC_VERB_SET_CONNECT_SEL, 0x01}, {0x1a, AC_VERB_SET_CONNECT_SEL, 0x01}, @@ -14002,6 +14008,7 @@ static const char *alc269_models[ALC269_MODEL_LAST] = { [ALC269_DMIC] = "laptop-dmic", [ALC269_FUJITSU] = "fujitsu", [ALC269_LIFEBOOK] = "lifebook",
- [ALC269_VAIO] = "vaio", [ALC269_AUTO] = "auto",
};
@@ -14051,7 +14058,7 @@ static struct snd_pci_quirk alc269_cfg_tbl[] = { ALC269_DMIC), SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005HA", ALC269_DMIC), SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005HA", ALC269_DMIC),
- SND_PCI_QUIRK(0x104d, 0x9071, "SONY XTB", ALC269_DMIC),
- SND_PCI_QUIRK(0x104d, 0x9071, "SONY Vaio", ALC269_VAIO), SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook ICH9M-based", ALC269_LIFEBOOK), SND_PCI_QUIRK(0x152d, 0x1778, "Quanta ON1", ALC269_DMIC), SND_PCI_QUIRK(0x1734, 0x115d, "FSC Amilo", ALC269_FUJITSU),
@@ -14073,6 +14080,21 @@ static struct alc_config_preset alc269_presets[] = { .channel_mode = alc269_modes, .input_mux = &alc269_capture_source, },
- [ALC269_VAIO] = {
.mixers = { alc269_laptop_mixer },
.cap_mixer = alc269_laptop_digital_capture_mixer,
.init_verbs = { alc269_init_verbs,
alc269_vaio_verbs,
alc269_laptop_dmic_init_verbs },
.num_dacs = ARRAY_SIZE(alc269_dac_nids),
.dac_nids = alc269_dac_nids,
.hp_nid = 0x03,
.num_channel_mode = ARRAY_SIZE(alc269_modes),
.channel_mode = alc269_modes,
.unsol_event = alc269_laptop_unsol_event,
.setup = alc269_laptop_dmic_setup,
.init_hook = alc269_laptop_inithook,
[ALC269_QUANTA_FL1] = { .mixers = { alc269_quanta_fl1_mixer }, .init_verbs = { alc269_init_verbs, alc269_quanta_fl1_verbs },},
-- 1.7.0.3
Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Takashi Iwai scrisse:
It fixes alsa-bugs #4941, #4934 and #4945
Doesn't it work with model=auto with the latest version? I'm willing apply your quirk patch but I also would like to avoid unnecessary quirks as much as possible. Please give alsa-info.sh output, anyway, for further analysis.
It doesn't seem so. You can find all the needed details attached to https://bugtrack.alsa-project.org/alsa-bug/view.php?id=4934
Cheers, Luca
At Sun, 4 Apr 2010 13:38:02 +0200, Luca Bruno wrote:
[1 <multipart/signed (7bit)>] [1.1 <text/plain; US-ASCII (quoted-printable)>] Takashi Iwai scrisse:
It fixes alsa-bugs #4941, #4934 and #4945
Doesn't it work with model=auto with the latest version? I'm willing apply your quirk patch but I also would like to avoid unnecessary quirks as much as possible. Please give alsa-info.sh output, anyway, for further analysis.
It doesn't seem so. You can find all the needed details attached to https://bugtrack.alsa-project.org/alsa-bug/view.php?id=4934
Could you attach alsa-info.sh output rather to mail?
thanks,
Takashi
Takashi Iwai scrisse:
It fixes alsa-bugs #4941, #4934 and #4945
Doesn't it work with model=auto with the latest version? I'm willing apply your quirk patch but I also would like to avoid unnecessary quirks as much as possible. Please give alsa-info.sh output, anyway, for further analysis.
It doesn't seem so. You can find all the needed details attached to https://bugtrack.alsa-project.org/alsa-bug/view.php?id=4934
Could you attach alsa-info.sh output rather to mail?
Here it is, thanks a lot.
Cheers, Luca
At Tue, 6 Apr 2010 12:21:36 +0200, Luca Bruno wrote:
Takashi Iwai scrisse:
It fixes alsa-bugs #4941, #4934 and #4945
Doesn't it work with model=auto with the latest version? I'm willing apply your quirk patch but I also would like to avoid unnecessary quirks as much as possible. Please give alsa-info.sh output, anyway, for further analysis.
It doesn't seem so. You can find all the needed details attached to https://bugtrack.alsa-project.org/alsa-bug/view.php?id=4934
Could you attach alsa-info.sh output rather to mail?
Here it is, thanks a lot.
Thanks. And what actually doesn't work with model=auto? With the very latest driver, both mic and HP auto-switching seems working.
Takashi
Takashi Iwai scrisse:
Thanks. And what actually doesn't work with model=auto? With the very latest driver, both mic and HP auto-switching seems working.
Mic was working, but got no sound via internal speakers nor through headphones. Switching VREF did the magic.
At the time, I tried various git revision till http://git.alsa-project.org/?p=alsa-kernel.git;a=commitdiff;h=bcd10cdee90866... when I decided to cook up a quirk.
If you have a particular revision to suggest, I can re-try that without my patch. Also, are the bleeding-edge drivers on kernel.org or on alsa-project.org git?
Cheers, Luca
At Tue, 6 Apr 2010 14:47:06 +0200, Luca Bruno wrote:
Takashi Iwai scrisse:
Thanks. And what actually doesn't work with model=auto? With the very latest driver, both mic and HP auto-switching seems working.
Mic was working, but got no sound via internal speakers nor through headphones. Switching VREF did the magic.
Do you mean setting the pinctl 0x22 (PIN_VREFGRD) to NID 0x19? Changing this via hda-verb with model=auto state also fixes the issue?
At the time, I tried various git revision till http://git.alsa-project.org/?p=alsa-kernel.git;a=commitdiff;h=bcd10cdee90866... when I decided to cook up a quirk.
If you have a particular revision to suggest, I can re-try that without my patch. Also, are the bleeding-edge drivers on kernel.org or on alsa-project.org git?
For the kernel, try: git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6.git
For alsa-driver snapshot, try: ftp://ftp.kernel.org/pub/linux/kernel/people/tiwai/snapshot/alsa-driver-snapshot.tar.gz
thanks,
Takashi
Takashi Iwai scrisse:
Do you mean setting the pinctl 0x22 (PIN_VREFGRD) to NID 0x19?
Yes. It was mentioned that PIN_VREFHIZ works too.
Changing this via hda-verb with model=auto state also fixes the issue?
Yes, that's how the quirk-patch came out (I've zero knowledge of sound/alsa development, I was just asked to cook a patch based on that suggestion, as nobody was doing it).
For the kernel, try: git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6.git For alsa-driver snapshot, try: ftp://ftp.kernel.org/pub/linux/kernel/people/tiwai/snapshot/alsa-driver-snapshot.tar.gz
Tried latest of both, yet no luck out-of-the-box. Still have to apply the quirk-patch or manually change via hda-verb each time to have a working sound output.
Ciao, Luca
At Sat, 10 Apr 2010 20:35:30 +0200, Luca Bruno wrote:
[1 <text/plain; US-ASCII (quoted-printable)>] Takashi Iwai scrisse:
Do you mean setting the pinctl 0x22 (PIN_VREFGRD) to NID 0x19?
Yes. It was mentioned that PIN_VREFHIZ works too.
Changing this via hda-verb with model=auto state also fixes the issue?
Yes, that's how the quirk-patch came out (I've zero knowledge of sound/alsa development, I was just asked to cook a patch based on that suggestion, as nobody was doing it).
For the kernel, try: git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6.git For alsa-driver snapshot, try: ftp://ftp.kernel.org/pub/linux/kernel/people/tiwai/snapshot/alsa-driver-snapshot.tar.gz
Tried latest of both, yet no luck out-of-the-box. Still have to apply the quirk-patch or manually change via hda-verb each time to have a working sound output.
OK, could you try the patch below?
thanks,
Takashi --- diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 8d60b1f..4b35176 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -1390,22 +1390,31 @@ struct alc_fixup {
static void alc_pick_fixup(struct hda_codec *codec, const struct snd_pci_quirk *quirk, - const struct alc_fixup *fix) + const struct alc_fixup *fix, + int pre_init) { const struct alc_pincfg *cfg;
quirk = snd_pci_quirk_lookup(codec->bus->pci, quirk); if (!quirk) return; - fix += quirk->value; cfg = fix->pins; - if (cfg) { + if (pre_init && cfg) { +#ifdef CONFIG_SND_DEBUG_VERBOSE + snd_printdd(KERN_INFO "hda_codec: %s: Apply pincfg for %s\n", + codec->chip_name, quirk->name); +#endif for (; cfg->nid; cfg++) snd_hda_codec_set_pincfg(codec, cfg->nid, cfg->val); } - if (fix->verbs) + if (!pre_init && fix->verbs) { +#ifdef CONFIG_SND_DEBUG_VERBOSE + snd_printdd(KERN_INFO "hda_codec: %s: Apply fix-verbs for %s\n", + codec->chip_name, quirk->name); +#endif add_verb(codec->spec, fix->verbs); + } }
static int alc_read_coef_idx(struct hda_codec *codec, @@ -10439,7 +10448,8 @@ static int patch_alc882(struct hda_codec *codec) board_config = ALC882_AUTO; }
- alc_pick_fixup(codec, alc882_fixup_tbl, alc882_fixups); + if (board_config == ALC882_AUTO) + alc_pick_fixup(codec, alc882_fixup_tbl, alc882_fixups, 1);
if (board_config == ALC882_AUTO) { /* automatic parse from the BIOS config */ @@ -10512,6 +10522,9 @@ static int patch_alc882(struct hda_codec *codec) set_capture_mixer(codec); set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT);
+ if (board_config == ALC882_AUTO) + alc_pick_fixup(codec, alc882_fixup_tbl, alc882_fixups, 0); + spec->vmaster_nid = 0x0c;
codec->patch_ops = alc_patch_ops; @@ -14064,6 +14077,27 @@ static void alc269_auto_init(struct hda_codec *codec) alc_inithook(codec); }
+enum { + ALC269_FIXUP_SONY_VAIO, +}; + +const static struct hda_verb alc269_sony_vaio_fixup_verbs[] = { + {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREFGRD}, + {} +}; + +static const struct alc_fixup alc269_fixups[] = { + [ALC269_FIXUP_SONY_VAIO] = { + .verbs = alc269_sony_vaio_fixup_verbs + }, +}; + +static struct snd_pci_quirk alc269_fixup_tbl[] = { + SND_PCI_QUIRK(0x104d, 0x9071, "Sony VAIO", ALC269_FIXUP_SONY_VAIO), + {} +}; + + /* * configuration and preset */ @@ -14123,7 +14157,7 @@ static struct snd_pci_quirk alc269_cfg_tbl[] = { ALC269_DMIC), SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005HA", ALC269_DMIC), SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005HA", ALC269_DMIC), - SND_PCI_QUIRK(0x104d, 0x9071, "SONY XTB", ALC269_DMIC), + SND_PCI_QUIRK(0x104d, 0x9071, "Sony VAIO", ALC269_AUTO), SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook ICH9M-based", ALC269_LIFEBOOK), SND_PCI_QUIRK(0x152d, 0x1778, "Quanta ON1", ALC269_DMIC), SND_PCI_QUIRK(0x1734, 0x115d, "FSC Amilo", ALC269_FUJITSU), @@ -14277,6 +14311,9 @@ static int patch_alc269(struct hda_codec *codec) board_config = ALC269_AUTO; }
+ if (board_config == ALC269_AUTO) + alc_pick_fixup(codec, alc269_fixup_tbl, alc269_fixups, 1); + if (board_config == ALC269_AUTO) { /* automatic parse from the BIOS config */ err = alc269_parse_auto_config(codec); @@ -14329,6 +14366,9 @@ static int patch_alc269(struct hda_codec *codec) set_capture_mixer(codec); set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT);
+ if (board_config == ALC269_AUTO) + alc_pick_fixup(codec, alc269_fixup_tbl, alc269_fixups, 0); + spec->vmaster_nid = 0x02;
codec->patch_ops = alc_patch_ops; @@ -15417,7 +15457,8 @@ static int patch_alc861(struct hda_codec *codec) board_config = ALC861_AUTO; }
- alc_pick_fixup(codec, alc861_fixup_tbl, alc861_fixups); + if (board_config == ALC861_AUTO) + alc_pick_fixup(codec, alc861_fixup_tbl, alc861_fixups, 1);
if (board_config == ALC861_AUTO) { /* automatic parse from the BIOS config */ @@ -15454,6 +15495,9 @@ static int patch_alc861(struct hda_codec *codec)
spec->vmaster_nid = 0x03;
+ if (board_config == ALC861_AUTO) + alc_pick_fixup(codec, alc861_fixup_tbl, alc861_fixups, 0); + codec->patch_ops = alc_patch_ops; if (board_config == ALC861_AUTO) { spec->init_hook = alc861_auto_init; @@ -16388,7 +16432,8 @@ static int patch_alc861vd(struct hda_codec *codec) board_config = ALC861VD_AUTO; }
- alc_pick_fixup(codec, alc861vd_fixup_tbl, alc861vd_fixups); + if (board_config == ALC861VD_AUTO) + alc_pick_fixup(codec, alc861vd_fixup_tbl, alc861vd_fixups, 1);
if (board_config == ALC861VD_AUTO) { /* automatic parse from the BIOS config */ @@ -16436,6 +16481,9 @@ static int patch_alc861vd(struct hda_codec *codec)
spec->vmaster_nid = 0x02;
+ if (board_config == ALC861VD_AUTO) + alc_pick_fixup(codec, alc861vd_fixup_tbl, alc861vd_fixups, 0); + codec->patch_ops = alc_patch_ops;
if (board_config == ALC861VD_AUTO)
Takashi Iwai scrisse:
Tried latest of both, yet no luck out-of-the-box. Still have to apply the quirk-patch or manually change via hda-verb each time to have a working sound output.
OK, could you try the patch below?
Fine, it worked perfectly. Thanks a lot.
Ciao, Luca
At Tue, 13 Apr 2010 07:58:57 +0200, Luca Bruno wrote:
Takashi Iwai scrisse:
Tried latest of both, yet no luck out-of-the-box. Still have to apply the quirk-patch or manually change via hda-verb each time to have a working sound output.
OK, could you try the patch below?
Fine, it worked perfectly. Thanks a lot.
Merged patches now. Thanks for testing.
Takashi
participants (2)
-
Luca Bruno
-
Takashi Iwai