Skip to content

ASoC: codecs: add TAS2557 mono smart amplifier driver and tulip/jasmine_sprout enablement#187

Open
M0Rf30 wants to merge 6 commits into
qcom-sdm660-7.0.yfrom
m0rf30/qcom-sdm660-7.0.y-tas2557-working
Open

ASoC: codecs: add TAS2557 mono smart amplifier driver and tulip/jasmine_sprout enablement#187
M0Rf30 wants to merge 6 commits into
qcom-sdm660-7.0.yfrom
m0rf30/qcom-sdm660-7.0.y-tas2557-working

Conversation

@M0Rf30

@M0Rf30 M0Rf30 commented Jun 17, 2026

Copy link
Copy Markdown

No description provided.

@minlexx

minlexx commented Jun 17, 2026

Copy link
Copy Markdown
Member

new errros/warnings on dt-bindings-check:

 CHKDT   ../Documentation/devicetree/bindings
/home/runner/work/linux/linux/Documentation/devicetree/bindings/sound/ti,tas2557.yaml: properties:ti,i2s-bits: '$ref' should not be valid under {'const': '$ref'}
	hint: Standard unit suffix properties don't need a type $ref
	from schema $id: http://devicetree.org/meta-schemas/core.yaml

new errors/warnings on dtbs-check:

sdm636-xiaomi-tulip.dtb: codec@4c (ti,tas2557): ti,i2s-bits: 16 is not of type 'array'
sdm660-xiaomi-jasmine.dtb: codec@4c (ti,tas2557): ti,i2s-bits: 16 is not of type 'array'

@M0Rf30 M0Rf30 force-pushed the m0rf30/qcom-sdm660-7.0.y-tas2557-working branch from e9b60be to b81fc1e Compare June 17, 2026 22:59
@minlexx

minlexx commented Jun 18, 2026

Copy link
Copy Markdown
Member

So I guess the problem was unfortunate naming of ti,i2s-bits property that confused bindings checker about its implicit type, and naming it ti,i2s-bit-width avoids this confusion..

Let me try to test this on my jasmine before merging...

@M0Rf30

M0Rf30 commented Jun 18, 2026

Copy link
Copy Markdown
Author

So I guess the problem was unfortunate naming of ti,i2s-bits property that confused bindings checker about its implicit type, and naming it ti,i2s-bit-width avoids this confusion..

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:
https://github.com/sdm660-mainline/linux/tree/m0rf30/qcom-sdm660-7.0.y-wifi-5ghz

@M0Rf30 M0Rf30 force-pushed the m0rf30/qcom-sdm660-7.0.y-tas2557-working branch 2 times, most recently from 0793c60 to 0fb1ce6 Compare June 18, 2026 09:37
Comment thread sound/soc/codecs/tas2557.h
@M0Rf30 M0Rf30 force-pushed the m0rf30/qcom-sdm660-7.0.y-tas2557-working branch from 0fb1ce6 to 671c89f Compare June 18, 2026 12:33
@M0Rf30

M0Rf30 commented Jun 18, 2026

Copy link
Copy Markdown
Author

I updated with stereo support, firmware-name dts property support and checkpatch/dtschema fixes

@setotau

setotau commented Jun 18, 2026

Copy link
Copy Markdown

When I'm trying to enable speakers on my clover I'm getting the following errors:

[  264.522235] tas2557 1-004c: loading program 0 (Tuning Mode)
[  264.659446] tas2557 1-004c: firmware program load failed on enable: -22
[  264.659474] tas2557 1-004c: ASoC error (-22): at snd_soc_dai_digital_mute() on tas2557-amplifier
[  264.683178] tas2557 1-004e: loading program 0 (Tuning Mode)
[  264.821246] tas2557 1-004e: firmware program load failed on enable: -22
[  264.821275] tas2557 1-004e: ASoC error (-22): at snd_soc_dai_digital_mute() on tas2557-amplifier
[  264.873725] tas2557 1-004c: loading program 0 (Tuning Mode)
[  265.001238] tas2557 1-004c: firmware program load failed on enable: -22

@M0Rf30 M0Rf30 force-pushed the m0rf30/qcom-sdm660-7.0.y-tas2557-working branch from 671c89f to f509f3b Compare June 18, 2026 15:24
@M0Rf30

M0Rf30 commented Jun 18, 2026

Copy link
Copy Markdown
Author

When I'm trying to enable speakers on my clover I'm getting the following errors:

[  264.522235] tas2557 1-004c: loading program 0 (Tuning Mode)
[  264.659446] tas2557 1-004c: firmware program load failed on enable: -22
[  264.659474] tas2557 1-004c: ASoC error (-22): at snd_soc_dai_digital_mute() on tas2557-amplifier
[  264.683178] tas2557 1-004e: loading program 0 (Tuning Mode)
[  264.821246] tas2557 1-004e: firmware program load failed on enable: -22
[  264.821275] tas2557 1-004e: ASoC error (-22): at snd_soc_dai_digital_mute() on tas2557-amplifier
[  264.873725] tas2557 1-004c: loading program 0 (Tuning Mode)
[  265.001238] tas2557 1-004c: firmware program load failed on enable: -22

I fixed the tas2557_load_block under-advance that caused the firmware program load failed. Please retry

@setotau

setotau commented Jun 18, 2026

Copy link
Copy Markdown

now it spams with:

[  156.448344] tas2557 1-004c: loading program 0 (Tuning Mode)
[  156.782475] tas2557 1-004c: loading config 0 (configuration_Tuning Mode_48 KHz_s1_0) rate=48000 Hz PLL[0]
[  156.886134] tas2557 1-004c: PLL locked, power-up OK (FLAG=0xfc F1=0x02 F2=0x00)
[  156.886181] tas2557 1-004c: amplifier powered on (prog=0 cfg=0)
[  156.994161] tas2557 1-004e: loading program 0 (Tuning Mode)
[  157.317959] tas2557 1-004e: loading config 0 (configuration_Tuning Mode_48 KHz_s1_0) rate=48000 Hz PLL[0]
[  157.410596] tas2557 1-004e: PLL locked, power-up OK (FLAG=0xfc F1=0x02 F2=0x00)
[  157.410641] tas2557 1-004e: amplifier powered on (prog=0 cfg=0)

@M0Rf30

M0Rf30 commented Jun 18, 2026

Copy link
Copy Markdown
Author

now it spams with:

[  156.448344] tas2557 1-004c: loading program 0 (Tuning Mode)
[  156.782475] tas2557 1-004c: loading config 0 (configuration_Tuning Mode_48 KHz_s1_0) rate=48000 Hz PLL[0]
[  156.886134] tas2557 1-004c: PLL locked, power-up OK (FLAG=0xfc F1=0x02 F2=0x00)
[  156.886181] tas2557 1-004c: amplifier powered on (prog=0 cfg=0)
[  156.994161] tas2557 1-004e: loading program 0 (Tuning Mode)
[  157.317959] tas2557 1-004e: loading config 0 (configuration_Tuning Mode_48 KHz_s1_0) rate=48000 Hz PLL[0]
[  157.410596] tas2557 1-004e: PLL locked, power-up OK (FLAG=0xfc F1=0x02 F2=0x00)
[  157.410641] tas2557 1-004e: amplifier powered on (prog=0 cfg=0)

That log looks good — both amps (4c left, 4e right) load program/config, PLL locks, power on, no more -22.
So the load path is working on both channels now.

That only tells us the chain is alive, though, not that L/R are actually separated.
Easiest way to check:
speaker-test -c 2 -t wav
it says "Front Left" then "Front Right", so make sure left only comes out the left speaker and right only the right. If both speakers play both channels (or they're swapped), the ASI offset / ti,channel mapping needs a look.

Also worth playing something real for a few minutes and watching dmesg | grep tas2557 for protection/IRQ/PLL-drop spam.

If you can grab these back I can confirm the rest:

  cat /proc/asound/card0/pcm0p/sub0/hw_params      # during playback, expect S16_LE/48000/2ch                
  amixer -c0 contents | grep -iE -A1 'PRI_MI2S.*MultiMedia1|Left Speaker|Right Speaker'                      
  cat /sys/kernel/debug/tas2557/status                                                                      
  cat /sys/kernel/debug/tas2557/regdump                                                                     
  dmesg | grep -iE 'tas2557|q6asm'                                                                           

The thing I'm most curious about is ASI1_OFFSET1 on 4c vs 4e (in the regdump) — if they differ, the two
chips are reading different I2S slots and stereo separation is correct.

One minor note: the F1=0x02 after power-up on both chips looks like a normal status bit, not a fault (faults
are over-current 0x80, brownout 0x08, clk-lost 0x04, etc.) — just keep an eye that it doesn't escalate
during real playback.

@setotau

setotau commented Jun 18, 2026

Copy link
Copy Markdown

it just spams and no sound with speaker-test and pulseaudio

@setotau

setotau commented Jun 18, 2026

Copy link
Copy Markdown
/sys/kernel/debug/tas2557 # cat /proc/asound/card0/pcm0p/sub0/hw_params
access: RW_INTERLEAVED
format: S16_LE
subformat: STD
channels: 2
rate: 44100 (44100/1)
period_size: 1440
buffer_size: 4320
/sys/kernel/debug/tas2557 # amixer -c0 contents | grep -iE -A1 'PRI_MI2S.*MultiMedia1|Left Speaker|Right Speaker'
numid=1,iface=MIXER,name='Left Speaker Switch'
  ; type=BOOLEAN,access=rw------,values=1
--
numid=2,iface=MIXER,name='Left Speaker Volume'
  ; type=INTEGER,access=rw---R--,values=1,min=0,max=15,step=0
--
numid=138,iface=MIXER,name='PRI_MI2S_RX Audio Mixer MultiMedia1'
  ; type=BOOLEAN,access=rw------,values=1
--
numid=8,iface=MIXER,name='Right Speaker Switch'
  ; type=BOOLEAN,access=rw------,values=1
--
numid=9,iface=MIXER,name='Right Speaker Volume'
  ; type=INTEGER,access=rw---R--,values=1,min=0,max=15,step=0
/sys/kernel/debug/tas2557 # cat /sys/kernel/debug/tas2557/status 
pg_id:        0xa0 (PG2.1)
firmware:     loaded (tas2557s_uCDSP.bin)
fw_version:   0x01010000
ppc_version:  0x00068700
num_programs: 3
num_configs:  6
active_prog:  0 (Tuning Mode)
active_cfg:   0 (configuration_Tuning Mode_48 KHz_s1_0, 48000 Hz)
powered:      no
muted:        yes
i2s_bits:     16
channel:      0 (left)
imon_slot:    0
vmon_slot:    2
sample_rate:  48000
err_code:     0x00000000
restart_cnt:  0
die_temp:     0 C
(live registers not read: device powered off)
/sys/kernel/debug/tas2557 # cat /sys/kernel/debug/tas2557/regdump
=== Book 0 Page 0 (core control) ===
B0P00R001  SW_RESET                     = 0x00
B0P00R003  REV_PGID                     = 0xa0
B0P00R004  POWER_CTRL1                  = 0x00
B0P00R005  POWER_CTRL2                  = 0x00
B0P00R006  SPK_CTRL                     = 0x74
B0P00R007  MUTE                         = 0x03
B0P00R008  SNS_CTRL                     = 0x00
B0P00R042  ASI_CTL1                     = 0x00
B0P00R044  CLK_ERR_CTRL                 = 0x00
B0P00R045  CLK_ERR_CTRL2                = 0x17
B0P00R046  CLK_ERR_CTRL3                = 0x21
B0P00R100  POWER_UP_FLAG                = 0x00
B0P00R104  FLAGS_1                      = 0x02
B0P00R108  FLAGS_2                      = 0x02

=== Book 0 Page 1 (ASI / clocks / GPIO) ===
B0P01R001  ASI1_DAC_FORMAT              = 0x00
B0P01R021  ASI2_DAC_FORMAT              = 0x18
B0P01R023  ASI2_OFFSET1                 = 0x00
B0P01R028  ASI2_DAC_BCLK                = 0x20
B0P01R029  ASI2_DAC_WCLK                = 0x28
B0P01R033  ASI2_BDIV_CLK_SEL            = 0x01
B0P01R034  ASI2_BDIV_CLK_RATIO          = 0x81
B0P01R035  ASI2_WDIV_CLK_RATIO          = 0xc0
B0P01R065  GPIO5 (ASI2 BCLK)            = 0x00
B0P01R066  GPIO6 (ASI2 WCLK)            = 0x00
B0P01R067  GPIO7 (ASI2 DOUT)            = 0x00
B0P01R068  GPIO8 (ASI2 DIN)             = 0x00
B0P01R077  GPI_PIN                      = 0x00
B0P01R115  MAIN_CLKIN                   = 0x0f
B0P01R116  PLL_CLKIN                    = 0x00

=== Book 100 Page 0 (DSP / PLL) ===
B100P00R027  PLL_P_VAL                    = 0x01
B100P00R028  PLL_J_VAL                    = 0x30
B100P00R029  PLL_D_MSB                    = 0x00
B100P00R030  PLL_D_LSB                    = 0x00
B100P00R031  CLK_MISC                     = 0x20
B100P00R032  PLL_N_VAL                    = 0x03
B100P00R007  SOFT_MUTE                    = 0x01
B100P00R001  DAC_INTERPOL                 = 0x08

@setotau

setotau commented Jun 18, 2026

Copy link
Copy Markdown

I'm testing it on newer sndcard driver (sm8250-based)
clover.conf:

Syntax 3

SectionUseCase."HiFi" {
        File "/Xiaomi/clover/HiFi.conf"
        Comment "HiFi audio"
}

# Volume defaults should be declared in the boot sequence so they can be
# overriden by the user.
BootSequence [
        # Headphones
        cset "name='Digital RX1 Digital Volume' 84"
        cset "name='Digital RX2 Digital Volume' 84"

        # Headset Microphone
        cset "name='ADC2 Volume' 8"

        # Speakers
        cset "name='Left Speaker Volume' 14"
        cset "name='Right Speaker Volume' 14"
]

FixedBootSequence [
        cset "name='RDAC2 MUX' RX2"
]

HiFi.conf:

SectionVerb {
        EnableSequence [


        ]

        DisableSequence [


        ]

        Value {
                TQ "HiFi"
        }
}

SectionDevice."Microphone" {
        Comment "Built-in Microphone"

        EnableSequence [
                cset "name='MultiMedia2 Mixer LPI_MI2S_TX_3' 1"
                cset "name='Digital CIC1 MUX' AMIC"
                cset "name='Digital DEC1 MUX' ADC1"
        ]

        DisableSequence [
                cset "name='MultiMedia2 Mixer LPI_MI2S_TX_3' 0"
                cset "name='Digital DEC1 MUX' ZERO"
        ]

        ConflictingDevices [
                "Headset Mic"
        ]

        Value {
                CapturePCM "hw:${CardId},1"
                CapturePriority 100
                CaptureChannels 1
        }
}

SectionDevice."Headphones" {
        Comment "Headphones (3.5 mm jack)"

        EnableSequence [
                cset "name='LPI_MI2S_RX_0 Audio Mixer MultiMedia1' 1"
                cset "name='Digital RX1 MIX1 INP1' RX1"
                cset "name='Digital RX2 MIX1 INP1' RX2"
                cset "name='HPHL' Switch"
                cset "name='HPHR' Switch"
        ]

        DisableSequence [
                cset "name='LPI_MI2S_RX_0 Audio Mixer MultiMedia1' 0"
                cset "name='Digital RX1 MIX1 INP1' ZERO"
                cset "name='Digital RX2 MIX1 INP1' ZERO"
                cset "name='HPHL' ZERO"
                cset "name='HPHR' ZERO"
        ]

        Value {
                PlaybackPCM "hw:${CardId},0"
                PlaybackPriority 200
                JackControl "Headset Jack"
        }
}

SectionDevice."Headset Mic" {
        Comment "Headset Microphone"

        EnableSequence [
                cset "name='MultiMedia2 Mixer LPI_MI2S_TX_3' 1"
                cset "name='Digital CIC1 MUX' AMIC"
                cset "name='Digital DEC1 MUX' ADC2"
                cset "name='ADC2 MUX' INP2"
        ]

        DisableSequence [
                cset "name='MultiMedia2 Mixer LPI_MI2S_TX_0' 0"
                cset "name='Digital DEC1 MUX' ZERO"
                cset "name='ADC2 MUX' ZERO"
        ]

        ConflictingDevices [
                "Microphone"
        ]

        Value {
                CapturePCM "hw:${CardId},1"
                CapturePriority 200
                CaptureChannels 1
                JackControl "Headset Jack"
        }
}

SectionDevice."Speaker" {
        Comment "Built-in Speakers (2x TAS2557)"

        EnableSequence [
                cset "name='PRI_MI2S_RX Audio Mixer MultiMedia1' 1"
                cset "name='Left Speaker Switch' 1"
                cset "name='Right Speaker Switch' 1"
        ]

        DisableSequence [
                cset "name='Left Speaker Switch' 0"
                cset "name='Right Speaker Switch' 0"
                cset "name='PRI_MI2S_RX Audio Mixer MultiMedia1' 0"
        ]

        ConflictingDevices [ "Headphones" ]

        Value {
                PlaybackPCM "hw:${CardId},0"
                PlaybackPriority 300
        }
}

@M0Rf30

M0Rf30 commented Jun 18, 2026

Copy link
Copy Markdown
Author

speaker-test -D hw:0,0 bypasses UCM entirely, so the PRI_MI2S_RX Audio Mixer MultiMedia1 route never gets
enabled — nothing reaches the amps, which would explain "doesn't work at all". Either play through pipewire
with the Speaker device selected, or set the route by hand first:

  amixer -c0 cset name='PRI_MI2S_RX Audio Mixer MultiMedia1' 1                                               
  amixer -c0 cset name='Left Speaker Switch' 1                                                               
  amixer -c0 cset name='Right Speaker Switch' 1                                                              
  speaker-test -D hw:0,0 -c 2 -r 48000 -t sine                                                               

and watch dmesg | grep tas2557 — if both amps power on, the path's alive and it's down to data/offset; if
they don't, the route isn't reaching PRI_MI2S on this card.

Since this is the sm8250-based card, the backend naming is the thing to confirm: internal codec is on
LPI_MI2S_* (your Headphones/Mic use that), amp on PRI_MI2S_RX. Check the control actually exists and is
wired to the TAS2557:

  amixer -c0 controls | grep -iE 'PRI_MI2S|Audio Mixer MultiMedia1'                                          

If there's no PRI_MI2S_RX Audio Mixer MultiMedia1, the speaker backend isn't hooked up in the sm8250 card's
DT yet (and the dai-link needs to point PRI_MI2S RX at the two tas2557 codecs).

One real bug in the UCM while I'm here: in Headset Mic, the DisableSequence clears LPI_MI2S_TX_0 but the
EnableSequence set LPI_MI2S_TX_3 — mismatch, should be _3. Won't affect the speaker, just leaves the cap
route stuck.

So, to move it forward, send back:

  amixer -c0 controls | grep -iE 'PRI_MI2S|MultiMedia1'                                                      
  # then with the route set (above) or via pipewire Speaker:                                                 
  dmesg | grep -iE 'tas2557|q6asm'                                                                           
  cat /proc/asound/card0/pcm0p/sub0/hw_params                                                                

That tells us whether it's a missing/!misnamed backend on the sm8250 card vs the amps getting clocked but
silent (back to the ASI2 offset question).

@setotau

setotau commented Jun 18, 2026

Copy link
Copy Markdown
xiaomi-clover:~$ amixer -c0 controls | grep -iE 'PRI_MI2S|Audio Mixer MultiMedia1'
numid=74,iface=MIXER,name='DISPLAY_PORT_RX Audio Mixer MultiMedia1'
numid=586,iface=MIXER,name='LPI_MI2S_RX_0 Audio Mixer MultiMedia1'
numid=594,iface=MIXER,name='LPI_MI2S_RX_1 Audio Mixer MultiMedia1'
numid=602,iface=MIXER,name='LPI_MI2S_RX_2 Audio Mixer MultiMedia1'
numid=610,iface=MIXER,name='LPI_MI2S_RX_3 Audio Mixer MultiMedia1'
numid=618,iface=MIXER,name='LPI_MI2S_RX_4 Audio Mixer MultiMedia1'
numid=626,iface=MIXER,name='LPI_MI2S_RX_5 Audio Mixer MultiMedia1'
numid=634,iface=MIXER,name='LPI_MI2S_RX_6 Audio Mixer MultiMedia1'
numid=642,iface=MIXER,name='MultiMedia1 Mixer PRI_MI2S_TX'
numid=713,iface=MIXER,name='MultiMedia2 Mixer PRI_MI2S_TX'
numid=784,iface=MIXER,name='MultiMedia3 Mixer PRI_MI2S_TX'
numid=855,iface=MIXER,name='MultiMedia4 Mixer PRI_MI2S_TX'
numid=926,iface=MIXER,name='MultiMedia5 Mixer PRI_MI2S_TX'
numid=997,iface=MIXER,name='MultiMedia6 Mixer PRI_MI2S_TX'
numid=1068,iface=MIXER,name='MultiMedia7 Mixer PRI_MI2S_TX'
numid=1139,iface=MIXER,name='MultiMedia8 Mixer PRI_MI2S_TX'
numid=178,iface=MIXER,name='PRIMARY_TDM_RX_0 Audio Mixer MultiMedia1'
numid=186,iface=MIXER,name='PRIMARY_TDM_RX_1 Audio Mixer MultiMedia1'
numid=194,iface=MIXER,name='PRIMARY_TDM_RX_2 Audio Mixer MultiMedia1'
numid=202,iface=MIXER,name='PRIMARY_TDM_RX_3 Audio Mixer MultiMedia1'
numid=210,iface=MIXER,name='PRIMARY_TDM_RX_4 Audio Mixer MultiMedia1'
numid=218,iface=MIXER,name='PRIMARY_TDM_RX_5 Audio Mixer MultiMedia1'
numid=226,iface=MIXER,name='PRIMARY_TDM_RX_6 Audio Mixer MultiMedia1'
numid=234,iface=MIXER,name='PRIMARY_TDM_RX_7 Audio Mixer MultiMedia1'
numid=138,iface=MIXER,name='PRI_MI2S_RX Audio Mixer MultiMedia1'
numid=139,iface=MIXER,name='PRI_MI2S_RX Audio Mixer MultiMedia2'
numid=140,iface=MIXER,name='PRI_MI2S_RX Audio Mixer MultiMedia3'
numid=141,iface=MIXER,name='PRI_MI2S_RX Audio Mixer MultiMedia4'
numid=142,iface=MIXER,name='PRI_MI2S_RX Audio Mixer MultiMedia5'
numid=143,iface=MIXER,name='PRI_MI2S_RX Audio Mixer MultiMedia6'
numid=144,iface=MIXER,name='PRI_MI2S_RX Audio Mixer MultiMedia7'
numid=145,iface=MIXER,name='PRI_MI2S_RX Audio Mixer MultiMedia8'
numid=154,iface=MIXER,name='QUAT_MI2S_RX Audio Mixer MultiMedia1'
numid=370,iface=MIXER,name='QUAT_TDM_RX_0 Audio Mixer MultiMedia1'
numid=378,iface=MIXER,name='QUAT_TDM_RX_1 Audio Mixer MultiMedia1'
numid=386,iface=MIXER,name='QUAT_TDM_RX_2 Audio Mixer MultiMedia1'
numid=394,iface=MIXER,name='QUAT_TDM_RX_3 Audio Mixer MultiMedia1'
numid=402,iface=MIXER,name='QUAT_TDM_RX_4 Audio Mixer MultiMedia1'
numid=410,iface=MIXER,name='QUAT_TDM_RX_5 Audio Mixer MultiMedia1'
numid=418,iface=MIXER,name='QUAT_TDM_RX_6 Audio Mixer MultiMedia1'
numid=426,iface=MIXER,name='QUAT_TDM_RX_7 Audio Mixer MultiMedia1'
numid=162,iface=MIXER,name='QUIN_MI2S_RX Audio Mixer MultiMedia1'
numid=434,iface=MIXER,name='QUIN_TDM_RX_0 Audio Mixer MultiMedia1'
numid=442,iface=MIXER,name='QUIN_TDM_RX_1 Audio Mixer MultiMedia1'
numid=450,iface=MIXER,name='QUIN_TDM_RX_2 Audio Mixer MultiMedia1'
numid=458,iface=MIXER,name='QUIN_TDM_RX_3 Audio Mixer MultiMedia1'
numid=466,iface=MIXER,name='QUIN_TDM_RX_4 Audio Mixer MultiMedia1'
numid=474,iface=MIXER,name='QUIN_TDM_RX_5 Audio Mixer MultiMedia1'
numid=482,iface=MIXER,name='QUIN_TDM_RX_6 Audio Mixer MultiMedia1'
numid=490,iface=MIXER,name='QUIN_TDM_RX_7 Audio Mixer MultiMedia1'
numid=514,iface=MIXER,name='RX_CODEC_DMA_RX_0 Audio Mixer MultiMedia1'
numid=522,iface=MIXER,name='RX_CODEC_DMA_RX_1 Audio Mixer MultiMedia1'
numid=530,iface=MIXER,name='RX_CODEC_DMA_RX_2 Audio Mixer MultiMedia1'
numid=538,iface=MIXER,name='RX_CODEC_DMA_RX_3 Audio Mixer MultiMedia1'
numid=546,iface=MIXER,name='RX_CODEC_DMA_RX_4 Audio Mixer MultiMedia1'
numid=554,iface=MIXER,name='RX_CODEC_DMA_RX_5 Audio Mixer MultiMedia1'
numid=562,iface=MIXER,name='RX_CODEC_DMA_RX_6 Audio Mixer MultiMedia1'
numid=570,iface=MIXER,name='RX_CODEC_DMA_RX_7 Audio Mixer MultiMedia1'
numid=146,iface=MIXER,name='SEC_MI2S_RX Audio Mixer MultiMedia1'
numid=242,iface=MIXER,name='SEC_TDM_RX_0 Audio Mixer MultiMedia1'
numid=250,iface=MIXER,name='SEC_TDM_RX_1 Audio Mixer MultiMedia1'
numid=258,iface=MIXER,name='SEC_TDM_RX_2 Audio Mixer MultiMedia1'
numid=266,iface=MIXER,name='SEC_TDM_RX_3 Audio Mixer MultiMedia1'
numid=274,iface=MIXER,name='SEC_TDM_RX_4 Audio Mixer MultiMedia1'
numid=282,iface=MIXER,name='SEC_TDM_RX_5 Audio Mixer MultiMedia1'
numid=290,iface=MIXER,name='SEC_TDM_RX_6 Audio Mixer MultiMedia1'
numid=298,iface=MIXER,name='SEC_TDM_RX_7 Audio Mixer MultiMedia1'
numid=82,iface=MIXER,name='SLIMBUS_0_RX Audio Mixer MultiMedia1'
numid=90,iface=MIXER,name='SLIMBUS_1_RX Audio Mixer MultiMedia1'
numid=98,iface=MIXER,name='SLIMBUS_2_RX Audio Mixer MultiMedia1'
numid=106,iface=MIXER,name='SLIMBUS_3_RX Audio Mixer MultiMedia1'
numid=114,iface=MIXER,name='SLIMBUS_4_RX Audio Mixer MultiMedia1'
numid=122,iface=MIXER,name='SLIMBUS_5_RX Audio Mixer MultiMedia1'
numid=130,iface=MIXER,name='SLIMBUS_6_RX Audio Mixer MultiMedia1'
numid=170,iface=MIXER,name='TERT_MI2S_RX Audio Mixer MultiMedia1'
numid=306,iface=MIXER,name='TERT_TDM_RX_0 Audio Mixer MultiMedia1'
numid=314,iface=MIXER,name='TERT_TDM_RX_1 Audio Mixer MultiMedia1'
numid=322,iface=MIXER,name='TERT_TDM_RX_2 Audio Mixer MultiMedia1'
numid=330,iface=MIXER,name='TERT_TDM_RX_3 Audio Mixer MultiMedia1'
numid=338,iface=MIXER,name='TERT_TDM_RX_4 Audio Mixer MultiMedia1'
numid=346,iface=MIXER,name='TERT_TDM_RX_5 Audio Mixer MultiMedia1'
numid=354,iface=MIXER,name='TERT_TDM_RX_6 Audio Mixer MultiMedia1'
numid=362,iface=MIXER,name='TERT_TDM_RX_7 Audio Mixer MultiMedia1'
numid=578,iface=MIXER,name='USB_RX Audio Mixer MultiMedia1'
numid=498,iface=MIXER,name='WSA_CODEC_DMA_RX_0 Audio Mixer MultiMedia1'
numid=506,iface=MIXER,name='WSA_CODEC_DMA_RX_1 Audio Mixer MultiMedia1'
xiaomi-clover:~$ dmesg | grep -iE 'tas2557|q6asm'
[   17.399336] tas2557 1-004c: reset GPIO: present
[   17.407814] tas2557 1-004c: TAS2557 probed (I2C addr 0x4c, left channel, 16-bit I2S)
[   17.420609] tas2557 1-004e: reset GPIO: present
[   17.424305] debugfs: 'tas2557' already exists in '/'
[   17.428251] tas2557 1-004e: TAS2557 probed (I2C addr 0x4e, right channel, 16-bit I2S)
[   18.683103] tas2557 1-004c: silicon: PG2.1 (0xa0)
[   18.689191] tas2557 1-004c: codec probed, requesting firmware 'tas2557s_uCDSP.bin'
[   18.692691] tas2557 1-004c: firmware 'tas2557s_uCDSP.bin' loaded: ver=0x1010000 ppc=0x68700 drv=0x400 3 program(s) 6 config(s)
[   18.695976] tas2557 1-004c:   program[0]: Tuning Mode program
[   18.699155] tas2557 1-004c:   program[1]: ROM Mode 1 program
[   18.702410] tas2557 1-004c:   program[2]: FactoryCalibration ROMMode2 program
[   18.705508] tas2557 1-004c:   config[0]: Tuning Settings (prog=0 rate=48000 PLL[0])
[   18.708652] tas2557 1-004c:   config[1]: Tuning Settings (prog=0 rate=48000 PLL[0])
[   18.711770] tas2557 1-004c:   config[2]: Tuning Settings (prog=0 rate=48000 PLL[0])
[   18.713124] tas2557 1-004e: silicon: PG2.1 (0xa0)
[   18.714877] tas2557 1-004c:   config[3]: Tuning Settings (prog=0 rate=48000 PLL[0])
[   18.720659] tas2557 1-004e: codec probed, requesting firmware 'tas2557s_uCDSP.bin'
[   18.720914] tas2557 1-004c:   config[4]: Tuning Settings (prog=1 rate=48000 PLL[1])
[   18.720924] tas2557 1-004c:   config[5]: Tuning Settings (prog=2 rate=48000 PLL[2])
[   18.734575] tas2557 1-004e: firmware 'tas2557s_uCDSP.bin' loaded: ver=0x1010000 ppc=0x68700 drv=0x400 3 program(s) 6 config(s)
[   18.738956] tas2557 1-004e:   program[0]: Tuning Mode program
[   18.743262] tas2557 1-004e:   program[1]: ROM Mode 1 program
[   18.744647] tas2557 1-004c: loading program 0 (Tuning Mode)
[   18.747551] tas2557 1-004e:   program[2]: FactoryCalibration ROMMode2 program
[   18.754930] tas2557 1-004e:   config[0]: Tuning Settings (prog=0 rate=48000 PLL[0])
[   18.759176] tas2557 1-004e:   config[1]: Tuning Settings (prog=0 rate=48000 PLL[0])
[   18.766570] tas2557 1-004e:   config[2]: Tuning Settings (prog=0 rate=48000 PLL[0])
[   18.774275] tas2557 1-004e:   config[3]: Tuning Settings (prog=0 rate=48000 PLL[0])
[   18.778568] tas2557 1-004e:   config[4]: Tuning Settings (prog=1 rate=48000 PLL[1])
[   18.782817] tas2557 1-004e:   config[5]: Tuning Settings (prog=2 rate=48000 PLL[2])
[   18.837351] tas2557 1-004e: loading program 0 (Tuning Mode)
[   19.388451] tas2557 1-004c: loading config 0 (configuration_Tuning Mode_48 KHz_s1_0) rate=48000 Hz PLL[0]
[   19.475914] tas2557 1-004e: loading config 0 (configuration_Tuning Mode_48 KHz_s1_0) rate=48000 Hz PLL[0]
[   19.563098] tas2557 1-004c: firmware initialised successfully
[   19.599107] tas2557 1-004e: firmware initialised successfully
[   24.843883] tas2557 1-004c: loading program 0 (Tuning Mode)
[   25.193774] tas2557 1-004c: loading config 0 (configuration_Tuning Mode_48 KHz_s1_0) rate=48000 Hz PLL[0]
[   25.324267] tas2557 1-004c: loading program 0 (Tuning Mode)
[   25.662686] tas2557 1-004c: loading config 0 (configuration_Tuning Mode_48 KHz_s1_0) rate=48000 Hz PLL[0]
[   25.778829] tas2557 1-004e: loading program 0 (Tuning Mode)
[   26.119743] tas2557 1-004e: loading config 0 (configuration_Tuning Mode_48 KHz_s1_0) rate=48000 Hz PLL[0]
[   26.224866] tas2557 1-004e: loading program 0 (Tuning Mode)
[   26.554213] tas2557 1-004e: loading config 0 (configuration_Tuning Mode_48 KHz_s1_0) rate=48000 Hz PLL[0]
[   79.245947] tas2557 1-004c: loading program 0 (Tuning Mode)
[   79.564323] tas2557 1-004c: loading config 0 (configuration_Tuning Mode_48 KHz_s1_0) rate=48000 Hz PLL[0]
[   79.649549] tas2557 1-004c: PLL locked, power-up OK (FLAG=0xfc F1=0x00 F2=0x00)
[   79.649586] tas2557 1-004c: amplifier powered on (prog=0 cfg=0)
[   84.919456] tas2557 1-004e: loading program 0 (Tuning Mode)
[   85.235005] tas2557 1-004e: loading config 0 (configuration_Tuning Mode_48 KHz_s1_0) rate=48000 Hz PLL[0]
[   85.336015] tas2557 1-004e: PLL locked, power-up OK (FLAG=0xfc F1=0x00 F2=0x00)
[   85.336052] tas2557 1-004e: amplifier powered on (prog=0 cfg=0)
[  190.602066] tas2557 1-004c: loading program 0 (Tuning Mode)
[  190.917753] tas2557 1-004c: loading config 0 (configuration_Tuning Mode_48 KHz_s1_0) rate=48000 Hz PLL[0]
[  191.018273] tas2557 1-004c: PLL locked, power-up OK (FLAG=0xf4 F1=0x02 F2=0x00)
[  191.018314] tas2557 1-004c: amplifier powered on (prog=0 cfg=0)
[  191.040309] tas2557 1-004e: loading program 0 (Tuning Mode)
[  191.363099] tas2557 1-004e: loading config 0 (configuration_Tuning Mode_48 KHz_s1_0) rate=48000 Hz PLL[0]
[  191.459958] tas2557 1-004e: PLL locked, power-up OK (FLAG=0xfc F1=0x02 F2=0x00)
[  191.460002] tas2557 1-004e: amplifier powered on (prog=0 cfg=0)
[  191.565493] tas2557 1-004c: loading program 0 (Tuning Mode)
[  191.885546] tas2557 1-004c: loading config 0 (configuration_Tuning Mode_48 KHz_s1_0) rate=48000 Hz PLL[0]
[  191.985764] tas2557 1-004c: PLL locked, power-up OK (FLAG=0xfc F1=0x02 F2=0x00)
[  191.985803] tas2557 1-004c: amplifier powered on (prog=0 cfg=0)
[  192.007795] tas2557 1-004e: loading program 0 (Tuning Mode)
[  192.334401] tas2557 1-004e: loading config 0 (configuration_Tuning Mode_48 KHz_s1_0) rate=48000 Hz PLL[0]
[  192.428616] tas2557 1-004e: PLL locked, power-up OK (FLAG=0xfc F1=0x02 F2=0x00)
[  192.428649] tas2557 1-004e: amplifier powered on (prog=0 cfg=0)
[  192.533364] tas2557 1-004c: loading program 0 (Tuning Mode)
[  192.866158] tas2557 1-004c: loading config 0 (configuration_Tuning Mode_48 KHz_s1_0) rate=48000 Hz PLL[0]
[  192.960467] tas2557 1-004c: PLL locked, power-up OK (FLAG=0xf4 F1=0x02 F2=0x00)
[  192.960570] tas2557 1-004c: amplifier powered on (prog=0 cfg=0)
[  192.982564] tas2557 1-004e: loading program 0 (Tuning Mode)
[  193.303524] tas2557 1-004e: loading config 0 (configuration_Tuning Mode_48 KHz_s1_0) rate=48000 Hz PLL[0]
[  193.392115] tas2557 1-004e: PLL locked, power-up OK (FLAG=0xfc F1=0x02 F2=0x00)
[  193.392149] tas2557 1-004e: amplifier powered on (prog=0 cfg=0)
[  193.496358] tas2557 1-004c: loading program 0 (Tuning Mode)
[  193.821718] tas2557 1-004c: loading config 0 (configuration_Tuning Mode_48 KHz_s1_0) rate=48000 Hz PLL[0]
[  193.910915] tas2557 1-004c: PLL locked, power-up OK (FLAG=0xfc F1=0x02 F2=0x00)
[  193.910953] tas2557 1-004c: amplifier powered on (prog=0 cfg=0)
[  193.934088] tas2557 1-004e: loading program 0 (Tuning Mode)
[  194.261442] tas2557 1-004e: loading config 0 (configuration_Tuning Mode_48 KHz_s1_0) rate=48000 Hz PLL[0]
[  194.356689] tas2557 1-004e: PLL locked, power-up OK (FLAG=0xfc F1=0x02 F2=0x00)
[  194.356722] tas2557 1-004e: amplifier powered on (prog=0 cfg=0)
[  194.908206] tas2557 1-004c: loading program 0 (Tuning Mode)
[  195.226590] tas2557 1-004c: loading config 0 (configuration_Tuning Mode_48 KHz_s1_0) rate=48000 Hz PLL[0]
[  195.327898] tas2557 1-004c: PLL locked, power-up OK (FLAG=0xfc F1=0x02 F2=0x00)
[  195.327955] tas2557 1-004c: amplifier powered on (prog=0 cfg=0)
[  195.350838] tas2557 1-004e: loading program 0 (Tuning Mode)
[  195.672268] tas2557 1-004e: loading config 0 (configuration_Tuning Mode_48 KHz_s1_0) rate=48000 Hz PLL[0]
[  195.769137] tas2557 1-004e: PLL locked, power-up OK (FLAG=0xfc F1=0x02 F2=0x00)
[  195.769178] tas2557 1-004e: amplifier powered on (prog=0 cfg=0)
[  195.872710] tas2557 1-004c: loading program 0 (Tuning Mode)
[  196.188869] tas2557 1-004c: loading config 0 (configuration_Tuning Mode_48 KHz_s1_0) rate=48000 Hz PLL[0]
[  196.283924] tas2557 1-004c: PLL locked, power-up OK (FLAG=0xfc F1=0x02 F2=0x00)
[  196.283944] tas2557 1-004c: amplifier powered on (prog=0 cfg=0)
[  196.305297] tas2557 1-004e: loading program 0 (Tuning Mode)
[  196.618301] tas2557 1-004e: loading config 0 (configuration_Tuning Mode_48 KHz_s1_0) rate=48000 Hz PLL[0]
[  196.716911] tas2557 1-004e: PLL locked, power-up OK (FLAG=0xfc F1=0x02 F2=0x00)
[  196.716931] tas2557 1-004e: amplifier powered on (prog=0 cfg=0)
[  196.821156] tas2557 1-004c: loading program 0 (Tuning Mode)
[  197.131846] tas2557 1-004c: loading config 0 (configuration_Tuning Mode_48 KHz_s1_0) rate=48000 Hz PLL[0]
[  197.226643] tas2557 1-004c: PLL locked, power-up OK (FLAG=0xfc F1=0x02 F2=0x00)
[  197.226663] tas2557 1-004c: amplifier powered on (prog=0 cfg=0)
[  197.248150] tas2557 1-004e: loading program 0 (Tuning Mode)
[  197.575173] tas2557 1-004e: loading config 0 (configuration_Tuning Mode_48 KHz_s1_0) rate=48000 Hz PLL[0]
[  197.663819] tas2557 1-004e: PLL locked, power-up OK (FLAG=0xfc F1=0x02 F2=0x00)
[  197.663858] tas2557 1-004e: amplifier powered on (prog=0 cfg=0)
[  197.761448] tas2557 1-004c: loading program 0 (Tuning Mode)
[  198.072018] tas2557 1-004c: loading config 0 (configuration_Tuning Mode_48 KHz_s1_0) rate=48000 Hz PLL[0]
[  198.167841] tas2557 1-004c: PLL locked, power-up OK (FLAG=0xfc F1=0x02 F2=0x00)
[  198.167882] tas2557 1-004c: amplifier powered on (prog=0 cfg=0)
[  198.188932] tas2557 1-004e: loading program 0 (Tuning Mode)
[  198.505813] tas2557 1-004e: loading config 0 (configuration_Tuning Mode_48 KHz_s1_0) rate=48000 Hz PLL[0]
[  198.601599] tas2557 1-004e: PLL locked, power-up OK (FLAG=0xfc F1=0x02 F2=0x00)
[  198.601642] tas2557 1-004e: amplifier powered on (prog=0 cfg=0)
[  198.729187] tas2557 1-004c: loading program 0 (Tuning Mode)
[  199.060192] tas2557 1-004c: loading config 0 (configuration_Tuning Mode_48 KHz_s1_0) rate=48000 Hz PLL[0]
[  199.159058] tas2557 1-004c: PLL locked, power-up OK (FLAG=0xfc F1=0x02 F2=0x00)
[  199.159101] tas2557 1-004c: amplifier powered on (prog=0 cfg=0)
[  199.183057] tas2557 1-004e: loading program 0 (Tuning Mode)
[  199.504450] tas2557 1-004e: loading config 0 (configuration_Tuning Mode_48 KHz_s1_0) rate=48000 Hz PLL[0]
[  199.599293] tas2557 1-004e: PLL locked, power-up OK (FLAG=0xfc F1=0x02 F2=0x00)
[  199.599330] tas2557 1-004e: amplifier powered on (prog=0 cfg=0)
[  199.703805] tas2557 1-004c: loading program 0 (Tuning Mode)
[  200.041549] tas2557 1-004c: loading config 0 (configuration_Tuning Mode_48 KHz_s1_0) rate=48000 Hz PLL[0]
[  200.139880] tas2557 1-004c: PLL locked, power-up OK (FLAG=0xfc F1=0x02 F2=0x00)
[  200.139915] tas2557 1-004c: amplifier powered on (prog=0 cfg=0)
[  200.162908] tas2557 1-004e: loading program 0 (Tuning Mode)
[  200.491963] tas2557 1-004e: loading config 0 (configuration_Tuning Mode_48 KHz_s1_0) rate=48000 Hz PLL[0]
[  200.584171] tas2557 1-004e: PLL locked, power-up OK (FLAG=0xfc F1=0x02 F2=0x00)
[  200.584212] tas2557 1-004e: amplifier powered on (prog=0 cfg=0)
[  200.690814] tas2557 1-004c: loading program 0 (Tuning Mode)
[  201.008670] tas2557 1-004c: loading config 0 (configuration_Tuning Mode_48 KHz_s1_0) rate=48000 Hz PLL[0]
[  201.103116] tas2557 1-004c: PLL locked, power-up OK (FLAG=0xfc F1=0x02 F2=0x00)
[  201.103161] tas2557 1-004c: amplifier powered on (prog=0 cfg=0)
[  201.124251] tas2557 1-004e: loading program 0 (Tuning Mode)
[  201.451337] tas2557 1-004e: loading config 0 (configuration_Tuning Mode_48 KHz_s1_0) rate=48000 Hz PLL[0]
[  201.555698] tas2557 1-004e: PLL locked, power-up OK (FLAG=0xfc F1=0x02 F2=0x00)
[  201.555745] tas2557 1-004e: amplifier powered on (prog=0 cfg=0)
[  201.660037] tas2557 1-004c: loading program 0 (Tuning Mode)
[  201.988577] tas2557 1-004c: loading config 0 (configuration_Tuning Mode_48 KHz_s1_0) rate=48000 Hz PLL[0]
[  202.094513] tas2557 1-004c: PLL locked, power-up OK (FLAG=0xfc F1=0x02 F2=0x00)
[  202.094559] tas2557 1-004c: amplifier powered on (prog=0 cfg=0)
[  202.116322] tas2557 1-004e: loading program 0 (Tuning Mode)
[  202.441568] tas2557 1-004e: loading config 0 (configuration_Tuning Mode_48 KHz_s1_0) rate=48000 Hz PLL[0]
[  202.527588] tas2557 1-004e: PLL locked, power-up OK (FLAG=0xfc F1=0x02 F2=0x00)
[  202.527656] tas2557 1-004e: amplifier powered on (prog=0 cfg=0)
[  202.644017] tas2557 1-004c: loading program 0 (Tuning Mode)
[  202.956557] tas2557 1-004c: loading config 0 (configuration_Tuning Mode_48 KHz_s1_0) rate=48000 Hz PLL[0]
[  203.048516] tas2557 1-004c: PLL locked, power-up OK (FLAG=0xfc F1=0x02 F2=0x00)
[  203.048557] tas2557 1-004c: amplifier powered on (prog=0 cfg=0)
[  203.068525] tas2557 1-004e: loading program 0 (Tuning Mode)
[  203.388692] tas2557 1-004e: loading config 0 (configuration_Tuning Mode_48 KHz_s1_0) rate=48000 Hz PLL[0]
[  203.482528] tas2557 1-004e: PLL locked, power-up OK (FLAG=0xf4 F1=0x02 F2=0x00)
[  203.482560] tas2557 1-004e: amplifier powered on (prog=0 cfg=0)
[  203.590815] tas2557 1-004c: loading program 0 (Tuning Mode)
[  203.911370] tas2557 1-004c: loading config 0 (configuration_Tuning Mode_48 KHz_s1_0) rate=48000 Hz PLL[0]
[  204.020861] tas2557 1-004c: PLL locked, power-up OK (FLAG=0xfc F1=0x02 F2=0x00)
[  204.020918] tas2557 1-004c: amplifier powered on (prog=0 cfg=0)
[  204.046309] tas2557 1-004e: loading program 0 (Tuning Mode)
[  204.373528] tas2557 1-004e: loading config 0 (configuration_Tuning Mode_48 KHz_s1_0) rate=48000 Hz PLL[0]
[  204.465223] tas2557 1-004e: PLL locked, power-up OK (FLAG=0xfc F1=0x02 F2=0x00)
[  204.465255] tas2557 1-004e: amplifier powered on (prog=0 cfg=0)
[  204.571164] tas2557 1-004c: loading program 0 (Tuning Mode)
[  204.898745] tas2557 1-004c: loading config 0 (configuration_Tuning Mode_48 KHz_s1_0) rate=48000 Hz PLL[0]
[  205.012676] tas2557 1-004c: PLL locked, power-up OK (FLAG=0xfc F1=0x02 F2=0x00)
[  205.012708] tas2557 1-004c: amplifier powered on (prog=0 cfg=0)
[  205.034223] tas2557 1-004e: loading program 0 (Tuning Mode)
[  205.364021] tas2557 1-004e: loading config 0 (configuration_Tuning Mode_48 KHz_s1_0) rate=48000 Hz PLL[0]
[  205.461612] tas2557 1-004e: PLL locked, power-up OK (FLAG=0xfc F1=0x02 F2=0x00)
[  205.461644] tas2557 1-004e: amplifier powered on (prog=0 cfg=0)
[  205.566056] tas2557 1-004c: loading program 0 (Tuning Mode)
[  205.887910] tas2557 1-004c: loading config 0 (configuration_Tuning Mode_48 KHz_s1_0) rate=48000 Hz PLL[0]
[  205.992786] tas2557 1-004c: PLL locked, power-up OK (FLAG=0xfc F1=0x02 F2=0x00)
[  205.992818] tas2557 1-004c: amplifier powered on (prog=0 cfg=0)
[  206.016089] tas2557 1-004e: loading program 0 (Tuning Mode)
[  206.335989] tas2557 1-004e: loading config 0 (configuration_Tuning Mode_48 KHz_s1_0) rate=48000 Hz PLL[0]
[  206.430062] tas2557 1-004e: PLL locked, power-up OK (FLAG=0xfc F1=0x02 F2=0x00)
[  206.430093] tas2557 1-004e: amplifier powered on (prog=0 cfg=0)
[  206.560147] tas2557 1-004c: loading program 0 (Tuning Mode)
[  206.887659] tas2557 1-004c: loading config 0 (configuration_Tuning Mode_48 KHz_s1_0) rate=48000 Hz PLL[0]
[  206.991619] tas2557 1-004c: PLL locked, power-up OK (FLAG=0xf4 F1=0x02 F2=0x00)
[  206.991656] tas2557 1-004c: amplifier powered on (prog=0 cfg=0)
[  207.014280] tas2557 1-004e: loading program 0 (Tuning Mode)
[  207.340483] tas2557 1-004e: loading config 0 (configuration_Tuning Mode_48 KHz_s1_0) rate=48000 Hz PLL[0]
[  207.424780] tas2557 1-004e: PLL locked, power-up OK (FLAG=0xfc F1=0x02 F2=0x00)
[  207.424808] tas2557 1-004e: amplifier powered on (prog=0 cfg=0)
[  207.525041] tas2557 1-004c: loading program 0 (Tuning Mode)
[  207.839108] tas2557 1-004c: loading config 0 (configuration_Tuning Mode_48 KHz_s1_0) rate=48000 Hz PLL[0]
[  207.933259] tas2557 1-004c: PLL locked, power-up OK (FLAG=0xfc F1=0x02 F2=0x00)
[  207.933284] tas2557 1-004c: amplifier powered on (prog=0 cfg=0)
[  207.954257] tas2557 1-004e: loading program 0 (Tuning Mode)
[  208.280001] tas2557 1-004e: loading config 0 (configuration_Tuning Mode_48 KHz_s1_0) rate=48000 Hz PLL[0]
[  208.368848] tas2557 1-004e: PLL locked, power-up OK (FLAG=0xfc F1=0x02 F2=0x00)
[  208.368872] tas2557 1-004e: amplifier powered on (prog=0 cfg=0)
[  208.470272] tas2557 1-004c: loading program 0 (Tuning Mode)
[  208.797872] tas2557 1-004c: loading config 0 (configuration_Tuning Mode_48 KHz_s1_0) rate=48000 Hz PLL[0]
[  208.892072] tas2557 1-004c: PLL locked, power-up OK (FLAG=0xfc F1=0x02 F2=0x00)
[  208.892095] tas2557 1-004c: amplifier powered on (prog=0 cfg=0)
[  208.912658] tas2557 1-004e: loading program 0 (Tuning Mode)
[  209.237224] tas2557 1-004e: loading config 0 (configuration_Tuning Mode_48 KHz_s1_0) rate=48000 Hz PLL[0]
[  209.338763] tas2557 1-004e: PLL locked, power-up OK (FLAG=0xfc F1=0x02 F2=0x00)
[  209.338805] tas2557 1-004e: amplifier powered on (prog=0 cfg=0)
[  209.443702] tas2557 1-004c: loading program 0 (Tuning Mode)
[  209.763719] tas2557 1-004c: loading config 0 (configuration_Tuning Mode_48 KHz_s1_0) rate=48000 Hz PLL[0]
[  209.859553] tas2557 1-004c: PLL locked, power-up OK (FLAG=0xfc F1=0x02 F2=0x00)
[  209.859593] tas2557 1-004c: amplifier powered on (prog=0 cfg=0)
[  209.880486] tas2557 1-004e: loading program 0 (Tuning Mode)
[  210.202700] tas2557 1-004e: loading config 0 (configuration_Tuning Mode_48 KHz_s1_0) rate=48000 Hz PLL[0]
[  210.294760] tas2557 1-004e: PLL locked, power-up OK (FLAG=0xfc F1=0x02 F2=0x00)
[  210.294800] tas2557 1-004e: amplifier powered on (prog=0 cfg=0)
[  210.409561] tas2557 1-004c: loading program 0 (Tuning Mode)
[  210.720261] tas2557 1-004c: loading config 0 (configuration_Tuning Mode_48 KHz_s1_0) rate=48000 Hz PLL[0]
[  210.810575] tas2557 1-004c: PLL locked, power-up OK (FLAG=0xfc F1=0x02 F2=0x00)
[  210.810606] tas2557 1-004c: amplifier powered on (prog=0 cfg=0)
[  210.831805] tas2557 1-004e: loading program 0 (Tuning Mode)
[  211.140293] tas2557 1-004e: loading config 0 (configuration_Tuning Mode_48 KHz_s1_0) rate=48000 Hz PLL[0]
[  211.234993] tas2557 1-004e: PLL locked, power-up OK (FLAG=0xfc F1=0x02 F2=0x00)
[  211.235031] tas2557 1-004e: amplifier powered on (prog=0 cfg=0)
[  211.338695] tas2557 1-004c: loading program 0 (Tuning Mode)
[  211.659642] tas2557 1-004c: loading config 0 (configuration_Tuning Mode_48 KHz_s1_0) rate=48000 Hz PLL[0]
[  211.757944] tas2557 1-004c: PLL locked, power-up OK (FLAG=0xfc F1=0x02 F2=0x00)
[  211.757983] tas2557 1-004c: amplifier powered on (prog=0 cfg=0)
[  211.781132] tas2557 1-004e: loading program 0 (Tuning Mode)
[  212.104363] tas2557 1-004e: loading config 0 (configuration_Tuning Mode_48 KHz_s1_0) rate=48000 Hz PLL[0]
[  212.190077] tas2557 1-004e: PLL locked, power-up OK (FLAG=0xfc F1=0x02 F2=0x00)
[  212.190130] tas2557 1-004e: amplifier powered on (prog=0 cfg=0)
[  212.298654] tas2557 1-004c: loading program 0 (Tuning Mode)
[  212.609525] tas2557 1-004c: loading config 0 (configuration_Tuning Mode_48 KHz_s1_0) rate=48000 Hz PLL[0]
[  212.707942] tas2557 1-004c: PLL locked, power-up OK (FLAG=0xfc F1=0x02 F2=0x00)
[  212.707974] tas2557 1-004c: amplifier powered on (prog=0 cfg=0)
[  212.728325] tas2557 1-004e: loading program 0 (Tuning Mode)
[  213.046067] tas2557 1-004e: loading config 0 (configuration_Tuning Mode_48 KHz_s1_0) rate=48000 Hz PLL[0]
[  213.137509] tas2557 1-004e: PLL locked, power-up OK (FLAG=0xfc F1=0x02 F2=0x00)
[  213.137546] tas2557 1-004e: amplifier powered on (prog=0 cfg=0)
[  213.238042] tas2557 1-004c: loading program 0 (Tuning Mode)
[  213.554336] tas2557 1-004c: loading config 0 (configuration_Tuning Mode_48 KHz_s1_0) rate=48000 Hz PLL[0]
[  213.661341] tas2557 1-004c: PLL locked, power-up OK (FLAG=0xfc F1=0x02 F2=0x00)
[  213.661373] tas2557 1-004c: amplifier powered on (prog=0 cfg=0)
[  213.682276] tas2557 1-004e: loading program 0 (Tuning Mode)
[  214.012074] tas2557 1-004e: loading config 0 (configuration_Tuning Mode_48 KHz_s1_0) rate=48000 Hz PLL[0]
[  214.104130] tas2557 1-004e: PLL locked, power-up OK (FLAG=0xfc F1=0x02 F2=0x00)
[  214.104175] tas2557 1-004e: amplifier powered on (prog=0 cfg=0)
xiaomi-clover:~$ cat /proc/asound/card0/pcm0p/sub0/hw_params  
access: RW_INTERLEAVED
format: S16_LE
subformat: STD
channels: 2
rate: 44100 (44100/1)
period_size: 1440
buffer_size: 4320

@setotau

setotau commented Jun 18, 2026

Copy link
Copy Markdown

also it seems that second driver instance doesn't create a debugfs entry since they're both named identically

@M0Rf30

M0Rf30 commented Jun 18, 2026

Copy link
Copy Markdown
Author

do you have any branch with sdm8250 usage for clover?

@setotau

setotau commented Jun 18, 2026

Copy link
Copy Markdown

@setotau

setotau commented Jun 18, 2026

Copy link
Copy Markdown

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*

@setotau

setotau commented Jun 18, 2026

Copy link
Copy Markdown
  amixer -c0 cset name='PRI_MI2S_RX Audio Mixer MultiMedia1' 1                                               
  amixer -c0 cset name='Left Speaker Switch' 1                                                               
  amixer -c0 cset name='Right Speaker Switch' 1                                                              
  speaker-test -D hw:0,0 -c 2 -r 48000 -t sine                                                               

With these commands executed I've been able to heard a sine from both speakers one-by-one

@M0Rf30 M0Rf30 force-pushed the m0rf30/qcom-sdm660-7.0.y-tas2557-working branch from f509f3b to 3a08416 Compare June 18, 2026 17:45
@M0Rf30

M0Rf30 commented Jun 18, 2026

Copy link
Copy Markdown
Author

I've pushed it at https://github.com/sdm660-mainline/linux/tree/setotau/qcom-sdm660-7.0.y-flamingradian-upstream-sound-test

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).

   pri-mi2s-dai-link {                                                                                        
       link-name = "Primary MI2S Playback";                                                                   
       cpu    { sound-dai = <&q6afedai PRIMARY_MI2S_RX>; };                                                   
       platform { sound-dai = <&q6routing>; };                                                                
       codec  { sound-dai = <&tas2557_l>, <&tas2557_r>; };   /* sound-name-prefix Left/Right */               
   };

@setotau

setotau commented Jun 18, 2026

Copy link
Copy Markdown

I've pushed it at https://github.com/sdm660-mainline/linux/tree/setotau/qcom-sdm660-7.0.y-flamingradian-upstream-sound-test

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).

   pri-mi2s-dai-link {                                                                                        
       link-name = "Primary MI2S Playback";                                                                   
       cpu    { sound-dai = <&q6afedai PRIMARY_MI2S_RX>; };                                                   
       platform { sound-dai = <&q6routing>; };                                                                
       codec  { sound-dai = <&tas2557_l>, <&tas2557_r>; };   /* sound-name-prefix Left/Right */               
   };

I've done that, just didn't push

@M0Rf30

M0Rf30 commented Jun 18, 2026

Copy link
Copy Markdown
Author

I've pushed it at https://github.com/sdm660-mainline/linux/tree/setotau/qcom-sdm660-7.0.y-flamingradian-upstream-sound-test

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).

   pri-mi2s-dai-link {                                                                                        
       link-name = "Primary MI2S Playback";                                                                   
       cpu    { sound-dai = <&q6afedai PRIMARY_MI2S_RX>; };                                                   
       platform { sound-dai = <&q6routing>; };                                                                
       codec  { sound-dai = <&tas2557_l>, <&tas2557_r>; };   /* sound-name-prefix Left/Right */               
   };

I've done that, just didn't push

Can you gentlly push then?
In the meantime I fixed the issues about debug interface and instance

@setotau

setotau commented Jun 18, 2026

Copy link
Copy Markdown

pushed

@M0Rf30

M0Rf30 commented Jun 18, 2026

Copy link
Copy Markdown
Author

The driver and the PRI_MI2S dai-link seems fine — you confirmed L/R separation with the manual route + speaker-test -D hw:0,0, so the codec, the backend link and the channel mapping are all correct.

What's left is on the userspace/UCM side, and your own results point right at it:

  • You only got sound after enabling PRI_MI2S_RX Audio Mixer MultiMedia1 and the speaker switches by hand, so the UCM Speaker device isn't being applied automatically.
  • The ~1 s re-init spam is the stream being reopened (PA suspend/reopen), not the amp — a single continuous stream (your manual test) didn't spam.

Two things to sort:

  1. UCM Speaker device not auto-applying. Check the profile loads and the device activates:

    alsaucm -c <card> set _verb HiFi set _enadev Speaker
    amixer -c0 contents | grep -A1 'MultiMedia1\|Speaker Switch'
    

    If those csets only go on when you set them manually, userspace isn't selecting Speaker.

  2. PA reopening the sink. tulip/jasmine run clean on pipewire + wireplumber with the UCM (it holds the Speaker device for the whole session). Easiest is to use that stack on clover too, or disable PA's module-suspend-on-idle / tsched.

Quick check that the kernel side is truly done: with the route set by hand,

aplay -D hw:0,0 <48 kHz wav> of a long file should play straight through with no cycling.

If it does, it's purely PA/UCM wiring from here.

@M0Rf30

M0Rf30 commented Jun 18, 2026

Copy link
Copy Markdown
Author

It does this:

[ 1076.422283] tas2557 1-004e: loading program 0 (Tuning Mode)
[ 1076.739169] tas2557 1-004e: loading config 0 (configuration_Tuning Mode_48 KHz_s1_0) rate=48000 Hz PLL[0]
[ 1076.840181] tas2557 1-004e: PLL locked, power-up OK (FLAG=0xfc F1=0x02 F2=0x00)
[ 1076.840213] tas2557 1-004e: amplifier powered on (prog=0 cfg=0)
[ 1076.863723] tas2557 1-004c: loading program 0 (Tuning Mode)
[ 1077.192039] tas2557 1-004c: loading config 0 (configuration_Tuning Mode_48 KHz_s1_0) rate=48000 Hz PLL[0]
[ 1077.295450] tas2557 1-004c: PLL locked, power-up OK (FLAG=0xfc F1=0x02 F2=0x00)
[ 1077.295485] tas2557 1-004c: amplifier powered on (prog=0 cfg=0)

several times and then, it seems, gives up

dmesg | grep -iE 'q6asm|q6routing|q6afe|ASoC|xrun|underrun|error|Memory_map' | tail -30
cat /proc/asound/card0/pcm0p/sub0/status # during the attempt: RUNNING vs SETUP/XRUN bouncing

@setotau

setotau commented Jun 18, 2026

Copy link
Copy Markdown
xiaomi-clover:~$ dmesg | grep -iE 'q6asm|q6routing|q6afe|ASoC|xrun|underrun|error|Memory_map' | tail -30
[    4.465593] msm_dpu c901000.display-controller: Direct firmware load for qcom/a530_pm4.fw failed with error -2
[    4.465625] msm_dpu c901000.display-controller: [drm:adreno_request_fw [msm]] *ERROR* failed to load a530_pm4.fw
[   18.008255] qcom_sns_reg.qcom-sns-reg qcom_common.sns-reg.1: Direct firmware load for qcom/sensors/sns.reg-xiaomi,clover-plus failed with error -2
[   18.014921] qcom_sns_reg.qcom-sns-reg qcom_common.sns-reg.1: firmware loaded, error above can be ignored.
[   45.521570]  MultiMedia2: ASoC: no backend DAIs enabled for MultiMedia2, possibly missing ALSA mixer-based routing or UCM profile

@M0Rf30

M0Rf30 commented Jun 18, 2026

Copy link
Copy Markdown
Author

xiaomi-clover:~$ dmesg | grep -iE 'q6asm|q6routing|q6afe|ASoC|xrun|underrun|error|Memory_map' | tail -30
[ 4.465593] msm_dpu c901000.display-controller: Direct firmware load for qcom/a530_pm4.fw failed with error -2
[ 4.465625] msm_dpu c901000.display-controller: [drm:adreno_request_fw [msm]] ERROR failed to load a530_pm4.fw
[ 18.008255] qcom_sns_reg.qcom-sns-reg qcom_common.sns-reg.1: Direct firmware load for qcom/sensors/sns.reg-xiaomi,clover-plus failed with error -2
[ 18.014921] qcom_sns_reg.qcom-sns-reg qcom_common.sns-reg.1: firmware loaded, error above can be ignored.
[ 45.521570] MultiMedia2: ASoC: no backend DAIs enabled for MultiMedia2, possibly missing ALSA mixer-based routing or UCM profile

For the MM2 "no backend" (the mic), put the capture route in the verb —
capture is safe there because there's only one capture backend (unlike
playback, where Speaker vs Headphones conflicted). In HiFi.conf:

  SectionVerb {                                                            
      EnableSequence [                                                     
          cset "name='MultiMedia2 Mixer LPI_MI2S_TX_3' 1"                  
      ]                                                                    
      DisableSequence [                                                    
          cset "name='MultiMedia2 Mixer LPI_MI2S_TX_3' 0"                  
      ]                                                                    
      Value { TQ "HiFi" }                                                  
  }

@setotau

setotau commented Jun 19, 2026

Copy link
Copy Markdown

got sound from pipewire, but silent

@M0Rf30

M0Rf30 commented Jun 19, 2026

Copy link
Copy Markdown
Author

got sound from pipewire, but silent

are you using the ucm that I drafted on alsa-ucm-conf? or something different?

@setotau

setotau commented Jun 19, 2026

Copy link
Copy Markdown

are you using the ucm that I drafted on alsa-ucm-conf? or something different?

yes, I've copied some things from your ucm

@M0Rf30

M0Rf30 commented Jun 19, 2026

Copy link
Copy Markdown
Author

got sound from pipewire, but silent

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                            

@setotau

setotau commented Jun 19, 2026

Copy link
Copy Markdown
xiaomi-clover:~$ amixer -c0 sget 'Left Speaker';  amixer -c0 sget 'Right Speaker'
Simple mixer control 'Left Speaker',0
  Capabilities: volume volume-joined pswitch pswitch-joined
  Playback channels: Mono
  Capture channels: Mono
  Limits: 0 - 15
  Mono: 14 [93%] [0.00dB] Playback [on]
Simple mixer control 'Right Speaker',0
  Capabilities: volume volume-joined pswitch pswitch-joined
  Playback channels: Mono
  Capture channels: Mono
  Limits: 0 - 15
  Mono: 14 [93%] [0.00dB] Playback [on] 
xiaomi-clover:~$ amixer -c0 cget name='PRI_MI2S_RX Audio Mixer MultiMedia1'
numid=138,iface=MIXER,name='PRI_MI2S_RX Audio Mixer MultiMedia1'
  ; type=BOOLEAN,access=rw------,values=1
  : values=on
xiaomi-clover:~$  wpctl get-volume @DEFAULT_AUDIO_SINK@
Volume: 1.00
xiaomi-clover:~$ cat /proc/asound/card0/pcm0p/sub0/status
state: RUNNING
owner_pid   : 2718
trigger_time: 240.578028276
tstamp      : 246.940093458
delay       : 1985
avail       : 1855
avail_max   : 2623
-----
hw_ptr      : 306719
appl_ptr    : 308704

@M0Rf30

M0Rf30 commented Jun 19, 2026

Copy link
Copy Markdown
Author

pin the sink format in wireplumber and see if sound returns:

  # ~/.config/wireplumber/wireplumber.conf.d/51-clover-spk.conf                                        
  monitor.alsa.rules = [                                                                               
    {                                                                                                  
      matches = [ { node.name = "~alsa_output.*" } ]                                                   
      actions = { update-props = {                                                                     
        audio.format   = "S16LE"                                                                       
        audio.rate     = 48000                                                                         
        audio.channels = 2                                                                             
      } }                                                                                              
    }                                                                                                  
  ]                                                                                                    
  systemctl --user restart wireplumber pipewire                                                        
  cat /proc/asound/card0/pcm0p/sub0/hw_params    # should now read S16_LE                              

@setotau

setotau commented Jun 19, 2026

Copy link
Copy Markdown

I already have sound on speakers

@M0Rf30

M0Rf30 commented Jun 19, 2026

Copy link
Copy Markdown
Author

I already have sound on speakers

so only the volume is the issue?

amixer -c0 sset 'Left Speaker Volume' 15                                                             
amixer -c0 sset 'Right Speaker Volume' 15   

@setotau

setotau commented Jun 19, 2026

Copy link
Copy Markdown

I already have sound on speakers

so only the volume is the issue?

yes, and stereo separation works properly

amixer -c0 sset 'Left Speaker Volume' 15                                                             
amixer -c0 sset 'Right Speaker Volume' 15   

will try, thanks

Comment thread Documentation/devicetree/bindings/sound/ti,tas2557.yaml
@M0Rf30 M0Rf30 force-pushed the m0rf30/qcom-sdm660-7.0.y-tas2557-working branch 5 times, most recently from 1c8da1f to 5db25a3 Compare June 26, 2026 19:27
@minlexx

minlexx commented Jun 28, 2026

Copy link
Copy Markdown
Member

The amount of extra messages ("spam") in dmesg should probably be reduced, I'm talking about these, each time sound is played

[ 2740.002306] tas2557 1-004c: loading program 0 (Tuning Mode)
[ 2740.325075] tas2557 1-004c: loading config 0 (configuration_Tuning Mode_48 KHz_s1_0) rate=48000 Hz PLL[0]
[ 2740.397363] tas2557 1-004c: PLL locked, power-up OK (FLAG=0xfc F1=0x02 F2=0x02)
[ 2740.397419] tas2557 1-004c: amplifier powered on (prog=0 cfg=0)

@M0Rf30 M0Rf30 force-pushed the m0rf30/qcom-sdm660-7.0.y-tas2557-working branch from 5db25a3 to f26828b Compare June 28, 2026 14:59
Comment thread sound/soc/codecs/tas2557.c
M0Rf30 added 6 commits July 3, 2026 22:54
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>
@M0Rf30 M0Rf30 force-pushed the m0rf30/qcom-sdm660-7.0.y-tas2557-working branch from 41dca05 to a2981b9 Compare July 3, 2026 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants