Sound Playback via Flexcomm I2S in Zephyr.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Sound Playback via Flexcomm I2S in Zephyr.

363 Views
JustMe1
Contributor II

I've been trying to implement a I2S playback application for the rt600 in Zephyr 3.4.

I've set up the application by reading the Zephyr guides but I'm finding its not a walk in the park.  It's taking a lot of reverse engineering + trial and error.

 

Such as:

The Zephyr I2S driver requires that a slab of memory is allocated for tx and rx buffers K_MEM_SLAB_DEFINE.

However, in order to set this up correctly you have to set the number of blocks to either:

CONFIG_I2S_MCUX_FLEXCOMM_RX_BLOCK_COUNT
or
CONFIG_I2S_MCUX_FLEXCOMM_TX_BLOCK_COUNT

Not an easy find.  
It's taking a lot of digging to figure out how to get things operating.  I'm guessing the NXP has already tested i2s code for Zephyr in one way or another.

Could NXP share sample code to play sound via Flexcomm I2S for Zephyr?

 

0 Kudos
3 Replies

328 Views
Gavin_Jia
NXP TechSupport
NXP TechSupport

Hi @JustMe1 ,

 

Thanks for contacting NXP support.

There is no official NXP reference for porting the Zephyr I2S for the RT680. But here is some information from Zephyr Github you can consult:

Implement an I2S / SAI (shim) driver for NXP IMX-RT1060 (mcux). · Issue #32037 · zephyrproject-rtos/...

i2s: add i2s support for NXP imxrt10xx platform by hakehuang · Pull Request #37335 · zephyrproject-r...

 

Best regards,

Gavin

0 Kudos

295 Views
JustMe1
Contributor II

I've gone through the Zephyr samples... and they are a steaming pile of contradictions.

For example:

/zephyr/tests/drivers/i2s/i2s_api/src/
Search the samples for: k_mem_slab_alloc or k_mem_slab_free 
They are not used.  This goes against how their I2S interface is supposed to operate.  

https://docs.zephyrproject.org/3.4.0/hardware/peripherals/audio/i2s.html

A slab memory is allocated in common.c but never used.  See: tx_block_write_slab and 

rx_block_read_slab. 

In other words there are no public examples of the correct use of the I2S interface for Zephyr.
0 Kudos

252 Views
Gavin_Jia
NXP TechSupport
NXP TechSupport

Hi @JustMe1 ,

I apologize for the delay in my response. I have confirmed this information with our experts and received their response.

The MIMXRT685-EVK board does have Zephyr I2S support in the upstream repo.  See the Supported Features table for the MIMXRT685-EVK.  For testing, we use the Zephyr tests/drivers/i2s/i2s_speed. That is a loopback test and runs on the MIMXRT658-EVK board, so please use it as a reference. 

 

Best regards,

Gavin

 

0 Kudos