Skip to content

Conversation

@cgutman
Copy link
Collaborator

@cgutman cgutman commented Jan 14, 2023

Description

This PR implements a series of network performance optimizations for Windows and Linux.

a0658d0 adds support for send batching on Windows and Linux via a new platf::send_batch() function. This uses UDP segmentation offload to handle the splitting of our video frames into identically sized packets. For NICs that support it, this can even be offloaded to the NIC itself rather than requiring the OS to perform the packet splitting on the CPU. Even for NICs without hardware segmentation offload support, it significantly cuts down on the number of syscalls per frame by an order of magnitude (or two).

054140a implements support for QoS tagging our video and audio streams on Windows using the qWAVE API. This will set a DSCP tag on our outgoing traffic, which may result in prioritization by the local router or wireless AP if it performs QoS scheduling. Even without a QoS-enabled router, the QoS API should prioritize our traffic over other general traffic on the system when scheduling packets to be sent.

d50a6c9 is a trivial fix for a crash I hit while testing the other changes. It happens when the stream terminates without establishing a control stream connection.

b39949e ports over the WLAN media streaming optimization from moonlight-common-c to Sunshine. This puts the NIC in media streaming mode which reduces background scan activity that can cause additional packet loss or network jitter.

Screenshot

Issues Fixed or Closed

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Dependency update (updates to dependencies)
  • Documentation update (changes to documentation)
  • Repository update (changes to repository files, e.g. .github/...)

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated the in code docstring/documentation-blocks for new or existing methods/components

Branch Updates

LizardByte requires that branches be up-to-date before merging. This means that after any PR is merged, this branch
must be updated before it can be merged. You must also
Allow edits from maintainers.

  • I want maintainers to keep my branch updated

@ReenigneArcher ReenigneArcher merged commit fa14b6e into LizardByte:nightly Jan 16, 2023
@Michoko92
Copy link

Great job! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants