-
Notifications
You must be signed in to change notification settings - Fork 349
Convert volume to use the new module interface #5766
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
Conversation
5ac90a7 to
213fb98
Compare
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.
@ranj063 having a second thought about this I think we shouldn't use config->type but UUID as we agreed with @cujomalainey at some point.
We want to avoid adding new component types in the future.
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.
Personally I want to delete that enum, i think its just confusing for newcomers.
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.
Pointer *spec points directly to IPC mailbox address. In this code You assume, it maps to following structure:
struct ipc_config_process {
uint32_t size; /< size of bespoke data section in bytes */
uint32_t type; /< sof_ipc_process_type */
unsigned char *data;
};
I think this is not true for IPC4 protocol, where initial data are passed through IPC4 header extended, and payload starts with beginning of the configuration. The size variable will be wrong here.
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.
@jxstelter right the module adapter needs to be adapter for IPC4. My next target is to convert the copier. I will handle this with that change
b351fa3 to
7c563ed
Compare
487b141 to
eb61ba8
Compare
|
@singalsu @lgirdwood this PR is ready for review now |
lgirdwood
left a comment
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.
How does the legacy part work ? i.e how is volume partitioned ?
@lgirdwood I created new functions for the API's needed for the new module interface API and then reused them within the ops for the legacy comp_drv ops. This only difference is that with the comp_drv interface we also need to allocated struct processing_module apart from comp_dev. But this structure is minimally used with no memory allocation for the input/putput buffers |
tools/tplg_parser/pga.c
Outdated
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.
do we do this everywhere? It would be better to use container_of() for these
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.
no I switched back to the original definition. so not relevant anymore
tools/tplg_parser/pga.c
Outdated
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.
memcpy(volume + 1,...)
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.
or better still a convenience macro for UUID copying (since I assume the relative position is calculated the same and the size is const)
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.
not sure if a macro will be helpful, Liam. The size is actually not constant since it varies based on type of component.
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.
wouldn't it be better to put legacy and new in two different files?
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.
volume is the only exception for a module that will need to keep the legacy comp_drv. While it might a bit cleaner to separate them out, I think keeping them all in one place might make it easier to read.
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.
Why is there need to zero the buffer?
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.
isnt it better to zero the input buffers? WHy leave stale data in?
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.
is it possible that that stale data ends up being delivered to the user? And this one is on a hot path - executed for each copy, so indeed should be avoided
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.
Clearing the buffer consumes unnecessary MCPS. Please fix this afterwards if not in this version.
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.
VOL_S32_SAMPLES_TO_BYTES() ?
In preparation for comverting the volume component to use the module interface, add support for parsing the UUID from topology when parsing the PGA widget in testbench. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
eb61ba8 to
c7612f0
Compare
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.
do I see it correctly, that these source and sink are only used in the simple_copy case below? If so, please move these assignments there
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.
@lyakh if I move it inside the if, I get an error with these being used uninitialized.
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.
first of all I think it's only source that the compiler won't be able to figure out. So, yes, we'd have to initialise it to NULL - I think that's better than assigning irrelevant for the non-simple case values here to be overwritten there.
c7612f0 to
af2a74e
Compare
Optimize the copy() function for modules that have only 1 source/sink buffer and produce only period bytes every period. There is no need to allocate intermediate buffers to hold the processed samples. Also, pass the buffer stream pointers directly so that there no extra copies. Introduce a new field, simple_copy in struct processing_module that can be set by modules that do not need deep buffering and produce exactly period worth of data in every copy(). Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
af2a74e to
e67347e
Compare
singalsu
left a comment
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.
Looks OK, the issues those I commented were from the original code. Please make an improvements PR later for this, e.g. the bzero().
lgirdwood
left a comment
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.
Lets get this under daily testing now and fix the other comments incrementally.
@ranj063 can we also include in the followup PR a Kconfi change that uses the new volume module on say TGL/ADL and the old comp on the other platforms. This will give us more CI/test coverage and make sure we dont see any regressions in the legacy.
|
@ranj063 looks like a lot of QB CI failures, I 'm not sure if this is recent. Any clues what Nonetype errors mean ? |
|
SOFCI TEST |
e67347e to
7790c86
Compare
@lgirdwood done. I left the legacy comp drv interface for everything up until CNL |
7790c86 to
482a30a
Compare
Move the volume component inside the module_adapter folder and use the module interface API instead of the component driver interface. Also fix the volume cmocka tests to use the modified scale_vol function. Also, add kconfig option for keeping the legacy comp_drv interface for platforms that are limited in text region memory size, such as BYT/CHT/APL/JSL/ICL. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
482a30a to
603cb88
Compare
|
In case a git bisect lands you on commit --- build_apl_gcc_volbroken/generated/.config 2022-06-10 20:50:39.178214458 +0000
+++ build_apl_gcc/generated/.config 2022-06-10 20:58:12.840624754 +0000
@@ -81,6 +81,8 @@
# Audio components
#
CONFIG_COMP_DAI=y
+CONFIG_COMP_DAI_GROUP=y
+CONFIG_COMP_BLOB=y
CONFIG_COMP_SRC=y
# CONFIG_COMP_SRC_STD is not set
CONFIG_COMP_SRC_SMALL=y
@@ -114,8 +116,19 @@
CONFIG_ASRC_SUPPORT_CONVERSION_48000_TO_32000=y
CONFIG_ASRC_SUPPORT_CONVERSION_48000_TO_44100=y
# CONFIG_COMP_TDFB is not set
-# CONFIG_COMP_MODULE_ADAPTER is not set
-# CONFIG_COMP_LEGACY_INTERFACE is not set
+CONFIG_COMP_MODULE_ADAPTER=y
+CONFIG_COMP_LEGACY_INTERFACE=y
+
+#
+# Processing modules
+#
+# CONFIG_CADENCE_CODEC is not set
+CONFIG_COMP_VOLUME=y
+# CONFIG_COMP_VOLUME_WINDOWS_FADE is not set
+CONFIG_COMP_VOLUME_LINEAR_RAMP=y
+# CONFIG_PASSTHROUGH_CODEC is not set
+# CONFIG_WAVES_CODEC is not set
+# CONFIG_DTS_CODEC is not set
# CONFIG_COMP_IGO_NR is not set
# CONFIG_COMP_RTNR is not set
|
|
100% reproducible regression / panic filed in |
This first 4 commits are from #5872. This PR will need to be rebased once that is merged.