LizardByte / LizardByte/Sunshine
Hardcoded DSCP CS6 on audio causes episodic loss on some consumer WiFi; add option to disable QoS tagging
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 41.3k
- Forks
- 2.1k
- Avg merge
- 23h 47m
- Merged PRs (30d)
- 124
Description
### Is there an existing issue for this?
- [x] I have searched the existing issues
### Is your issue described in the documentation?
- [x] I have read the documentation
### Is your issue present in the latest beta/pre-release?
This issue is present in the latest pre-release
### Describe the Bug
Sunshine hardcodes DSCP tags on Linux (`src/platform/linux/misc.cpp`, `enable_socket_qos()`): audio CS6 (48), video CS5 (40), with no config option.
CS6 maps to the WMM AC_VO (voice) WiFi queue, which is unreliable for sustained downlink on some consumer AP/client combinations. On a TP-Link Archer AX10 to a Steam Deck OLED, the audio stream suffered episodic bursty loss (30-60 unrecoverable audio FEC events/min, heard as intermittent severe crackle) while the channel was measured clean (~6% airtime, no neighbor APs, -110 dBm noise, zero client TX retries) and untagged synthetic UDP replicating the exact stream shape had zero loss running concurrently. Video (CS5) was unaffected. The pathology engages per WiFi association, so it appears intermittent and unreproducible.
Stripping DSCP at host egress fixes it instantly (audio drop rate to 0, verified by tone capture on the client):
```
iptables -t mangle -A POSTROUTING -o -p udp --sport 47998:48000 -j DSCP --set-dscp 0
```
Request: a config option to disable DSCP tagging or set the per-type values (e.g. `qos = disabled` or `audio_dscp = 0..63`). Happy to submit a PR. A note in the audio troubleshooting docs would also likely resolve a class of "audio stutters on WiFi but the network is fine" reports.
Related client-side investigation with full measurements: moonlight-stream/moonlight-qt#1978
### Expected Behavior
A supported way to disable or adjust DSCP tagging, without host firewall mangle rules.
### Additional Context
Fix verified over multiple 90 s tone-capture windows and hours of gameplay. The loss is invariant to bitrate (2-20 Mbps), fps (30-90), resolution, and codec, ruling out congestion.
### Host Operating System
Linux
### Operating System Version
Ubuntu 24.04
### Architecture
amd64/x86_64
### Package
Linux - deb
### GPU Type
NVIDIA
### GPU Model
GeForce RTX 2080 Super
### GPU Driver/Mesa Version
580.173.02 (proprietary), X11
### Capture Method
NvFBC (Linux)
### Apps
```json
```
### Log output
```shell
```
### Online logs
_No response_
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/platform/linux/misc.cpp at enable_socket_qos() and trace where the audio and video DSCP values are applied. Review the surrounding configuration and call sites before choosing the supported option shape; done means DSCP tagging can be disabled or adjusted without firewall rules, with behavior covering the requested audio case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, linux
- Domain
- networking
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 66/100