Hello, I'm trying to play with pipelines on esp-adf, I've just tried to test a loopback pipeline i2s reader --> i2s writer to play what very same input to the output.
Here my snippet, I've probably did something wrong, in the monitor I saw "W (367) I2S: I2S driver already installed" when I'll add the second i2s_cfg_r, from docs it is not clear how to use i2s in full duplex:
ESP_LOGI(TAG, "[3.0] Create audio pipeline for loopback");
audio_pipeline_cfg_t pipeline_cfg = DEFAULT_AUDIO_PIPELINE_CONFIG();
pipeline = audio_pipeline_init(&pipeline_cfg);
mem_assert(pipeline);
ESP_LOGI(TAG, "[3.1] Create i2s stream to write data to codec chip");
i2s_stream_cfg_t i2s_cfg_w = I2S_STREAM_CFG_DEFAULT();
i2s_cfg_w.type = AUDIO_STREAM_WRITER;
i2s_stream_writer = i2s_stream_init(&i2s_cfg_w);
ESP_LOGI(TAG, "[3.2] Create i2s stream to read audio data from codec chip");
i2s_stream_cfg_t i2s_cfg_r = I2S_STREAM_CFG_DEFAULT();
i2s_cfg_r.type = AUDIO_STREAM_READER;
i2s_stream_reader = i2s_stream_init(&i2s_cfg_r);
ESP_LOGI(TAG, "[3.3] Register all elements to audio pipeline");
audio_pipeline_register(pipeline, i2s_stream_writer, "i2s_w");
audio_pipeline_register(pipeline, i2s_stream_reader, "i2s_r");
ESP_LOGI(TAG, "[3.4] Link it together [codec_chip]-->i2s_stream_r->i2s_stream_w-->[codec_chip]");
audio_pipeline_link(pipeline, (const char *[]) {"i2s_r", "i2s_w"}, 2);
i2s_stream_set_clk(i2s_stream_reader, 16000, 16, 2);
i2s_stream_set_clk(i2s_stream_writer, 16000, 16, 2);
Ultimately I would like to test the following pipeline "read i2s" -> "write on UPD socket"->"write i2s the very same input", I guess I need to create my audio element stream that supports UDP I thought to start from http_stream example or raw_stream and write my own (BTW is this the right things to do?), but without knowing how to use i2s in full duplex it I'm stuck.
Anyone tried that?
Simple loopback i2s full duplex how
Jump to
- English Forum
- Explore
- News
- General Discussion
- FAQ
- Documentation
- Documentation
- Sample Code
- Discussion Forum
- Hardware
- ESP-IDF
- ESP-BOX
- ESP-ADF
- ESP-MDF
- ESP-WHO
- ESP-SkaiNet
- ESP32 Arduino
- IDEs for ESP-IDF
- ESP-AT
- ESP IoT Solution
- ESP RainMaker
- Rust
- ESP8266
- Report Bugs
- Showcase
- Chinese Forum 中文社区
- 活动区
- 乐鑫活动专区
- 讨论区
- 全国大学生物联网设计竞赛乐鑫答疑专区
- ESP-IDF 中文讨论版
- 《ESP32-C3 物联网工程开发实战》书籍讨论版
- 中文文档讨论版
- ESP-AT 中文讨论版
- ESP-BOX 中文讨论版
- ESP IoT Solution 中文讨论版
- ESP-ADF 中文讨论版
- ESP Mesh 中文讨论版
- ESP Cloud 中文讨论版
- ESP-WHO 中文讨论版
- ESP-SkaiNet 中文讨论版
- ESP 生产支持讨论版
- 硬件问题讨论
- 项目展示
Who is online
Users browsing this forum: No registered users and 68 guests
- All times are UTC
- Top
- Delete cookies
About Us
Espressif Systems is a fabless semiconductor company providing cutting-edge low power WiFi SoCs and wireless solutions for wireless communications and Internet of Things applications. ESP8266EX and ESP32 are some of our products.