-
Notifications
You must be signed in to change notification settings - Fork 8k
samples: i2s_codec: Refine i2s_codec sample #96976
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
base: main
Are you sure you want to change the base?
samples: i2s_codec: Refine i2s_codec sample #96976
Conversation
ZhaoxiangJin
commented
Oct 3, 2025
- Configure BLOCK count by using kconfig option 'EXTRA_BLOCKS' instad of fixed value. This allows user to customize the RAM usage based on their platform.
- Keep the PCM data in flash to avoid large RAM usage.
- Refine the sample to get the SAMPLE_BIT_WIDTH and BYTES_PER_SAMPLE from Kconfig options.
Hello @TomasBarakNXP, @VitekST, please help review. Thanks. |
0xc3, 0xc8, 0xc8, 0xc8, 0xc8, 0x38, 0xcf, 0x38, 0xcf, 0x1c, 0xd7, 0x1c, 0xd7, 0x37, 0xe0, | ||
0x37, 0xe0, 0x45, 0xea, 0x45, 0xea, 0xf8, 0xf4, 0xf8, 0xf4}; | ||
const unsigned int __16kHz16bit_stereo_sine_pcm_len = sizeof(__16kHz16bit_stereo_sine_pcm); | ||
static const unsigned int __16kHz16bit_stereo_sine_pcm_len = sizeof(__16kHz16bit_stereo_sine_pcm); |
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.
ARRAY_SIZE be better?
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.
updated.
int "Extra block size" | ||
default 32 | ||
help | ||
Count of DMIC channels to capture and process. |
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 this really the count of DMIC channels?
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.
updated.
3f5e03a
to
a587e39
Compare
- Configure BLOCK count by using kconfig option 'EXTRA_BLOCKS' instad of fixed value. This allows user to customize the RAM usage based on their platform. - Keep the PCM data in flash to avoid large RAM usage. - Refine the sample to get the SAMPLE_BIT_WIDTH and BYTES_PER_SAMPLE from Kconfig options. Signed-off-by: Zhaoxiang Jin <[email protected]>
a587e39
to
dd50879
Compare
Update: |
|
0xc3, 0xc8, 0xc8, 0xc8, 0xc8, 0x38, 0xcf, 0x38, 0xcf, 0x1c, 0xd7, 0x1c, 0xd7, 0x37, 0xe0, | ||
0x37, 0xe0, 0x45, 0xea, 0x45, 0xea, 0xf8, 0xf4, 0xf8, 0xf4}; | ||
const unsigned int __16kHz16bit_stereo_sine_pcm_len = sizeof(__16kHz16bit_stereo_sine_pcm); | ||
static const unsigned int __16kHz16bit_stereo_sine_pcm_len = |
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.
const is probably not necessary here. See the reported issue: when cast to (void *) in main.c, const is lost.
them and the codec will be expected to consume them. | ||
|
||
config EXTRA_BLOCKS | ||
int "Extra block size" |
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.
int "Extra block size" | |
int "Number of extra blocks" |