-
Notifications
You must be signed in to change notification settings - Fork 321
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
Tools: Topology2: Intel: Add enhanced speaker and DMIC processing to SDW PCs #9652
Tools: Topology2: Intel: Add enhanced speaker and DMIC processing to SDW PCs #9652
Conversation
04b0c72
to
86e992c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - are there before and after audio signal response measurements ?
I have the upper type of device that is without microphone, so I can't demonstrate the capture enhance. But I can make some recording demo of playback with DRC on/off. If I'm able to measure the speaker response I can also demo the EQ on/off. The current 100 Hz high-pass filter is not audible though it helps to reduce speaker distortion when playing loud. |
tools/topology/topology2/include/pipelines/cavs/mixout-gain-efx-alh-dai-copier-playback.conf
Outdated
Show resolved
Hide resolved
86e992c
to
3f8259b
Compare
...gy/topology2/include/pipelines/cavs/mixout-gain-eqiir-eqfir-drc-alh-dai-copier-playback.conf
Outdated
Show resolved
Hide resolved
Note: There's CI SDW capture fail with this PR, finding out what causes it. |
It should be fixed now (module-copier stream name set). Huge thanks to @ujfalusi for testing it and finding the issue! |
3f8259b
to
a837f57
Compare
The original PR caused NULL pointer dereference in kernel when using capture on :0,4 because the module copier in the patch have the same stream_name as the ALH copier:
|
Other, non DAI copier widgets could have the same stream name (sname) as the ALH copier and in that case the copier->data is NULL, no alh_data is attached, which could lead to NULL pointer dereference. We could check for this NULL pointer in sof_ipc4_prepare_copier_module() and avoid the crash, but a similar loop in sof_ipc4_widget_setup_comp_dai() will miscalculate the ALH device count, causing broken audio. The correct fix is to harden the matching logic by making sure that the 1. widget is a DAI widget - so dai = w->private is valid 2. the dai (and thus the copier) is ALH copier Fixes: 0e357b5 ("ASoC: SOF: ipc4-topology: add SoundWire/ALH aggregation support") Reported-by: Seppo Ingalsuo <[email protected]> Link: thesofproject/sof#9652 Signed-off-by: Peter Ujfalusi <[email protected]>
The kernel side fix: thesofproject/linux#5247 |
You mean that the module-copier name is no longer set, right? |
Other, non DAI copier widgets could have the same stream name (sname) as the ALH copier and in that case the copier->data is NULL, no alh_data is attached, which could lead to NULL pointer dereference. We could check for this NULL pointer in sof_ipc4_prepare_copier_module() and avoid the crash, but a similar loop in sof_ipc4_widget_setup_comp_dai() will miscalculate the ALH device count, causing broken audio. The correct fix is to harden the matching logic by making sure that the 1. widget is a DAI widget - so dai = w->private is valid 2. the dai (and thus the copier) is ALH copier Fixes: 0e357b5 ("ASoC: SOF: ipc4-topology: add SoundWire/ALH aggregation support") Reported-by: Seppo Ingalsuo <[email protected]> Link: thesofproject/sof#9652 Signed-off-by: Peter Ujfalusi <[email protected]>
Yes that's correct, I left out the stream_name set for module-copier. I want this to work with released kernels. |
I made a video of processing off, generic processing settings for speaker, and (quickly done) tuned settings but with size limit of 10 MB I'm not able to attach it even with lowest 360p export quality. Attached are the tuned IIR and FIR EQ responses and before and after frequency responses those I applied for the used notebook PC. |
Other, non DAI copier widgets could have the same stream name (sname) as the ALH copier and in that case the copier->data is NULL, no alh_data is attached, which could lead to NULL pointer dereference. We could check for this NULL pointer in sof_ipc4_prepare_copier_module() and avoid the crash, but a similar loop in sof_ipc4_widget_setup_comp_dai() will miscalculate the ALH device count, causing broken audio. The correct fix is to harden the matching logic by making sure that the 1. widget is a DAI widget - so dai = w->private is valid 2. the dai (and thus the copier) is ALH copier Fixes: 0e357b5 ("ASoC: SOF: ipc4-topology: add SoundWire/ALH aggregation support") Reported-by: Seppo Ingalsuo <[email protected]> Link: thesofproject/sof#9652 Signed-off-by: Peter Ujfalusi <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a837f57
to
abf578d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Some minor/non-blocking comments inline.
@@ -10,6 +10,7 @@ Define { | |||
AMP_FEEDBACK_CH 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@singalsu Style note, avoid using passive verbs like this "DAI pipelines are aligned". Just explain what the patch does like "align DAI with other topologies" (more examples at https://docs.zephyrproject.org/latest/contribute/guidelines.html#commit-message-guidelines ). E.g here I first thought you were describing how things are before your changes. But that's not the case, but it's actually thi spatch that does the aligning.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that makes sense, the text really could be interpreted as not what I meant. I'll fix.
@lgirdwood I checked with @singalsu and there is no new required from kernel. |
The control names "Amplifier Volume" and "Main Amplifier Volume" are not describing well the fact that they control speaker endpoint volume before and after SOF mixer. This patch changes the control names to: - "Pre Mixer Speaker Playback Volume" - "Post Mixer Speaker Playback Volume" These new names are similar as in other SOF topologies. There is no UCM rules dependency with the names yet, so good to do it now. Signed-off-by: Seppo Ingalsuo <[email protected]>
…oute To use the pipeline class as SubTreeCopy base class the route needs to be an array. Without it the route from base is not present in the modified class. Suggested-by: Ranjani Sridharan <[email protected]> Signed-off-by: Seppo Ingalsuo <[email protected]>
This patch adds to ALH pipeline between gain and ALH processing with IIR, FIR, and DRC. The change is intended for topologies for PCs running Linux OS. Topologies with enable enhanced playback are currently: - sof-mtl-rt713-l0-rt1316-l12.tplg - sof-lnl-rt722-l0.tplg The change adds in MTL platform 4.2 MCPS load to speaker playback in pass-through mode. With highpass IIR and default speaker DRC the load increase is 45 MCPS. Other topologies than above have no MCPS increase. Signed-off-by: Seppo Ingalsuo <[email protected]>
This patch adds to all topologies with SDW DMIC the module copier to in ALH copier pipeline after the IIR equalizer. The module copier allows to duplicate the stream for several post-processing pipelines as analogy with mixin/mixout in playback pipelines. When SDW_DMIC_ENHANCED_CAPTURE is set "true" in topology build the multi-microphone beamformer (TDFB) and dynamic range control (DRC) components are added to host pipeline. The capture pre-processing is enabled for PC topology sof-lnl-rt722-l0.tplg. The beamformer is set for a narrow opening stereo image suitable for notebook user voice enhance. The DRC is set for a default DMIC level boost. Signed-off-by: Seppo Ingalsuo <[email protected]>
This patch adds speaker post-processing and microphone pre-processing to next topologies: - sof-mtl-rt711-l0-rt1316-l23-rt714-l1.tplg - sof-lnl-rt711-l0-rt1316-l23-rt714-l1.tplg The SOF CI system currently tests these two SDW platforms. This patch adds test coverage for processing with IIR, FIR, DRC, and TDFB components. Signed-off-by: Seppo Ingalsuo <[email protected]>
abf578d
to
591c2cb
Compare
Other, non DAI copier widgets could have the same stream name (sname) as the ALH copier and in that case the copier->data is NULL, no alh_data is attached, which could lead to NULL pointer dereference. We could check for this NULL pointer in sof_ipc4_prepare_copier_module() and avoid the crash, but a similar loop in sof_ipc4_widget_setup_comp_dai() will miscalculate the ALH device count, causing broken audio. The correct fix is to harden the matching logic by making sure that the 1. widget is a DAI widget - so dai = w->private is valid 2. the dai (and thus the copier) is ALH copier Fixes: 0e357b5 ("ASoC: SOF: ipc4-topology: add SoundWire/ALH aggregation support") Reported-by: Seppo Ingalsuo <[email protected]> Link: thesofproject/sof#9652 Signed-off-by: Peter Ujfalusi <[email protected]> Reviewed-by: Liam Girdwood <[email protected]> Reviewed-by: Ranjani Sridharan <[email protected]> Reviewed-by: Bard Liao <[email protected]>
Other, non DAI copier widgets could have the same stream name (sname) as the ALH copier and in that case the copier->data is NULL, no alh_data is attached, which could lead to NULL pointer dereference. We could check for this NULL pointer in sof_ipc4_prepare_copier_module() and avoid the crash, but a similar loop in sof_ipc4_widget_setup_comp_dai() will miscalculate the ALH device count, causing broken audio. The correct fix is to harden the matching logic by making sure that the 1. widget is a DAI widget - so dai = w->private is valid 2. the dai (and thus the copier) is ALH copier Fixes: 0e357b5 ("ASoC: SOF: ipc4-topology: add SoundWire/ALH aggregation support") Reported-by: Seppo Ingalsuo <[email protected]> Link: thesofproject/sof#9652 Signed-off-by: Peter Ujfalusi <[email protected]> Reviewed-by: Liam Girdwood <[email protected]> Reviewed-by: Ranjani Sridharan <[email protected]> Reviewed-by: Bard Liao <[email protected]>
Other, non DAI copier widgets could have the same stream name (sname) as the ALH copier and in that case the copier->data is NULL, no alh_data is attached, which could lead to NULL pointer dereference. We could check for this NULL pointer in sof_ipc4_prepare_copier_module() and avoid the crash, but a similar loop in sof_ipc4_widget_setup_comp_dai() will miscalculate the ALH device count, causing broken audio. The correct fix is to harden the matching logic by making sure that the 1. widget is a DAI widget - so dai = w->private is valid 2. the dai (and thus the copier) is ALH copier Fixes: 0e357b5 ("ASoC: SOF: ipc4-topology: add SoundWire/ALH aggregation support") Reported-by: Seppo Ingalsuo <[email protected]> Link: thesofproject/sof#9652 Signed-off-by: Peter Ujfalusi <[email protected]> Reviewed-by: Liam Girdwood <[email protected]> Reviewed-by: Ranjani Sridharan <[email protected]> Reviewed-by: Bard Liao <[email protected]>
No description provided.