Skip to content

audio: host-zephyr: add HOST_DMA_IPC_POSITION_UPDATES Kconfig#10849

Open
kv2019i wants to merge 1 commit into
thesofproject:mainfrom
kv2019i:202606-make-ipc-pos-updates-conditional
Open

audio: host-zephyr: add HOST_DMA_IPC_POSITION_UPDATES Kconfig#10849
kv2019i wants to merge 1 commit into
thesofproject:mainfrom
kv2019i:202606-make-ipc-pos-updates-conditional

Conversation

@kv2019i
Copy link
Copy Markdown
Collaborator

@kv2019i kv2019i commented Jun 5, 2026

Add a built option HOST_DMA_IPC_POSITION_UPDATES to control whether functionality to send IPC stream position updates is enabled or not. Most platforms provide more efficient means for host to monitor DMA state, so this code is in most cases unncessary.

The current IPC sending code (from audio context) also assume kernel context, so making this functionality user-space compatible will require extra work.

Enable DMA IPC position updates by default for IPC3 as the feature can be controlled by host with sof_ipc_stream_params.no_stream_position IPC interface. Disable the feature by default for IPC4, as there is no host IPC interface to control this and copier_update_params() unconditionally disables IPC updates for IPC4 now, so this code is never used.

Copilot AI review requested due to automatic review settings June 5, 2026 12:25
@kv2019i kv2019i requested a review from jsarha June 5, 2026 12:25
@kv2019i kv2019i requested review from lyakh and tmleman June 5, 2026 12:25
@kv2019i
Copy link
Copy Markdown
Collaborator Author

kv2019i commented Jun 5, 2026

For context, part of #10558

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a Kconfig option to control whether host DMA stream position updates are reported via IPC messages, and uses it to compile-time disable the IPC notification path in the Zephyr host implementation.

Changes:

  • Introduce HOST_DMA_IPC_POSITION_UPDATES Kconfig (default enabled for IPC3).
  • Guard IPC position-update sending (and ipc_msg allocation/free) in host-zephyr.c behind the new Kconfig.
  • Make struct host_data::msg conditional on CONFIG_HOST_DMA_IPC_POSITION_UPDATES.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/audio/Kconfig Adds the new Kconfig switch controlling IPC-based position updates.
src/audio/host-zephyr.c Wraps IPC position update logic and message lifecycle with the new config option.
src/audio/copier/host_copier.h Makes the ipc_msg *msg member conditional on the new config.

Comment on lines 108 to +111
struct sof_ipc_stream_posn posn; /* TODO: update this */
#if CONFIG_HOST_DMA_IPC_POSITION_UPDATES
struct ipc_msg *msg; /**< host notification */
#endif
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack, fixed in V2.

Comment thread src/audio/Kconfig Outdated
Comment on lines +45 to +47
config HOST_DMA_IPC_POSITION_UPDATES
bool "Support for stream position updates via IPC messages"
default y if IPC_MAJOR_3
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack, fixed in V2.

Add a built option HOST_DMA_IPC_POSITION_UPDATES to control whether
functionality to send IPC stream position updates is enabled or
not. Most platforms provide more efficient means for host to
monitor DMA state, so this code is in most cases unncessary.

The current IPC sending code (from audio context) also assume
kernel context, so making this functionality user-space compatible
will require extra work.

Enable DMA IPC position updates by default for IPC3 as the feature can
be controlled by host with sof_ipc_stream_params.no_stream_position IPC
interface. Disable the feature by default for IPC4, as there is no host
IPC interface to control this and copier_update_params() unconditionally
disables IPC updates for IPC4 now, so this code is never used.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
@kv2019i kv2019i force-pushed the 202606-make-ipc-pos-updates-conditional branch from be41a4b to 143d6c2 Compare June 5, 2026 14:40
@kv2019i
Copy link
Copy Markdown
Collaborator Author

kv2019i commented Jun 5, 2026

V2 pushed:

  • make it possible to build IPC3 with position update feature disable
  • change the Kconfig logic to prevent use of position updates with IPC4 (as it doesn't fully work)
  • move "report_pos" under ifdef as this field is only needed for IPC position reporting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants