Skip to content

Commit

Permalink
UCM2: sof-soundwire: Enable DRC and equalizers for speaker
Browse files Browse the repository at this point in the history
This patch adds to soundwire speaker output enable of DRC processing
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.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
  • Loading branch information
singalsu committed Dec 16, 2024
1 parent c5036a4 commit 6094159
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 5 deletions.
31 changes: 26 additions & 5 deletions ucm2/Intel/sof-hda-dsp/dsp.conf
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ Define {
PostMixerAnalogPlaybackFirBytes "not available"
PostMixerAnalogPlaybackDrcBytes "not available"
PostMixerAnalogPlaybackDrcSwitch "not available"
PostMixerSpeakerPlaybackIirBytes "not available"
PostMixerSpeakerPlaybackFirBytes "not available"
PostMixerSpeakerPlaybackDrcBytes "not available"
PostMixerSpeakerPlaybackDrcSwitch "not available"
Dmic0CaptureIirBytes "not available"
Dmic0CaptureDrcBytes "not available"
Dmic0CaptureDrcSwitch "not available"
Expand All @@ -34,7 +38,7 @@ Define {
Dmic0CaptureBeamformerBeamAngleSet "not available"
}

If.SOFIPCVer {
If.SOFHdaIpc4 {
Condition {
Type ControlExists
Control "name='Post Mixer Analog Playback IIR Eq bytes'"
Expand All @@ -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"
}
}
}

Expand Down Expand Up @@ -85,6 +102,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}"
Expand Down
8 changes: 8 additions & 0 deletions ucm2/sof-soundwire/sof-soundwire.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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'"

0 comments on commit 6094159

Please sign in to comment.