toverainc / willow

Open source, local, and self-hosted Amazon Echo/Google Home competitive Voice Assistant alternative
https://heywillow.io/
Apache License 2.0
2.61k stars 96 forks source link

sdkconfig: improve TCP performance #352

Closed stintel closed 10 months ago

stintel commented 10 months ago

The default TCP window size is too low for anything but low-latency links. This causes stuttering audio for WIS TTS where the latency between Willow and WIS is 50ms, even for very short responses. Increase the default TCP window size to 16 * MSS (1440), and adapt the receive mailbox size according to the LwIP documentation.

Similar issues could happen with WIS for STT, so let's increase the default TCP send buffer size also.

Both the TCP send buffer and receive window size were 5744 before this change.

While at it, also enable TCP SACK, which can improve overal performance by reducing unnecessary retransmissions.