I'm trying to use the ESP32 as a simple bluetooth audio receiver that is connected to an ADAU1701 DSP via I2S.
The ESP32 works perfectly on the PCM5102 DAC when the ESP32 is running in Master Mode ( .mode = (i2s_mode_t) (I2S_MODE_MASTER | I2S_MODE_TX) )
So, every pin spits out the correct signals.
Now my problem is, that the DSP acts as a master and the ESP32 should receive the main clock from the DSP.
With the following code I have following signals on its pins (bluetooth device is connected and streaming audio):
Pin3, Masterclock: 11,28MHz
Pin13, I2S Data: no signal
Pin14, LRCK: 48kHz (coming from the DSP, MP10, LRCK OUT)
Pin15, BitClock: 3,07MHz (coming from the DSP, MP11, BCK OUT)
Someone is running such configuration and knows how to configure that thing?
BT Library used:
https://www.pschatzmann.ch/home/2020/03/27/1255/Board used: Olimex ESP32-PoE
#include "BluetoothA2DPSink.h"
BluetoothA2DPSink a2dp_sink;
void setup() {
static const i2s_config_t i2s_config = {
.mode = (i2s_mode_t) (I2S_MODE_SLAVE | I2S_MODE_TX),
.sample_rate = 48000, // corrected by info from bluetooth
.bits_per_sample = (i2s_bits_per_sample_t) 16, /* the DAC module will only take the 8bits from MSB */
.channel_format = I2S_CHANNEL_FMT_RIGHT_LEFT,
.communication_format = I2S_COMM_FORMAT_I2S_MSB,
.intr_alloc_flags = 0, // default interrupt priority
.dma_buf_count = 8,
.dma_buf_len = 64,
.use_apll = false
};
a2dp_sink.set_i2s_config(i2s_config);
static const i2s_pin_config_t pin_config = {
//.mck_io_num = 3,
.bck_io_num = 15,
.ws_io_num = 14,
.data_out_num = 13,
.data_in_num = I2S_PIN_NO_CHANGE
};
a2dp_sink.set_pin_config(pin_config);
a2dp_sink.i2s_mclk_pin_select(3);
a2dp_sink.start("MyMusic", true);
}
void loop() {
delay(1000); // do nothing
}