i2s bit-errors

floitsch_toit
Posts: 26
Joined: Wed Jun 29, 2022 4:25 pm

i2s bit-errors

Postby floitsch_toit » Tue Jan 21, 2025 7:30 pm

I'm writing tests for my i2s abstraction, and have some tests that try to send a few MB of data from one ESP32S3 to another. Somehow, I'm seeing bit-errors from time to time. For example:

Code: Select all

Sent:     ... 0xcc, 0xcd, 0xce, 0xcf, 0x2a, 0x5a, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0x2a, 0x5b, 0xda, 0xdb, 0xde, 0xdd, 0xde, 0xdf ...
Received: ... 0xcc, 0xcd, 0xce, 0xcf, 0x2a, 0x5a, 0xd2, 0x53, 0xde, 0xd5, 0xd6, 0xd7, 0x2a, 0x5b, 0xda, 0x5b, 0xfe, 0xcd, 0xde, 0xdf ...
                                                          ^      ^                                        ^
I have had similar errors with two ESP32s (not S3).

This specific error happened after 40KB of streaming, but it can happen faster.
The sample-rate doesn't seem to have any impact. The error happened with ~1000 samples/s

I'm currently using ESP-IDF 5.3.1.

Any ideas what could be happening here?

robiwan
Posts: 29
Joined: Sat Dec 07, 2024 11:36 am

Re: i2s bit-errors

Postby robiwan » Sat Jan 25, 2025 5:32 am

Just a thought: The polarity of the bit clock, making the sampling of the data line on the "wrong" edge?

floitsch_toit
Posts: 26
Joined: Wed Jun 29, 2022 4:25 pm

Re: i2s bit-errors

Postby floitsch_toit » Sun Jan 26, 2025 2:10 pm

Took me a good night sleep to think of the same. I think at least some of the bit flips can be explained this way. Since I'm using the DEFAULT macros of the ESP-IDF, it would be a bug in the ESP-IDF.

I did more experiments and concluded that the I2S reading is flaky in some configurations. I ended up filing an issue: https://github.com/espressif/esp-idf/issues/15275

Who is online

Users browsing this forum: sazanof and 82 guests