-
Notifications
You must be signed in to change notification settings - Fork 322
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
Fix testbench xt build fail #8289
Conversation
@@ -121,7 +121,7 @@ void mfcc_fill_prev_samples(struct mfcc_buffer *buf, int16_t *prev_data, | |||
|
|||
buf->s_avail -= prev_data_length; | |||
buf->s_free += prev_data_length; | |||
buf->r_ptr = in; | |||
buf->r_ptr = (void *)in; /* int16_t pointer but direct cast is not possible */ |
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.
is in
the wrong ptr type, do we need to look at other changes here ?
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.
It's up to @andrula-song to confirm but in the patch she used ae_int32 type to load two ae_int16 types, that's in comments a few lines above this typecast. I was wondering too if this can be correct but it appears so.
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.
ok, intrinsic types are non portable. Lets revisist as we do need to support AVX here (and the API would need to become more generic).
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.
@singalsu @lgirdwood , I used to use AE_LA16X4_XC to load a 16bit * 4 data, but I found the result is not right, I think it is a bug of xtensa. So I use AE_L32_XC to load a 32bit data(16bit * 2) to replace twice AE_L16_XC, and force the datatype to ae_int16 to copy the last 16 bit if the input data size is odd.
@@ -1578,10 +1578,12 @@ int module_adapter_reset(struct comp_dev *dev) | |||
} | |||
#endif /* CONFIG_ZEPHYR_DP_SCHEDULER */ | |||
if (IS_PROCESSING_MODE_SINK_SOURCE(mod)) { | |||
int i; |
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.
I wonder if we could build testbench in C99 mode. When we build SOF currently (at least Zephyr builds), we are using C99 mode:
-std=c99 -std=gnu99
... so basicly C99'ism can pass through our CI checks and testbench will always be in catch-up mode. Zephyr is C99+ -> https://docs.zephyrproject.org/latest/develop/languages/c/index.html
That's a harder question where to set this, but would be a longer term solution.
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.
Need to check how to add this, this commit could be possible to drop with that change.
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.
Using "std=c99 -std=gnu99 -fgnu89-inline" seems to work, thanks for suggestion!
This patch adds "-std=c99 -std=gnu99 -fgnu89-inline options" to host architecture build to prevent error with "scripts/rebuild-testbench -p tgl". src/audio/module_adapter/module_adapter.c: In function ‘module_adapter_reset’: src/audio/module_adapter/module_adapter.c:1582: error: ‘for’ loop initial declaration used outside C99 mode src/audio/module_adapter/module_adapter.c:1584: error: redefinition of ‘i’ Signed-off-by: Seppo Ingalsuo <[email protected]>
Build with "scripts/rebuild-testbench -p tgl" fails to error: src/audio/mfcc/mfcc_hifi3.c: In function ‘mfcc_source_copy_s16’: src/audio/mfcc/mfcc_hifi3.c:91: warning: assignment from incompatible pointer type src/audio/mfcc/mfcc_hifi3.c: In function ‘mfcc_fill_prev_samples’: src/audio/mfcc/mfcc_hifi3.c:124: warning: assignment from incompatible pointer type src/audio/mfcc/mfcc_hifi3.c: In function ‘mfcc_fill_fft_buffer’: src/audio/mfcc/mfcc_hifi3.c:159: warning: assignment from incompatible pointer type fixes: d0cb478 ("Audio: MFCC: Add HiFi3 implementation of MFCC") Signed-off-by: Seppo Ingalsuo <[email protected]>
4cef327
to
2da8ab7
Compare
@@ -121,7 +121,7 @@ void mfcc_fill_prev_samples(struct mfcc_buffer *buf, int16_t *prev_data, | |||
|
|||
buf->s_avail -= prev_data_length; | |||
buf->s_free += prev_data_length; | |||
buf->r_ptr = in; | |||
buf->r_ptr = (void *)in; /* int16_t pointer but direct cast is not possible */ |
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.
ok, intrinsic types are non portable. Lets revisist as we do need to support AVX here (and the API would need to become more generic).
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.
Thanks @singalsu !
No description provided.