Add enable_uso option to disable UDP segmentation offload for batched video sends - #1557
Open
JeffreyNijs wants to merge 1 commit into
Open
Add enable_uso option to disable UDP segmentation offload for batched video sends#1557JeffreyNijs wants to merge 1 commit into
JeffreyNijs wants to merge 1 commit into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On Windows, Apollo sends batched video packets using UDP segmentation offload (USO) via the
UDP_SEND_MSG_SIZEcontrol message inWSASendMsg. 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_usoconfig option (defaultenabled, preserving current behavior):src/config.h/src/config.cpp: newenable_usoboolean optionsrc/platform/common.h:enable_usofield onbatched_send_info_tsrc/stream.cpp: populate the flag from configsrc/platform/windows/misc.cpp: only attach theUDP_SEND_MSG_SIZEcontrol message when enabledUsers on VirtIO/VMs can set
enable_uso = disabledinsunshine.conf(or the Audio/Video tab) to send regular MTU-sized packets, which restores video streaming.Verified
Related