-
Notifications
You must be signed in to change notification settings - Fork 349
audio: fix conflict with IPC3 xrun messages and IPC4 mailbox definition #10480
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
base: main
Are you sure you want to change the base?
Conversation
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 prevents potential conflicts between IPC3 xrun message handling and IPC4 debug window2 functionality by conditionally compiling IPC3-specific code paths. The changes ensure that stream mailbox writes and xrun position reporting are only active when using IPC3, avoiding unintended overwrites of IPC4 debug window content.
Changes:
- Added compile-time guards to prevent stream mailbox usage in IPC4 configurations
- Wrapped IPC3-specific xrun handling code with conditional compilation directives
- Added clarifying comments explaining the IPC version-specific behavior
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/include/sof/lib/mailbox.h | Adds IPC4 stub for mailbox_stream_write that asserts false, preventing accidental use |
| src/audio/pipeline/pipeline-xrun.c | Wraps IPC3-specific xrun position reporting and pipeline walking code with CONFIG_IPC_MAJOR_3 guards |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@kv2019i can you check CI, not sure if CI issue here. |
…ilds The IPC interface to notify host of over/underruns is different between IPC3 and IPC4. The pipeline_xrun() implementation however was called in common code and could lead to corruption of the host-DSP mailboxes. In practise errors were not hit in current SOF builds as none of the DMA drivers that are used with targets using IPC4, return runtime errors in their dma_reload() implementations, so dai_report_xrun() was never called. Zephyr DMA does allow errors to be returned for reload, so correct the implementation to never send IPC3 notifications in IPC4 builds. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
To prevent any accidental use in new code, add an assert to mailbox_stream_write() against use in IPC4 builds. The "stream mailbox" is not available in IPC4 mailbox layout, so it must not be used. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
b601cb4 to
c39a5a9
Compare
|
https://sof-ci.01.org/sofpr/PR10480/build18465/build is caused by #10476 . Uploaded V2 that rebases on top of latest SOF, the SOF PR build should pass now. |
Fix potential issue with IPC3 xrun messages written on top of IPC4 debug window2 content.
Issue not hit with current SOF builds, but make sure this won't be hit in future either.