-
Notifications
You must be signed in to change notification settings - Fork 366
audio: iadk: support API 4.5.2 loadable detector modules #11032
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
Open
TsaiGaggery
wants to merge
4
commits into
thesofproject:main
Choose a base branch
from
TsaiGaggery:iadk-detector-fixes
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
f00d8c3
audio: iadk: accept module API 4.5.2
TsaiGaggery c02b317
audio: iadk: resolve missing module placeholders
TsaiGaggery f8908cc
audio: iadk: initialize loadable modules once
TsaiGaggery 41e9f2b
audio: module_adapter: support sinkless IADK modules
TsaiGaggery 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -366,6 +366,18 @@ static void module_adapter_calculate_dp_period(struct comp_dev *dev) | |
|
|
||
| } | ||
|
|
||
| /* Sinkless modules derive their deadline from one input buffer. */ | ||
| if (period == UINT32_MAX && mod->num_of_sources > 0) { | ||
| size_t frame_bytes = source_get_frame_bytes(mod->sources[0]); | ||
| unsigned int rate = source_get_rate(mod->sources[0]); | ||
|
|
||
| if (frame_bytes && rate) | ||
| period = 1000000ULL * source_get_min_available(mod->sources[0]) / | ||
| (frame_bytes * rate); | ||
| else | ||
| period = 0; | ||
| } | ||
|
|
||
| dev->period = period; | ||
| } | ||
| #endif /* CONFIG_ZEPHYR_DP_SCHEDULER */ | ||
|
|
@@ -473,12 +485,18 @@ int module_adapter_prepare(struct comp_dev *dev) | |
| * Hence check for NULL. | ||
| */ | ||
| sink = comp_dev_get_first_data_consumer(dev); | ||
| if (!sink) { | ||
| if (!sink && !IS_PROCESSING_MODE_SINK_SOURCE(mod)) { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. are sinkless modules only allowed in DP mode or in LL too? |
||
| comp_err(dev, "no sink present on period size calculation"); | ||
| return -EINVAL; | ||
| } | ||
|
|
||
| mod->period_bytes = audio_stream_period_bytes(&sink->stream, dev->frames); | ||
| /* A sinkless module still needs at least one source. */ | ||
| if (!sink && !comp_dev_get_first_data_producer(dev)) { | ||
| comp_err(dev, "no source or sink buffer connected"); | ||
| return -EINVAL; | ||
| } | ||
|
|
||
| mod->period_bytes = sink ? audio_stream_period_bytes(&sink->stream, dev->frames) : 0; | ||
| comp_dbg(dev, "got period_bytes = %u", mod->period_bytes); | ||
|
|
||
| /* no more to do for sink/source mode */ | ||
|
|
||
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.
previously in this case
dev->periodwould be set toUINT32_MAX. Is this change deliberate? What's its purpose? This seems to be an error case anyway, right?