adafruit / Adafruit_VS1053_Library

This is a Arduino library for the Adafruit VS1053 Codec Breakout and Music Maker Shields
https://www.adafruit.com/products/1381
135 stars 113 forks source link

ESP8266/NodeMCU: SPI clock speed FIX #35

Closed startupsolutions closed 2 years ago

startupsolutions commented 7 years ago

Hi, I was having glitching problems recording OGG audio with ESP8266 (NodeMCU) due to low SPI clock speed. I've simply fixed it changing the lines (in Adafruit_VS1053.cpp) from: `

define VS1053_CONTROL_SPI_SETTING SPISettings(250000, MSBFIRST, SPI_MODE0)

define VS1053_DATA_SPI_SETTING SPISettings(8000000, MSBFIRST, SPI_MODE0)

to:

if defined(ESP8266)

#define VS1053_CONTROL_SPI_SETTING  SPISettings(1000000,  MSBFIRST, SPI_MODE0)
#define VS1053_DATA_SPI_SETTING     SPISettings(20000000, MSBFIRST, SPI_MODE0)

else

#define VS1053_CONTROL_SPI_SETTING  SPISettings(250000,  MSBFIRST, SPI_MODE0)
#define VS1053_DATA_SPI_SETTING     SPISettings(8000000, MSBFIRST, SPI_MODE0)

endif

` setting speed to 1MHz/20MHz. As I can hear now, no glitches anymore!

ladyada commented 7 years ago

cool, wanna submit a PR? :)

TheNitek commented 6 years ago

For me this broke MP3 playback

caternuson commented 2 years ago

Closing due to age and potentially breaking change.