-
Notifications
You must be signed in to change notification settings - Fork 321
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
src: make coefficients constant #8829
Conversation
Make coefficients and their tables constant. Signed-off-by: Guennadi Liakhovetski <[email protected]>
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.
Reminder to myself, update the generator script to produce header files with this change.
@singalsu btw, all the SRC coefficients are loaded into uncache memory IIUC i.e. from binutils nm
This means we need to ucache_to_cache then when we set up the pointers for coeffs. |
@lgirdwood this is before this commit, right? After it I see these in |
@lgirdwood @lyakh Wait, do you mean that const C arrays are potentially corrupt if accessed without those address conversions? |
Also, fast coefficients access is key for good performance. If memory where these are located is slow, the tables that the active x to y kHz rate conversion uses should be copied to a memory where the SIMD MAC instructions work efficiently. Because the tables are very large like 100 - 200 kB it would make sense to keep them in a large slow memory and copy to fastest RAM only the much smaller that time needed set. |
so weird, I thought I'd replied, sorry. No, it isn't about corruption. And I don't think any conversion is needed. After this commit I see all those arrays accessed via cached aliases, but maybe I'm missing some build configuration @lgirdwood ? BTW, there's one more thing to check - explicit type conversions like sof/src/audio/src/src_hifi2ep.c Line 59 in 45dc968
const qualifier from exactly those coefficients IIUC, so it can then in principle be used to corrupt them, yes. I assume we have a few of such conversions in the sources...
|
CI: a known suspend-resume problem in https://sof-ci.01.org/sofpr/PR8829/build2554/devicetest/index.html and a supposedly unrelated fuzzer failure. "main" Zephyr build failures are known too |
ok, great good to know RO is properly mapped here. |
@singalsu we could add a
and use it for |
Thanks @lyakh I'll try it if I can proceed with it! |
Make coefficients and their tables constant.