Skip to content

Dummy keyphrase detection component - #1036

Merged
lgirdwood merged 5 commits into
thesofproject:masterfrom
slawblauciak:kd_dummy_comp
Apr 18, 2019
Merged

lgirdwood merged 5 commits into
thesofproject:masterfrom
slawblauciak:kd_dummy_comp

Conversation

@slawblauciak

Copy link
Copy Markdown
Collaborator

This change introduces a component to be used for integration-testing of keyphrase detection systems.
The component will detect spikes in audio signal and will notify the host whenever they occur.
It will also simulate both memory and DSP load with the given configuration passed in the form of a binary blob.

Comment thread src/include/sof/audio/component.h Resolved
@keyonjie

Copy link
Copy Markdown
Contributor

@slawblauciak do we need any configuration from driver side via topology for this dummy keyphrase detection component?

@keyonjie keyonjie left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Some comments about the default detect func.

Comment thread src/audio/detect_test.c Resolved
Comment thread src/audio/detect_test.c Resolved
Comment thread src/include/uapi/abi.h Resolved
@slawblauciak

Copy link
Copy Markdown
Collaborator Author

@keyonjie the component doesn't take any topology configuration. It only accepts binary blob configuration during runtime, before prepare.

@ranj063

ranj063 commented Feb 25, 2019

Copy link
Copy Markdown
Collaborator

@slawblauciak the 4th commit needs to be split up and some changes need to be squashed with earlier ones ex adding the detec_test.c for compilation should be moved to the 3rd commit.

@keyonjie

Copy link
Copy Markdown
Contributor

@keyonjie the component doesn't take any topology configuration. It only accepts binary blob configuration during runtime, before prepare.

OK, good to know that.

@slawblauciak
slawblauciak force-pushed the kd_dummy_comp branch 6 times, most recently from 7f7133c to 5a4606d Compare March 1, 2019 13:15
@slawblauciak

Copy link
Copy Markdown
Collaborator Author

Changes applied and fixed the builds. Checks pass successfully now

@tlauda

tlauda commented Mar 1, 2019

Copy link
Copy Markdown
Contributor

I think it would be better to rebase instead of merge.

@slawblauciak
slawblauciak force-pushed the kd_dummy_comp branch 2 times, most recently from ea708d7 to 26710eb Compare March 1, 2019 14:50
Comment thread src/math/numbers.c Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@slawblauciak we need a textbook CRC that can be licensed BSD/MIT.

@lgirdwood

Copy link
Copy Markdown
Member

@slawblauciak please update to textbook CRC then it's good to merge.

@slawblauciak

slawblauciak commented Apr 17, 2019 •

Copy link
Copy Markdown
Collaborator Author

@lgirdwood very well. Please note however that the most common approach (and the one you're most likely thinking of) requires a fairly large lookup table, which consists of 256 32-bit values. This is why I've been so reluctant to use such an implementation.

EDIT: The darkest place is right under the candlestick... Plugged the math behind the computation of the lookup table directly into the main crc loop. Sorry.

It will compute crc32 of a given area in memory.

Signed-off-by: Slawomir Blauciak <slawomir.blauciak@linux.intel.com>
Provides ipc_send_comp_notification function for
sending custom notifications to the host.

Signed-off-by: Slawomir Blauciak <slawomir.blauciak@linux.intel.com>

@lgirdwood lgirdwood left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Did you push the latest update ? Can still see old CRC32 ?

@slawblauciak

Copy link
Copy Markdown
Collaborator Author

Yeah. And I see the changes correctly.

@lgirdwood

Copy link
Copy Markdown
Member

Btw, a quick google search shows the CRC32 algo using polynomial 0xEDB88320 is within the public domain e.g. http://home.thep.lu.se/~bjorn/crc/ and https://www.hackersdelight.org/hdcodetxt/crc.c.txt
You could just re-implement this algo with your own code to avoid the table and be licence compliant.

@slawblauciak

Copy link
Copy Markdown
Collaborator Author

Those were the ones I used :) hackersdelight is the one that I used first.

@lbetlej lbetlej left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approved as CRC implementation was fixed.

@lgirdwood

Copy link
Copy Markdown
Member

@slawblauciak CI not building on CHT/BYT, can you make sure this component is disabled via Kconfig on those platforms.

@q009

q009 commented Apr 17, 2019

Copy link
Copy Markdown

@lgirdwood it's not a problem with this PR in particular, a lot of PRs are failing for the same reason, on the same platforms.

@lgirdwood

Copy link
Copy Markdown
Member

@slawblauciak master is building for me today

make[1]: Leaving directory '/home/lrg/work/sof/sof/build_kbl_gcc'
-rw-r--r-- 1 lrg lrg 159744 Apr 17 18:31 build_apl_gcc/sof-apl.ri
-rw-r--r-- 1 lrg lrg  91768 Apr 17 18:31 build_bdw_gcc/sof-bdw.ri
-rw-r--r-- 1 lrg lrg  92256 Apr 17 18:30 build_byt_gcc/sof-byt.ri
-rw-r--r-- 1 lrg lrg  93088 Apr 17 18:31 build_cht_gcc/sof-cht.ri
-rw-r--r-- 1 lrg lrg 159744 Apr 17 18:31 build_cnl_gcc/sof-cnl.ri
-rw-r--r-- 1 lrg lrg  91768 Apr 17 18:31 build_hsw_gcc/sof-hsw.ri
-rw-r--r-- 1 lrg lrg 159744 Apr 17 18:31 build_icl_gcc/sof-icl.ri
-rw-r--r-- 1 lrg lrg 135168 Apr 17 18:31 build_kbl_gcc/sof-kbl.ri
-rw-r--r-- 1 lrg lrg 135168 Apr 17 18:31 build_skl_gcc/sof-skl.ri
-rw-r--r-- 1 lrg lrg 323584 Apr 17 18:31 build_sue_gcc/sof-sue.ri

Can you do the Kconfig updates for legacy platforms for thisi and I'll force the other PR owners to do likewise. Ideally we need to only enable a base set of components and not all by default.

This is a testing component acting as a dummy keyword
detector comp. Add the init/free and cmd op so as to be
able to accept switch cmd from userspace.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Slawomir Blauciak <slawomir.blauciak@linux.intel.com>
@lgirdwood

Copy link
Copy Markdown
Member

@slawblauciak looks like we have CI code scan error, can you check.

@slawblauciak

Copy link
Copy Markdown
Collaborator Author

@lgirdwood KW scan itself has failed

Comment thread src/audio/detect_test.c
/* TODO: remove in the future */
dev->params.channels = 1;

if (dev->params.channels != 1) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

CodeCheck complains that you have unrechable code here

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@tlauda @mrajwa may I remove line 261 now?

@lgirdwood

Copy link
Copy Markdown
Member

@slawblauciak @jajanusz so I'm seeing Codecheck passing now but no push update ?

@slawblauciak

Copy link
Copy Markdown
Collaborator Author

@lgirdwood as I mentioned, the codecheck crashed, that's why it didn't pass before. The issue located is probably non-critical, which is why it's passing.

@lgirdwood
lgirdwood merged commit 738c83d into thesofproject:master Apr 18, 2019
@lgirdwood

Copy link
Copy Markdown
Member

@slawblauciak ok, the unreachable code (if it still exists) can be fixed in a new PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P1 Blocker bugs or important features

Projects

None yet

Development

Successfully merging this pull request may close these issues.