Why no I2S_COMM_FORMAT_TDM? Please help me add i2s tdm support for my codec.

User avatar
cooperbaker
Posts: 10
Joined: Fri Jan 18, 2019 6:39 am

Why no I2S_COMM_FORMAT_TDM? Please help me add i2s tdm support for my codec.

Postby cooperbaker » Fri Jan 18, 2019 7:02 am

Hello.

I'm working on an audio dsp board with a Cirrus CS42448 codec and an Esp32 at the center, targeted at the audio hardware market. The codec uses TDM to move 8 channels of data over 1 pin. The other Esp32 pins are in use for the user interface.

I was surprised to find that there is no TDM support in the i2s driver, and am eager to get it working for my application.

What are the next steps I should take? It seems like adding TDM support to i2s.c/h is the proper approach. Is this a feature that will eventually be added to the esp-idf? I am happy to help implement it but don't know much about low-level dma programming :/

If anyone can point me in the right direction or offer advice I'd be most grateful.

Thanks!

For reference, here's the TDM frame I am trying to move through the i2s bus:
Image

ESP_Sprite
Posts: 9709
Joined: Thu Nov 26, 2015 4:08 am

Re: Why no I2S_COMM_FORMAT_TDM? Please help me add i2s tdm support for my codec.

Postby ESP_Sprite » Sat Jan 19, 2019 3:27 am

The issue here is that the ESP32 does not have support for TDM, specifically, there's no builtin way to generate the FSYNC signal TDM requires. I'm halfway sure that it's possible to 'fake' that signal by e.g. backfeeding the WS signal into the MPWM peripheral and generating a FSYNC signal that way, but at the moment, no one has tried that yet.

User avatar
cooperbaker
Posts: 10
Joined: Fri Jan 18, 2019 6:39 am

Re: Why no I2S_COMM_FORMAT_TDM? Please help me add i2s tdm support for my codec.

Postby cooperbaker » Wed Jan 23, 2019 7:32 pm

Thanks for the reply.

Theoretically, is it possible to route WS into the MPWM to make FSYNC internally? Is it possible to emit the TDM FSYNC output on the same i2s pin as the normal FSYNC signals?

I don't know how many pins we have to spare in our little audio board :/

ESP_Sprite
Posts: 9709
Joined: Thu Nov 26, 2015 4:08 am

Re: Why no I2S_COMM_FORMAT_TDM? Please help me add i2s tdm support for my codec.

Postby ESP_Sprite » Thu Jan 24, 2019 3:39 am

Given that you can somehow convince the MPWM peripheral to generate the FSYNC signal for you, you can use GPIO 20 as a 'passthrough' pin for the WS signal. This pin is not externally available but still has all the pad logic. You can then route the MPWM output signal to where you used to lead the Ws signal to.

Who is online

Users browsing this forum: Majestic-12 [Bot] and 117 guests