peterhinch / micropython-vs1053

Synchronous and asynchronous drivers for VS1053b MP3/FLAC player
MIT License
24 stars 7 forks source link

Glitchy sound #8

Open microplasticos opened 5 months ago

microplasticos commented 5 months ago

I managed to run the sync and async modes on the rpico with the vs1053 breakout, but it sounds glitchy, at 128. Which parameter should I check to control this issue? On Arduino I can play MP3 files smoothly, but one way or another I want to achieve the same with a Raspberry Pi Pico.

Thank you very much.

https://github.com/peterhinch/micropython-vs1053/assets/166957596/db0c36bb-3843-4330-89aa-8a814f8f0056

peterhinch commented 5 months ago

It's hard to be sure. As stated in the docs, the driver has been tested with a Pico at much higher data rates, up to and including FLAC at 700Kbps, so MP3 at 128Kbps should work fine. The most likely cause is lack of bandwidth in accessing the music files. Testing was done with a good quality SD card as the source.

virgileMaon commented 1 week ago

Hello,

I try to use your driver with https://fr.aliexpress.com/item/32966454016.html?spm=a2g0o.order_list.order_list_main.5.26f75e5bDahLw8&gatewayAdapt=glo2fra and an esp32s3 from xiao : https://wiki.seeedstudio.com/xiao_esp32s3_getting_started/

I'have the same glitch as @microplasticos.

Do you think the problem can comes from the value of _INITIAL_BAUDRATE and _DATA_BAUDRATE in vs1053_sync.py? Or this could comes from my circular buffer used to keep the socket data before to send it to player?

Any advice is welcome

Thank you

Regards

peterhinch commented 6 days ago

As per my previous post

The most likely cause is lack of bandwidth in accessing the music files.

Where are your files stored? If you're using an SD card with the official driver you may want to try a higher baudrate.

Although from the sound of your post you're using a socket on a WiFi connection. If so, you're doing something which is outside of my experience - my work with sockets has been low bandwidth applications. I would consider asking a question in discussions on how best to achieve a high bandwidth on a socket connection. Also ask what bandwidth can reasonably be expected.

A circular buffer can help with temporary drops in bandwidth, but it can't rescue you from a mean bandwidth which is too low.

virgileMaon commented 6 days ago

Hi,

Thank you for your answer. Effectively I forgot to precise I build a web radio. I found a clue here : https://github.com/baldram/ESP_VS1053_Library/issues/52 They talk about exactly my problem, if it's work, I will try to adapt your driver.

regards.

peterhinch commented 5 days ago

There is now a built-in circular buffer which you may find useful - as part of the firmware it's written in C so will be fast.

This is an interesting application - if you get something working please let me know.