earlephilhower / ESP8266Audio

Arduino library to play MOD, WAV, FLAC, MIDI, RTTTL, MP3, and AAC files on I2S DACs or with a software emulated delta-sigma DAC on the ESP8266 and ESP32
GNU General Public License v3.0
2.06k stars 437 forks source link

ESP32 pinout with internal DAC #284

Open jvet88 opened 4 years ago

jvet88 commented 4 years ago

The readme indicates if I want to use the internal DAC on ESP32, we'll have to instantiate the class as AudioOutputI2S(0,1). Standard pinout of the library is BCK=26, LRCK=25, Dout=22, to which setting does it get changed when using the internal DAC: BCK=27, LRCK=25, Dout=25?

ikostoski commented 4 years ago

Internal ESP32 DACs are fixed and hardware limited to IO25 and IO26. No other pin should be affected. https://github.com/earlephilhower/ESP8266Audio/blob/d37010e5d776d7a2cf560ffbc629246ba9596648/src/AudioOutputI2S.cpp#L77-L80 Just don't call SetPinout after setting up internal DAC output.

jvet88 commented 4 years ago

That's what puzzles me, LRCK is on IO25 without the internal DAC, so if I change to the internal DAC, IO25 will be the new Dout, what about the other pins?

ikostoski commented 4 years ago

IO25 and IO26 will be analog outputs (DAC) and nothing will happen to other pins.