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

Audio: MFCC: Fix build of component for current SOF #9365

Merged
merged 6 commits into from
Aug 21, 2024

Conversation

singalsu
Copy link
Collaborator

This is a set of patches to bring MFCC component up-to-date to run with Zephyr IPC4 systems.

@singalsu singalsu marked this pull request as ready for review August 14, 2024 09:14
zephyr/CMakeLists.txt Show resolved Hide resolved
"Exported MFCC configuration", ...
"cd tools/tune/mfcc; octave setup_mfcc.m");
otherwise
error("Illegal cfg.tplg_ver, use 1 or 2.");
Copy link
Member

Choose a reason for hiding this comment

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

use 1 for X or 2 for Y - more helpful :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done!

@lgirdwood lgirdwood added this to the v2.11 milestone Aug 14, 2024
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is the whole file indented?

Copy link
Collaborator

Choose a reason for hiding this comment

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

@marc-hb it is needed if and when MFCC is used on ACE platforms or if any other platforms are converted to split TOML and MFCC is used on them

Copy link
Collaborator

Choose a reason for hiding this comment

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

I tried hard and I really couldn't find a connection between your answer and indentation. Neither the pre-processor nor TOML care about indentation, do they? What am I missing?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I tried hard and I really couldn't find a connection between your answer and indentation. Neither the pre-processor nor TOML care about indentation, do they? What am I missing?

@marc-hb sorry... misread, please, ignore

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

So, I can remove the indent, right?

Copy link
Collaborator

Choose a reason for hiding this comment

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

If it works then yes please remove the indentation. I really don't see how that would be a problem. Assuming it was intentional, what made you think it was needed? Some other example maybe?

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, other examples.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done!

zephyr_library_sources_ifdef(CONFIG_BINARY_LOGARITHM_FIXED
${SOF_MATH_PATH}/base2log.c
)

Copy link
Collaborator

Choose a reason for hiding this comment

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

This would ideally use #8260 and avoid the duplicated definitions, but I can math needs to be moved in one go.

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, prefer that way.

@singalsu
Copy link
Collaborator Author

Here's picture of proposed topology with MFCC for DMIC1 (16 kHz). The DAI captures audio with 32 bits, the IIR filters the audio with 100 Hz high-pass (MFCC is for speech applications), Gain allows user mute of MFCC features data, module copier converts s32 -> s16, MFCC computes the audio features vectors:

sof-hda-generic-ace1-4ch-mfcc

It has not been possible to build the component earlier for Zephyr
IPC4 systems. This patch makes the next fixes:

- Add SOF_MODULE_INIT() and include of rtos/init.h
- For unit test fix the init function to
  sys_comp_module_mfcc_interface_init()
- To Zephyr/CMakeLists.txt add the needed math library sources
- Add .toml files for rimage for IPC4 systems

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
The same dai-copier-eqiir-gain-module-copier-capture pipeline can
be used for both DMIC0 and DMIC1, with different IIR setting,
so the blob definition is moved to dmic-generic.conf where the
pipeline is instantiated.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch adds build of topologies
- sof-hda-generic-cavs25-2ch-mfcc.tplg
- sof-hda-generic-cavs25-4ch-mfcc.tplg
- sof-hda-generic-ace1-2ch-mfcc.tplg
- sof-hda-generic-ace1-4ch-mfcc.tplg

The MFCC is connected to 16 kHz DMIC1 DAI. The MFCC bitstream
is passed to capture PCM. The DMIC1 pipeline style is copied
from DMIC0:

DAI copier -> IIR -> gain -> module_copier -> MFCC -> host copier

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch updates the setup_mfcc.m Octave script to produce
configuration blob for topology version 2 builds.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
In test topologies the MFCC data can be packed to 1, 2, or 4
channels stream. This change fixes the shown time scale for
audio features 3D plot.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
To see draft CI build results, will be removed later for
proposal.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
@singalsu
Copy link
Collaborator Author

Note: I still have patch to set in kconfig CONFIG_COMP_MFCC=y to see build CI results. I'll remove it from next version. This MFCC version is still using the fake PCM stream instead of ALSA compressed audio.

@lgirdwood lgirdwood merged commit 1009ba7 into thesofproject:main Aug 21, 2024
42 of 49 checks passed
@marc-hb
Copy link
Collaborator

marc-hb commented Aug 22, 2024

This was merged with a number of failures.

@LaurentiuM1234 this is the PR that broke the 64bits build (and sparse)

@singalsu
Copy link
Collaborator Author

This was merged with a number of failures.

@LaurentiuM1234 this is the PR that broke the 64bits build (and sparse)

Can you be more specific, how did it break?

@LaurentiuM1234
Copy link
Contributor

This was merged with a number of failures.

@LaurentiuM1234 this is the PR that broke the 64bits build (and sparse)

right, same as faf725a I guess

@marc-hb
Copy link
Collaborator

marc-hb commented Aug 22, 2024

Can you be more specific, how did it break?

"View details" button.

EDIT:

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.

6 participants