Linux Sound subsystem development
 help / color / mirror / Atom feed
From: Andrey Golovko <andrey.golovko@gmail.com>
To: "Mukunda,Vijendar" <vijendar.mukunda@amd.com>,
	Antoine Monnet <antoine@montane.tech>,
	linux-sound@vger.kernel.org
Cc: shenghao-ding@ti.com, kevin-lu@ti.com, baojun.xu@ti.com,
	broonie@kernel.org, lgirdwood@gmail.com, vkoul@kernel.org,
	yung-chuan.liao@linux.intel.com, pierre-louis.bossart@linux.dev,
	Mario Limonciello <superm1@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: Re: ASoC: tas2783-sdw: calibration firmware not re-downloaded after s2idle resume (AMD ACP SoundWire, ASUS ProArt PX13)
Date: Mon, 27 Jul 2026 12:32:35 +0300	[thread overview]
Message-ID: <68c1cc6c645185a255acd0c6a73fac7d@gmail.com> (raw)
In-Reply-To: <13a5a03d-8263-443b-a6ba-84d954549b2b@amd.com>

Thanks for the quick response.

> restoring the dma ring buffer reigsters, pte programming along with
> re-enabling irq mask will be done in acp70_restore_sdw_dma_config()
> function which will be invoked during resume sequence.

You are right, and my earlier description of that part was wrong - I
apologise. acp63_sdw_pcm_resume() is the SYSTEM_SLEEP resume callback and
it does exactly that for every live substream, and it has been there
since v7.2-rc1. My claim that the ring buffer registers are only
programmed in hw_params was incorrect.

I have since measured it on the hardware instead of reading code, and the
measurements confirm your point: the ACP side is fine, and the audio is
lost somewhere else entirely.

Setup: ASUS ProArt PX13 HN7306EAC, ACP rev 0x70, two TAS2783 + RT721 on
link 1, v7.2-rc4 plus 5893013efabb. One s2idle cycle of 147 s with 140 s
of S0i3 residency, i.e. a real power gate. After resume the speakers are
silent, with no error anywhere in the log.

1) ACP registers during silent playback versus during working playback
(after the card profile is cycled, which restores audio): I dumped ring
buffer address/size, FIFO address/size, DMA size, watermark, stream
enable and the SoundWire manager block - 72 of 78 registers are
bit-identical. The only differences are ACP_EXTERNAL_INTR_CNTL, where the
silent capture has the extra PDM_DMA_INTR_MASK bit because the mics
happened to be open, and the last immediate command/response pair. So
acp70_restore_sdw_dma_config() does its job.

2) The DMA is running while silent. Sampling
ACP_P1_AUDIO1_TX_LINEARPOSITIONCNTR every 500 ms:

  +96064, +96000, +96064, +96064, +96000 bytes

96000 bytes per 500 ms = 192000 B/s = 48 kHz x 2 ch x 2 bytes, exactly
nominal. The ACP fetches the buffer and feeds the SoundWire FIFO for the
entire time the speakers produce nothing.

3) The difference is on the peripherals. Dumping
/sys/kernel/debug/soundwire/master-0-1/sdw:*/registers during playback,
silent versus working, the whole difference across all three peripherals
is one register, on both amplifiers:

  DP1 0x104 (DPn_PrepareStatus):  silent = 0x3   working = 0x0

with DPn_PrepareCtrl = 0x3 and DPn_ChannelEn = 0x3 in both cases. Since a
set bit there means "not prepared" (the core polls for NOT_PREPARED == 0
in sdw_prep_deprep_slave_ports()), both amps sit with their port
unprepared while the manager streams at them. Nothing notices, because
tas2783-sdw declares simple_ch_prep_sm, so the core skips its
write-and-poll and the codec's own tas_port_prep() writes
DPn_PrepareCtrl without ever checking the status.

I have sent the details of that part to the TI folks in a separate thread
so as not to derail this one.

I will file a Bugzilla ticket with the full dmesg (dyndbg enabled), the
register dumps from both states and the DMA counter trace, and post the
number here.

One question while I have your attention: given that
acp70_restore_sdw_dma_config() restores the DMA configuration on resume,
is SNDRV_PCM_INFO_RESUME on the SoundWire DMA PCM intended? Intel does
not set it for SoundWire, and with it userspace can issue TRIGGER_RESUME
and skip prepare entirely. On this board that path leads to the silent
state described above, though after these measurements I no longer think
the flag is the root cause.

Thanks,
Andrey

  reply	other threads:[~2026-07-27  9:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-19  0:22 ASoC: tas2783-sdw: calibration firmware not re-downloaded after s2idle resume (AMD ACP SoundWire, ASUS ProArt PX13) Antoine Monnet
2026-07-27  8:13 ` Andrey Golovko
2026-07-27  9:04   ` Mukunda,Vijendar
2026-07-27  9:32     ` Andrey Golovko [this message]
2026-07-27  9:32     ` Andrey Golovko
2026-07-27  9:55     ` Andrey Golovko
2026-07-27 13:44   ` Mark Brown

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=68c1cc6c645185a255acd0c6a73fac7d@gmail.com \
    --to=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=pierre-louis.bossart@linux.dev \
    --cc=shenghao-ding@ti.com \
    --cc=superm1@kernel.org \
    --cc=vijendar.mukunda@amd.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