* [PATCH v2] ASoC: tas2783-sdw: restore the stereo split when no SDCA function data
@ 2026-12-03 13:48 Lee Mann
2026-12-03 14:15 ` sashiko-bot
0 siblings, 1 reply; 2+ messages in thread
From: Lee Mann @ 2026-12-03 13:48 UTC (permalink / raw)
To: Mark Brown, Liam Girdwood, linux-sound
Cc: Baojun Xu, Shenghao Ding, Niranjan H Y, Waldemar Hamm,
Thorsten Leemhuis, regressions, Antoine Monnet, Andrey Golovko,
Pierre-Louis Bossart, Matthew Schwartz, linux-kernel
Commit f42fbd560cd8 ("ASoC: tas2783-sdw: add firmware download status
check") removed the per-amp channel mask from tas_sdw_hw_params(), on
the basis that the channel is selected by the SDCA init table from
ACPI DisCo.
That only holds when the SmartAmp function is parsed. On the ASUS
ProArt PX13 (HN7306EA, two TAS2783 on SoundWire link 1) the ACPI
declares the function type without a DisCo constant, so
sdca_parse_function() fails, sa_func_data stays NULL and the init
table is never written. Both amps keep ClusterIndex 0x01 from
tas2783_init_seq and, with the full playback mask, the right speaker
is silent.
Restore the split for that case only: when sa_func_data is NULL and
the link has one amp per channel, give each amp a single channel from
its machine-assigned prefix, as before f42fbd560cd8, and set ch_count
to match the mask. Links with more amps than channels, such as the
four-amp tas2783_2_adr boards, keep the full mask: there the split
pushes amps 3 and 4 past the two-channel payload. Platforms where the
init table is applied are unchanged.
Tested on the PX13 on v7.3.7 with the v7.4-rc5 driver plus this patch,
speaker-test -c2 -t wav: left and right correct.
Fixes: f42fbd560cd8 ("ASoC: tas2783-sdw: add firmware download status check")
Closes: https://lore.kernel.org/all/20261107212552.10990-1-leepaulmann@gmail.com/
Link: https://github.com/thesofproject/linux/issues/6037
Assisted-by: LLM
Signed-off-by: Lee Mann <leepaulmann@gmail.com>
---
v2:
- only split when the link has two amps (Mark: four-amp tas2783_2_adr;
Waldemar Hamm's report from a four-amp HP board shows amps 3/4
silent with the split and correct stereo with the full mask)
- set stream_config.ch_count to 1 to match the mask (Mark). On AMD it
only sizes the port slot reservation (offsets come from the mask);
the generic allocator used by Intel doesn't read it.
Baojun, could you check v2 on your two-amp boards? I expect them to
log "Found Smart Amp function", in which case nothing changes there.
v1: https://lore.kernel.org/all/?q=s%3A%22restore+the+stereo+split%22
AI note: written with Claude Code; I reviewed, built and tested it.
sound/soc/codecs/tas2783-sdw.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/sound/soc/codecs/tas2783-sdw.c b/sound/soc/codecs/tas2783-sdw.c
index 3f21700..76280f6 100644
--- a/sound/soc/codecs/tas2783-sdw.c
+++ b/sound/soc/codecs/tas2783-sdw.c
@@ -995,6 +995,30 @@ static s32 tas_sdw_hw_params(struct snd_pcm_substream *substream,
snd_sdw_params_to_config(substream, params,
&stream_config, &port_config);
+ /*
+ * Without the SDCA SmartAmp function data from ACPI DisCo, the per-amp
+ * init table that selects each amp's channel is never written and both
+ * amps keep the ClusterIndex from tas2783_init_seq, so with the full
+ * mask from snd_sdw_params_to_config() the pair renders one channel.
+ * With one amp per channel, give each amp its own channel, keyed off
+ * the machine-assigned prefix (tas2783-1 left, tas2783-2 right).
+ * Links with more amps than channels keep the full mask, as do
+ * platforms where the init table selects the channel.
+ */
+ if (!tas_dev->sa_func_data &&
+ substream->stream == SNDRV_PCM_STREAM_PLAYBACK &&
+ params_channels(params) == 2 &&
+ snd_soc_substream_to_rtd(substream)->dai_link->num_codecs == 2 &&
+ component->name_prefix) {
+ const char *idx_str = strrchr(component->name_prefix, '-');
+ unsigned long idx;
+
+ if (idx_str && !kstrtoul(idx_str + 1, 10, &idx) && idx) {
+ port_config.ch_mask = (idx & 1) ? BIT(0) : BIT(1);
+ stream_config.ch_count = 1;
+ }
+ }
+
/* port 1 for playback */
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
port_config.num = 1;
--
2.56.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] ASoC: tas2783-sdw: restore the stereo split when no SDCA function data
2026-12-03 13:48 [PATCH v2] ASoC: tas2783-sdw: restore the stereo split when no SDCA function data Lee Mann
@ 2026-12-03 14:15 ` sashiko-bot
0 siblings, 0 replies; 2+ messages in thread
From: sashiko-bot @ 2026-12-03 14:15 UTC (permalink / raw)
To: Lee Mann, linux-sound
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] ASoC: tas2783-sdw: inaccurate comment on ClusterIndex and
ch_mask routing
--
commit faa58a455f0635ef0eb57c9ed35971c94e6b53eb
Author: Lee Mann <leepaulmann@gmail.com>
ASoC: tas2783-sdw: restore the stereo split when no SDCA function data
This commit restores a single-channel port_config.ch_mask and sets
stream_config.ch_count to 1 in tas_sdw_hw_params() for two-amp playback links
when SDCA SmartAmp function data is unavailable.
Link: https://github.com/thesofproject/linux/issues/6037
> diff --git a/sound/soc/codecs/tas2783-sdw.c b/sound/soc/codecs/tas2783-sdw.c
> index 08b37e7b3a9e4..899873a169b43 100644
> --- a/sound/soc/codecs/tas2783-sdw.c
> +++ b/sound/soc/codecs/tas2783-sdw.c
> @@ -994,6 +994,30 @@ static s32 tas_sdw_hw_params(struct snd_pcm_substream *substream,
> snd_sdw_params_to_config(substream, params,
> &stream_config, &port_config);
>
> + /*
> + * Without the SDCA SmartAmp function data from ACPI DisCo, the per-amp
> + * init table that selects each amp's channel is never written and both
> + * amps keep the ClusterIndex from tas2783_init_seq, so with the full
> + * mask from snd_sdw_params_to_config() the pair renders one channel.
> + * With one amp per channel, give each amp its own channel, keyed off
> + * the machine-assigned prefix (tas2783-1 left, tas2783-2 right).
> + * Links with more amps than channels keep the full mask, as do
> + * platforms where the init table selects the channel.
> + */
> + if (!tas_dev->sa_func_data &&
> + substream->stream == SNDRV_PCM_STREAM_PLAYBACK &&
> + params_channels(params) == 2 &&
> + snd_soc_substream_to_rtd(substream)->dai_link->num_codecs == 2 &&
> + component->name_prefix) {
> + const char *idx_str = strrchr(component->name_prefix, '-');
> + unsigned long idx;
> +
> + if (idx_str && !kstrtoul(idx_str + 1, 10, &idx) && idx) {
> + port_config.ch_mask = (idx & 1) ? BIT(0) : BIT(1);
> + stream_config.ch_count = 1;
> + }
> + }
[Severity: Low]
Are the comment and commit message accurate in saying both amps keep
ClusterIndex from tas2783_init_seq? tas2783_init_seq writes control 0x10 on
TAS2783_SDCA_ENT_PPU21, which is SDCA_CTL_PPU_POSTURENUMBER, not ClusterIndex
(control 0x10 on TAS2783_SDCA_ENT_UDMPU23).
The comment also implies that BIT(0) vs BIT(1) from component->name_prefix
selects left vs right. sdw_compute_slave_ports() only uses
hweight32(p_rt->ch_mask) to advance port_bo across m_rt->slave_rt_list, so
channel assignment comes from codec ordering on the DAI link, not the bit.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261203134857.11614-1-leepaulmann@gmail.com?part=1
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-12-03 14:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-03 13:48 [PATCH v2] ASoC: tas2783-sdw: restore the stereo split when no SDCA function data Lee Mann
2026-12-03 14:15 ` sashiko-bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox