Skip to content

audio: tdfb: place IIR emphasis coefficients in .rodata - #11116

Merged
kv2019i merged 1 commit into
thesofproject:mainfrom
kv2019i:202608-ll-user-tdfb-coeffs
Sep 3, 2026
Merged

audio: tdfb: place IIR emphasis coefficients in .rodata#11116
kv2019i merged 1 commit into
thesofproject:mainfrom
kv2019i:202608-ll-user-tdfb-coeffs

Conversation

@kv2019i

@kv2019i kv2019i commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

The direction-of-arrival emphasis coefficient tables iir_emphasis_48k and iir_emphasis_16k were declared as mutable globals, so the linker placed them in the .data section.

The tables are read-only coefficient data, never modified, so mark them static const. This mirrors how sound_dose stores its IIR coefficient table.

As another benefit, this change makes it possible to run tdfb in user-space as user threads can access rodata.

@kv2019i
kv2019i requested a review from singalsu as a code owner August 24, 2026 14:19
@kv2019i
kv2019i requested review from jsarha, lgirdwood, lyakh and singalsu and a lite review from Copilot and removed request for singalsu August 24, 2026 14:19

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.

Pull request overview

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

This PR moves the direction-of-arrival (tdfb) IIR emphasis coefficient tables into read-only memory by marking them static const, ensuring the linker places them in .rodata instead of .data and enabling safer user-space access.

Changes:

  • Mark iir_emphasis_48k and iir_emphasis_16k as static const so they are treated as read-only data
  • Prevent mutable global placement of coefficient tables (reducing .data usage and supporting user-space execution)

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

*/

uint32_t iir_emphasis_48k[20] = {
static const uint32_t iir_emphasis_48k[20] = {
};

uint32_t iir_emphasis_16k[20] = {
static const uint32_t iir_emphasis_16k[20] = {
@kv2019i

kv2019i commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator Author

@singalsu Can you check, ok to you?

@kv2019i
kv2019i force-pushed the 202608-ll-user-tdfb-coeffs branch from 31f6da7 to f3540de Compare August 28, 2026 11:09
@kv2019i

kv2019i commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator Author

V2:

  • refresh, no changes to code

The direction-of-arrival emphasis coefficient tables iir_emphasis_48k
and iir_emphasis_16k were declared as mutable globals, so the linker
placed them in the .data section.

The tables are read-only coefficient data, never modified, so mark them
static const. This mirrors how sound_dose stores its IIR coefficient
table.

As another benefit, this change makes it possible to run tdfb in
user-space as user threads can access rodata.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
@kv2019i
kv2019i force-pushed the 202608-ll-user-tdfb-coeffs branch from f3540de to b7d1caf Compare September 3, 2026 12:19
@kv2019i

kv2019i commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator Author

V3:

  • rebased on top of SOF main to fix failing CI checks
  • no functional changes to the PR

@intel-sofci

Copy link
Copy Markdown

PR 11116: test results

Run date: 2026-09-03 13:39 UTC

Tested commit: b7d1caf45deddb7b5be132747aa1d5a6d46a41de

mtl pass rate lnl pass rate ptl pass rate wcl pass rate nvl pass rate

@kv2019i

kv2019i commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator Author

Fuzzer fails are known #11162 , rest is good, proceeding with merge.

@kv2019i
kv2019i merged commit e554e8e into thesofproject:main Sep 3, 2026
44 of 46 checks passed
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.

7 participants