Code: Select all
esp_err_t ret;
static const int i2s_num = 0; // i2s port number
static const i2s_config_t i2s_config = {
.mode = I2S_MODE_MASTER | I2S_MODE_TX | I2S_MODE_DAC_BUILT_IN,
.sample_rate = 8000,
.bits_per_sample = 8,
.channel_format = I2S_CHANNEL_FMT_ONLY_LEFT,
//.communication_format = I2S_COMM_FORMAT_I2S_MSB,
.communication_format = I2S_COMM_FORMAT_I2S | I2S_COMM_FORMAT_PCM,
.intr_alloc_flags = 0, // default interrupt priority
.dma_buf_count = 8,
.dma_buf_len = 64,
.use_apll = false
};
ret = i2s_driver_install(i2s_num, &i2s_config, 0, NULL);
assert(ret == ESP_OK);
Code: Select all
E (6361) I2S: Invalid bits per sample
clearly seems to allow for 8 bits per sample. See line 40. However, an error is raised if it is done. See
https://github.com/espressif/esp-idf/bl ... iver/i2s.c
line 333.
It is because
Code: Select all
bits < I2S_BITS_PER_SAMPLE_16BIT