Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UCM2: Intel: sof-hda-dsp: Enable Dmic0 pre-processing and SDW speaker post-processing #481

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
109 changes: 14 additions & 95 deletions ucm2/Intel/sof-hda-dsp/HiFi-sof.conf
Original file line number Diff line number Diff line change
@@ -1,123 +1,42 @@
# 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.

DefineMacro.SofControl {
Define.EndpointDrcVar "${var:__endpoint}DrcBlob"
Define.EndpointIirVar "${var:__endpoint}IirBlob"
Define.EndpointFirVar "${var:__endpoint}FirBlob"
DefineMacro.SofAnalogPlaybackControl {
Define.EndpointDrcVar "PostMixerAnalogPlayback${var:__endpoint}DrcBlob"
Define.EndpointIirVar "PostMixerAnalogPlayback${var:__endpoint}IirBlob"
Define.EndpointFirVar "PostMixerAnalogPlayback${var:__endpoint}FirBlob"
Define.EndpointDrcBlob "${var:$EndpointDrcVar}"
Define.EndpointIirBlob "${var:$EndpointIirVar}"
Define.EndpointFirBlob "${var:$EndpointFirVar}"

If.endpoint_with_drc {
Condition {
Type ControlExists
Control "name='${var:PostMixerAnalogPlaybackDRCSwitch}'"
Control "name='${var:PostMixerAnalogPlaybackDrcSwitch}'"
}
True {
EnableSequence [
# For debug uncomment below the echo command to see what blobs are applied
#shell "/bin/echo '${var:__endpoint} ${var:EndpointIirBlob} ${var:EndpointFirBlob} ${var:EndpointDrcBlob}' >> /tmp/alsa-ucm.txt"
cset "name='${var:PostMixerAnalogPlaybackDRCSwitch}' ${var:__drcswitch}"
cset-tlv "name='${var:PostMixerAnalogPlaybackDRCBytes}' ${var:EndpointDrcBlob}"
cset-tlv "name='${var:PostMixerAnalogPlaybackIIRBytes}' ${var:EndpointIirBlob}"
cset-tlv "name='${var:PostMixerAnalogPlaybackFIRBytes}' ${var:EndpointFirBlob}"
cset "name='${var:PostMixerAnalogPlaybackDrcSwitch}' ${var:__drcswitch}"
cset-tlv "name='${var:PostMixerAnalogPlaybackDrcBytes}' ${var:EndpointDrcBlob}"
cset-tlv "name='${var:PostMixerAnalogPlaybackIirBytes}' ${var:EndpointIirBlob}"
cset-tlv "name='${var:PostMixerAnalogPlaybackFirBytes}' ${var:EndpointFirBlob}"
]
}
False.If.endpoint_with_eq {
Condition {
Type ControlExists
Control "name='${var:PostMixerAnalogPlaybackFIRBytes}'"
Control "name='${var:PostMixerAnalogPlaybackFirBytes}'"
}
True {
EnableSequence [
# For debug uncomment below the echo command to see what blobs are applied
#shell "/bin/echo '${var:__endpoint} ${var:EndpointIirBlob} ${var:EndpointFirBlob}' >> /tmp/alsa-ucm.txt"
cset-tlv "name='${var:PostMixerAnalogPlaybackIIRBytes}' ${var:EndpointIirBlob}"
cset-tlv "name='${var:PostMixerAnalogPlaybackFIRBytes}' ${var:EndpointFirBlob}"
cset-tlv "name='${var:PostMixerAnalogPlaybackIirBytes}' ${var:EndpointIirBlob}"
cset-tlv "name='${var:PostMixerAnalogPlaybackFirBytes}' ${var:EndpointFirBlob}"
]
}
}
Expand All @@ -126,7 +45,7 @@ DefineMacro.SofControl {

# Merge this to Headpones subtree in HDA/HiFi-analog.conf
SectionDevice."Headphones" {
Macro.headphone.SofControl "endpoint=Headphone drcswitch=off"
Macro.headphone.SofAnalogPlaybackControl "endpoint=Headphone drcswitch=off"
}

# Merge this to Speaker subtree in HDA/HiFi-analog.conf
Expand All @@ -136,6 +55,6 @@ If.spk {
Control "name='Speaker Playback Switch'"
}
True.SectionDevice."Speaker" {
Macro.speaker.SofControl "endpoint=Speaker drcswitch=on"
Macro.speaker.SofAnalogPlaybackControl "endpoint=Speaker drcswitch=on"
}
}
Loading
Loading