don't use audio pll on buggy rev0 chips (#40)

as ESP32_MP3_Decoder does
This commit is contained in:
h3ndrik authored and Earle F. Philhower, III committed 2018-01-26 07:51:49 -08:00
1 parent f1916051ec
commit e7c2aba2aa
1 file changed
+8 -1
+8 -1
View File
@@ -32,6 +32,13 @@ AudioOutputI2S::AudioOutputI2S(int port, bool builtInDAC)
i2sOn = false;
#ifdef ESP32
if (!i2sOn) {
// don't use audio pll on buggy rev0 chips
int use_apll = 0;
esp_chip_info_t out_info;
esp_chip_info(&out_info);
if(out_info.revision > 0) {
use_apll = 1;
}
i2s_config_t i2s_config_dac = {
.mode = (i2s_mode_t)(I2S_MODE_MASTER | I2S_MODE_TX | (builtInDAC ? I2S_MODE_DAC_BUILT_IN : 0)),
.sample_rate = 44100,
@@ -41,7 +48,7 @@ AudioOutputI2S::AudioOutputI2S(int port, bool builtInDAC)
.intr_alloc_flags = ESP_INTR_FLAG_LEVEL1, // high interrupt priority
.dma_buf_count = 8,
.dma_buf_len = 64, //Interrupt level 1
.use_apll = 1 // Use audio PLL
.use_apll = use_apll // Use audio PLL
};
Serial.printf("+%d %p\n", portNo, &i2s_config_dac);
if (i2s_driver_install((i2s_port_t)portNo, &i2s_config_dac, 0, NULL) != ESP_OK) {