ASoC: codecs: add TAS2557 mono smart amplifier driver and tulip/jasmine_sprout enablement#187
ASoC: codecs: add TAS2557 mono smart amplifier driver and tulip/jasmine_sprout enablement#187M0Rf30 wants to merge 6 commits into
Conversation
|
new errros/warnings on dt-bindings-check: new errors/warnings on dtbs-check: |
e9b60be to
b81fc1e
Compare
|
So I guess the problem was unfortunate naming of Let me try to test this on my jasmine before merging... |
Yes it was that property. I also pushed a branch for working wifi on 5Ghz, if you want to test on jasmine in a single round: |
0793c60 to
0fb1ce6
Compare
0fb1ce6 to
671c89f
Compare
|
I updated with stereo support, |
|
When I'm trying to enable speakers on my clover I'm getting the following errors: |
671c89f to
f509f3b
Compare
I fixed the |
|
now it spams with: |
That log looks good — both amps (4c left, 4e right) load program/config, PLL locks, power on, no more -22. That only tells us the chain is alive, though, not that L/R are actually separated. Also worth playing something real for a few minutes and watching If you can grab these back I can confirm the rest: The thing I'm most curious about is ASI1_OFFSET1 on 4c vs 4e (in the regdump) — if they differ, the two One minor note: the F1=0x02 after power-up on both chips looks like a normal status bit, not a fault (faults |
|
it just spams and no sound with speaker-test and pulseaudio |
|
|
I'm testing it on newer sndcard driver (sm8250-based) HiFi.conf: |
|
speaker-test -D hw:0,0 bypasses UCM entirely, so the PRI_MI2S_RX Audio Mixer MultiMedia1 route never gets and watch dmesg | grep tas2557 — if both amps power on, the path's alive and it's down to data/offset; if Since this is the sm8250-based card, the backend naming is the thing to confirm: internal codec is on If there's no PRI_MI2S_RX Audio Mixer MultiMedia1, the speaker backend isn't hooked up in the sm8250 card's One real bug in the UCM while I'm here: in Headset Mic, the DisableSequence clears LPI_MI2S_TX_0 but the So, to move it forward, send back: That tells us whether it's a missing/!misnamed backend on the sm8250 card vs the amps getting clocked but |
|
|
also it seems that second driver instance doesn't create a debugfs entry since they're both named identically |
|
do you have any branch with sdm8250 usage for clover? |
|
Don't forget to change "sdm660-internal" folder name in the ucm's conf.d to "sdm660" and "sdm660-internal-soundcard" compatible to "sdm660-soundcard", and change INT*MI2S_TX/RX to LPI_MI2S_TX/RX* |
With these commands executed I've been able to heard a sine from both speakers one-by-one |
f509f3b to
3a08416
Compare
the speaker needs a PRI_MI2S backend dai-link pointing at both tas2557 codecs (the internal codec being on LPI_MI2S is why headphones/mic work but the amp doesn't). |
I've done that, just didn't push |
Can you gentlly push then? |
|
pushed |
|
The driver and the PRI_MI2S dai-link seems fine — you confirmed L/R separation with the manual route + What's left is on the userspace/UCM side, and your own results point right at it:
Two things to sort:
Quick check that the kernel side is truly done: with the route set by hand,
If it does, it's purely PA/UCM wiring from here. |
dmesg | grep -iE 'q6asm|q6routing|q6afe|ASoC|xrun|underrun|error|Memory_map' | tail -30 |
|
For the MM2 "no backend" (the mic), put the capture route in the verb — |
|
got sound from pipewire, but silent |
are you using the ucm that I drafted on alsa-ucm-conf? or something different? |
yes, I've copied some things from your ucm |
While it's "playing" silently, dump the state and compare to the working manual case: export XDG_RUNTIME_DIR=/run/user/$(id -u)
# the four controls that made manual playback audible:
amixer -c0 sget 'Left Speaker Switch'; amixer -c0 sget 'Right Speaker Switch'
amixer -c0 sget 'Left Speaker Volume'; amixer -c0 sget 'Right Speaker Volume'
amixer -c0 cget name='PRI_MI2S_RX Audio Mixer MultiMedia1'
# pipewire side:
wpctl get-volume @DEFAULT_AUDIO_SINK@
cat /proc/asound/card0/pcm0p/sub0/status # state/format/rate/channels |
|
|
pin the sink format in wireplumber and see if sound returns: systemctl --user restart wireplumber pipewire
cat /proc/asound/card0/pcm0p/sub0/hw_params # should now read S16_LE |
|
I already have sound on speakers |
so only the volume is the issue? |
yes, and stereo separation works properly
will try, thanks |
1c8da1f to
5db25a3
Compare
|
The amount of extra messages ("spam") in dmesg should probably be reduced, I'm talking about these, each time sound is played |
5db25a3 to
f26828b
Compare
f26828b to
41dca05
Compare
Document the TAS2557 mono Class-D smart amplifier with an integrated DSP for speaker protection. The device is controlled over I2C and receives audio over I2S/TDM (ASI). It can drive a single mono speaker or, as two devices, a stereo pair; in that case the ti,channel property selects the audio slot each device reproduces and the per-device tuning it applies. The on-chip DSP boots from a firmware image generated per speaker design with the TI PurePath Console tuning tools; the optional firmware-name property selects a board-specific image. Signed-off-by: Gianluca Boiano <morf3089@gmail.com>
The TAS2557 is a mono Class-D smart amplifier with an on-chip DSP for speaker protection. Audio is received over I2S/TDM (ASI) and processed by DSP firmware before reaching the Class-D output stage. The register map is book/page indirected behind an 8-bit regmap; the driver layers composite book/page/register addressing on top of it. The TI "uCDSP" firmware format (PLL, program and configuration blocks) is parsed with bounds checking, and program 0 with a sample-rate matched configuration is applied whenever the amplifier powers up; the device cannot pass audio without this firmware. Firmware images are produced per speaker design with TI's PurePath Console tuning tools, so they are board specific; the default image name is derived from the detected silicon revision and can be overridden with the firmware-name device tree property. Amplifier power is managed through DAPM. A fault interrupt handler recovers the device from clock loss, over-current, brownout and over-temperature events by reloading the firmware configuration. Speaker volume and I/V-sense switches are exposed as ALSA controls. Stereo is supported as two cooperating instances using stereo (device 3) firmware, with per-instance DEV_A/DEV_B tuning selected by the ti,channel property. Signed-off-by: Gianluca Boiano <morf3089@gmail.com>
The startup/shutdown clock setup only handled the internal codec MI2S ports (INT0/INT3) and the TDM ports, returning -ENOSYS for any other AFE DAI. External speaker amplifiers such as the TAS2557 on the Xiaomi tulip are wired to the Primary MI2S port, so streams to that backend failed at startup with -ENOSYS. Handle PRIMARY_MI2S_RX: on the first user enable the PRI_MI2S_IBIT clock at the I2S bit-clock rate and put the AFE into I2S master mode (CBP_CFP), releasing the clock on the last user. Also force S16_LE on the MI2S/TDM backends in the hw_params fixup: snd_mask_set_format() only adds to the format mask, so a front-end negotiating S24_LE (e.g. PipeWire) would run the Primary MI2S/TAS2557 path at 24-bit and emit silence. Reset the mask with snd_mask_none() first. Signed-off-by: Gianluca Boiano <morf3089@gmail.com>
41dca05 to
a2981b9
Compare
No description provided.