Skip to content

ASoC: tas2764: Write the idle slot setup again after a reset - #760

Closed
erikwb wants to merge 1 commit into
aurora-silicon:integration/aurorafrom
erikwb:j713/tas2764-idle-after-reset
Closed

erikwb wants to merge 1 commit into
aurora-silicon:integration/aurorafrom
erikwb:j713/tas2764-idle-after-reset

Conversation

@erikwb

@erikwb erikwb commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

After the speaker card binds a second time, the amps that fill idle TDM slots lose their force-0 enable, and the other amps' sense words go bad. This writes the idle slot setup again after the reset the component probe does.

What happens

tas2764_codec_probe() resets the amp and reinitialises the register cache. That clears the SDOUT idle slot mask (SDOUT_HIZ_1..4) and the force-0 enable (SDOUT_HIZ_9 bit 7). The idle slot setup cached in the driver data (idle_slot_config) survives the reset, though, because the module stays loaded. So when the card binds again, set_tdm_idle() is asked for the same mask and mode and returns early, and the enable is never written. set_bclk_ratio() writes the mask again, but not the enable.

On the J713 the two amps with dai-tdm-idle-mode = "zero" (left and right woofer, masks 0xf0f0 and 0x0f0f) ended up with the masks set and the enable clear. The right woofer's and right tweeter's voltage sense words then came back with the top bit set in about a quarter of the frames. The speaker protection daemon read that as a voltage with no current, charged the worst case, and held the speakers at the card's safe level, so there was no audible sound.

Any rebind triggers it. A plain rmmod snd_soc_macaudio; modprobe snd_soc_macaudio is enough, as is reloading snd-soc-aop with #759.

The change

Clear idle_slot_config right after the reset in the component probe, so the next set_tdm_idle() writes the mask and the enable again. System sleep is unaffected: it keeps the cache and syncs it back.

Testing (J713)

Reading SDOUT_HIZ_9 on the two idle-filling amps through the regmap debugfs:

Fresh module After a macaudio rebind After an snd-soc-aop reload (with #759)
Without this commit 0x80 0x00 0x00
With this commit 0x80 0x80 0x80
  • Sense data: I captured the raw 12-channel sense stream for 1 s of silence after each step.
    • Without the commit, after an snd-soc-aop reload: the right woofer's and right tweeter's voltage channels each had about 11,700 of 48,000 words with the top bit set.
    • With it, after a full reload: none, and every channel's statistics match a fresh boot.
  • Audio: after the reload, playback through PipeWire (the UCM speaker route) is audible again, and the protection daemon governs normally.
  • Checks:
    • checkpatch --strict is clean;
    • the module builds with W=1 on integration/aurora with no warnings.

The component probe resets the amp and reinitialises the register
cache, which clears the SDOUT idle slot mask and the force-0 enable.
The idle slot setup cached in the driver data survives the reset,
though, so when the card binds again and set_tdm_idle() asks for the
same mask and mode, it returns early and the force-0 enable is never
written.  set_bclk_ratio() writes the mask again but not the enable.

On the J713 every rebind of the speaker card left the two amps that
force their idle slots to zero without the enable, and the other two
amps' voltage sense words then came back with the top bit set in about
a quarter of the frames.  The speaker protection daemon reads those as a
voltage without current and holds the speakers at a safe level.

Clear the cached setup after the reset, so that the next set_tdm_idle()
writes it.

Signed-off-by: Erik Bourget <erik@ebourget.net>
@erikwb

erikwb commented Nov 1, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #820, where this is commit 19, unchanged.

@erikwb erikwb closed this Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant