]> git.alsa-project.org Git - alsa-ucm-conf.git/commitdiff
UCM2: Intel: sof-hda-dsp: Move variables defitions from
authorSeppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Thu, 12 Dec 2024 17:28:34 +0000 (19:28 +0200)
committerJaroslav Kysela <perex@perex.cz>
Wed, 29 Jan 2025 09:21:59 +0000 (10:21 +0100)
This patch moves SOF control blobs related variables set are to
a new dsp.conf that is included from top level sof-hda-dsp.conf.

The change allows to use the variables in InitBootSequence for the
controls. E.g. customize the default blobs applied based on
DMI ID of the device.

There's no change to functionality in this patch.

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/HiFi-sof.conf
ucm2/Intel/sof-hda-dsp/dsp.conf [new file with mode: 0644]
ucm2/Intel/sof-hda-dsp/sof-hda-dsp.conf

index 6a11b3b8c560456c846376c1da8fe978a427331b..86a62f8754771dac931aa65efc12bd7a4e7adb23 100644 (file)
@@ -1,86 +1,5 @@
 # Control audio processing in SOF
 
-# File paths for controlling SOF processing
-
-Define.SOFVendor "$${sys:devices/virtual/dmi/id/sys_vendor}"
-Define.SOFProduct "$${sys:devices/virtual/dmi/id/product_name}"
-
-If.SOFVendor {
-       Condition {
-               Type String
-               Empty "${var:SOFVendor}"
-       }
-       True.Define.SOFVendor "${sys:devices/virtual/dmi/id/board_vendor}"
-}
-
-If.SOFProduct {
-       Condition {
-               Type String
-               Empty "${var:SOFProduct}"
-       }
-       True.Define.SOFProduct "${sys:devices/virtual/dmi/id/board_name}"
-}
-
-If.SOFIPCVer {
-       Condition {
-               Type ControlExists
-               Control "name='Post Mixer Analog Playback IIR Eq bytes'"
-       }
-       True.Define {
-             SOFIPCVer "ipc4"
-             PostMixerAnalogPlaybackIIRBytes "Post Mixer Analog Playback IIR Eq bytes"
-             PostMixerAnalogPlaybackFIRBytes "Post Mixer Analog Playback FIR Eq bytes"
-             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"
-             PostMixerAnalogPlaybackDRCBytes "not available"
-             PostMixerAnalogPlaybackDRCSwitch "not available"
-       }
-}
-
-If.SOFPath {
-       Condition { Type AlwaysTrue }
-       True.Define {
-               BlobPath "${ConfTopDir}/blobs/sof/${var:SOFIPCVer}"
-               SpeakerIirBlob "${var:BlobPath}/eq_iir/highpass_100hz_0db_48khz.blob"
-               SpeakerFirBlob "${var:BlobPath}/eq_fir/pass.blob"
-               SpeakerDrcBlob "${var:BlobPath}/drc/speaker_default.blob"
-               HeadphoneIirBlob "${var:BlobPath}/eq_iir/pass.blob"
-               HeadphoneFirBlob "${var:BlobPath}/eq_fir/pass.blob"
-               HeadphoneDrcBlob "${var:BlobPath}/drc/passthrough.blob"
-               ConfPathFromDMI "${var:SOFVendor}/${var:SOFProduct}.conf"
-               SOFProductConfig "/blobs/sof/product_configs/${var:ConfPathFromDMI}"
-               SOFConfFullPath "${ConfTopDir}${var:SOFProductConfig}"
-               SOFUserConfig "/blobs/sof/user_configs/${var:ConfPathFromDMI}"
-               SOFUserConfFullPath "${ConfTopDir}${var:SOFUserConfig}"
-       }
-}
-
-If.HasUserConfig {
-       Condition {
-               Type Path
-               Mode read
-               Path "${var:SOFUserConfFullPath}"
-       }
-       True {
-               Include.product-config.File "${var:SOFUserConfig}"
-       }
-       False.If.HasProductConfig {
-               Condition {
-                       Type Path
-                       Mode read
-                       Path "${var:SOFConfFullPath}"
-               }
-               True {
-                       Include.product-config.File "${var:SOFProductConfig}"
-               }
-       }
-}
-
 # Redefine headphone control FOR SOF. This is same as Headphone in HDA/HiFi-analog.conf
 # but adds DRC and EQ controls.
 
diff --git a/ucm2/Intel/sof-hda-dsp/dsp.conf b/ucm2/Intel/sof-hda-dsp/dsp.conf
new file mode 100644 (file)
index 0000000..cf7fb71
--- /dev/null
@@ -0,0 +1,82 @@
+# Control audio processing in SOF
+
+# File paths for controlling SOF processing
+
+Define.SOFVendor "$${sys:devices/virtual/dmi/id/sys_vendor}"
+Define.SOFProduct "$${sys:devices/virtual/dmi/id/product_name}"
+
+If.SOFVendor {
+       Condition {
+               Type String
+               Empty "${var:SOFVendor}"
+       }
+       True.Define.SOFVendor "${sys:devices/virtual/dmi/id/board_vendor}"
+}
+
+If.SOFProduct {
+       Condition {
+               Type String
+               Empty "${var:SOFProduct}"
+       }
+       True.Define.SOFProduct "${sys:devices/virtual/dmi/id/board_name}"
+}
+
+If.SOFIPCVer {
+       Condition {
+               Type ControlExists
+               Control "name='Post Mixer Analog Playback IIR Eq bytes'"
+       }
+       True.Define {
+             SOFIPCVer "ipc4"
+             PostMixerAnalogPlaybackIIRBytes "Post Mixer Analog Playback IIR Eq bytes"
+             PostMixerAnalogPlaybackFIRBytes "Post Mixer Analog Playback FIR Eq bytes"
+             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"
+             PostMixerAnalogPlaybackDRCBytes "not available"
+             PostMixerAnalogPlaybackDRCSwitch "not available"
+       }
+}
+
+If.SOFPath {
+       Condition { Type AlwaysTrue }
+       True.Define {
+               BlobPath "${ConfTopDir}/blobs/sof/${var:SOFIPCVer}"
+               SpeakerIirBlob "${var:BlobPath}/eq_iir/highpass_100hz_0db_48khz.blob"
+               SpeakerFirBlob "${var:BlobPath}/eq_fir/pass.blob"
+               SpeakerDrcBlob "${var:BlobPath}/drc/speaker_default.blob"
+               HeadphoneIirBlob "${var:BlobPath}/eq_iir/pass.blob"
+               HeadphoneFirBlob "${var:BlobPath}/eq_fir/pass.blob"
+               HeadphoneDrcBlob "${var:BlobPath}/drc/passthrough.blob"
+               ConfPathFromDMI "${var:SOFVendor}/${var:SOFProduct}.conf"
+               SOFProductConfig "/blobs/sof/product_configs/${var:ConfPathFromDMI}"
+               SOFConfFullPath "${ConfTopDir}${var:SOFProductConfig}"
+               SOFUserConfig "/blobs/sof/user_configs/${var:ConfPathFromDMI}"
+               SOFUserConfFullPath "${ConfTopDir}${var:SOFUserConfig}"
+       }
+}
+
+If.HasUserConfig {
+       Condition {
+               Type Path
+               Mode read
+               Path "${var:SOFUserConfFullPath}"
+       }
+       True {
+               Include.product-config.File "${var:SOFUserConfig}"
+       }
+       False.If.HasProductConfig {
+               Condition {
+                       Type Path
+                       Mode read
+                       Path "${var:SOFConfFullPath}"
+               }
+               True {
+                       Include.product-config.File "${var:SOFProductConfig}"
+               }
+       }
+}
index 84596bcd52430d161cf265a78bfa5948acc61ad3..7469797d3ab568410cfc359c9f423f320bbb56ab 100644 (file)
@@ -1,6 +1,7 @@
 Syntax 7
 
 Include.card-init.File "/lib/card-init.conf"
+Include.dsp-variables.File "dsp.conf"
 
 Define {
        DeviceMic "Mic"