Closed SveLil closed 9 months ago
I tried adding my own definition for the board
class PinsAudioKitAC101V2Class : public DriverPins {
public:
PinsAudioKitAC101V2Class() {
// sd pins
addSPI(ESP32PinsSD);
// add i2c codec pins: scl, sda, port, frequency
addI2C(PinFunction::CODEC, 32, 33);
// add i2s pins: mclk, bck, ws,data_out, data_in ,(port)
addI2S(PinFunction::CODEC, 0, 27, 26, 25, 35);
// add other pins
addPin(PinFunction::KEY, 36, PinLogic::InputActiveLow, 1);
// addPin(PinFunction::KEY, 13, PinLogic::InputActiveLow, 2);
addPin(PinFunction::KEY, 19, PinLogic::InputActiveLow, 3);
addPin(PinFunction::KEY, 23, PinLogic::InputActiveLow, 4);
addPin(PinFunction::KEY, 18, PinLogic::InputActiveLow, 5);
addPin(PinFunction::KEY, 5, PinLogic::InputActiveLow, 6);
// addPin(PinFunction::LED, 22, PinLogic::Output, 0);
addPin(PinFunction::LED, 19, PinLogic::Output, 1);
addPin(PinFunction::HEADPHONE_DETECT, 5, PinLogic::InputActiveLow);
addPin(PinFunction::PA, 21, PinLogic::Output);
}
};
static PinsAudioKitAC101V2Class PinsAudioKitAC101V2;
static AudioBoard AudioKitAC101V2{AudioDriverAC101, PinsAudioKitAC101V2};
That get rid of the pin warnings, but still leaves the error in Wire
Are you sure that it is a AC101 based board? Usually I2C is failing if you select the wrong board...
I think the I2C address is wrong: it should be 0x1a<<1 (= 0x34) instead of 0x1a ! The code has been converted partly from ADF which uses a different addressing then Arduino
There were some more issues relate to this: I committed a correction!
I did not spend any attention to this, having it already working as part of the legacy AudioKit project, but it seems that I have never ported the I2C functionality to the Arduino Wire API for this driver
Problem Description
When using the exmaple from https://github.com/pschatzmann/arduino-audio-tools/blob/main/examples/examples-audiokit/streams-audiokit-audiokit/ with AudioBoardStream kit(AudioKitAC101); I only get `Warning: Pin '13' not set up because of conflict Warning: Pin '22' not set up because of conflict Error: ->p_wire->endTransmission: 2 Error: reset failed! Error: init failed
assert failed: audio_driver::error_t i2c_bus_read_bytes(audio_driver::i2c_bus_handle_t, int, uint8_t, int, uint8_t, int) I2C.cpp:40 (datalen == 1)
Backtrace: 0x40083be1:0x3ffb1e00 0x4008a405:0x3ffb1e20 0x4008f52d:0x3ffb1e40 0x400db2b2:0x3ffb1f70 0x400d7db9:0x3ffb1f90 0x400d7f4d:0x3ffb1fc0 0x400d805d:0x3ffb1fe0 0x400d2adb:0x3ffb2000 0x400d4b0d:0x3ffb2020 0x400d4bb7:0x3ffb2070 0x400d4bfd:0x3ffb20f0 0x400d375b:0x3ffb2110 0x400d46c9:0x3ffb2130 0x400d4cab:0x3ffb21b0 0x400ddb86:0x3ffb2290 `
DIP settings I tried: Off, On,On,Off,Off On, On, On, Off, Off (This is working with ESP32-audioI2S)
Device Description
ESP32 Audio Kit V2.2 2762 wtih AC101 (confirmed by using https://github.com/schreibfaul1/ESP32-audioI2S/
Sketch
Other Steps to Reproduce
No response
What is your development environment
PlatformIO with ` platform = espressif32 board = esp32dev
lib_deps = https://github.com/pschatzmann/arduino-audio-tools https://github.com/pschatzmann/ESP32-A2DP https://github.com/pschatzmann/arduino-audio-driver https://github.com/pschatzmann/arduino-libhelix https://github.com/pschatzmann/arduino-flite`
I have checked existing issues, discussions and online documentation