Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pipeline_http_mp3播放卡顿,并且ringbuffer报timeout (AUD-5904) #1323

Open
casitelwithdean opened this issue Dec 3, 2024 · 1 comment

Comments

@casitelwithdean
Copy link

casitelwithdean commented Dec 3, 2024

ESP32S3-BOX-LITE,开启了PSRAM
ADF版本为最新的master
IDF版本为5.2.1
在使用pipeline_http_mp3的例程,官方的音频不会卡顿,但是播放自己服务器上的音频就会卡顿,并且有的卡顿,有的不卡顿。(应该不是网络的问题,换了好几个网络都是这样)
代码里我只修改了buffer_size,

    ESP_LOGI(TAG, "[2.1] Create http stream to read data");
    http_stream_cfg_t http_cfg = HTTP_STREAM_CFG_DEFAULT();
    http_cfg.out_rb_size = 200 * 1024,

    http_stream_reader = http_stream_init(&http_cfg);

    ESP_LOGI(TAG, "[2.2] Create i2s stream to write data to codec chip");
    i2s_stream_cfg_t i2s_cfg = I2S_STREAM_CFG_DEFAULT();
    i2s_cfg.type = AUDIO_STREAM_WRITER;
    i2s_cfg.out_rb_size = 200 * 1024,
    i2s_stream_writer = i2s_stream_init(&i2s_cfg);

    ESP_LOGI(TAG, "[2.3] Create mp3 decoder to decode mp3 file");
    mp3_decoder_cfg_t mp3_cfg = DEFAULT_MP3_DECODER_CONFIG();
    mp3_cfg.out_rb_size = 200 * 1024,

    mp3_decoder = mp3_decoder_init(&mp3_cfg);

然后我在

ret_val = RB_TIMEOUT;
这里添加了打印,发现播放时打印RB_TIMEOUT。但我已经把ringbuffer的size设置的很大了,并且在sdkconfig里的wifi设置如下:

CONFIG_ESP_WIFI_ENABLED=y
CONFIG_ESP_WIFI_STATIC_RX_BUFFER_NUM=16
CONFIG_ESP_WIFI_DYNAMIC_RX_BUFFER_NUM=96
CONFIG_ESP_WIFI_STATIC_TX_BUFFER=y
# CONFIG_ESP_WIFI_DYNAMIC_TX_BUFFER is not set
CONFIG_ESP_WIFI_TX_BUFFER_TYPE=0
CONFIG_ESP_WIFI_STATIC_TX_BUFFER_NUM=32
CONFIG_ESP_WIFI_CACHE_TX_BUFFER_NUM=64
CONFIG_ESP_WIFI_STATIC_RX_MGMT_BUFFER=y
# CONFIG_ESP_WIFI_DYNAMIC_RX_MGMT_BUFFER is not set
CONFIG_ESP_WIFI_DYNAMIC_RX_MGMT_BUF=0
CONFIG_ESP_WIFI_RX_MGMT_BUF_NUM_DEF=5
# CONFIG_ESP_WIFI_CSI_ENABLED is not set
CONFIG_ESP_WIFI_AMPDU_TX_ENABLED=y
CONFIG_ESP_WIFI_TX_BA_WIN=6
CONFIG_ESP_WIFI_AMPDU_RX_ENABLED=y
CONFIG_ESP_WIFI_RX_BA_WIN=32
CONFIG_LWIP_MAX_ACTIVE_TCP=16
CONFIG_LWIP_MAX_LISTENING_TCP=16
CONFIG_LWIP_TCP_HIGH_SPEED_RETRANSMISSION=y
CONFIG_LWIP_TCP_MAXRTX=12
CONFIG_LWIP_TCP_SYNMAXRTX=12
CONFIG_LWIP_TCP_MSS=1440
CONFIG_LWIP_TCP_TMR_INTERVAL=250
CONFIG_LWIP_TCP_MSL=60000
CONFIG_LWIP_TCP_FIN_WAIT_TIMEOUT=20000
CONFIG_LWIP_TCP_SND_BUF_DEFAULT=5760
CONFIG_LWIP_TCP_WND_DEFAULT=65535
CONFIG_LWIP_TCP_RECVMBOX_SIZE=6
CONFIG_LWIP_TCP_QUEUE_OOSEQ=y
CONFIG_LWIP_TCP_OOSEQ_TIMEOUT=6
CONFIG_LWIP_TCP_OOSEQ_MAX_PBUFS=0

请问出现这种RB_TIMEOUT应该怎么解决呢?

测试音频如下
卡顿音频:http://openpin3-cdn.z33.fun/static//voice/output/1733068065.911701.mp3
不卡顿音频:http://openpin3-cdn.z33.fun/static//voice/output/1733138879.7853725.mp3

@github-actions github-actions bot changed the title playing_http_mp3播放卡顿,并且ringbuffer报timeout playing_http_mp3播放卡顿,并且ringbuffer报timeout (AUD-5904) Dec 3, 2024
@casitelwithdean casitelwithdean changed the title playing_http_mp3播放卡顿,并且ringbuffer报timeout (AUD-5904) pipeline_http_mp3播放卡顿,并且ringbuffer报timeout (AUD-5904) Dec 5, 2024
@jason-mao
Copy link
Collaborator

@casitelwithdean HTTP 音频出现timeout 一般是下载侧太慢,你提供的两个音频基本一样。你单独测试一下你下载音频的速度。我测试pipeline_http_mp3,用 默认配置可以流畅播放。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants