# Audio Effects Playback Demo
- [中文版](./README_CN.md)
- Basic Example: ⭐
## Example Brief
This example is based on the Espressif Generic Media Framework (GMF) and demonstrates how to build and run multiple audio processing pipelines. It uses embedded audio assets to showcase different audio effects and mixer capabilities, helping developers quickly understand GMF usage and audible results.
- **Audio effects demo**: adjust effect parameters (e.g. EQ gain, DRC compression curve) while playing and hear the change in real time.
- **Mixer demo**: demonstrates real-time mixing and control of multiple audio sources, e.g. background music with a prompt tone and fade-in/fade-out.
### Typical Scenarios
- Real-time adjustment of effect parameters during playback (ALC, Sonic, EQ, Fade, DRC, MBC).
- Multi-source mixing, e.g. background music plus prompt tone with fade control.
### Run Flow
- **Mixer mode**: Multiple pipelines (background music, prompt tone) feed the mixer element via ring buffers; the tone pipeline includes decode and sample-rate/channel/bit-depth conversion, working with the mixer for fade-in/fade-out.
- **Single-effect mode**: One pipeline `io_embed_flash` → `aud_dec` → `effect` (one of ALC, Sonic, EQ, Fade, DRC, MBC) → `io_codec_dev`; effect parameters are updated via API after about 4 seconds of playback.
## Environment Setup
### Hardware Required
- **Board**: ESP32-S3-Korvo V3 by default; other ESP audio boards are also supported.
- **Resource requirements**: Audio DAC, speaker.
### Default IDF Branch
This example supports IDF release/v5.4 (>= v5.4.3) and release/v5.5 (>= v5.5.2).
### Prerequisites
The audio files used in this example are in [embedded binary](https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/api-guides/build-system.html#cmake-embed-data) format and are compiled and downloaded to flash with the code.
This example provides two test files, `manloud_48000_2_16_10.wav` and `tone.mp3`, in `${PROJECT_DIR}/components/music_src/`. The files `esp_embed_tone.h` and `esp_embed_tone.cmake` are generated by `$YOUR_GMF_PATH/elements/gmf_io/mk_flash_embed_tone.py`. To use different audio files, run the script to regenerate them:
```
python $YOUR_GMF_PATH/elements/gmf_io/mk_flash_embed_tone.py -p $YOUR_GMF_PATH/gmf_examples/basic_examples/pipeline_audio_effects/components/music_src
```
## Build and Flash
### Build Preparation
Before building this example, ensure the ESP-IDF environment is set up. If it is already set up, skip this paragraph and go to the project directory and run the pre-build script(s) as follows. If not, run the following in the ESP-IDF root directory to complete the environment setup. For full steps, see the [ESP-IDF Programming Guide](https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/index.html).
```
./install.sh
. ./export.sh
```
Short steps:
- Go to this example's project directory:
```
cd $YOUR_GMF_PATH/gmf_examples/basic_examples/pipeline_audio_effects
```
- Run the pre-build script: follow the prompts to select the target chip, set up the IDF Action extension, and use `esp_board_manager` to select a supported board. For a custom board, see [Custom board](https://github.com/espressif/esp-gmf/blob/main/packages/esp_board_manager/README.md#custom-board).
On Linux / macOS:
```bash/zsh
source prebuild.sh
```
On Windows:
```powershell
.\prebuild.ps1
```
### Project Configuration
- **Effect demo**: All audio effect demos (ALC, Sonic, EQ, Fade, DRC, MBC, and Mixer) are enabled by default. You can select which effects to demonstrate in menuconfig under `Pipeline Audio Effects Example`.
- **Audio type**: The example uses WAV and MP3; corresponding decoders are registered. For other formats, configure the decoder in menuconfig.
```bash
idf.py menuconfig
```
Configure the following in menuconfig:
- Select effects to demonstrate: `(Top)` → `Pipeline Audio Effects Example`
- Select decoder: `Component config` → `Audio Codec Configuration` → `Audio Decoder Configuration`
> Press `s` to save and `Esc` to exit after configuration.
### Build and Flash Commands
- Build the example:
```
idf.py build
```
- Flash the firmware and run the serial monitor (replace PORT with your port name):
```
idf.py -p PORT flash monitor
```
- To exit the monitor, use `Ctrl-]`
## How to Use the Example
### Functionality and Usage
- **Single-effect mode**
1. Read and decode the embedded WAV file `manloud_48000_2_16_10.wav` from flash.
2. Play the first 4 seconds with neutral parameters.
3. After the delay, the demo calls effect APIs to update parameters so the change is audible.
4. When playback ends, the pipeline stops and releases GMF resources.
- **Mixer mode**
1. Pipeline A reads and decodes background music `manloud_48000_2_16_10.wav` from flash.
2. Pipeline B starts later, reads and decodes the prompt tone `tone.mp3`, with automatic sample-rate, channel and bit-depth conversion.
3. Pipeline C mixes both streams and applies fade-in/fade-out based on tone events.
4. When all inputs finish, the mixer and related pipelines exit and release resources.
### Log Output
Normal run order: mixer demo, then single-effect demos (ALC, Sonic, EQ, Fade, DRC, MBC) and teardown. Key steps are marked with `[ 1 ]`–`[ 4 ]` and messages like "Applying aud_xxx parameters", "Mixer demo finished", "Effect demo finished". Example (ESP32-S3):
```c
I (1360) PIPELINE_AUDIO_EFFECTS: [ 1 ] Prepare GMF pool
I (1361) PIPELINE_AUDIO_EFFECTS: [ 2 ] Build mixer pipelines
I (1363) PIPELINE_AUDIO_EFFECTS: [ 2.1 ] Set audio url to play for music pipeline
I (1370) PIPELINE_AUDIO_EFFECTS: [ 2.2 ] Connect pipelines via ring buffers
I (1377) NEW_DATA_BUS: New ringbuffer:0x3c3aab34, num:10, item_cnt:1024, db:0x3c3ad360
I (1385) NEW_DATA_BUS: New ringbuffer:0x3c3ad3c8, num:10, item_cnt:1024, db:0x3c3afbf4
I (1392) PIPELINE_AUDIO_EFFECTS: [ 2.3 ] Prepare tasks
I (1397) ESP_GMF_TASK: Waiting to run... [tsk:base_stream-0x3fcec184, wk:0x0, run:0]
I (1397) ESP_GMF_TASK: Waiting to run... [tsk:mixer_stream-0x3fcee774, wk:0x0, run:0]
I (1397) ESP_GMF_TASK: Waiting to run... [tsk:tone_stream-0x3fced47c, wk:0x0, run:0]
I (1404) ESP_GMF_TASK: Waiting to run... [tsk:base_stream-0x3fcec184, wk:0x3c3afd9c, run:0]
I (1419) ESP_GMF_TASK: Waiting to run... [tsk:tone_stream-0x3fced47c, wk:0x3c3afe44, run:0]
W (1397) ESP_GMF_PIPELINE: Element[aud_mixer-0x3c3aa8c0] not ready to register job, ret:0xffffdff8
I (1444) PIPELINE_AUDIO_EFFECTS: [ 2.4 ] Create event groups and set event handler for each pipeline
I (1453) ESP_GMF_TASK: Waiting to run... [tsk:mixer_stream-0x3fcee774, wk:0x3c3afef0, run:0]
I (1461) PIPELINE_AUDIO_EFFECTS: [ 3 ] Start mixer pipelines
I (1467) ESP_GMF_EMBED_FLASH: The read item is 0, embed://tone/0
I (1472) ESP_GMF_TASK: One times job is complete, del[wk:0x3c3afd9c, ctx:0x3c3aa040, label:aud_dec_open]
I (1473) ESP_GMF_TASK: One times job is complete, del[wk:0x3c3afef0, ctx:0x3c3aa8c0, label:aud_mixer_open]
I (1482) ESP_GMF_PORT: ACQ IN, new self payload:0x3c3afd9c, port:0x3c3aa1f8, el:0x3c3aa040-aud_dec
I (1491) ESP_GMF_PORT: ACQ IN, new self payload:0x3c3afef0, port:0x3c3afc9c, el:0x3c3aa8c0-aud_mixer
I (1500) ESP_ES_PARSER: The version of es_parser is v1.0.0
I (1513) ESP_GMF_PORT: ACQ IN, new self payload:0x3c3aff98, port:0x3c3afd2c, el:0x3c3aa8c0-aud_mixer
I (3473) ESP_GMF_EMBED_FLASH: The read item is 1, embed://tone/1
I (3473) ESP_GMF_TASK: One times job is complete, del[wk:0x3c3afe44, ctx:0x3c3aa27c, label:aud_dec_open]
I (3476) ESP_GMF_PORT: ACQ IN, new self payload:0x3c3afe44, port:0x3c3aa83c, el:0x3c3aa27c-aud_dec
I (3485) ESP_ES_PARSER: The version of es_parser is v1.0.0
W (3492) ESP_GMF_ASMP_DEC: Not enough memory for out, need:1152, old: 1024, new: 1152
I (3499) ESP_GMF_TASK: One times job is complete, del[wk:0x3c3b3068, ctx:0x3c3aa38c, label:aud_rate_cvt_open]
I (3508) ESP_GMF_TASK: One times job is complete, del[wk:0x3c3b30b8, ctx:0x3c3aa4e8, label:aud_ch_cvt_open]
I (3518) ESP_GMF_TASK: One times job is complete, del[wk:0x3c3b3108, ctx:0x3c3aa640, label:aud_bit_cvt_open]
W (7426) ESP_GMF_EMBED_FLASH: No more data, ret:0, pos: 22651/22651
I (7426) ESP_GMF_TASK: Job is done, [tsk:tone_stream-0x3fced47c, wk:0x3c3afe80, job:0x3c3aa27c-aud_dec_proc]
I (7430) ESP_GMF_TASK: Job is done, [tsk:tone_stream-0x3fced47c, wk:0x3c3b3090, job:0x3c3aa38c-aud_rate_cvt_proc]
I (7440) ESP_GMF_TASK: Job is done, [tsk:tone_stream-0x3fced47c, wk:0x3c3b30e0, job:0x3c3aa4e8-aud_ch_cvt_proc]
I (7450) ESP_GMF_TASK: Job is done, [tsk:tone_stream-0x3fced47c, wk:0x3c3b3130, job:0x3c3aa640-aud_bit_cvt_proc]
I (7460) ESP_GMF_TASK: Finish, strategy action: 0, [tsk:0x3fced47c-tone_stream]
I (7467) ESP_GMF_EMBED_FLASH: Closed, pos: 22651/22651
I (7472) ESP_GMF_TASK: One times job is complete, del[wk:0x3c3afe68, ctx:0x3c3aa27c, label:aud_dec_close]
I (7481) ESP_GMF_TASK: One times job is complete, del[wk:0x3c3afe90, ctx:0x3c3aa38c, label:aud_rate_cvt_close]
I (7491) ESP_GMF_TASK: One times job is complete, del[wk:0x3c3b3090, ctx:0x3c3aa4e8, label:aud_ch_cvt_close]
I (7500) ESP_GMF_TASK: One times job is complete, del[wk:0x3c3b30b8, ctx:0x3c3aa640, label:aud_bit_cvt_close]
I (7510) ESP_GMF_TASK: Waiting to run... [tsk:tone_stream-0x3fced47c, wk:0x0, run:0]
I (7517) ESP_GMF_TASK: Waiting to run... [tsk:tone_stream-0x3fced47c, wk:0x0, run:0]
W (11445) ESP_GMF_EMBED_FLASH: No more data, ret:0, pos: 1920044/1920044
I (11445) ESP_GMF_TASK: Job is done, [tsk:base_stream-0x3fcec184, wk:0x3c3afdd8, job:0x3c3aa040-aud_dec_proc]
I (11450) ESP_GMF_TASK: Finish, strategy action: 0, [tsk:0x3fcec184-base_stream]
I (11457) ESP_GMF_EMBED_FLASH: Closed, pos: 1920044/1920044
I (11463) ESP_GMF_TASK: One times job is complete, del[wk:0x3c3afdc0, ctx:0x3c3aa040, label:aud_dec_close]
I (11472) ESP_GMF_TASK: Waiting to run... [tsk:base_stream-0x3fcec184, wk:0x0, run:0]
I (11475) ESP_GMF_CODEC_DEV: CLose, 0x3c3aa9e0, pos = 1914240/0
I (11480) ESP_GMF_TASK: Waiting to run... [tsk:base_stream-0x3fcec184, wk:0x0, run:0]
I (11485) ESP_GMF_TASK: One times job is complete, del[wk:0x3c3aff14, ctx:0x3c3aa8c0, label:aud_mixer_close]
I (11502) ESP_GMF_TASK: Waiting to run... [tsk:mixer_stream-0x3fcee774, wk:0x0, run:0]
I (11510) ESP_GMF_TASK: Waiting to run... [tsk:mixer_stream-0x3fcee774, wk:0x0, run:0]
I (11518) PIPELINE_AUDIO_EFFECTS: [ 4 ] Tear down mixer pipelines
W (11524) GMF_SETUP_AUD_CODEC: Unregistering default encoder
W (11529) GMF_SETUP_AUD_CODEC: Unregistering default decoder
I (11535) PIPELINE_AUDIO_EFFECTS: Mixer demo finished
I (11539) PIPELINE_AUDIO_EFFECTS: [ 1 ] Prepare GMF pool
I (11545) PIPELINE_AUDIO_EFFECTS: [ 2 ] Build pipeline: io_embed_flash -> aud_dec -> effect -> io_codec_dev
I (11554) PIPELINE_AUDIO_EFFECTS: [ 2.1 ] Set audio url to play
I (11559) PIPELINE_AUDIO_EFFECTS: [ 2.2 ] Create gmf task, bind task to pipeline and load linked element jobs to the bind task
I (11570) ESP_GMF_TASK: Waiting to run... [tsk:TSK_0x3fcebd64-0x3fcebd64, wk:0x0, run:0]
I (11578) ESP_GMF_TASK: Waiting to run... [tsk:TSK_0x3fcebd64-0x3fcebd64, wk:0x3c3aa4ec, run:0]
I (11587) PIPELINE_AUDIO_EFFECTS: [ 3 ] Start playback and wait 4 s before enabling aud_alc
I (11595) ESP_GMF_EMBED_FLASH: The read item is 0, embed://tone/0
I (11600) ESP_GMF_TASK: One times job is complete, del[wk:0x3c3aa4ec, ctx:0x3c3aa040, label:aud_dec_open]
I (11610) ESP_GMF_PORT: ACQ IN, new self payload:0x3c3aa4ec, port:0x3c3aa364, el:0x3c3aa040-aud_dec
I (11618) ESP_ES_PARSER: The version of es_parser is v1.0.0
I (11629) ESP_GMF_TASK: One times job is complete, del[wk:0x3c3aabd4, ctx:0x3c3aa150, label:aud_alc_open]
I (15634) PIPELINE_AUDIO_EFFECTS: Applying aud_alc parameters
W (21605) ESP_GMF_EMBED_FLASH: No more data, ret:0, pos: 1920044/1920044
I (21605) ESP_GMF_TASK: Job is done, [tsk:TSK_0x3fcebd64-0x3fcebd64, wk:0x3c3aa528, job:0x3c3aa040-aud_dec_proc]
I (21610) ESP_GMF_TASK: Job is done, [tsk:TSK_0x3fcebd64-0x3fcebd64, wk:0x3c3aabfc, job:0x3c3aa150-aud_alc_proc]
I (21620) ESP_GMF_TASK: Finish, strategy action: 0, [tsk:0x3fcebd64-TSK_0x3fcebd64]
I (21628) ESP_GMF_EMBED_FLASH: Closed, pos: 1920044/1920044
I (21633) ESP_GMF_CODEC_DEV: CLose, 0x3c3aa3a4, pos = 1920000/0
I (21639) ESP_GMF_TASK: One times job is complete, del[wk:0x3c3aa510, ctx:0x3c3aa040, label:aud_dec_close]
I (21648) ESP_GMF_TASK: One times job is complete, del[wk:0x3c3aa538, ctx:0x3c3aa150, label:aud_alc_close]
I (21657) ESP_GMF_TASK: Waiting to run... [tsk:TSK_0x3fcebd64-0x3fcebd64, wk:0x0, run:0]
I (21665) ESP_GMF_TASK: Waiting to run... [tsk:TSK_0x3fcebd64-0x3fcebd64, wk:0x0, run:0]
I (21673) PIPELINE_AUDIO_EFFECTS: [ 4 ] Tear down pipeline
W (21678) GMF_SETUP_AUD_CODEC: Unregistering default encoder
W (21684) GMF_SETUP_AUD_CODEC: Unregistering default decoder
I (21689) PIPELINE_AUDIO_EFFECTS: [ 1 ] Prepare GMF pool
I (21695) PIPELINE_AUDIO_EFFECTS: [ 2 ] Build pipeline: io_embed_flash -> aud_dec -> effect -> io_codec_dev
I (21704) PIPELINE_AUDIO_EFFECTS: [ 2.1 ] Set audio url to play
I (21709) PIPELINE_AUDIO_EFFECTS: [ 2.2 ] Create gmf task, bind task to pipeline and load linked element jobs to the bind task
I (21720) ESP_GMF_TASK: Waiting to run... [tsk:TSK_0x3fcebd64-0x3fcebd64, wk:0x0, run:0]
I (21728) ESP_GMF_TASK: Waiting to run... [tsk:TSK_0x3fcebd64-0x3fcebd64, wk:0x3c3aa514, run:0]
I (21737) PIPELINE_AUDIO_EFFECTS: [ 3 ] Start playback and wait 4 s before enabling aud_sonic
I (21745) ESP_GMF_EMBED_FLASH: The read item is 0, embed://tone/0
I (21751) ESP_GMF_TASK: One times job is complete, del[wk:0x3c3aa514, ctx:0x3c3aa040, label:aud_dec_open]
I (21760) ESP_GMF_PORT: ACQ IN, new self payload:0x3c3aa514, port:0x3c3aa38c, el:0x3c3aa040-aud_dec
I (21769) ESP_ES_PARSER: The version of es_parser is v1.0.0
I (21774) ESP_GMF_TASK: One times job is complete, del[wk:0x3c3aabf4, ctx:0x3c3aa150, label:aud_sonic_open]
I (25784) PIPELINE_AUDIO_EFFECTS: Applying aud_sonic parameters
W (33220) ESP_GMF_EMBED_FLASH: No more data, ret:0, pos: 1920044/1920044
I (33220) ESP_GMF_TASK: Job is done, [tsk:TSK_0x3fcebd64-0x3fcebd64, wk:0x3c3aa550, job:0x3c3aa040-aud_dec_proc]
I (33225) ESP_GMF_TASK: Job is done, [tsk:TSK_0x3fcebd64-0x3fcebd64, wk:0x3c3aac1c, job:0x3c3aa150-aud_sonic_proc]
I (33236) ESP_GMF_TASK: Finish, strategy action: 0, [tsk:0x3fcebd64-TSK_0x3fcebd64]
I (33243) ESP_GMF_EMBED_FLASH: Closed, pos: 1920044/1920044
I (33248) ESP_GMF_CODEC_DEV: CLose, 0x3c3aa3cc, pos = 2200776/0
I (33254) ESP_GMF_TASK: One times job is complete, del[wk:0x3c3aa538, ctx:0x3c3aa040, label:aud_dec_close]
I (33263) ESP_GMF_TASK: One times job is complete, del[wk:0x3c3aa560, ctx:0x3c3aa150, label:aud_sonic_close]
I (33273) ESP_GMF_TASK: Waiting to run... [tsk:TSK_0x3fcebd64-0x3fcebd64, wk:0x0, run:0]
I (33281) ESP_GMF_TASK: Waiting to run... [tsk:TSK_0x3fcebd64-0x3fcebd64, wk:0x0, run:0]
I (33288) PIPELINE_AUDIO_EFFECTS: [ 4 ] Tear down pipeline
W (33294) GMF_SETUP_AUD_CODEC: Unregistering default encoder
W (33299) GMF_SETUP_AUD_CODEC: Unregistering default decoder
I (33305) PIPELINE_AUDIO_EFFECTS: [ 1 ] Prepare GMF pool
I (33310) PIPELINE_AUDIO_EFFECTS: [ 2 ] Build pipeline: io_embed_flash -> aud_dec -> effect -> io_codec_dev
I (33319) PIPELINE_AUDIO_EFFECTS: [ 2.1 ] Set audio url to play
I (33325) PIPELINE_AUDIO_EFFECTS: [ 2.2 ] Create gmf task, bind task to pipeline and load linked element jobs to the bind task
I (33336) ESP_GMF_TASK: Waiting to run... [tsk:TSK_0x3fcebd64-0x3fcebd64, wk:0x0, run:0]
I (33343) ESP_GMF_TASK: Waiting to run... [tsk:TSK_0x3fcebd64-0x3fcebd64, wk:0x3c3aa590, run:0]
I (33352) PIPELINE_AUDIO_EFFECTS: [ 3 ] Start playback and wait 4 s before enabling aud_eq
I (33360) ESP_GMF_EMBED_FLASH: The read item is 0, embed://tone/0
I (33366) ESP_GMF_TASK: One times job is complete, del[wk:0x3c3aa590, ctx:0x3c3aa040, label:aud_dec_open]
I (33375) ESP_GMF_PORT: ACQ IN, new self payload:0x3c3aa590, port:0x3c3aa408, el:0x3c3aa040-aud_dec
I (33384) ESP_ES_PARSER: The version of es_parser is v1.0.0
I (33390) ESP_GMF_TASK: One times job is complete, del[wk:0x3c3aac74, ctx:0x3c3aa150, label:aud_eq_open]
I (37398) PIPELINE_AUDIO_EFFECTS: Applying aud_eq parameters
W (43370) ESP_GMF_EMBED_FLASH: No more data, ret:0, pos: 1920044/1920044
I (43370) ESP_GMF_TASK: Job is done, [tsk:TSK_0x3fcebd64-0x3fcebd64, wk:0x3c3aa5cc, job:0x3c3aa040-aud_dec_proc]
I (43375) ESP_GMF_TASK: Job is done, [tsk:TSK_0x3fcebd64-0x3fcebd64, wk:0x3c3aac9c, job:0x3c3aa150-aud_eq_proc]
I (43385) ESP_GMF_TASK: Finish, strategy action: 0, [tsk:0x3fcebd64-TSK_0x3fcebd64]
I (43393) ESP_GMF_EMBED_FLASH: Closed, pos: 1920044/1920044
I (43398) ESP_GMF_CODEC_DEV: CLose, 0x3c3aa448, pos = 1920000/0
I (43404) ESP_GMF_TASK: One times job is complete, del[wk:0x3c3aa5b4, ctx:0x3c3aa040, label:aud_dec_close]
I (43413) ESP_GMF_TASK: One times job is complete, del[wk:0x3c3aa5dc, ctx:0x3c3aa150, label:aud_eq_close]
I (43422) ESP_GMF_TASK: Waiting to run... [tsk:TSK_0x3fcebd64-0x3fcebd64, wk:0x0, run:0]
I (43430) ESP_GMF_TASK: Waiting to run... [tsk:TSK_0x3fcebd64-0x3fcebd64, wk:0x0, run:0]
I (43438) PIPELINE_AUDIO_EFFECTS: [ 4 ] Tear down pipeline
W (43443) GMF_SETUP_AUD_CODEC: Unregistering default encoder
W (43449) GMF_SETUP_AUD_CODEC: Unregistering default decoder
I (43454) PIPELINE_AUDIO_EFFECTS: [ 1 ] Prepare GMF pool
I (43460) PIPELINE_AUDIO_EFFECTS: [ 2 ] Build pipeline: io_embed_flash -> aud_dec -> effect -> io_codec_dev
I (43469) PIPELINE_AUDIO_EFFECTS: [ 2.1 ] Set audio url to play
I (43474) PIPELINE_AUDIO_EFFECTS: [ 2.2 ] Create gmf task, bind task to pipeline and load linked element jobs to the bind task
I (43485) ESP_GMF_TASK: Waiting to run... [tsk:TSK_0x3fcebd64-0x3fcebd64, wk:0x0, run:0]
I (43493) ESP_GMF_TASK: Waiting to run... [tsk:TSK_0x3fcebd64-0x3fcebd64, wk:0x3c3aa4dc, run:0]
I (43501) PIPELINE_AUDIO_EFFECTS: [ 3 ] Start playback and wait 4 s before enabling aud_fade
I (43510) ESP_GMF_EMBED_FLASH: The read item is 0, embed://tone/0
I (43515) ESP_GMF_TASK: One times job is complete, del[wk:0x3c3aa4dc, ctx:0x3c3aa040, label:aud_dec_open]
I (43525) ESP_GMF_PORT: ACQ IN, new self payload:0x3c3aa4dc, port:0x3c3aa354, el:0x3c3aa040-aud_dec
I (43533) ESP_ES_PARSER: The version of es_parser is v1.0.0
I (43539) ESP_GMF_TASK: One times job is complete, del[wk:0x3c3aabc4, ctx:0x3c3aa150, label:aud_fade_open]
I (47549) PIPELINE_AUDIO_EFFECTS: Applying aud_fade parameters
W (53520) ESP_GMF_EMBED_FLASH: No more data, ret:0, pos: 1920044/1920044
I (53520) ESP_GMF_TASK: Job is done, [tsk:TSK_0x3fcebd64-0x3fcebd64, wk:0x3c3aa518, job:0x3c3aa040-aud_dec_proc]
I (53525) ESP_GMF_TASK: Job is done, [tsk:TSK_0x3fcebd64-0x3fcebd64, wk:0x3c3aabec, job:0x3c3aa150-aud_fade_proc]
I (53535) ESP_GMF_TASK: Finish, strategy action: 0, [tsk:0x3fcebd64-TSK_0x3fcebd64]
I (53543) ESP_GMF_EMBED_FLASH: Closed, pos: 1920044/1920044
I (53548) ESP_GMF_CODEC_DEV: CLose, 0x3c3aa394, pos = 1920000/0
I (53554) ESP_GMF_TASK: One times job is complete, del[wk:0x3c3aa500, ctx:0x3c3aa040, label:aud_dec_close]
I (53563) ESP_GMF_TASK: One times job is complete, del[wk:0x3c3aa528, ctx:0x3c3aa150, label:aud_fade_close]
I (53573) ESP_GMF_TASK: Waiting to run... [tsk:TSK_0x3fcebd64-0x3fcebd64, wk:0x0, run:0]
I (53580) ESP_GMF_TASK: Waiting to run... [tsk:TSK_0x3fcebd64-0x3fcebd64, wk:0x0, run:0]
I (53588) PIPELINE_AUDIO_EFFECTS: [ 4 ] Tear down pipeline
W (53594) GMF_SETUP_AUD_CODEC: Unregistering default encoder
W (53599) GMF_SETUP_AUD_CODEC: Unregistering default decoder
I (53605) PIPELINE_AUDIO_EFFECTS: [ 1 ] Prepare GMF pool
I (53610) PIPELINE_AUDIO_EFFECTS: [ 2 ] Build pipeline: io_embed_flash -> aud_dec -> effect -> io_codec_dev
I (53619) PIPELINE_AUDIO_EFFECTS: [ 2.1 ] Set audio url to play
I (53624) PIPELINE_AUDIO_EFFECTS: [ 2.2 ] Create gmf task, bind task to pipeline and load linked element jobs to the bind task
I (53636) ESP_GMF_TASK: Waiting to run... [tsk:TSK_0x3fcebd64-0x3fcebd64, wk:0x0, run:0]
I (53643) ESP_GMF_TASK: Waiting to run... [tsk:TSK_0x3fcebd64-0x3fcebd64, wk:0x3c3aa4fc, run:0]
I (53652) PIPELINE_AUDIO_EFFECTS: [ 3 ] Start playback and wait 4 s before enabling aud_drc
I (53660) ESP_GMF_EMBED_FLASH: The read item is 0, embed://tone/0
I (53666) ESP_GMF_TASK: One times job is complete, del[wk:0x3c3aa4fc, ctx:0x3c3aa040, label:aud_dec_open]
I (53675) ESP_GMF_PORT: ACQ IN, new self payload:0x3c3aa4fc, port:0x3c3aa374, el:0x3c3aa040-aud_dec
I (53684) ESP_ES_PARSER: The version of es_parser is v1.0.0
I (53736) ESP_GMF_TASK: One times job is complete, del[wk:0x3c3aabe4, ctx:0x3c3aa150, label:aud_drc_open]
I (57738) PIPELINE_AUDIO_EFFECTS: Applying aud_drc parameters
W (63710) ESP_GMF_EMBED_FLASH: No more data, ret:0, pos: 1920044/1920044
I (63710) ESP_GMF_TASK: Job is done, [tsk:TSK_0x3fcebd64-0x3fcebd64, wk:0x3c3aa538, job:0x3c3aa040-aud_dec_proc]
I (63715) ESP_GMF_TASK: Job is done, [tsk:TSK_0x3fcebd64-0x3fcebd64, wk:0x3c3aac0c, job:0x3c3aa150-aud_drc_proc]
I (63725) ESP_GMF_TASK: Finish, strategy action: 0, [tsk:0x3fcebd64-TSK_0x3fcebd64]
I (63733) ESP_GMF_EMBED_FLASH: Closed, pos: 1920044/1920044
I (63738) ESP_GMF_CODEC_DEV: CLose, 0x3c3aa3b4, pos = 1920000/0
I (63744) ESP_GMF_TASK: One times job is complete, del[wk:0x3c3aabe4, ctx:0x3c3aa040, label:aud_dec_close]
I (63753) ESP_GMF_TASK: One times job is complete, del[wk:0x3c3aac0c, ctx:0x3c3aa150, label:aud_drc_close]
I (63762) ESP_GMF_TASK: Waiting to run... [tsk:TSK_0x3fcebd64-0x3fcebd64, wk:0x0, run:0]
I (63770) ESP_GMF_TASK: Waiting to run... [tsk:TSK_0x3fcebd64-0x3fcebd64, wk:0x0, run:0]
I (63778) PIPELINE_AUDIO_EFFECTS: [ 4 ] Tear down pipeline
W (63783) GMF_SETUP_AUD_CODEC: Unregistering default encoder
W (63789) GMF_SETUP_AUD_CODEC: Unregistering default decoder
I (63794) PIPELINE_AUDIO_EFFECTS: [ 1 ] Prepare GMF pool
I (63800) PIPELINE_AUDIO_EFFECTS: [ 2 ] Build pipeline: io_embed_flash -> aud_dec -> effect -> io_codec_dev
I (63809) PIPELINE_AUDIO_EFFECTS: [ 2.1 ] Set audio url to play
I (63814) PIPELINE_AUDIO_EFFECTS: [ 2.2 ] Create gmf task, bind task to pipeline and load linked element jobs to the bind task
I (63825) ESP_GMF_TASK: Waiting to run... [tsk:TSK_0x3fcebd64-0x3fcebd64, wk:0x0, run:0]
I (63833) ESP_GMF_TASK: Waiting to run... [tsk:TSK_0x3fcebd64-0x3fcebd64, wk:0x3c3aa544, run:0]
I (63842) PIPELINE_AUDIO_EFFECTS: [ 3 ] Start playback and wait 4 s before enabling aud_mbc
I (63850) ESP_GMF_EMBED_FLASH: The read item is 0, embed://tone/0
I (63855) ESP_GMF_TASK: One times job is complete, del[wk:0x3c3aa544, ctx:0x3c3aa040, label:aud_dec_open]
I (63865) ESP_GMF_PORT: ACQ IN, new self payload:0x3c3aa544, port:0x3c3aa3bc, el:0x3c3aa040-aud_dec
I (63873) ESP_ES_PARSER: The version of es_parser is v1.0.0
I (64068) ESP_GMF_TASK: One times job is complete, del[wk:0x3c3aac24, ctx:0x3c3aa150, label:aud_mbc_open]
I (68074) PIPELINE_AUDIO_EFFECTS: Applying aud_mbc parameters
W (74045) ESP_GMF_EMBED_FLASH: No more data, ret:0, pos: 1920044/1920044
I (74045) ESP_GMF_TASK: Job is done, [tsk:TSK_0x3fcebd64-0x3fcebd64, wk:0x3c3aa580, job:0x3c3aa040-aud_dec_proc]
I (74050) ESP_GMF_TASK: Job is done, [tsk:TSK_0x3fcebd64-0x3fcebd64, wk:0x3c3aac4c, job:0x3c3aa150-aud_mbc_proc]
I (74060) ESP_GMF_TASK: Finish, strategy action: 0, [tsk:0x3fcebd64-TSK_0x3fcebd64]
I (74068) ESP_GMF_EMBED_FLASH: Closed, pos: 1920044/1920044
I (74073) ESP_GMF_CODEC_DEV: CLose, 0x3c3aa3fc, pos = 1920000/0
I (74079) ESP_GMF_TASK: One times job is complete, del[wk:0x3c3aac24, ctx:0x3c3aa040, label:aud_dec_close]
I (74088) ESP_GMF_TASK: One times job is complete, del[wk:0x3c3aac4c, ctx:0x3c3aa150, label:aud_mbc_close]
I (74097) ESP_GMF_TASK: Waiting to run... [tsk:TSK_0x3fcebd64-0x3fcebd64, wk:0x0, run:0]
I (74105) ESP_GMF_TASK: Waiting to run... [tsk:TSK_0x3fcebd64-0x3fcebd64, wk:0x0, run:0]
I (74113) PIPELINE_AUDIO_EFFECTS: [ 4 ] Tear down pipeline
W (74118) GMF_SETUP_AUD_CODEC: Unregistering default encoder
W (74124) GMF_SETUP_AUD_CODEC: Unregistering default decoder
I (74135) BOARD_DEVICE: Deinit device audio_dac ref_count: 0 device_handle:0x3fce9a7c
I (74142) BOARD_DEVICE: Device audio_dac config found: 0x3c16a220 (size: 92)
I (74143) BOARD_PERIPH: Deinit peripheral i2s_audio_out ref_count: 0
E (74149) i2s_common: i2s_channel_disable(1256): the channel has not been enabled yet
W (74157) PERIPH_I2S: Caution: Releasing TX (0x0).
W (74161) PERIPH_I2S: Caution: RX (0x3c3a87ec) forced to stop.
E (74167) i2s_common: i2s_channel_disable(1256): the channel has not been enabled yet
I (74175) BOARD_PERIPH: Deinit peripheral i2c_master ref_count: 0
I (74180) PERIPH_I2C: I2C master bus deinitialized successfully
I (74186) BOARD_MANAGER: Device audio_dac deinitialized
I (74191) PIPELINE_AUDIO_EFFECTS: Effect demo finished
I (74196) main_task: Returned from app_main()
```
## Troubleshooting
### No sound or device not ready
If the log shows codec/DAC init failure or I2S errors, ensure the board configuration has audio output enabled and the speaker or headphone is connected.
### Embedded audio files missing
If you see errors opening `embed://tone/0` and the like, ensure you have run `mk_flash_embed_tone.py` to generate `esp_embed_tone.h` and `esp_embed_tone.cmake`, and that the required audio files exist under `components/music_src/`.
## Technical Support
For technical support, use the links below:
- Technical support: [esp32.com](https://esp32.com/viewforum.php?f=20) forum
- Issue reports and feature requests: [GitHub issue](https://github.com/espressif/esp-gmf/issues)
We will reply as soon as possible.
To create a project from this example, run:
idf.py create-project-from-example "espressif/gmf_examples=0.8.0:pipeline_audio_effects"