PCM5100A DAC distortion on high(er) volume

Danie.
Posts: 5
Joined: Tue May 22, 2018 8:41 pm

PCM5100A DAC distortion on high(er) volume

Postby Danie. » Fri Jan 10, 2020 10:44 pm

Hello,

i have a project which uses the PCM5100A as I2S Audio Codec.
I currently use the bluetooth audio sink example from the esp-idf which was made for the PCM51002A.
Audio is playing fine until i increase the volume to above 80%.
If i go higher i can hear some serious distortion.

What could be the reason for that?

I am not sure if this is a hardware or software related issue.
To check that, i just ordered a PCM51002A to see if the error also occurs. (waiting for delivery)
The reason to choose the PCM5100A over the PCM51002A is to reduce BOM cost.

Here is the current schematic:
PCM5100A_schematic.png
PCM5100A_schematic.png (31.75 KiB) Viewed 4646 times

Crossed out parts (R502, R504, R506) are not mounted.
So CODEC_FLT, CODEC_DEMP and CODEC_FMT are pulled low by 10k resistors.

Thank you very much!

Kind Regards
Danie

Danie.
Posts: 5
Joined: Tue May 22, 2018 8:41 pm

Re: PCM5100A DAC distortion on high(er) volume

Postby Danie. » Mon Jan 27, 2020 11:43 pm

After a bit of research i was able to fix the problem.

Maybe someone is facing a similar issue.
The clue was to set the communication_format to I2S_COMM_FORMAT_I2S in the i2s config struct:
i2s_config_t i2s_config = {
.mode = I2S_MODE_MASTER | I2S_MODE_TX, // Only TX
.sample_rate = 44100,
.bits_per_sample = 32,
.channel_format = I2S_CHANNEL_FMT_RIGHT_LEFT, // 2-channels
.communication_format = I2S_COMM_FORMAT_I2S | I2S_COMM_FORMAT_I2S_MSB,
.dma_buf_count = 6,
.dma_buf_len = 60,
.intr_alloc_flags = 0, // Default interrupt priority
.tx_desc_auto_clear = true, // Auto clear tx descriptor on underflow
.use_apll = 1
};
i2s_driver_install(0, &i2s_config, 0, NULL);

With this settings - audio works as expected without any distortion.


But now i am facing another issue:
In my application i need to read serial input and depending on the serial commands read and write to I2C devices, send back data to uart and so on...
Unfortunately while processing the serial and I2C stuff the audio is sometimes interrupted.

I am running the I2S on core 0 and the other code is running in a separate task on core 1!
Is there any workaround or a better way to separate the work so that the I2S stream is not affected?

Kind regards
Danie

User avatar
jgustavoam
Posts: 165
Joined: Thu Feb 01, 2018 2:43 pm
Location: Belo Horizonte , Brazil
Contact:

Re: PCM5100A DAC distortion on high(er) volume

Postby jgustavoam » Sun Feb 09, 2020 1:38 pm

Hi, interesting project!
May you post the code?
Thanks.
Retired IBM Brasil
Electronic hobbyist since 1976.

Who is online

Users browsing this forum: No registered users and 141 guests