Due to high demand, expect some shipping delays at this time - orders may not ship for up to 2-3 business days.
0

Adafruit I2S Stereo Decoder - UDA1334A Breakout
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Adafruit I2S Stereo Decoder - UDA1334A Breakout

by Ianlinsdell on Wed Jan 19, 2022 2:14 pm

Hi Adafruit ppl,

I just purchased several I2S Stereo Decoder boards: https://www.adafruit.com/product/3678

It sounds great but.... I noticed that my Left / Right channels are swapped when listening with the breakout board headphone socket.

I am driving it from and ESP32 and checked its configuration which is shown below:

My question is what format does the Adafruit I2S breakout board expect ? (LRCLK low for left? or high for left ?)

Thanks,

--- ESP32 I2S configuration ---
(There is no I2S_CHANNEL_FMT_LEFT_RIGHT in case you are wondering, only LEFT or RIGHT channel only)
I do not appear to be able to switch the LRCLK phase or channel format in code.

m_i2s_num = I2S_NUM_0; // i2s port number
m_i2s_config.sample_rate = 16000;
m_i2s_config.bits_per_sample = I2S_BITS_PER_SAMPLE_16BIT;
m_i2s_config.channel_format = I2S_CHANNEL_FMT_RIGHT_LEFT;
m_i2s_config.intr_alloc_flags = ESP_INTR_FLAG_LEVEL1; // high interrupt priority
m_i2s_config.dma_buf_count = 8; // max buffers
m_i2s_config.dma_buf_len = 1024; // max value
m_i2s_config.use_apll = APLL_DISABLE; // must be disabled in V2.0.1-RC1
m_i2s_config.tx_desc_auto_clear = true; // new in V1.0.1
m_i2s_config.fixed_mclk = I2S_PIN_NO_CHANGE;

Ianlinsdell
 
Posts: 6
Joined: Sat Apr 17, 2021 5:58 pm

Re: Adafruit I2S Stereo Decoder - UDA1334A Breakout

by Ianlinsdell on Wed Jan 19, 2022 2:59 pm

Nevermind,

I update my local copy of the AudioI2s Library (https://github.com/schreibfaul1/ESP32-audioI2S/wiki ) as shown below to fix left right channel swap issue.
Seems weired that ESP32 appears to specify that Right channel should go before Left?

playChunk(..)
{
...
sample[LEFTCHANNEL] = y; // Swap: x;
sample[RIGHTCHANNEL] = x; // Swap: y;

...

sample[LEFTCHANNEL] = m_outBuff[m_curSample * 2 + 1]; // Swap: m_outBuff[m_curSample * 2];
sample[RIGHTCHANNEL] = m_outBuff[m_curSample * 2]; // Swap: m_outBuff[m_curSample * 2 + 1];

Ianlinsdell
 
Posts: 6
Joined: Sat Apr 17, 2021 5:58 pm

Re: Adafruit I2S Stereo Decoder - UDA1334A Breakout

by Ianlinsdell on Thu Jan 20, 2022 11:24 am

Apparently this was defect in ESP32 AudioI2s library: https://github.com/schreibfaul1/ESP32-a ... ssions/263

Library Maintainer has fixed now after brining to his attention:

schreibfaul1 9 hours ago
Maintainer
I downloaded a test file from the Fraunhofer Institute https://www2.iis.fraunhofer.de/AAC/SBRt ... 41-16b.wav and tested it with a PCM5102a. In fact, left and right are reversed. I didn't notice that with the AC101 DAC. I have corrected the defect. Thanks for the hint.

Ianlinsdell
 
Posts: 6
Joined: Sat Apr 17, 2021 5:58 pm

Please be positive and constructive with your questions and comments.