-
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: Tune: Add tplg2 support to dcblock setup tool #8122
Merged
kv2019i
merged 3 commits into
thesofproject:main
from
singalsu:dcblock_update_setup_tool
Sep 14, 2023
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,38 @@ | ||
function example_dcblock(); | ||
function example_dcblock() | ||
|
||
% Set the parameters here | ||
tplg_fn = "../../topology/topology1/m4/dcblock_coef_default.m4" % Control Bytes File | ||
tplg1_fn = "../../topology/topology1/m4/dcblock_coef_default.m4"; % Control Bytes File | ||
tplg2_fn = "../../topology/topology2/include/components/dcblock/default.conf"; | ||
% Use those files with sof-ctl to update the component's configuration | ||
blob_fn = "../../ctl/dcblock_coef.blob" % Blob binary file | ||
alsa_fn = "../../ctl/dcblock_coef.txt" % ALSA CSV format file | ||
blob3_fn = "../../ctl/ipc3/dcblock_coef.blob"; % Blob binary file | ||
alsa3_fn = "../../ctl/ipc3/dcblock_coef.txt"; % ALSA CSV format file | ||
blob4_fn = "../../ctl/ipc4/dcblock_coef.blob"; % Blob binary file | ||
alsa4_fn = "../../ctl/ipc4/dcblock_coef.txt"; % ALSA CSV format file | ||
|
||
endian = "little"; | ||
R_coeffs = [0.98, 0.98, 0.98, 0.98, 0.98, 0.98, 0.98, 0.98]; | ||
|
||
addpath ./../common | ||
|
||
blob8 = dcblock_build_blob(R_coeffs, endian); | ||
blob8_ipc4 = dcblock_build_blob(R_coeffs, endian, 4); | ||
|
||
% Generate output files | ||
addpath ./../common | ||
tplg_write(tplg1_fn, blob8, "DCBLOCK"); | ||
blob_write(blob3_fn, blob8); | ||
alsactl_write(alsa3_fn, blob8); | ||
|
||
tplg_write(tplg_fn, blob8, "DCBLOCK"); | ||
blob_write(blob_fn, blob8); | ||
alsactl_write(alsa_fn, blob8); | ||
tplg2_write(tplg2_fn, blob8_ipc4, "dcblock_config", "Exported with script example_dcblock.m"); | ||
blob_write(blob4_fn, blob8_ipc4); | ||
alsactl_write(alsa4_fn, blob8_ipc4); | ||
|
||
% Plot Filter's Transfer Function and Step Response | ||
% As an example, plot the graphs of the first coefficient | ||
fs = 48e3 | ||
fs = 48e3; | ||
dcblock_plot_transferfn(R_coeffs(1), fs); | ||
figure | ||
dcblock_plot_stepfn(R_coeffs(1), fs); | ||
|
||
rmpath ./../common | ||
|
||
endfunction | ||
end |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
bits_R
looks like unused.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.
Yep, I can remove. Easy to add back if would be needed again.