There is a "pop" noise when adjusting the volume (AUD-6165)
Environment
- Module or chip used:
ESP32-S3-WROOM-1U - Codec used:
ES8388 - IDF version (run
git describe --tagsin $IDF_PATH folder to find it):v5.3.2 - ADF version (run
git describe --tagsin $ADF_PATH folder to find it):v2.7-55-g29de65cd - Build system:
idf.py - Compiler version (run
xtensa-esp32-elf-gcc --versionin your project folder to find it):xtensa-esp-elf-gcc.exe (crosstool-NG esp-13.2.0_20240530) 13.2.0 - Operating system:
Windows - Using an IDE?:
VScode ESP-IDF extension - Power supply:
USB / external 5V
Problem Description
当我调节音量的时候,每次调节都会伴随着“噼啪”的噪声,无论调节幅度或者频率,音量越大噪声越响。
已使用 pipeline_play_sdcard_music 和 play_mp3_control 测试过,都存在该问题。且尝试改变过调节幅度和频率,均存在该问题。已在三种硬件上尝试,都存在问题。
请问是否有能够解决或规避该问题的方案?
When I adjust the volume, every time I do so, there will be a "pop" noise accompanying it. No matter the adjustment range or frequency, the louder the volume, the louder the noise will be.
The problem has been tested with pipeline_play_sdcard_music and play_mp3_control, and it exists in both cases. Moreover, attempts have been made to adjust the amplitude and frequency, but the problem persists in all cases.
If there is any solution that can solve or circumvent this problem?
Steps to Reproduce
- Flash the program.
- Adjust volume using
audio_hal_set_volumeAPI. - Here comes the problem.
Hardware schematic diagram
Debug Logs
No error logs. All the code works fine.
如果规避的话,是不是可以 先 mute, 然后设置 音量, 然后在 unmute 再试一下
如果规避的话,是不是可以 先 mute, 然后设置 音量, 然后在 unmute 再试一下
尝试了一下mute的方案,即使用 audio_hal_set_mute(board_handle->audio_hal, true); 接口,但依然存在问题。
确认一下面的寄存器看看是什么值,把斜率设置为最小看看
确认一下面的寄存器看看是什么值,把斜率设置为最小看看
ADC值为默认值 00
设置为11100000 = 0xE0看看
设置为11100000 = 0xE0看看
依然还有该问题,调节一格音量就会有噼噼啪啪的声音,声音越响越明显。
已确认寄存器值修改成功 @TempoTian
如果调节硬件codec无法满足要求可以加一个软件的volume 模块,你可以把硬件寄存器设置为最大音量然后前面加个alc模块来实现软件的音量调节。
如果调节硬件codec无法满足要求可以加一个软件的volume 模块,你可以把硬件寄存器设置为最大音量然后前面加个alc模块来实现软件的音量调节。
请问如何实现这样的调节音量模块,能麻烦您具体展开说一下吗
如果你用i2s_stream, i2s_stream是带alc功能的,设置函数 int i2s_alc_volume_set(audio_element_handle_t i2s_stream, int volume) 注意这个volume设置的是db值。
https://github.com/espressif/esp-adf/blob/master/components/audio_stream/include/i2s_stream.h#L69 use_alc开启这个功能。如果自己实现可以参考里面的代码
我联系了ES8388 codec的芯片厂商,移植了他们提供的codec驱动但仍未解决问题。
尝试更改寄存器 DAC Control 3 的 DACSoftRamp值 和 DACRampRate值,但是只是pop不那么刺耳,没有消除pop。
存在问题:
- 上电时有POP声
- 调节音量有POP声
我们打算更换ES8388为更新一代的型号ES8389进行尝试。后续如果有进展我会继续跟进本帖。
我用es8311,也碰到了同样的问题