78 / xiaozhi-esp32

Build your own AI friend
MIT License
60 stars 10 forks source link

How to change the settings for xiao esp32s3 sense #2

Open mqgw opened 1 week ago

mqgw commented 1 week ago

Recently I tried to reuse the code for xiao esp32s3 sense. Have tried to change the GPIO as below, but failed to wake the chips. Besides these changes, what else needs the change?

chan_cfg.id = I2S_NUM_1;
ESP_ERROR_CHECK(i2s_new_channel(&chan_cfg, nullptr, &rx_handle_));
std_cfg.clk_cfg.sample_rate_hz = (uint32_t)input_sample_rate_;
std_cfg.gpio_cfg.bclk = (gpio_num_t)42; //CONFIG_AUDIO_DEVICE_I2S_MIC_GPIO_BCLK;
std_cfg.gpio_cfg.ws = I2S_GPIO_UNUSED;//(gpio_num_t)CONFIG_AUDIO_DEVICE_I2S_MIC_GPIO_WS;
std_cfg.gpio_cfg.dout = I2S_GPIO_UNUSED;
std_cfg.gpio_cfg.din = (gpio_num_t)41; //CONFIG_AUDIO_DEVICE_I2S_GPIO_DIN;
78 commented 6 days ago

What do you mean by "wake the chips"? I am not very familiar with I2S either. I have only been working with it for a month. But as far as I know, the WS pin needs to be set. If you are also using INMP441. XIAO esp32s3 has too few GPIO pins. You should use duplex mode to share the BCLK and WS pins if you have a speaker and a microphone both connected.