alsa-project / alsa-ucm-conf

ALSA Use Case Manager configuration
BSD 3-Clause "New" or "Revised" License
72 stars 211 forks source link

ucm2: soundwire: add rt722 SDCA device #409

Closed jack-cy-yu closed 3 months ago

jack-cy-yu commented 5 months ago

Add support of ucm to rt722 SDCA.

perexg commented 4 months ago

It looks bad. What's the final components string?

plbossart commented 4 months ago

@bardliao can you share what your latest component string would be?

bardliao commented 4 months ago

@perexg @plbossart Components : 'HDA:8086281d,80860101,00100000 cfg-amp:1 iec61937-pcm:7,6,5 hs:rt722 spk:rt722 mic:rt722'

perexg commented 4 months ago

In this case, codecs/rt722/init.conf and rt722.conf are included/evaluated multiple times which is not ideal. Some ideas to optimize this:

DefineRegex.MultiCodec {
       Regex "(rt722(-sdca)?)"
       String "${var:SpeakerCodec1} ${var:HeadsetCodec1} ${var:MicCodec1}"
}

If.multi_init {
        Condition {
                Type String
                Empty "${var:MultiCodec1} "
        }
        False {
                 Define {
                        SpeakerCodecShadow "${var:SpeakerCodec1}"
                        HeadsetCodecShadow "${var:HeadsetCodec1}"
                        MicCodecShadow "${var:MicCodec1}"
                        SpeakerCodec1 ""   # FIXME: Add If - discard when SpeakerCodec1 == MultiCodec1
                        HeadsetCodec1 ""   # FIXME: dtto
                        MicCodec1 ""       # FIXME: dtto
                 }
                 Include.multi_init.File "/codecs/${var:MultiCodec1}/init.conf"
        }
}

... rt722.conf should use ...Shadow variables for the decision. Also HiFi conf should be updated to include MultiCodec1 file.