Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

ESP32 WROOM32 + PCM1754 DAC #2849

Closed
cocowayco opened this issue Mar 12, 2025 · 0 comments
Closed

ESP32 WROOM32 + PCM1754 DAC #2849

cocowayco opened this issue Mar 12, 2025 · 0 comments

Comments

@cocowayco
Copy link

cocowayco commented Mar 12, 2025

Hi,
I have found this code here on Github in order to reproduce bluetooth music, and I modified it to add a PLL out, but I can get it to work.
I have an external DAC (PCM1754) attached to the ESP32 Wroom32E via I2S.
Since the DAC needs a masterclock to work (unlike the PCM5102 for example, which generates the MCK within itself), I am using GPIO0 to output a PLL of 11.2896MHz.
The DAC is silent, no output.
WS, DATA, BCK are fine.
GPIO0 is a strange quasi SINE of 11.2896MHz (I was expecting a square wave)

Can anyone help

Has anybody done this already?

Thanks

#include "AudioTools.h"
#include "BluetoothA2DPSink.h"

I2SStream i2s;
BluetoothA2DPSink a2dp_sink(i2s);

void setup() {
auto cfg = i2s.defaultConfig();

cfg.sample_rate = 44100; // Match Bluetooth A2DP capability
cfg.bits_per_sample = 16; // ESP32 cannot send 24-bit over A2DP
cfg.channels = 2;
cfg.i2s_format = I2S_MSB_FORMAT; // PCM1754 requires MSB

cfg.pin_mck = 0;
cfg.pin_bck = 23;
cfg.pin_ws = 21;
cfg.pin_data = 22;

cfg.buffer_size = 128; // Optimize for stability
cfg.buffer_count = 8;

i2s.begin(cfg);

a2dp_sink.start("MyMusic");
}

void loop() {
}

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant