tetele / onju-voice-satellite

An ESPHome config for the Onju Voice which makes it a Home Assistant voice satellite
MIT License
65 stars 9 forks source link

Audio playback stutters #26

Closed jherby2k closed 1 month ago

jherby2k commented 2 months ago

This might be (probably is) an ESPHome issue, but i get stuttering playback (hitches every 10-20 seconds) when streaming an MP3 to the media player component. Are others having this issue, and anyone have a fix or workaround?

Thanks for maintaining this! great work in progress.

tetele commented 2 months ago

This might be addressed in ESPHome 2024.4, but we'll wait and see. UDP does not have package acknowledgement confirmation, hence some packets might have been lost, even though they arrived faster than through TCP.

Either way, it's probably not a config issue, but an ESPHome upstream issue. If 2024.4 does not fix it, i'll look into it further.

jherby2k commented 2 months ago

So sounds like it won't be addressed - the TCP changes in 2024.4 are for voice assistant audio only - i confirmed this on Discord. For media_players, i've been pointed to https://github.com/gnumpi/esphome_audio which sounds promising for multiple reasons (full duplex?). Wondering if you've had a look?

tetele commented 1 month ago

I have, but at the time i did it was lacking in many aspects (the most important of which was the fact that it needed 2 I2S buses, which the Onju does not use), so I gave up due to lack of time.

I'll give it another go once I have some more free time to experiment.

vhsdream commented 1 month ago

@jherby2k Are you using the MicroWakeword variant of the config, or the other one? I ask because I find better stability with streaming audio when I add the PSRAM to the non-MWW config.

tetele commented 1 month ago

That's a fair point. I'll add that bit of config for the OWW variant or maybe you can do a PR for that @vhsdream

vhsdream commented 1 month ago

@tetele Created pull request #37.

jherby2k commented 1 month ago

Thanks vhsdream your fix indeed seems to work.

tetele commented 1 month ago

Fixed in #37