-
Notifications
You must be signed in to change notification settings - Fork 51
Description
Checklist
- Checked the issue tracker for similar issues to ensure this is not a duplicate
- Read the documentation to confirm the issue is not addressed there and your configuration is set correctly
- Tested with the latest version to ensure the issue hasn't been fixed
How often does this bug occurs?
always
Expected behavior
After switching to the GMF-based esp_capture (v0.7.4), OPUS audio encoding should work without audio glitches using the default Opus VBR configuration, just like the pre-GMF capture system.
Actual behavior (suspected bug)
After migrating to GMF capture, audio glitches occur that were not present in the pre-GMF esp_capture system. The audio glitches appear specifically during loud sounds and consonants when using AEC in VC mode.
We traced the issue to VBR mode being enabled by default (bitrate = 0). Forcing CBR mode (bitrate = 90000, enable_vbr = false) eliminates the glitches.
Configuration results:
NEW GMF with VBR (default) and AEC VC mode → glitches during loud sounds and consonants
NEW GMF with CBR (forced) and AEC VC mode → no glitches
NEW GMF with VBR (default) and AEC SR mode → no noticeable glitches
OLD pre-GMF esp_capture with VBR and AEC VC mode → no glitches
OLD pre-GMF esp_capture with CBR and AEC VC mode → no glitches
Error logs or terminal output
No errors are logged.Steps to reproduce the behavior
- Use ESP32-S3 with esp-webrtc-solution
- Use GMF-based esp_capture v0.7.4 with default configuration (latest build)
- Enable AEC in VC mode
- Establish a WebRTC call
- Speak loudly or pronounce consonants (p, t, k, s)
- Observe audio glitches or crackling during these sounds
Verify the fix:
Modify managed_components/espressif__gmf_audio/esp_gmf_audio_enc.c:
opus_enc_cfg.bitrate = 90000; // Force CBR
opus_enc_cfg.enable_vbr = false; // Disable VBR
opus_enc_cfg.application_mode = ESP_OPUS_ENC_APPLICATION_AUDIO;
Project release version
Latest
System architecture
Intel/AMD 64-bit (modern PC, older Mac)
Operating system
MacOS
Operating system version
ESP IDF 5.4.1
Shell
ZSH
Additional context
No response