Skip to content

Add enable_uso option to disable UDP segmentation offload for batched video sends - #1557

Open
JeffreyNijs wants to merge 1 commit into
ClassicOldSong:masterfrom
JeffreyNijs:fix/virtio-uso-send
Open

Add enable_uso option to disable UDP segmentation offload for batched video sends#1557
JeffreyNijs wants to merge 1 commit into
ClassicOldSong:masterfrom
JeffreyNijs:fix/virtio-uso-send

Conversation

@JeffreyNijs

Copy link
Copy Markdown

Problem

On Windows, Apollo sends batched video packets using UDP segmentation offload (USO) via the UDP_SEND_MSG_SIZE control message in WSASendMsg. The code assumes that if USO is unsupported, the call fails and Apollo falls back to unbatched sends.

However, some NIC drivers — most notably Red Hat VirtIO (used in QEMU/KVM/Proxmox VMs) — accept the control message but silently drop the datagram instead of segmenting it. Result: Apollo logs every frame as Sent Frame, the encoder produces normal bitrate, but zero video packets ever reach the network. The client shows "No video received from host" and disconnects after ~10 seconds, while small keepalive packets still flow fine.

Fix

Add an enable_uso config option (default enabled, preserving current behavior):

  • src/config.h / src/config.cpp: new enable_uso boolean option
  • src/platform/common.h: enable_uso field on batched_send_info_t
  • src/stream.cpp: populate the flag from config
  • src/platform/windows/misc.cpp: only attach the UDP_SEND_MSG_SIZE control message when enabled
  • Web UI default entry for the option

Users on VirtIO/VMs can set enable_uso = disabled in sunshine.conf (or the Audio/Video tab) to send regular MTU-sized packets, which restores video streaming.

Verified

  • Reproduced: RX 9070 XT VM (Proxmox, VirtIO NIC), Apollo 0.4.6, Artemis client — no video on the wire despite frames being encoded and "sent"
  • After disabling USO at the NIC level (equivalent to this change), video flows immediately and streaming works end-to-end

Related

Some NIC drivers (notably VirtIO) accept the UDP_SEND_MSG_SIZE control
message but silently drop the datagram instead of segmenting it. This
results in Apollo logging frames as sent while no video ever reaches
the client ('no video received from host' after ~10s).

Add an 'enable_uso' config option (default enabled) so users on such
adapters can disable UDP segmentation offload and fall back to regular
MTU-sized packet sends, which works reliably.
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

Successfully merging this pull request may close these issues.

1 participant