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: Tune: DRC: Add calculation of blob for speaker processing #8475

Merged
merged 6 commits into from
Dec 19, 2023

Conversation

singalsu
Copy link
Collaborator

@singalsu singalsu commented Nov 10, 2023

First commit adds m4 blob for testbench, 2nd commit adds same for tplg2, 3rd commit adds same for sof-ctl, 4th commit contains the Matlab code changes to produce blobs.

@singalsu singalsu force-pushed the drc_add_speaker_blob branch from 731476c to 93ca352 Compare November 10, 2023 17:21
@singalsu singalsu marked this pull request as ready for review November 10, 2023 17:23
Copy link
Member

@lgirdwood lgirdwood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but is there an instruction/comments on how to change the gains ?

@@ -0,0 +1,21 @@
# Exported Control Bytes 10-Nov-2023
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we add comments for this blob usage here?
maybe filename not need so complicated, we can add its usage and specification here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A generic name like drc_coef_generic_notebook_speaker.m4 / .conf might do after I can decide what are the final parameters to use.

@@ -0,0 +1,22 @@
# Exported Control Bytes 10-Nov-2023
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here, what is it and how this table was used?

tools/tune/drc/drc_gen_coefs.m Show resolved Hide resolved
@@ -31,6 +31,14 @@ function example_drc()
params.enabled = 1;
drc_coefs_and_config_export(params, 'enabled');

% Export experimental configuration for a small speaker
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my view the only purpose for these lines is to generate the config "threshold_-25_knee_15_ratio_10_post_3", they are not supposed to land upstream. Alternatively, the applied param set could be put into the comment together with the generated config files.
Another point is that the generated config will be changed by any parameter which is not specified here, e.g. attack and release.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, there's more parameters. I guess I should change the file name, but the intention of this is to become the default notebook speaker (hda-generic PC) DRC so used by their default topology so it should be in upstream. The parameters are still likely to change with more subjective testing. I used these parameters for an internal demo to show how DRC can be used to make a very audible loudness change. The EQ in the pipeline is also part of the enhance effect.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. It should be a good idea to separate them into multiple files, e.g. example_drc_default.m, example_drc_notebook.m, and others for different use cases. I found that the same way is applied under eq/ and tfdb/

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, that would be a small and ease maintenance of the tools files.

@johnylin76
Copy link
Contributor

johnylin76 commented Nov 20, 2023

LGTM, but is there an instruction/comments on how to change the gains ?

The DRC design document may help:
Google-SOF Dynamic Range Compression Design Document.pdf

one can also check the freq response curve by this GUI website:
http://www.audio-tuning.appspot.com/
The parameter set is aligned with the one specified in example_drc.m

@lgirdwood
Copy link
Member

LGTM, but is there an instruction/comments on how to change the gains ?

The DRC design document may help: Google-SOF Dynamic Range Compression Design Document.pdf

one can also check the freq response curve by this GUI website: http://www.audio-tuning.appspot.com/ The parameter set is aligned with the one specified in example_drc.m

@singalsu lets make sure we get these in the DRC Readme.md

This blob exercises fully the features of DRC and is
therefore good for testbench runs to evaluate performance
in all operation regions.

The pipeline pipe-drc-playback.m4 is used only with testbench
so it is safe to change to use this blob.

Signed-off-by: Seppo Ingalsuo <[email protected]>
This blob exercises fully the features of DRC and is
therefore useful for performance evaluation in all
operation regions.

Signed-off-by: Seppo Ingalsuo <[email protected]>
Add descriptive comments how these blobs for DRC were
created.

Signed-off-by: Seppo Ingalsuo <[email protected]>
These blobs are useful in setting DRC in runtime to
pass-through or strong compression mode to evaluate
performance.

Signed-off-by: Seppo Ingalsuo <[email protected]>
This patch updates the generator script example_drc.m with added
information how the blobs were created.

Signed-off-by: Seppo Ingalsuo <[email protected]>
This patch adds generation of a blob that applies about
10 dB gain with compression and additional post gain of
3 dB for strong loudness boost effect.

The drc_gen_coefs.m script is changed to display
the master linear gain as decibels to help achieve
suitable gain when setting parameters.

Signed-off-by: Seppo Ingalsuo <[email protected]>
@singalsu singalsu requested a review from btian1 December 19, 2023 09:42
Copy link
Contributor

@johnylin76 johnylin76 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with one suggestion left

@@ -31,6 +31,14 @@ function example_drc()
params.enabled = 1;
drc_coefs_and_config_export(params, 'enabled');

% Export experimental configuration for a small speaker
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. It should be a good idea to separate them into multiple files, e.g. example_drc_default.m, example_drc_notebook.m, and others for different use cases. I found that the same way is applied under eq/ and tfdb/

@lgirdwood lgirdwood merged commit 3d083e7 into thesofproject:main Dec 19, 2023
43 of 44 checks passed
@singalsu singalsu deleted the drc_add_speaker_blob branch January 4, 2024 10:34
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.

5 participants