Skip to content

Key phrase detected: async notifications - #1042

Closed
mrajwa wants to merge 1 commit into
thesofproject:masterfrom
mrajwa:ghw_events
Closed

mrajwa wants to merge 1 commit into
thesofproject:masterfrom
mrajwa:ghw_events

Conversation

@mrajwa

@mrajwa mrajwa commented Feb 24, 2019 •

Copy link
Copy Markdown
Contributor

DO NOT MERGE! This is just a proposal of how we can handle async notification between key phrase detector component and KPB.

Key phrase detector component sends async notification to KPB
component using notifier module. KPB registers to specific event
dedicated to key phrase detection. Once such event takes place
detection component calls notifier_event handler which in turn
calls KPB call-back function.

Signed-off-by: Marcin Rajwa marcin.rajwa@linux.intel.com

Key phrase detector component sends async notification to KPB
component using notifier module. KPB registers to specific event
dedicated to key phrase detection. Once such event took place
detection component calls notifier_event handler which in turn
calls KPB call-back function.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
enum notify_id {
NOTIFIER_ID_CPU_FREQ = 0,
NOTIFIER_ID_SSP_FREQ,
NOTIFIER_ID_KEY_PHRASE_DETECTED,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pls replace with some more generic name for all events sent by KPB clients, e.g. `NOTIFIER_ID_KPB_CLIENT_EVT'

Comment thread src/audio/kp_detector.c
struct comp_data dummy_cd;

/* copy and process stream data from source to sink buffers */
static int kp_detector_copy(struct comp_dev *dev)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Seems to be a dummy test code, a final version should be part of kp-detector commit.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, I was thinking about merging this code with kp_detector once its PR is accepted.

@@ -0,0 +1,6 @@
#include <stdint.h>

struct kp_data {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Anything that is part of kpbuf public interface (internal to other fw components/units) may go to kpb.h or kpb_public.h (the latter follows current organization where the .h headers declare rather private data).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

kp_common.h, or kpb_public.h as you suggested has the same intention - provide a public/common data structure to be shared by key phrase related components.

@ranj063

ranj063 commented Feb 25, 2019

Copy link
Copy Markdown
Collaborator

@mrajwa I'm having a bit of trouble understanding the intent of this PR and the need for the kp_detector component. It seems like what you are looking for is to implement the cmd callback for the kpb component if I understand it correctly.

@mrajwa

mrajwa commented Feb 25, 2019

Copy link
Copy Markdown
Contributor Author

@ranj063 because "kp_detector" is really #1036 and here I create a dummy detector component and KPB just to show the intention. Once the #1036 and ##994 get accepted I will merge this one into them. Does it make sense now?

@ranj063

ranj063 commented Feb 25, 2019

Copy link
Copy Markdown
Collaborator

@mrajwa why not add the commits to those PR's instead then? It will make reviewing the flow easier there. But with this PR the reviewers will have to review unnecessary code.

@mrajwa

mrajwa commented Feb 25, 2019

Copy link
Copy Markdown
Contributor Author

Well I did not want to mess with with other PRs - especially with the detector one which was not created by myself. However I agree, it indeed might be easier to follow so I will close this PR and incorporate it into each PR accordingly.

@mrajwa mrajwa closed this Mar 8, 2019
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.

3 participants