Skip to content

Commit

Permalink
sdkconfig: improve TCP performance
Browse files Browse the repository at this point in the history
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 5760 before this
change.

While at it, also enable TCP SACK, which can improve overal performance
by reducing unnecessary retransmissions.
  • Loading branch information
stintel committed Dec 29, 2023
1 parent b5a48f5 commit f2cf29a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sdkconfig.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ CONFIG_LWIP_DHCP_GET_NTP_SRV=y
CONFIG_LWIP_DHCP_MAX_NTP_SERVERS=1
CONFIG_LWIP_LOCAL_HOSTNAME="willow"
CONFIG_LWIP_TCPIP_TASK_AFFINITY_CPU0=y
CONFIG_LWIP_TCP_SND_BUF_DEFAULT=23040
CONFIG_LWIP_TCP_WND_DEFAULT=23040
CONFIG_LWIP_TCP_RECVMBOX_SIZE=18
CONFIG_LWIP_TCP_SACK_OUT=y
CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_MAX_CERTS=1000
CONFIG_MBEDTLS_EXTERNAL_MEM_ALLOC=y
CONFIG_MBEDTLS_HARDWARE_AES=y
Expand Down

0 comments on commit f2cf29a

Please sign in to comment.