-
Notifications
You must be signed in to change notification settings - Fork 311
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
Generic process implementation #2956
Conversation
@lgirdwood @mmaka1 @kv2019i I am still using 32bit subtype as the 16Bytes UUID dereference is not implemented yet inside the FW, if we decide to go with that, we can add incremental changes once it is implemented. |
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.
Needs to be added to ABI classifier, but otherwise looks good.
comp->type); | ||
return NULL; | ||
tr_info(&comp_tr, "comp_new(), no type %d, fallback to use subtype", | ||
comp->type); |
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.
I think this should be tr_dbg instead of tr_info, when we will have full support for traces this will make a difference.
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.
I wanted this message to be logged most of the time, that's why I uses tr_info, not tr_dbg.
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.
We need to use this in conjunction with passing full UUID in constructing the topology.
@@ -47,6 +47,8 @@ enum sof_comp_type { | |||
SOF_COMP_ASRC, /**< Asynchronous sample rate converter */ | |||
SOF_COMP_DCBLOCK, | |||
SOF_COMP_SMART_AMP, /**< smart amplifier component */ | |||
|
|||
SOF_COMP_PROCESS = 1000, /**< generic process 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.
Can you add.
/*No more _COMP_ types to be added. Use SOF_COMP_PROCESS from now on.
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.
Sure thing.
src/include/ipc/topology.h
Outdated
@@ -67,8 +67,7 @@ struct sof_ipc_comp { | |||
uint32_t pipeline_id; | |||
uint32_t core; | |||
|
|||
/* reserved for future use */ | |||
uint32_t reserved[1]; | |||
uint32_t subtype; /**< favour for generic component type */ |
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.
This should be using UUID now. There's no pint in introducing a short lived ABI change.
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.
@lgirdwood as I stated above, the problem is that the 16Bytes UUID will not be accepted (Firmware can't understand it) by today's firmware.
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.
If it needs a new IPC then we add a new IPC. This subtype is just the old method.
@keyonjie lets make sure that the link This could be helpful for someone trying to understand the reason behind changes later in time. |
Good idea, will do that. |
@lgirdwood the 16Bytes UUID will not be accepted (Firmware can't understand it) by today's firmware, so that is still open to me, looks we have to introduce this maybe not-so-short-lived ABI change? |
The change to UUID should have no intermediate states, it should be done atomically in one ABI MINOR update. The new IPC can still carry the old "type" value to help with backwards compat, but the UUID should be introduced alongside the PROCESS_TYPE update. |
So, summarize the several solutions here:
The solution 2 above was what @mmaka1 and @ktrzcinx wanted and implemented and I believe parts (or most?) of the code changes are already merged on FW/rimage/kernel sides. So I think the solution 1 is what you wanted @lgirdwood ? It is somewhat like 2 (use the UUID concept to try to fix the "possible" existed flavor collision) + 3 (UUID dictionary in extended manifest not needed). I don't think the 16Bytes UUID introduction here can benefit us anything, the 32bit subtype is good enough: No matter UUID or subtype, we need to pre-define (before build time) them in both FW source and topology .h header files, and the pre-define for subtype (32bit enum, like the component type we are using today) can avoid the collision better than the 16bytes UUID. So I will suggest/advertise the solution 3 above if you want the solution 1, @lgirdwood @kv2019i , I can accept solution 2, but I like 3 most. |
Add SOF_COMP_PROCESS as generic process component type, which can be used for all process components (e.g. demux, eq, detect_test, smart_amp, ...) in the future. This and the subsequent commits are made to support generic process component as described in: https://github.com/orgs/thesofproject/teams/sof-developers/discussions/32 The corresponding FW PR is: thesofproject/sof#2956. After this series is applied, all existed process/effect components including mux/demux/eq/kpb/detect_test/selector/smart_amp/dcblock will be switched to this generic process type automatically. The ABI minor will be bumped to 17 to reflect this change. Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
@keyonjie please do 1 above. This requires changes to
|
Add SOF_COMP_PROCESS as generic process component type, which can be used for all process components (e.g. demux, eq, detect_test, smart_amp, ...) in the future. This and the subsequent commits are made to support generic process component as described in: https://github.com/orgs/thesofproject/teams/sof-developers/discussions/32 The corresponding Linux PR is: thesofproject/linux#2129. After this series is applied, all existed process/effect components including mux/demux/eq/kpb/detect_test/selector/smart_amp/dcblock will be switched to this generic process type automatically. The ABI minor will be bumped to 17 to reflect this change. Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Add subtype member to struct sof_ipc_comp, which will be used as flavour of some generic component type like process. Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
In comp_new(), match the component driver with comp->type first, if no driver matched (e.g. for SOF_COMP_PROCESS type), will try to match with subtype (e.g. for demux/detect_test/eq/smart_amp...). With this change applied, if the new generic SOF_COMP_PROCESS type and subtype entry address are passed from the driver, we can get the correct driver for it, all these are verified with demux component. Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Now, generic process/effect component is implemented, bump the ABI minor version to 17 for that. Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
All these 3 items were actually initially implemented with my "[RFC] UUID xxx" series, though I change to use the 32b UUID key later on. So this will be very easy to do.
This 4th item is the real trouble, need @mmaka1 @ktrzcinx 's help on it. |
We don't store the full UUID inside the ADSP SRAM at the moment, so unable to use the UUID to do the lookup. |
@keyonjie sounds like a minor change. You need to put them in RODATA or another section. |
To add UUID to RODATA it should be enough to change:
to
plus removing *) I didn't test it |
Thanks for this, but if we want to put it into the RODATA section, we should do change like this, no?
|
then we might need to change the ldc.c and smex.c also, the uuid entries will not be organized to be a separated section anymore. |
@keyonjie If UUID entries won't be in separate section, then generating UUID dictionary for ldc file will be awkward process. |
@ktrzcinx with your method mentioned above, the UUID entries is arranged in a separated section started from 0xbe120000 is out of the .rodata section range (0xbe052000~0xbe06e028) so I suppose it won't be loaded into SRAM. |
And back to the original, if the UUID dictionary is not reliable at dynamic module load/unload scenarios, does the UUID dictionary still valuable, shall we remove this part and not generate it in either ldc or extended manifest? |
@keyonjie yes, it's out of .rodata section, because it's in .static_uuid_entries section, but both of them are loaded into .sof_fw segment. In the same manner .fw_ready section is organized.
our trace system already use this UUID dictionary from ldc file to format trace logs. |
OK, then it's fine, let me try it. Thanks.
|
@lgirdwood @kv2019i @dbaluta @ktrzcinx I have figured out the solution and will push changes to #2920, will close the PR here, thanks. |
This is a simple series to support generic process component as described in:
https://github.com/orgs/thesofproject/teams/sof-developers/discussions/32
UUID support is not added yet, but this is sufficient to unblock adding new process components like crossover, beamformer, ...
The kernel corresponding PR is: thesofproject/linux#2129
After this series is applied, all existed process components including mux/demux/eq/kpb/detect_test/selector/smart_amp/dcblock will be switched to this generic process type automatically.
The ABI minor will be bumped to 17 with this change.