The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>
To: Andrey Golovko <andrey.golovko@gmail.com>,
	Antoine Monnet <antoine@montane.tech>,
	linux-sound@vger.kernel.org
Cc: Shenghao Ding <shenghao-ding@ti.com>, Kevin Lu <kevin-lu@ti.com>,
	Baojun Xu <baojun.xu@ti.com>, Sen Wang <sen@ti.com>,
	Mark Brown <broonie@kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Vijendar Mukunda <Vijendar.Mukunda@amd.com>,
	Vinod Koul <vkoul@kernel.org>,
	Bard Liao <yung-chuan.liao@linux.intel.com>,
	Robin Everaars <robineveraars@pm.me>,
	linux-kernel@vger.kernel.org
Subject: Re: ASoC: tas2783-sdw: no stereo channel split for two mono amps -> mono output (AMD ACP SoundWire, ASUS ProArt PX13)
Date: Fri, 7 Aug 2026 11:19:01 +0200	[thread overview]
Message-ID: <15034aea-2108-4fd3-a352-3940b19d280f@linux.dev> (raw)
In-Reply-To: <cf25e8d6e9625f774c793e66f8a59b8d@gmail.com>

On 8/7/26 07:21, Andrey Golovko wrote:
> On 7/27/26 13:21, Antoine Monnet wrote:
>> I logged name_prefix against the resulting ch_mask and got tas2783-1 = 0x8
>> = left, tas2783-2 = 0xb = right; the split is correct by ear and by per-amp
>> mixer mute. Since your unit is the same HN7306EAC the prefix ordering is
>> identical, so this should give correct L/R for you too - a Tested-by from
>> the second machine would be welcome if you get a chance, but nothing needs
>> re-deriving.
> 
> Tested-by: Andrey Golovko <andrey@golovko.me>
> 
> Confirmed on the second machine: ASUS ProArt PX13 HN7306EAC, v7.2-rc4 based
> kernel, same two TAS2783 at unique_id 0x8 / 0xB plus RT721 on SoundWire
> link 1.
> 
> With your patch applied both amps render, and the assignment is correct by
> physical placement, not merely by control name:
> 
>   speaker-test -Dpipewire -c2 -s1  ->  physically left speaker only
>   speaker-test -Dpipewire -c2 -s2  ->  physically right speaker only
> 
> Both amps at full scale, all four Left/Right Spk[2] switches on. Before the
> patch, -s1 was audible and -s2 was silent, with only one amp contributing at
> all - so this is exactly the behaviour you predicted for an identical
> HN7306EAC: the prefix ordering matches, tas2783-1 takes the left channel and
> tas2783-2 the right, and that lines up with the physical speakers.
> 
> One caveat, measured since by Robin Everaars, who reported the same
> issue on yet another HN7306EAC (added to Cc):
> 
>   https://lore.kernel.org/all/20260805183517.8665-1-robineveraars@pm.me/
> 
> The ch_mask *value* is not what selects the channel:
> sdw_compute_slave_ports() assigns payload offsets positionally along
> slave_rt_list, and Robin showed that inverting the two masks between the
> amps does not move the audio. A one-channel mask fixes mono because it
> stops the mirror-mode offset reset; L/R then follows the codec order in
> the DAI link, which on this platform happens to match the speakers. The
> Tested-by stands - the split the patch produces is correct on both
> machines - but the name_prefix -> BIT(n) mapping reads as if the bit
> picks the channel, which is worth a comment or a reword before a formal
> submission. Where the binding should really come from is being discussed
> in Robin's thread.

Selecting a mono channel at the port level is indeed a solution but not
quite what SDCA designs are supposed to implement. As discussed in the
other thread, all amps are supposed to receive *all* channels and use
mapping/processing to generate the per-amp desired output. That
generation can be dynamic depending on 'posture'.

Looking at the SmartAmp topology in the SDCA spec, my guess would be
that the mapping is really handled in the UDMPU23 and FU 23 entities.
The topology has a 'Amp Transducer Mapping' label which seems to be the
right location to make the left/right speaker selection.

FU23 looks like a dead-end, it is a 'platform' FU not supposed to be
modified by the class driver. The Channel Gain is a platform-specific
value set with OEM defaults, the drivers shouldn't muck with those values.

The UDMPU23 has a 'ClusterIndex' control at offset 0x10, it's not
exposed to userspace but is part of regmap

case SDW_SDCA_CTL(1, TAS2783_SDCA_ENT_UDMPU23,
			  TAS2783_SDCA_CTL_UDMPU_CLUSTER, 0):

It might be worth experimenting with different non-zero cluster indices
for each amp. If the index is zero then the channel selection is
bypassed, whatever is provided to the UDMPU input pin will flow on the
output.

Unfortunately the cluster index is not a direct representation of the
channel selection, it points to a table in which the channel selection
is defined. Nothing requires that the indices be continuous, and that
table can in theory be platform-specific...

One would hope that the codec vendor has guidelines on which cluster
uses what index... Someone at TI should really comment on whether this
UDMPU cluster selection is the correct direction, as usual the caveat
that such experiments might blow the speakers...


      reply	other threads:[~2026-08-07  9:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-19  0:53 ASoC: tas2783-sdw: no stereo channel split for two mono amps -> mono output (AMD ACP SoundWire, ASUS ProArt PX13) Antoine Monnet
2026-07-27  8:48 ` Andrey Golovko
2026-07-27 11:21   ` Antoine Monnet
2026-08-07  5:21     ` Andrey Golovko
2026-08-07  9:19       ` Pierre-Louis Bossart [this message]

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=15034aea-2108-4fd3-a352-3940b19d280f@linux.dev \
    --to=pierre-louis.bossart@linux.dev \
    --cc=Vijendar.Mukunda@amd.com \
    --cc=andrey.golovko@gmail.com \
    --cc=antoine@montane.tech \
    --cc=baojun.xu@ti.com \
    --cc=broonie@kernel.org \
    --cc=kevin-lu@ti.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=robineveraars@pm.me \
    --cc=sen@ti.com \
    --cc=shenghao-ding@ti.com \
    --cc=vkoul@kernel.org \
    --cc=yung-chuan.liao@linux.intel.com \
    /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