Skip to content

Apm spf status fix#47

Closed
man-rav wants to merge 0 commit intoAudioReach:masterfrom
man-rav:apm_spf_status_fix
Closed

Apm spf status fix#47
man-rav wants to merge 0 commit intoAudioReach:masterfrom
man-rav:apm_spf_status_fix

Conversation

@man-rav
Copy link
Copy Markdown

@man-rav man-rav commented Jan 29, 2026

This change fixes SPF state handling. Previously opcode was forced in as the spf status queried which always is a positive numerical, not tracking the spf status accurately.

We fix here the status decoding by extracting status out of payload and refining the wait logic to signal after setting the status flags.

Playback and Capture use case has been validated on Rb3Gen2, with this change.

@man-rav man-rav requested review from a team January 29, 2026 11:14
@man-rav man-rav force-pushed the apm_spf_status_fix branch from 4013acd to 1741ff3 Compare January 29, 2026 14:37
@mohsRafi
Copy link
Copy Markdown
Contributor

@man-rav,

is this patches tested on actual target ?

Please confirm.

don't want to break existing setup, please update the PR description on which target tested this change

Comment thread audioreach-driver/q6apm_audio_pkt.c Outdated

if (hdr->opcode == APM_CMD_RSP_GET_SPF_STATE) {
result = data->payload;
spf_status = (struct apm_cmd_rsp_get_spf_status_t *)(pkt+hdr_size);
Copy link
Copy Markdown
Contributor

@nandamajay nandamajay Jan 30, 2026

Choose a reason for hiding this comment

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

spf_status is a struct, but you’re assigning a pointer to it and later dereferencing as spf_status->status. This is undefined and will likely crash.

Use‑before‑init for pkt / hdr_size : pkt and hdr_size are used without initializing.

Does this patch is validated , before submitting ?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

with respect to spf_status structure pointer, fixed this on a follow-up commit had issue syncing changes in fork with PR.

For the query on Use-Before-init for "hdr_size" & "pkt" pointer , line 607 & line 623-628 have these initialized and setup for usage on line 653.

Playback and Capture use case has been validated on Rb3Gen2, with this change.

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.

Thanks for the update @man-rav

@man-rav man-rav force-pushed the apm_spf_status_fix branch from 1741ff3 to f2c1b6e Compare January 30, 2026 07:08
@man-rav
Copy link
Copy Markdown
Author

man-rav commented Feb 3, 2026

@man-rav,

is this patches tested on actual target ?

Please confirm.

don't want to break existing setup, please update the PR description on which target tested this change

Playback and Capture use case has been validated on Rb3Gen2, with this change.

@man-rav man-rav closed this Mar 24, 2026
@man-rav man-rav force-pushed the apm_spf_status_fix branch from f2c1b6e to 1176f55 Compare March 24, 2026 07:13
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.

3 participants