Skip to content

Hardcoded DSCP CS6 on audio causes episodic loss on some consumer WiFi; add option to disable QoS tagging #5508

Description

@Catkinsv3

Is there an existing issue for this?

  • I have searched the existing issues

Is your issue described in the documentation?

  • 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 <iface> -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

Log output

Online logs

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions