-
Notifications
You must be signed in to change notification settings - Fork 723
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
VoIP example with 16Khz HAL i2s clock: AV_STREAM: audio decoder ringbuf write timeout
(AUD-5988)
#1347
Comments
AV_STREAM: audio decoder ringbuf write timeout
AV_STREAM: audio decoder ringbuf write timeout
(AUD-5988)
For G711 almost use 8K sample rate, if play tone use 16K and SIP call use 8K, better use following config: av_stream_config_t av_stream_config = {
.algo_mask = ALGORITHM_STREAM_DEFAULT_MASK,
.acodec_samplerate = 8000,
.acodec_type = AV_ACODEC_G711A,
.vcodec_type = AV_VCODEC_NULL,
.hal = {
.audio_samplerate = 16000,
.audio_framesize = PCM_FRAME_SIZE,
},
};
av_stream = av_stream_init(&av_stream_config); |
@TempoTian Thank you for the response. Yes, this is what I originally did. I set the If you download the zip file I posted, you will see that I changed to I agree that this should work, but it does not. There is a problem somewhere. Have you tried it yourself? Using your own suggestion you should get the same error. |
I have test the av stream, it works all right if input 8k, output 16k. |
Just to be clear: the error only occurs when you make a SIP call. Are you saying you made a SIP call using 16k HAL rate without getting errors like I showed? In the zip file I gave, the only real change is So the code I gave: In
And:
So in the code I provided, the tone player rate and the |
Environment
Problem Description
Using the
voip_example
, settingav_stream_config.hal.audio_samplerate = 16000
causes write timeouts and watchdogs.The reason I want to do this is because I have stored audio files recorded at 16kHz and I want to play them at 16kHz. I also need to support VoIP SIP calls running at 8kHz.
In IDF 4.x this worked, the i2s would run at 16kHz and a filter would be used in the SIP pipeline to convert the microphone to 8kHz out to SIP, and incoming SIP audio up to 16kHz to play out the speaker.
I haven't been able to get this setup to work in IDF v5 with the new SIP example that uses the
av_stream
component and the newesp_rtc_
APIs.Expected Behavior
The
av_stream
component has logic to filter between theacodec_samplerate
and the.hal.audio_samplerate
. So I would expect to be able to play stored audio at 16kHz when not on a SIP call, and when not playing stored audio connect to SIP calls at 8kHz.This works in IDF 4, but there is no direct translation of code to IDF 5 because if the SIP refactoring. I know the hardware can do it, and the
av_stream
code appears to be able to handle filtering to down/up sample, but it doesn't work.Actual Behavior
It does not work.
Steps to Reproduce
3.1 The voip example doesn't work out of the box. The only way I could get the legacy driver stuff sorted out is to remove all the video functions and esp32-camera dependency from
av_stream
(wich uses esp32-camera). I only need audio stuff anyway. I did this by making a local copy of the components and editing them.components/av_stream/av_stream_hal/av_stream_hal.h
, defineAUDIO_HAL_SAMPLE_RATE
as16000
(leave codec rate at 8kHz)Code to Reproduce This Issue
See attached:
esp32_adf_voip_16k_crash.zip
Debug Logs
Full logs: voip-sip-16k-wdog.txt
Snippet:
The text was updated successfully, but these errors were encountered: