Browser and Moonlight Streaming Troubleshooting
Steam Headless offers two distinct, high-performance streaming paths:
- Native WebRTC and WebSocket Streaming: Browser-based desktop streaming accessible immediately from any modern web browser without installing client software.
- Sunshine and Moonlight Streaming: Dedicated GameStream-compatible streaming using the standalone Moonlight client for ultra-low latency, multi-gamepad passthrough, and native client decoding.
This guide provides targeted diagnostics for connection failures, video stuttering, latency spikes, and black screen issues.
For Steam Link and Steam Remote Play, see streaming capture layers. It explains why Steam Link captures Gamescope in Gaming Mode while Steam Headless UI and Sunshine capture the outer KWin display, and why one client can show a game or prompt that another cannot.
Symptoms on This Page
| What are you seeing? | Jump to Solution |
|---|---|
| WebRTC stream stays on "Connecting..." indefinitely | WebRTC Sticks at "Connecting..." (UDP 8483 Blocked) |
| WebSocket video stutters, freezes, or catches up rapidly | 2. Choosing Between WebSocket and WebRTC |
| WebSocket disconnects with error 1006 | 2. Choosing Between WebSocket and WebRTC |
| Video micro-stutters, high latency, or frame drops | 3. Video Quality, Micro-Stutters, and Latency Tuning |
| Black screen in browser or Moonlight stream | 4. Black Screen in Browser or Moonlight |
| Moonlight client cannot discover host or PIN pairing times out | 5. Sunshine and Moonlight Pairing Issues |
| Moonlight Error 11: "Failed to start audio/video stream" | 6. Moonlight Error 11: Failed to Start Stream |
| Game streams in a window instead of fullscreen | Desktop and KDE Plasma Troubleshooting |
1. Understanding the Streaming Architecture
2. Choosing Between WebSocket and WebRTC
The web streaming portal provides two connection modes in the Session Controls drawer:
- WebSocket (Default): Streams Annex B H.264 video frames over TCP 8483 to an HTML5 canvas powered by browser WebCodecs.
- WebRTC: Streams real-time media tracks directly over UDP 8483 into an HTML5
<video>element using SRTP encryption and transient DataChannels.
Why WebRTC is Usually the Inferior Choice on LAN (The 40 ms Browser Tax)
For local network (LAN) gaming, WebRTC is almost always the inferior option compared to WebSockets:
- TCP vs UDP Performance is Identical on Fast LANs: WebSockets communicates over TCP, while WebRTC uses UDP. In theory, UDP avoids TCP retransmission overhead. However, on a modern home local network (wired gigabit Ethernet or strong Wi-Fi) with negligible packet loss, the transmission latency difference between TCP and UDP is practically zero (often under 1 ms).
- Zero Buffer Overhead on WebSockets: In WebSocket mode, Steam Headless streams raw video frames straight into the browser's WebCodecs engine. Frames render immediately onto the canvas as soon as they arrive across the network, with zero artificial buffering.
- The Mandatory 40 ms WebRTC Browser Tax: Modern web browsers (including Google Chrome, Microsoft Edge, Mozilla Firefox, and Apple Safari) implement a hard-coded internal jitter buffer for WebRTC video streams, typically set between 40 ms and 50 ms. This buffer is originally intended for video conferencing applications (such as Google Meet) to smooth out audio sync and sporadic packet arrival times. Crucially, web applications have no control over this buffer; browser security and specification boundaries do not allow websites to disable, reduce, or configure it. As a result, choosing WebRTC immediately adds an unavoidable ~40 ms latency tax to your gameplay before a single input is registered.
- When WebRTC is Actually Worth Using: WebRTC only becomes worthwhile when your network connection is so poor that packet loss is continuously interrupting the stream. If you are playing across congested Wi-Fi with high packet drop, mobile phone tethering, or high-latency internet connections, TCP will repeatedly stall while waiting for retransmissions. In those adverse conditions, your connection is already compromised and sub-optimal, but WebRTC's UDP packet-dropping behaviour will at least keep video flowing without the severe video freezes and catch-up bursts typical of TCP.
Modern web browsers enforce an unconfigurable ~40 ms jitter buffer on WebRTC video streams. On a local network, choosing WebRTC taxes your stream with an automatic 40 ms input latency penalty. WebSockets bypasses this buffer completely, making it the superior choice for local play.
When WebSocket Streaming Starts Failing
While WebSockets delivers the lowest latency on stable wired or quiet Wi-Fi networks, certain network conditions can cause playback degradation:
- TCP Head-of-Line Blocking under Packet Loss: WebSockets relies on TCP, which guarantees in-order, lossless packet delivery. When packets are lost or delayed over congested Wi-Fi, mobile broadband (4G/5G), or remote internet connections, TCP halts delivery of all subsequent video frames until the missing packet is retransmitted. Users see this as an abrupt video freeze followed by a disorienting "fast-forward" burst as accumulated frames suddenly render at once.
- Reverse Proxy and Gateway Buffer Overflows: When proxying Steam Headless behind reverse proxies or CDNs (such as Nginx, Traefik, Caddy, or Cloudflare), high video bitrates (e.g. 8 to 20 Mbit/s) can exceed intermediate write-buffer limits. If the client network slows down, the proxy socket buffer fills up, causing ballooning latency or sudden connection termination with code
1006 (abnormal closure). - Browser WebCodecs Decoder Bottlenecks: WebSocket playback uses the browser's WebCodecs
VideoDecoderAPI feeding an HTML5<canvas>. On clients with limited hardware WebCodecs support (such as older laptops, select mobile browsers, or Linux browsers without GPU hardware decoding flags), CPU decoding can struggle to keep pace with 60 FPS streams, causing frame presentation drops and thermal throttling.
When WebRTC is a Better Fit
WebRTC is purpose-built for lossy or fluctuating networks and is the superior choice under the following conditions:
- Packet Loss Tolerance over Wi-Fi and WAN: Because WebRTC transmits video over UDP via RTP, dropped packets do not block subsequent frames. Incomplete frames are safely discarded while the client immediately requests a fresh keyframe over RTCP Picture Loss Indication (PLI), keeping real-time display latency consistent without bursty catch-up playback.
- Dynamic Bitrate Adaptation (GCC): WebRTC actively monitors round-trip time and packet jitter using Google Congestion Control (GCC). When network congestion is detected, GCC dials back the video bitrate smoothly without dropping the connection.
- Hardware-Accelerated Native Video Pipeline: WebRTC decodes video directly into the browser's native
<video>element, fully utilising client hardware decoders and avoiding canvas rendering overhead on lower-power devices.
Switching Connection Mode in the Portal
To switch connection mode:
- Open the Session Controls drawer by clicking the sliders icon on the left rail or pressing Ctrl+Alt+Shift+M.
- Under the Connection mode dropdown, select WebRTC (or WebSocket).
- The preference is stored in your browser's local storage and the stream reconnects automatically using the selected transport.
WebRTC Sticks at "Connecting..." (UDP 8483 Blocked)
The web interface connects over TCP, but desktop video frames require inbound UDP on port 8483. If UDP is blocked by a firewall or ICE fails to negotiate, video streaming cannot start.
What you see
- The desktop display shows a loading spinner with "Connecting...", and streaming video never appears.
- Audio may fail to initialise and the browser console logs ICE connection failures.
How to confirm this issue
- Open browser Developer Tools (press F12) and check the Console tab for ICE failures:
[WebRTC] ICE connection state changed: checking -> failed
- In Chromium-based browsers, open
chrome://webrtc-internalsin a new tab. Under the active peer connection, inspect the ICE candidate pairs. Look for pairs markedstate: succeeded. If all candidate pairs showfailed, UDP traffic is not reaching the container. - Verify that UDP port 8483 is listening inside the container:
docker exec -it steam-headless-a ss -ulpn | grep 8483
Step-by-step resolution
Open Host Firewall Ports:
Ensure UDP port 8483 is permitted on the Docker host:
# Fedora Server / RHEL (firewalld)
sudo firewall-cmd --add-port=8483/udp --permanent && sudo firewall-cmd --reload
# Ubuntu Server / Debian Server (ufw)
sudo ufw allow 8483/udp
Configure STUN for Remote Access:
When connecting across routers or over the internet, choose addresses from the remote browser streaming options and add them to docker-compose.yml:
environment:
SHUI_STUN_URLS: 'stun:stun.l.google.com:19302,stun:stun1.l.google.com:19302'
3. Video Quality, Micro-Stutters, and Latency Tuning
Stuttering, frame pacing drops, or periodic micro-freezes typically stem from encoder saturation, client decode bottlenecks, or local network packet jitter.
What you see
- Video feels choppy or stutters during fast in-game camera motion.
- Periodic micro-freezes followed by quick speed-up bursts.
- Input feels sluggish or delayed behind mouse and keyboard actions.
How to confirm this issue
Press Ctrl+Alt+Shift+D while viewing the stream, or enable the overlay from the Session Controls drawer.
Inspect the latency breakdown:
┌──────────────────────────────────────────────┐
│ Stream Diagnostics (WebRTC 1920x1080@60Hz) │
├──────────────────────────────────────────────┤
│ Bitrate: 4,210 kbps (target: 4,000) │
│ Encode Latency: 3.2 ms │
│ Transit RTT: 1.1 ms │
│ Jitter: 0.4 ms │
│ Packet Loss: 0.0% │
│ Decode Latency: 3.8 ms │
│ Total Frame Age: 14.2 ms │
└──────────────────────────────────────────────┘
Interpreting Metrics:
- Encode Latency > 12 ms: The server GPU video encoder is overloaded.
- Transit RTT > 15 ms or Jitter > 5 ms: Local Wi-Fi interference or network congestion.
- Decode Latency > 15 ms (or ~166 ms on NVIDIA): Client hardware decoding bottleneck or Decoded Picture Buffer (DPB) holdback. See GPU and Hardware Encoding Troubleshooting.
Step-by-step resolution
- Reduce display load: If encode latency is high, reduce the display mode in KDE Display Configuration. For a fresh desktop profile, choose a lower resolution or refresh rate with the
INITIAL_DISPLAY_*options. - Switch to wired Ethernet: If transit RTT or jitter is high, connect the client device via wired gigabit Ethernet.
- Tune bitrate policy: Start with the default adaptive policy so the stream can respond to changing network conditions. A fixed policy can help when testing a stable wired network. Choose the policy and bitrate limits from the streaming options reference, then recreate the container.
- Switch connection transport: If packet loss is causing TCP head-of-line blocking on Wi-Fi, switch from WebSocket to WebRTC in Session Controls to allow frame-dropping without freezes.
4. Black Screen in Browser or Moonlight
A black screen usually indicates that the KWin Wayland virtual compositor has stalled, PipeWire screencast portal buffers are failing to negotiate, or direct DMA-BUF VA-API memory export is incompatible with the host graphics driver.
What you see
- The stream connects successfully and audio plays normally, but the video display remains completely black.
- The desktop background or mouse cursor is visible, but application windows fail to render.
- Moonlight or browser viewer sits on an empty canvas despite active gameplay audio.
How to confirm this issue
- Verify KWin Wayland is running inside the container:
docker exec -it steam-headless-a systemctl --user status steam-headless-plasma.service
- Inspect PipeWire screencast streams:
Look fordocker exec -it steam-headless-a pw-top
kwin_waylandexporting video toshui-mediaorsunshine. Check thatERRcounters are zero andRATEmatches your configured refresh rate (such as 60 or 120).
Step-by-step resolution
- Switch video conversion mode (Intel Skylake and older):
On older Intel GPUs (such as Skylake/Broadwell
i965), direct GPU-memory conversion can produce black frames due to driver incompatibilities. Use the compatible streaming conversion option indocker-compose.yml:Recreate the container:docker-compose.ymlenvironment:SHUI_MEDIA_CONVERSION: 'system'docker compose up -d --force-recreate desktop-a - Restart the container:
Save your game if possible, then restart the container so the desktop compositor and capture services start together cleanly:
docker restart steam-headless-a
5. Sunshine and Moonlight Pairing Issues
Moonlight requires a one-time cryptographic PIN pairing handshake with Sunshine before launching streams. If ports are blocked or pairing times out, Moonlight cannot communicate with the container.
What you see
- Moonlight client fails to discover the container automatically on your local network.
- Manually adding
<CONTAINER_IP>in Moonlight shows the host as offline or pairing requests time out without a PIN prompt.
How to confirm this issue
- Confirm the Sunshine web proxy is reachable in your browser:
https://<CONTAINER_IP>:8483/sunshine
- Check that the Sunshine service is active inside the container:
docker exec -it steam-headless-a systemctl status steam-headless-sunshine.service
Step-by-step resolution
- Pair Moonlight with Sunshine:
- Open your browser and navigate to
https://<CONTAINER_IP>:8483/sunshine. - Log into the web interface with your
steamheadlesscredentials. - Open Moonlight on your client device, click Add Host, and enter
<CONTAINER_IP>. - Note the 4-digit PIN displayed by Moonlight (for example,
1234). - In the Sunshine web interface, navigate to the PIN tab, enter the PIN, and click Send.
- Moonlight immediately transitions to Paired status with a lock badge.
- Open your browser and navigate to
- Verify firewall ports:
Ensure the following Sunshine ports are accessible on the host:
- TCP:
47984,47989,47990,48010(Web administration, pairing, session management) - UDP:
47998,47999,48000,48002,48010(Video, audio, control, microphone) When using macvlan networking, traffic arrives directly at the container's virtual network interface without passing through Docker NAT, so host-level port forwarding is not required.
- TCP:
6. Moonlight Error 11: Failed to Start Stream
Moonlight Error 11 indicates that Sunshine successfully paired and received the launch request, but failed to capture the desktop display or virtual audio sink inside the container.
What you see
- Moonlight shows the container as paired and online.
- Clicking Desktop or Steam Big Picture immediately produces
Failed to start audio/video stream (Error 11).
How to confirm this issue
Inspect Sunshine's recent journal entries inside the container:
docker exec -it steam-headless-a journalctl -u steam-headless-sunshine.service -n 50 --no-pager
Look for errors relating to DRM device access (/dev/dri/renderD128) or PipeWire audio sink initialisation (sink not found or connection refused).
Step-by-step resolution
- Verify GPU render node permissions:
Ensure the container has access to
/dev/dri/renderD128(or your host's active render node) and that the render group ID is mapped correctly in your Compose file:docker exec -it steam-headless-a ls -l /dev/dri/ - Verify PipeWire audio health:
Check that PipeWire and WirePlumber are active inside the container:
If PipeWire failed, restart user audio services:docker exec -it steam-headless-a systemctl --user status pipewire wireplumberdocker exec -it steam-headless-a systemctl --user restart pipewire wireplumber
- Restart the Sunshine service:
docker exec -it steam-headless-a systemctl restart steam-headless-sunshine.service
Next Steps
If streaming is functional but controllers or audio are failing:
- Consult Input and Audio Troubleshooting.
- For system-level resource bottlenecks, see Capacity Warnings and Service Failures.