Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

for esp32-s3-eye I2S (AIV-637) #270

Open
hzhh110 opened this issue Aug 8, 2023 · 2 comments
Open

for esp32-s3-eye I2S (AIV-637) #270

hzhh110 opened this issue Aug 8, 2023 · 2 comments

Comments

@hzhh110
Copy link

hzhh110 commented Aug 8, 2023

for esp32-s3-eye board
static void i2s_init(void)
{
i2s_config_t i2s_config = {
.mode = (i2s_mode_t)(I2S_MODE_MASTER | I2S_MODE_RX), // the mode must be set according to DSP configuration
.sample_rate = 16000, // must be the same as DSP configuration
.bits_per_sample = (i2s_bits_per_sample_t)32, // must be the same as DSP configuration
.channel_format = I2S_CHANNEL_FMT_ONLY_LEFT, // must be the same as DSP configuration
.communication_format = I2S_COMM_FORMAT_STAND_I2S,
.intr_alloc_flags = ESP_INTR_FLAG_LEVEL2,
.dma_buf_count = 3,
.dma_buf_len = 300,
};
i2s_pin_config_t pin_config = {
.mck_io_num = I2S_PIN_NO_CHANGE,
.bck_io_num = 41, // IIS_SCLK
.ws_io_num = 42, // IIS_LCLK
.data_out_num = I2S_PIN_NO_CHANGE, // IIS_DSIN
.data_in_num = 2 // IIS_DOUT
};
i2s_driver_install(I2S_CH, &i2s_config, 0, NULL);
i2s_set_pin(I2S_CH, &pin_config);
i2s_zero_dma_buffer(I2S_CH);
}

size_t samp_len = audio_chunksize * I2S_CHANNEL_NUM;
size_t samp_len_bytes = samp_len * sizeof(int32_t);
int32_t *i2s_buff = (int32_t *)malloc(samp_len_bytes);
assert(i2s_buff);
size_t bytes_read;

while (true)
{
    i2s_read(I2S_CH, i2s_buff, samp_len_bytes, &bytes_read, portMAX_DELAY);

}

Why is the audio data I'm getting all noisy?

@github-actions github-actions bot changed the title for esp32-s3-eye I2S for esp32-s3-eye I2S (AIV-637) Aug 8, 2023
@hzhh110
Copy link
Author

hzhh110 commented Aug 8, 2023

How do I set up to get the full PCM data?

@feizi
Copy link

feizi commented Aug 8, 2023

Hi @hzhh110 , you can refer to esp-bsp/esp32-s3-eye about how to set your I2S.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants