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

Tools: Topology2: Enable DMIC capture pre-processing for hda-generic #9441

Merged

Conversation

singalsu
Copy link
Collaborator

@singalsu singalsu commented Sep 5, 2024

This patch adds to DMIC0 capture TDFB beamformer and DRC for dynamic range control. The impacted topology names are:

  • sof-hda-generic-2ch.tplg
  • sof-hda-generic-4ch.tplg
  • sof-hda-generic-cavs25-2ch.tplg
  • sof-hda-generic-cavs25-4ch.tplg
  • sof-hda-generic-ace1-2ch.tplg
  • sof-hda-generic-ace2-2ch.tplg

The DMIC0 capture pipelines before this patch was:

DAI-copier -> IIR -> gain -> module copier -> host-copier

After:

DAI-copier -> IIR -> gain -> module copier ->
TDFB -> DRC -> host-copier

The beamformer is set for 2ch topologies to a narrow user direction stereo image enhance with about 3 dB signal-to-noise ratio improvement with blob "line2_generic_pm10deg.conf". In 4ch topologies the beamformer is set to pass-through due to large variations in notebook array geometries. The processing need to be enabled per product by UCM2. The beamformer control switch is by default off.

The DRC is set with blob "dmic_default.conf" to produce up to 10 dB boost in capture level. It helps to make DMIC capture louder in normal silent conditions while it prevents clipping of samples in loud conditions. The DRC control switch is by default off.

The added controls (seen with "amixer -c0 controls") are:

  • Dmic0 Capture DRC bytes
  • Dmic0 Capture DRC switch
  • Dmic0 Capture TDFB angle set enum
  • Dmic0 Capture TDFB beam switch
  • Dmic0 Capture TDFB bytes

@singalsu singalsu added this to the v2.11 milestone Sep 5, 2024
@singalsu
Copy link
Collaborator Author

singalsu commented Sep 5, 2024

Here's before and after pictures of tools/build_tools/topology/topology2/production/sof-hda-generic-2ch.tplg

sof-hda-generic-2ch-before

sof-hda-generic-2ch-after

@singalsu singalsu force-pushed the hda_generic_dmic_add_preprocess branch from 2067323 to 9dfdb06 Compare September 5, 2024 17:18
@singalsu singalsu marked this pull request as ready for review September 6, 2024 07:14
@singalsu
Copy link
Collaborator Author

singalsu commented Sep 6, 2024

Note: The 2nd commit removes enum controls to not fail nearly every sof-ci/jenkins test. It's preferred to fix tplgtool2.py and sof-tplgreader.py from sof-test instead.

@singalsu singalsu force-pushed the hda_generic_dmic_add_preprocess branch from 9dfdb06 to 0f89055 Compare September 6, 2024 13:04
@marc-hb marc-hb marked this pull request as draft September 9, 2024 22:48
@marc-hb
Copy link
Collaborator

marc-hb commented Sep 9, 2024

Tools: Topology2: TDFB: Remove enum controls to unbock CI
This commit should be reverted after the issues in sof-test
are resolved. Without this change to topologies nearly
all CI steps fail.

Hack not needed anymore. Temporarily demoted to draft to avoid early merge.

This patch adds to DMIC0 capture TDFB beamformer and DRC for
dynamic range control. The impacted topology names are:

- sof-hda-generic-2ch.tplg
- sof-hda-generic-4ch.tplg
- sof-hda-generic-cavs25-2ch.tplg
- sof-hda-generic-cavs25-4ch.tplg
- sof-hda-generic-ace1-2ch.tplg
- sof-hda-generic-ace2-2ch.tplg

The DMIC0 capture pipelines before this patch was:

DAI-copier -> IIR -> gain -> module copier -> host-copier

After:

DAI-copier -> IIR -> gain -> module copier ->
TDFB -> DRC -> host-copier

The beamformer is set for 2ch topologies to a narrow user
direction stereo image enhance with about 3 dB signal-to-noise
ratio improvement with blob "line2_generic_pm10deg.conf". In 4ch
topologies the beamformer is set to pass-through due to large
variations in notebook array geometries. The processing need to
be enabled per product by UCM2. The beamformer control switch is
by default off.

The DRC is set with blob "dmic_default.conf" to produce up to
10 dB boost in capture level. It helps to make DMIC capture louder
in normal silent conditions while it prevents clipping of samples
in loud conditions. The DRC control switch is by default off.

The added controls (seen with "amixer -c0 controls") are:

- Dmic0 Capture DRC bytes
- Dmic0 Capture DRC switch
- Dmic0 Capture TDFB angle set enum
- Dmic0 Capture TDFB beam switch
- Dmic0 Capture TDFB bytes

Signed-off-by: Seppo Ingalsuo <[email protected]>
@singalsu singalsu force-pushed the hda_generic_dmic_add_preprocess branch from 0f89055 to 57ed385 Compare September 10, 2024 07:44
@marc-hb
Copy link
Collaborator

marc-hb commented Sep 11, 2024

SOFCI TEST

EDIT: previous run failed because it was missing thesofproject/sof-test@a00f414

@singalsu singalsu marked this pull request as ready for review September 11, 2024 07:13
@singalsu
Copy link
Collaborator Author

SOFCI TEST

@singalsu
Copy link
Collaborator Author

@singalsu
Copy link
Collaborator Author

The LNLM_SDW_AIOC check-alsabat-headset-playback-997.sh fail in https://sof-ci.01.org/sofpr/PR9441/build7883/devicetest/index.html is not related to this patch. It's a different topology with no generic dmic topology parts.

@lgirdwood lgirdwood merged commit 97e5c0d into thesofproject:main Sep 11, 2024
45 of 47 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants