-
Notifications
You must be signed in to change notification settings - Fork 349
ipc4: pipeline: Add notification pool and data process error notification #9972
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
73d3988 to
7640863
Compare
7640863 to
06d7cff
Compare
974d174 to
3beaf43
Compare
kv2019i
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.
Code changes looks good. A few question/comments inline, please check.
Move end of the include guard to cover entire file. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
Fix name and formatting for uaol event notification. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
Separate common resource event notification initialization code to a new resource_notif_header_init function. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
Provide a structure and function to initiate notification of an error reported by the module's data processing function. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
5c22aa4 to
de9d279
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.
Pull Request Overview
This PR adds a notification pool mechanism for IPC messages and integrates error notifications into both ll and dp modules when data processing errors occur.
- Introduces dynamically allocated notification pool management in src/ipc/notification_pool.c and corresponding header in src/include/sof/ipc/notification_pool.h.
- Updates IPC message structure (adding a callback) and adds error notification message initialization functions in src/ipc/ipc4/notification.c and src/include/ipc4/notification.h.
- Enhances pipeline error handling by triggering notifications on processing errors in src/audio/pipeline/pipeline-stream.c and src/audio/pipeline/pipeline-schedule.c.
Reviewed Changes
Copilot reviewed 9 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/ipc/notification_pool.c | New implementation of the notification pool with dynamic allocation. |
| src/ipc/ipc4/notification.c | Added header initialization helper and error notification init. |
| src/ipc/ipc-common.c | Invokes message callback after a successful send. |
| src/include/sof/ipc/notification_pool.h | Declares the notification pool retrieval function. |
| src/include/sof/ipc/msg.h | Adds a callback field to the IPC message structure. |
| src/include/sof/audio/pipeline.h | Declares the function for sending component copy error notifications. |
| src/include/ipc4/notification.h | Adjusts enum values and adds process data error structures. |
| src/audio/pipeline/pipeline-stream.c | Implements error notification during pipeline copy operations. |
| src/audio/pipeline/pipeline-schedule.c | Triggers error notifications upon failure in module processing. |
Files not reviewed (2)
- src/ipc/CMakeLists.txt: Language not supported
- uuid-registry.txt: Language not supported
Comments suppressed due to low confidence (4)
src/include/ipc4/notification.h:41
- The enum value has been renamed from UAOL_RSVD_ to UAOL_EVENT; please ensure that all references to this notification type are updated consistently across the project.
SOF_IPC4_UAOL_EVENT = 13,
src/ipc/notification_pool.c:51
- Consider verifying that decrementing 'pool_depth' on memory allocation failure does not cause an inconsistent or negative pool count, which could lead to unexpected behavior when retrieving notifications.
--pool_depth;
src/audio/pipeline/pipeline-stream.c:135
- [nitpick] Double-check that triggering pipeline_comp_copy_error_notify only for error conditions (err < 0) is the intended behavior, and that PPL_STATUS_PATH_STOP is handled appropriately without an error notification.
if (err < 0) {
src/audio/pipeline/pipeline-schedule.c:377
- [nitpick] Ensure that triggering pipeline_comp_copy_error_notify here correctly distinguishes between recoverable and non-recoverable errors returned by module_process_sink_src.
if (ret)
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.
Pull Request Overview
This PR introduces a notification pool for IPC messages along with error notification mechanisms for data processing failures in pipeline components. Key changes include:
- Implementation of a dynamic notification pool with callback support.
- Addition of new functions to initialize and send error notifications in both ll and dp modules.
- Updates to IPC and audio pipeline modules to integrate error notifications.
Reviewed Changes
Copilot reviewed 9 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/ipc/notification_pool.c | Implements dynamic allocation for IPC notifications using a pool. |
| src/ipc/ipc4/notification.c | Adds initialization functions for resource and error notifications. |
| src/ipc/ipc-common.c | Invokes the notification callback after sending messages. |
| src/include/sof/ipc/notification_pool.h | Exposes the notification pool API. |
| src/include/sof/ipc/msg.h | Adds a callback pointer to the IPC message structure. |
| src/include/sof/audio/pipeline.h | Declares an API for pipeline component copy error notifications. |
| src/include/ipc4/notification.h | Updates enums and declares error notification initialization. |
| src/audio/pipeline/pipeline-stream.c | Implements error notification for copy errors in the pipeline copy path. |
| src/audio/pipeline/pipeline-schedule.c | Notifies error conditions in module processing during scheduling. |
Files not reviewed (2)
- src/ipc/CMakeLists.txt: Language not supported
- uuid-registry.txt: Language not supported
src/ipc/notification_pool.c
Outdated
| item = rzalloc(SOF_MEM_ZONE_RUNTIME_SHARED, 0, SOF_MEM_CAPS_RAM, sizeof(*item)); | ||
| if (!item) { | ||
| key = k_spin_lock(&pool_free_list_lock); | ||
| --pool_depth; |
Copilot
AI
May 6, 2025
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.
Consider adding a check or assertion to ensure that pool_depth does not become negative after decrementing on allocation failure.
| --pool_depth; | |
| if (pool_depth > 0) { | |
| --pool_depth; | |
| } else { | |
| tr_err(¬if_tr, "pool_depth is already zero, cannot decrement"); | |
| } |
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.
in fact I wanted to comment on this but eventually decided not to - in the larger context when also checking the caller it is clear that pool_depth cannot underrun, but indeed this design choice isn't making it very obvious, logical and safe - the counter is incremented in the caller and on error it's decremented in the called function. I'd say that it would be more logical to do both at the same level.
Add a pool of IPC messages for sending notifications. These messages are dynamically allocated as needed. Add a callback to the ipc_msg structure that is called after sending a message, allowing messages to be returned to the pool once sent. Using a notification pool simplifies the process of sending sporadic notifications by components. This approach eliminates the need for components to manage the allocation and release of notifications. Additionally, it conserves memory, as notifications that are never sent during normal operation will not be allocated. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
Add functionality to send notifications when a data processing function in a module reports an error. Add notifications for both ll and dp modules. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
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.
Pull Request Overview
This PR introduces a notification pool for IPC messages, adding a callback mechanism to automatically recycle messages after transmission and integrating data processing error notifications into the pipeline.
- Implements a notification pool with dynamic allocation and free-list management in src/ipc/notification_pool.c.
- Adds process data error notification support in IPC4 via functions in src/ipc/ipc4/notification.c and integrates it into pipeline error handling in pipeline-stream.c and pipeline-schedule.c.
- Updates relevant header files to expose the new functionality.
Reviewed Changes
Copilot reviewed 9 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/ipc/notification_pool.c | Implements notification pool allocation and callback mechanism. |
| src/ipc/ipc4/notification.c | Adds data error notification initialization and header refactor. |
| src/ipc/ipc-common.c | Integrates callback invocation after successful IPC message send. |
| src/include/sof/ipc/notification_pool.h | Declares the API for retrieving notification messages. |
| src/include/sof/ipc/msg.h | Adds a callback member to the ipc_msg structure. |
| src/include/sof/audio/pipeline.h | Declares the new pipeline error notification function. |
| src/include/ipc4/notification.h | Updates IPC4 notification definitions to support process data error events. |
| src/audio/pipeline/pipeline-stream.c | Triggers error notifications on pipeline copy errors. |
| src/audio/pipeline/pipeline-schedule.c | Invokes error notifications when module processing fails. |
Files not reviewed (2)
- src/ipc/CMakeLists.txt: Language not supported
- uuid-registry.txt: Language not supported
|
CI has stalled. rerun. |
|
SOFCI TEST |
Add a pool of IPC messages for sending notifications. These messages are dynamically allocated as needed. Add a
callbackto theipc_msgstructure that is called after sending a message, allowing messages to be returned to the pool once sent.Using a notification pool simplifies the process of sending sporadic notifications by components. This approach eliminates the need for components to manage the allocation and release of notifications. Additionally, it conserves memory, as notifications that are never sent during normal operation will not be allocated.
Add functionality to send notifications when a data processing function in a module reports an error. Add notifications for both ll and dp modules.