Linux Sound subsystem development
 help / color / mirror / Atom feed
From: Aaron Ma <mapengyu@gmail.com>
To: Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Zhang Heng <zhangheng@kylinos.cn>,
	Kailang Yang <kailang@realtek.com>,
	Damien Dagorn <damien.dagorn29@gmail.com>,
	Aaron Ma <mapengyu@gmail.com>, Bob Song <songxiebing@kylinos.cn>,
	marco_giunta@outlook.it
Subject: [PATCH 2/3] ALSA: hda/realtek: Use quad channel map for Legion AW88399 speakers
Date: Sat,  1 Aug 2026 14:06:29 +0800	[thread overview]
Message-ID: <20260801060630.2768318-2-mapengyu@gmail.com> (raw)
In-Reply-To: <20260801060630.2768318-1-mapengyu@gmail.com>

The Lenovo Legion machines pairing an ALC287 codec with two AW88399
smart amplifiers have four speaker channels. The second pair is
full-range rear, not an LFE channel, so the default mapping is wrong.

Advertise FL/FR/RL/RR quad channel maps on the playback stream so
4-channel streams are routed correctly.

Signed-off-by: Aaron Ma <mapengyu@gmail.com>
---
 sound/hda/codecs/realtek/alc269.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/sound/hda/codecs/realtek/alc269.c b/sound/hda/codecs/realtek/alc269.c
index 2e3f7f1b52782..42fcdfe54225a 100644
--- a/sound/hda/codecs/realtek/alc269.c
+++ b/sound/hda/codecs/realtek/alc269.c
@@ -3268,6 +3268,15 @@ static void find_cirrus_companion_amps(struct hda_codec *cdc)
 	comp_generic_fixup(cdc, HDA_FIXUP_ACT_PRE_PROBE, bus, acpi_ids[i].hid, match, count);
 }
 
+static const struct snd_pcm_chmap_elem aw88399_pcm_quad_chmaps[] = {
+	{ .channels = 2,
+	  .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR } },
+	{ .channels = 4,
+	  .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR,
+		   SNDRV_CHMAP_RL, SNDRV_CHMAP_RR } },
+	{ }
+};
+
 static void aw88399_fixup_i2c_two(struct hda_codec *cdc, const struct hda_fixup *fix, int action)
 {
 	struct alc_spec *spec = cdc->spec;
@@ -3276,6 +3285,10 @@ static void aw88399_fixup_i2c_two(struct hda_codec *cdc, const struct hda_fixup
 		spec->gen.suppress_auto_mic = 1;
 
 	comp_generic_fixup(cdc, action, "i2c", "AWDZ8399", "-%s:00-aw88399-hda.%d", 2);
+	/* the second speaker pair is full-range rear, not LFE */
+	if (action == HDA_FIXUP_ACT_BUILD)
+		spec->gen.pcm_rec[0]->stream[SNDRV_PCM_STREAM_PLAYBACK].chmap =
+			aw88399_pcm_quad_chmaps;
 }
 
 static void cs35l41_fixup_i2c_two(struct hda_codec *cdc, const struct hda_fixup *fix, int action)
-- 
2.53.0


  reply	other threads:[~2026-08-01  6:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-01  6:06 [PATCH 1/3] ALSA: hda/realtek: Use AW88399 I2C fixup chain on Legion machines Aaron Ma
2026-08-01  6:06 ` Aaron Ma [this message]
2026-08-01  6:06 ` [PATCH 3/3] ALSA: hda/realtek: Rename headphone jack kcontrol " Aaron Ma
2026-08-01 12:56 ` [PATCH 1/3] ALSA: hda/realtek: Use AW88399 I2C fixup chain " Marco Giunta
2026-08-01 16:43   ` Pengyu Ma
2026-08-01 18:34     ` Marco Giunta

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260801060630.2768318-2-mapengyu@gmail.com \
    --to=mapengyu@gmail.com \
    --cc=damien.dagorn29@gmail.com \
    --cc=kailang@realtek.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=marco_giunta@outlook.it \
    --cc=perex@perex.cz \
    --cc=songxiebing@kylinos.cn \
    --cc=tiwai@suse.com \
    --cc=zhangheng@kylinos.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox