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

BBC radio stream play sound of low quality #941

Open
mifarelight opened this issue Jan 2, 2025 · 6 comments
Open

BBC radio stream play sound of low quality #941

mifarelight opened this issue Jan 2, 2025 · 6 comments

Comments

@mifarelight
Copy link
Contributor

I recently tried to play some BBC link (provided by you in #645), for example: BBC Radio 1.

The sound quality is very good for about 1 second at the beginning of successful connection, but then it gets worse (there is always sound distortion). I checked the log and there is not any abnormal prompt.

I think the network problem (tried wired and wireless network connection) and the audio source problem (VLC/MPC plays well on PC) can be ruled out.

Is it the problem of the decoder? Or the hardware decoding capability is insufficient (I am using ESP32-S3)? Or is it just me who has this problem?

@mifarelight
Copy link
Contributor Author

I manually downloaded the linked m3u8 content.

#EXTM3U
#EXT-X-VERSION:3
## Created with Unified Streaming Platform(version=1.8.4)
#EXT-X-MEDIA-SEQUENCE:271221806
#EXT-X-INDEPENDENT-SEGMENTS
#EXT-X-TARGETDURATION:6
#USP-X-TIMESTAMP-MAP:MPEGTS=7210089888,LOCAL=2025-01-02T12:05:52Z
#EXT-X-PROGRAM-DATE-TIME:2025-01-02T12:05:52Z
#EXTINF:6.4, no desc
bbc_radio_one-audio=96000-271221806.ts
#EXTINF:6.4, no desc
bbc_radio_one-audio=96000-271221807.ts
#EXTINF:6.4, no desc
bbc_radio_one-audio=96000-271221808.ts
#EXTINF:6.4, no desc
bbc_radio_one-audio=96000-271221809.ts
#EXTINF:6.4, no desc
bbc_radio_one-audio=96000-271221810.ts

Each .ts file is 6.5 seconds play length. In my experience, ESP32-audioI2S plays audio streams with segments of more than 5 seconds better than those with segments of about 1 second. So far BBC these links are the exception.

@mifarelight
Copy link
Contributor Author

My test is based on the Arduino framework. In addition to the audio playback task, another task is created. "audio.loop() is placed in the loop() (task priority is 0). Another task uses vTaskDelay combined with a counter to determine the end time of the beep (task priority is also 0). It is normal when playing other links. When playing the BBC link, the audio quality deteriorates and the beep time was extended distinctly.

I suspect that during the playback of the BBC link, downloading or decoding consumes extra time, which affects the FreeRTOS task switching.

@schreibfaul1
Copy link
Owner

I can run BBC Radio 1 without any problems. However, I do not use any other tasks.
It is possible that the ping time on "as-hls-ww-live.akamaized.net" is too long, preferably less than 100ms. For me it is 19ms.
image

@mifarelight
Copy link
Contributor Author

You are right, my ping time is close to 200mS, which seems to be unsolvable for the network I am using.

@mifarelight
Copy link
Contributor Author

Strangely, the VoA online radio station, which also has a ping time of 200mS, can be played smoothly.

It seems that there are other problems with BBC link playback.

@monupurohit
Copy link

i can play stream smoothly with this code
sometime hits issue need to handle buffering

#810

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

3 participants