From 969c87ef03058941f277978f6183e5962965c59f Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo Date: Thu, 12 Dec 2024 19:28:34 +0200 Subject: [PATCH] UCM2: Intel: sof-hda-dsp: Move variables defitions from 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 Signed-off-by: Jaroslav Kysela --- ucm2/Intel/sof-hda-dsp/HiFi-sof.conf | 81 ------------------------ ucm2/Intel/sof-hda-dsp/dsp.conf | 82 +++++++++++++++++++++++++ ucm2/Intel/sof-hda-dsp/sof-hda-dsp.conf | 1 + 3 files changed, 83 insertions(+), 81 deletions(-) create mode 100644 ucm2/Intel/sof-hda-dsp/dsp.conf diff --git a/ucm2/Intel/sof-hda-dsp/HiFi-sof.conf b/ucm2/Intel/sof-hda-dsp/HiFi-sof.conf index 6a11b3b..86a62f8 100644 --- a/ucm2/Intel/sof-hda-dsp/HiFi-sof.conf +++ b/ucm2/Intel/sof-hda-dsp/HiFi-sof.conf @@ -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 index 0000000..cf7fb71 --- /dev/null +++ b/ucm2/Intel/sof-hda-dsp/dsp.conf @@ -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}" + } + } +} diff --git a/ucm2/Intel/sof-hda-dsp/sof-hda-dsp.conf b/ucm2/Intel/sof-hda-dsp/sof-hda-dsp.conf index 84596bc..7469797 100644 --- a/ucm2/Intel/sof-hda-dsp/sof-hda-dsp.conf +++ b/ucm2/Intel/sof-hda-dsp/sof-hda-dsp.conf @@ -1,6 +1,7 @@ Syntax 7 Include.card-init.File "/lib/card-init.conf" +Include.dsp-variables.File "dsp.conf" Define { DeviceMic "Mic" -- 2.47.1