]> git.alsa-project.org Git - alsa-ucm-conf.git/commitdiff
UCM2: sof-soundwire: Enable DRC and equalizers for
authorSeppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Mon, 16 Dec 2024 13:38:44 +0000 (15:38 +0200)
committerJaroslav Kysela <perex@perex.cz>
Wed, 29 Jan 2025 09:21:59 +0000 (10:21 +0100)
This patch enables SOF post-processing for soundwire speaker
output. The DRC processing is enabled as BootSequence, and
setup of DRC, IIR, and FIR equalizer blobs as FixedBootSeqeuence
by DMI ID if custom blobs have been defined for the device in
ucm2/blobs/sof/product_configs or ucm2/blobs/sof/user_configs.

The DRC can be turned off permanently by user space if not
desired since BootSequence is only used for first time UCM2
start.

The DRC, IIR, FIR blobs are set as FixedBootSequence only
if custom blobs are defined. Otherwise the blobs defined in
topology remain in use.

Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/481
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
ucm2/Intel/sof-hda-dsp/dsp.conf
ucm2/sof-soundwire/sof-soundwire.conf

index 9480e66f220509d2bfebfa5bae217a87cbf116b9..a4d73d1003ee2de4b6d076d4e4d797f5139c97b5 100644 (file)
@@ -26,6 +26,10 @@ Define {
        PostMixerAnalogPlaybackFirBytes "N/A"
        PostMixerAnalogPlaybackDrcBytes "N/A"
        PostMixerAnalogPlaybackDrcSwitch "N/A"
+       PostMixerSpeakerPlaybackIirBytes "N/A"
+       PostMixerSpeakerPlaybackFirBytes "N/A"
+       PostMixerSpeakerPlaybackDrcBytes "N/A"
+       PostMixerSpeakerPlaybackDrcSwitch "N/A"
        Dmic0CaptureIirBytes "N/A"
        Dmic0CaptureDrcBytes "N/A"
        Dmic0CaptureDrcSwitch "N/A"
@@ -34,7 +38,7 @@ Define {
        Dmic0CaptureBeamformerBeamAngleSet "N/A"
 }
 
-If.SOFIPCVer {
+If.SOFHdaIpc4 {
        Condition {
                Type ControlExists
                Control "name='Post Mixer Analog Playback IIR Eq bytes'"
@@ -46,10 +50,23 @@ If.SOFIPCVer {
              PostMixerAnalogPlaybackDrcBytes "Post Mixer Analog Playback DRC bytes"
              PostMixerAnalogPlaybackDrcSwitch "Post Mixer Analog Playback DRC switch"
        }
-       False.Define {
-             SOFIPCVer "ipc3"
-             PostMixerAnalogPlaybackIirBytes "EQIIR1.0 eqiir_coef_1"
-             PostMixerAnalogPlaybackFirBytes "EQFIR1.0 eqfir_coef_1"
+       False.If.SOFSdwIpc4 {
+               Condition {
+                       Type ControlExists
+                       Control "name='Post Mixer Speaker Playback IIR Eq bytes'"
+               }
+               True.Define {
+                       SOFIPCVer "ipc4"
+                       PostMixerSpeakerPlaybackIirBytes "Post Mixer Speaker Playback IIR Eq bytes"
+                       PostMixerSpeakerPlaybackFirBytes "Post Mixer Speaker Playback FIR Eq bytes"
+                       PostMixerSpeakerPlaybackDrcBytes "Post Mixer Speaker Playback DRC bytes"
+                       PostMixerSpeakerPlaybackDrcSwitch "Post Mixer Speaker Playback DRC switch"
+               }
+               False.Define {
+                     SOFIPCVer "ipc3"
+                     PostMixerAnalogPlaybackIirBytes "EQIIR1.0 eqiir_coef_1"
+                     PostMixerAnalogPlaybackFirBytes "EQFIR1.0 eqfir_coef_1"
+               }
        }
 }
 
@@ -84,6 +101,10 @@ If.SOFPath {
                Dmic0CaptureDrcBlob ""
                Dmic0CaptureBeamformerBlob ""
                Dmic0CaptureIirBlob ""
+               # Similarly leave SDW speaker default blobs empty.
+               PostMixerSpeakerPlaybackIirBlob ""
+               PostMixerSpeakerPlaybackFirBlob ""
+               PostMixerSpeakerPlaybackDrcBlob ""
                ConfPathFromDMI "${var:SOFVendor}/${var:SOFProduct}.conf"
                SOFProductConfig "/blobs/sof/product_configs/${var:ConfPathFromDMI}"
                SOFConfFullPath "${ConfTopDir}${var:SOFProductConfig}"
index a2f95892f210cf49c5a9e87cf598c0d77e6241d0..736912dca9c0260cb08abbc93470a39f544f7378 100644 (file)
@@ -176,3 +176,11 @@ If.HdmiIec61937 {
        }
        True.Macro.save_hdmi_cfg.HdmiPCMSave { Name "42-sof-hdmi" }
 }
+
+# Define macros to set up processing controls
+Include.dsp-variables.File "../Intel/sof-hda-dsp/dsp.conf"
+
+# Set BootSequence and FixedBootSequence for drc, eqiir, eqfir
+Macro.SpeakerDrc.SofDrcBootSetup "endpoint='PostMixerSpeaker' direction='Playback'"
+Macro.SpeakerIir.SofEqBootSetup "endpoint='PostMixerSpeaker' direction='Playback' eqtype='Iir'"
+Macro.SpeakerFir.SofEqBootSetup "endpoint='PostMixerSpeaker' direction='Playback' eqtype='Fir'"