From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.43 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796231475; b=nh08tIlSRpfnt7AjCF+xyzpQpMesf6nxjctP2qHG/gqEys43uRChyseT3RUiAQN6ra3T 7c6RR3yxMwPkLgH4iWVt4MvdyjDXnhuGY5taswsLkRk80420CNTSgrx5gnQg0t1/LbX2w 1UtGgqMYqCdI0eKxO/ecAE72ACnIWn/7t12kONM9EEdFkVMkemHx/j3aGiacLJ/kLI0Nm 0eEum8tWFRELtn5/ZZr61OnblFXXvqubsjT9ich3bsKMJc+z8wVr/eaBmYcupY/H23/PI XoXvWqPSU1RObfX5+/u4lARjA5ad78TzzUlDvVgG3FXyuyclgt9He6LLjgzuvew9qIA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796231475; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Message-ID:Date:MIME-Version:User-Agent:Subject:To:Cc:References: Content-Language:From:In-Reply-To:Content-Type: Content-Transfer-Encoding; bh=z2v4VqeGFiY2a4kaD+SeCbSrxaLCUDTiEO723ttN6/c=; b=j1SBpsevg25xh88g1qoOZaMmqBVo9T1xlHEFqa2tVxzgeEUW3A5mUMFqVwh4hUfnAaVl HMR4v8LYRlQdnybL9UaihiRyadMkpgIgu47Lx0vdroW/IHorDaS3D7rrtoSkJ3LlMOYTV 0N9HF1ajAXxSuzPfBjKvlj/ExaYGKzgJw7XA6uuykbzQSjM/YKj92bm5rZcUsCFQwYb2C BKLsAeU4yhGxye9bN8ObgtUGX8FDCRkGDV/nE9t1u0tsy8NeV4vQn2zJeZgSarFr0dEcz N7ezlIlYwpfpgCdgRBUT89x1flebXNHIJ/faHroqqm00un0qFTItHfM9rZ44oMjF7eA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b="HLGM/nqK"; arc=none smtp.remote-ip=209.85.128.43 Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4E842606A323 for ; Wed, 2 Dec 2026 17:11:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 4E842606A323 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=HLGM/nqK Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-4bb5b8ef642so110414485e9.1 for ; Wed, 02 Dec 2026 09:11:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796231474; x=1796836274; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=z2v4VqeGFiY2a4kaD+SeCbSrxaLCUDTiEO723ttN6/c=; b=HLGM/nqKbPiTR6hU8STNBBWaWFx0+d7fcIBwcuwDkzR0Ixs9Achy40JYj2ZablMPpO Ku2mhFrJbyVldTTUmOnzVKST0L7WbzhWfKAWdE49PBMB4RMUlebky33iMWFHjGSKxif8 ME86M1u1uInQybvJmy2YoLEH2SrA0/M8ILh4SDedC0x6S6v93p1m9uF1mBfC+yuAv7Pc 3iVEJiPMnXtigZNcLtaqHzM67ZVlOz2+w06hokPJ7MvtdOEzfHClRPDizQK48yVXXvp6 IxfBl7fk/jhfGNHAy85FV9kZWEj4SeZgPUxwspRvfnKcjbBsfU5gYAu4knPTxvFm5+IS gpRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796231474; x=1796836274; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=z2v4VqeGFiY2a4kaD+SeCbSrxaLCUDTiEO723ttN6/c=; b=XwF1ZK5qCb9IHh6gKA2MO0lElel31KkU5TA9Ncq1u1sw4jcda/OMNxttWz/fgpPvB6 HXZs3AzJ7Eins6EKpHmDBfZiEiqcxxOgX7wEPCOuHmV+y9xejxQyPIU5xwwk78l7psN8 cSXm6SuUwjaT8I8bo9EaB+rYTT1BCyNiHAL+lVAK7boi9nCOGl3SGIivfZ1LPZ8UnZzM kZe+R82+hK4EfWsAavgu2n3j5tXEm6wxmScH7Ab6tLApDnQ6HddJmsaul8uHPhTyTcp2 mMEBzFfuMA4jD2CrKhgKEdNgUcFbtpvkxOp7gGUc4JGjsDA62eephrpfMQ+0yO0S/ANF fX1g== X-Forwarded-Encrypted: i=1; AL+hErEaC0DvxnQ5BLDZt7rNiGSr/7hoZRBpbjK1n5M3Jcw0sU07pCMJCoW0EaE3omOPXeWzBO3UFdnMMyclkLg=@vger.kernel.org X-Gm-Message-State: APuU4Z/HJu9r86sF9LgNlTYq6o6B79IpyNuJzX3+Mt6ZBPp5G2mXwOHg q98lcl/sYt4XSyzR6yMvq32RQT5YCV6BHVVeVzzaNIX0RUIGwwNbWqcB X-Gm-Gg: AZFdTZck1ioM666tsu1sB8t5NOuaiRXRNSGZ6x7Foan/lw8MR1dE0NKVCYN+lSinI1D GIoHiJRKFBQLZzntJ62Kvb1Q11E+S8rLQwkbsKbIblI9vAZIbRaj4/5ie/cYIaN9KZUYk2LzSjj iV78WE2lPDNFJF3yKJcvYM5v5f/WBT4cI11gJPKuOPxeUn4bf/9GDy8mreRbSGSalVfWMM6NQV5 aeN6hxx62PaBcTEo3FbfSD66dBxhyuwCWFBgO0V1sV8k64nEUTD9th2/K2TRBC/YM61DCuVmk6w +NkDtPJuiMsLwt9+RRZI+1HkwamLBUxhPgGkH6hbVrh+5sJuhGklwfG9pgclp17T3n9l6qNEIpQ LtxTU3oh1Kjy8b+NNrnOawqTtvwKcFALoi0FqFYfr1//Hn3JRY+ruTzVpN5CqUZ5pqgma+pSOos 2ZXHjf8ZnoiipXu43hvKwBvkJV4iE9sYecrRG2Bm6YKHCI7p+4HUqyk4v+Al5X2Yu4TcceRaMN8 6VZK3Ez+Gj4GNQo6XmcLXoERO2ZbiN99Xq0p5L50lhTUPRQ4NtBAmITBuB7fxuZGjvwZd4ub56g d5bLfnsAM4O/gX0R654t7mELyA4O4ogdfpM0tnv4hfdCOaWdtHzhs8LeMjY= X-Received: by 2002:a05:600c:1546:b0:4a1:fc98:1cb1 with SMTP id 5b1f17b1804b1-4bb887c2cb0mr883201565e9.2.1796231473409; Wed, 02 Dec 2026 09:11:13 -0800 (PST) Received: from [192.168.10.74] ([213.182.154.122]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4bb906640a2sm688844145e9.0.2026.12.02.09.11.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 02 Dec 2026 09:11:12 -0800 (PST) Message-ID: <0d46a73b-cf7c-46ed-88eb-19f378ce5cab@gmail.com> Date: Wed, 2 Dec 2026 18:11:11 +0100 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: ASoC: tas2783-sdw: no stereo channel split for two mono amps -> mono output (AMD ACP SoundWire, ASUS ProArt PX13) To: Antoine Monnet , Andrey Golovko , linux-sound@vger.kernel.org Cc: Shenghao Ding , Kevin Lu , Baojun Xu , Sen Wang , Mark Brown , Liam Girdwood , Vijendar Mukunda , Vinod Koul , Bard Liao , Pierre-Louis Bossart , linux-kernel@vger.kernel.org References: <29e8c08b-9475-4aba-bce0-6d4a45a26d3b@gmail.com> <20b6c100ec50c0b9eb1dd31a338dbc9e@gmail.com> <778f017a-e1c2-4ab6-9968-6e4c6285180b@montane.tech> Content-Language: en-US From: Waldemar Hamm In-Reply-To: <778f017a-e1c2-4ab6-9968-6e4c6285180b@montane.tech> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: ASoC: tas2783-sdw: no stereo channel split for two mono amps -> mono output (AMD ACP SoundWire, ASUS ProArt PX13) Hi, a data point from a board with *four* TAS2783 on one link, plus a question about commit f42fbd560cd8 ("ASoC: tas2783-sdw: add firmware download status check"). Hardware --------   HP ZBook Ultra G3a 16 inch Mobile Workstation PC   DMI board 8F6D, BIOS Y86 Ver. 01.01.07   ACP: [1022:15e2] rev 70, subsystem [103c:8f6d]   Card: amd-soundwire, SDW0-PIN1-PLAYBACK-SmartAmp (multicodec-2), 2ch   Amps: 4x TAS2783 on link 0, unique_id 0x9, 0xA, 0xC, 0xD         (prefixes tas2783-1..4), per-amp firmware         8F6D-0-0x9/0xA/0xC/0xD.bin from linux-firmware, no SPEAKER_ID         EFI variable   Jack: rt712-sdca on link 1   UCM: sof-soundwire/tas2783.conf from alsa-ucm-conf master        (not in the 1.2.16.1 release) 1) The channel split breaks four-amp boards ------------------------------------------- Physically tas2783-1 and -2 drive the left speaker, -3 and -4 the right one (determined by muting the "tas2783-N Speaker" controls one at a time, by ear and with the built-in microphones). With 173cb3147ba2 ("ASoC: tas2783-sdw: split a stereo stream across the two mono amps"), as shipped in v7.3.7, the payload offsets from sdw_compute_slave_ports() become 0, 1, 2, 3 on a two-channel stream:   tas2783-1 -> slot 0 (left)   left side   ok   tas2783-2 -> slot 1 (right)  left side   right channel comes out left   tas2783-3 -> slot 2          right side  beyond payload, silent   tas2783-4 -> slot 3          right side  beyond payload, silent so everything plays from the left speaker. Mirror mode (full mask for every amp) gives correct stereo on this machine; the per-amp firmware apparently selects the channel. I verified that with v7.3.7 plus the split restricted to "one amp per channel" (num_codecs == channels), and with the current for-next driver, which no longer has the split. f42fbd560cd8 removes the split from tas_sdw_hw_params() together with the firmware version check, but the changelog doesn't mention it. Was that intentional? If not, the two-amp PX13 is presumably back to mono. If the split comes back, please make it conditional on one amp per channel, e.g.     if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK &&         params_channels(params) == 2 && component->name_prefix && snd_soc_substream_to_rtd(substream)->dai_link->num_codecs ==         params_channels(params)) { otherwise four-amp boards like this one lose the right speaker again. 2) Firmware download timeout at boot ------------------------------------ On roughly 4 out of 5 boots one amp (mostly 0xA, sometimes 0x9) fails its firmware download:   amd_sdw_manager amd_sdw_manager.0: command timeout for Slave 3   slave-tas2783 sdw:0:0:0102:0000:01:a: FW download failed: -110   amd_sdw_manager amd_sdw_manager.0: SDW0 manager is in bad state With v7.3.7 the amp then stays without firmware and playback on the whole link is refused ("error playback without fw download"), i.e. no sound at all until the next reboot. The immediate block retry added in f42fbd560cd8 covers this here: with the for-next driver (backported to 7.3.7 for testing) the timeout occurred, no "FW download failed again" followed, and playback worked. That is one boot with the timeout so far; I'll report back if the immediate retry ever turns out not to be enough. A variant that resets the amp and retries the whole download after 100 ms also worked reliably here, in case that's needed. Transparency note: the analysis was done with the help of an AI coding assistant (Anthropic Claude, used through Claude Code). I reviewed the results and did all the testing on my own machine. Happy to test patches on this machine. Thanks, Waldemar Hamm Am 27.07.26 um 13:21 schrieb Antoine Monnet: > (Apologies — I sent that from the wrong identity. > monnet.antoine@gmail.com and antoine@montane.tech are the same person) > > Hi Andrey, > > Thanks for the second-machine confirmation and for spelling out the > mechanism - I went with exactly your suggestion and keyed the channel off > the machine-assigned component prefix rather than unique_id. > > 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. > > On the ch_maps alternative you raised: since asoc_sdw_hw_params() hands > every codec the full mask for playback, dai_link->ch_maps doesn't carry a > per-amp selection there, so I took the prefix-index route. Happy to > switch > to ch_maps if the machine layer is taught to fill per-amp maps first - > that's really the TI question below. > > Patch below, against broonie/sound for-next. > >  sound/soc/codecs/tas2783-sdw.c | 18 ++++++++++++++++++ >  1 file changed, 18 insertions(+) > > diff --git a/sound/soc/codecs/tas2783-sdw.c > b/sound/soc/codecs/tas2783-sdw.c > --- a/sound/soc/codecs/tas2783-sdw.c > +++ b/sound/soc/codecs/tas2783-sdw.c > @@ -216,6 +216,24 @@ static s32 tas_sdw_hw_params(struct > snd_pcm_substream *substream, >       /* SoundWire specific configuration */ >       snd_sdw_params_to_config(substream, params, >                                &stream_config, &port_config); > + > +     /* > +      * The two mono amps each render one channel of the stereo stream: > +      * snd_sdw_params_to_config() hands every codec the full mask for > +      * playback, so without a per-amp channel selection only one amp > would > +      * output. Derive the channel from the machine-assigned component > +      * prefix rather than the SoundWire address (which is > board-specific): > +      * soc_sdw_ti_amp.c maps tas2783-1/-3 to the Left speaker and > +      * tas2783-2/-4 to the Right, so odd-indexed amps take the left > +      * channel and even-indexed the right. > +      */ > +     if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK && > +         params_channels(params) == 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); > +     } > + >       /* port 1 for playback */ >       if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) >               port_config.num = 1; > -- > 2.53.0 > > > On 7/27/26 10:48, Andrey Golovko wrote: >> Hi Antoine, >> >> Confirmed on a second machine: ASUS ProArt PX13 HN7306EAC (Ryzen AI MAX+ >> 395), Ubuntu 26.04, 7.2-rc4 based kernel, same two TAS2783 at unique_id >> 0x8 / 0xB plus RT721 on SoundWire link 1. >> >> Rather than judging by ear, I used the per-amp mixer controls, which >> makes the result unambiguous. Both amps at full scale ('tas2783-1/-2 Amp >> Volume' = 20, 'Speaker Volume' = 200), all four 'Left/Right Spk[2] >> Switch' on: >> >>    speaker-test -Dpipewire -c2 -s1 (left channel only) >>      - audible >>      - 'tas2783-2 Speaker Volume' = 0  -> complete silence >>      - 'tas2783-1 Speaker Volume' = 0  -> no audible change >> >>    speaker-test -Dpipewire -c2 -s2 (right channel only) >>      - silent, with both amps unmuted at full scale >> >> So exactly your picture: one amp (tas2783-2) renders audio and it >> renders >> the *left* channel, the other amp contributes nothing, and the right >> channel is never reproduced. Both amps do load their own per-address >> blob here (1714-1-8.bin / 1714-1-B.bin, via the fallback naming path >> after the 0x-prefixed names miss), so this is not a case of the wrong >> configuration being downloaded. >> >> On the "proper mechanism" question: a good part of the plumbing already >> exists, and it does not need unique_id at all. >> >>   - The machine layer already knows which amp is which. In >>     sound/soc/sdw_utils/soc_sdw_ti_amp.c, asoc_sdw_ti_spk_rtd_init() >> maps >>     the component name prefix to a speaker widget: tas2783-1 -> "Left >>     Spk", tas2783-2 -> "Right Spk", tas2783-3/-4 -> "Left/Right Spk2". >>     That is where the four 'Left/Right Spk[2] Switch' controls on this >>     board come from. >> >>   - asoc_sdw_hw_params() (sound/soc/sdw_utils/soc_sdw_utils.c) fills >>     dai_link->ch_maps, but for playback it deliberately hands every >> codec >>     the full mask ("Identical data will be sent to all codecs in >>     playback"), leaving the per-amp channel selection to the amp itself. >>     acp-sdw-legacy-mach, which drives this board, uses both. >> >> So the driver could derive the channel from the same prefix index the >> DAPM routing already uses, or from its entry in dai_link->ch_maps, >> instead of hard-coding SoundWire addresses. >> >> Which raises the question for TI: on TAS2783 is the channel selection >> meant to come from the per-device .bin (in which case it is evidently >> not taking effect on this board), or is the driver expected to program a >> per-amp channel mask? Depending on the answer, either the firmware >> description or tas_sdw_hw_params() needs fixing - and in the latter case >> the amp's channel should come from the machine-level mapping rather than >> from unique_id, which as you say is board-specific. >> >> Happy to test patches on this hardware; I can also collect register >> dumps from both amps if that helps. >> >> Thanks, >> Andrey >