Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1209,6 +1209,7 @@ namespace config {
string_f(vars, "fallback_mode", video.fallback_mode);
bool_f(vars, "isolated_virtual_display_option", video.isolated_virtual_display_option);
bool_f(vars, "ignore_encoder_probe_failure", video.ignore_encoder_probe_failure);
bool_f(vars, "enable_uso", video.enable_uso);

path_f(vars, "pkey", nvhttp.pkey);
path_f(vars, "cert", nvhttp.cert);
Expand Down
9 changes: 9 additions & 0 deletions src/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,15 @@ namespace config {
std::string fallback_mode;
bool isolated_virtual_display_option;
bool ignore_encoder_probe_failure;

/**
* @brief Whether to use UDP segmentation offload (USO) when sending batched video packets on Windows.
*
* Some NIC drivers (notably VirtIO) accept the UDP_SEND_MSG_SIZE control message but silently
* drop the datagram instead of segmenting it, which results in no video ever reaching the client.
* Set to false to send video as regular MTU-sized packets instead.
*/
bool enable_uso = true;
};

struct audio_t {
Expand Down
8 changes: 8 additions & 0 deletions src/platform/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,14 @@ namespace platf {
uint16_t target_port;
boost::asio::ip::address &source_address;

/**
* @brief Whether to use UDP segmentation offload (USO) for the batch.
*
* Only supported on Windows and only meaningful when more than one message
* block is sent in a single call.
*/
bool enable_uso;

/**
* @brief Returns a payload buffer descriptor for the given payload offset.
* @param offset The offset in the total payload data (bytes).
Expand Down
5 changes: 4 additions & 1 deletion src/platform/windows/misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1491,7 +1491,10 @@ namespace platf {
memcpy(WSA_CMSG_DATA(cm), &pktInfo, sizeof(pktInfo));
}

if (send_info.block_count > 1) {
// Only request USO when the user opted in. Some NIC drivers (notably VirtIO) accept the
// UDP_SEND_MSG_SIZE control message but silently drop the datagram instead of segmenting
// it, which breaks video streaming without any error being reported.
if (send_info.enable_uso && send_info.block_count > 1) {
cmbuflen += WSA_CMSG_SPACE(sizeof(DWORD));

cm = WSA_CMSG_NXTHDR(&msg, cm);
Expand Down
1 change: 1 addition & 0 deletions src/stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1519,6 +1519,7 @@ namespace stream {
peer_address,
session->video.peer.port(),
session->localAddress,
config::video.enable_uso,
};

size_t next_shard_to_send = 0;
Expand Down
1 change: 1 addition & 0 deletions src_assets/common/assets/web/config.html
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ <h1 class="my-4">{{ $t('config.configuration') }}</h1>
"max_bitrate": 0,
"minimum_fps_target": 0,
"isolated_virtual_display_option": "disabled",
"enable_uso": "enabled",
},
},
{
Expand Down