Skip to content

module: eap: rework module to use sink/source api - #11213

Open
softwarecki wants to merge 1 commit into
thesofproject:mainfrom
softwarecki:p20-eap
Open

softwarecki wants to merge 1 commit into
thesofproject:mainfrom
softwarecki:p20-eap

Conversation

@softwarecki

Copy link
Copy Markdown
Collaborator

Rework the eap module to only use the sink/source api to prepare sof for the full transition to pipeline 2.0.

Rework the eap module to only use the sink/source api to prepare sof for
the full transition to pipeline 2.0.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Compilation, data-loss, and topology-handling issues remain unresolved.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Reworks the NXP EAP module to use SOF’s sink/source API for the pipeline 2.0 transition.

Changes:

  • Migrates EAP preparation and processing callbacks.
  • Adds circular-buffer input/output handling.
  • Updates module interface registration.
File summaries
File Summary Findings
src/audio/nxp/eap.c Converts EAP processing to sink/source buffer APIs. Critical pointer-arithmetic and topology-validation issues, plus a moderate source-release ordering issue, remain unresolved.
Review details

Suppressed comments (1)

src/audio/nxp/eap.c:292

  • snk_buf_start is a void *, so this addition also relies on GNU void-pointer arithmetic and is rejected by the host build's -Wpointer-arith -Werror flags. Cast it to a byte pointer before adding buf_size.
	size_to_wrap = cir_buf_bytes_without_wrap(snk_ptr, snk_buf_start + buf_size);
  • Files reviewed: 1/1 changed files
  • Comments generated: 3
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/audio/nxp/eap.c
Comment on lines +177 to +180
if (num_of_sources != 1) {
comp_err(dev, "invalid number of sources %d", num_of_sources);
return -EINVAL;
}
Comment thread src/audio/nxp/eap.c
return ret;

/* buf_size is the total ring buffer size; handle wrap when copying to in_buff */
size_to_wrap = cir_buf_bytes_without_wrap(src_ptr, src_buf_start + buf_size);
Comment thread src/audio/nxp/eap.c
Comment on lines +284 to +289
source_release_data(sources[0], process_size);

/* copy produced samples to output buffer */
memcpy_s(output_buffers[0].data, eap->mpd.produced, eap->mpd.out_buff, eap->mpd.produced);
output_buffers[0].size = eap->mpd.produced;
ret = sink_get_buffer(sinks[0], process_size, &snk_ptr, &snk_buf_start, &buf_size);
if (ret)
return ret;
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