Skip to content
← All articles
Project introduction

Artemis Switch: following a frame from the network to the screen

Listen to the audio story

Following a frame from the network to the screen · 2:20 · AI-written script, synthetic voices

Transcript

Ava: Picture a video stream with a perfectly healthy bitrate that still feels late. The numbers look fine, and your thumbs disagree. So where did the time go?

Andrew: That's a sneaky one. If the speed looks fine, where do you even start looking?

Ava: That's the question behind Artemis Switch, Antoine's fork of Moonlight-Switch, a game streaming client for the Nintendo Switch. He focuses on the short trip between receiving a frame and putting it on screen, and asks where each frame waited.

Andrew: So the PC does the heavy lifting, and the Switch just shows the result?

Ava: Exactly. A PC running Sunshine or Apollo sends the game over the Moonlight protocol. On the Switch, the video is decoded with FFmpeg and NVDEC, lands in a small queue, and a graphics layer called deko3d presents it. The client owns everything from that queue onward, so it's easy to tell whose job a hiccup is.

Andrew: Like a restaurant kitchen. Plates come out, wait at the pass, then a server carries them to the table.

Ava: Great picture, and the pass is where Antoine's clever part lives. When frames pile up, the client decides which to keep. It checks the deadline of the oldest frame first, and once the queue is ready, it drops older frames and shows the freshest.

Andrew: Why the oldest frame instead of just the newest?

Ava: If the gate chased the newest arrival, its deadline would keep sliding forward. Frames would keep coming in, but nothing would be shown. Anchoring on the oldest deadline keeps the screen moving, and a backlog can skip the usual wait so a slow renderer catches up.

Andrew: And how do you know it's working?

Ava: A small telemetry piece times each stage separately: decode, queue wait, render, GPU submission, the real video bitrate, and milestones like first packet and first presented frame. It uses a monotonic clock, so timings stay steady.

Andrew: So instead of one vague latency number, you get a timeline for each frame.

Ava: Yes. The app also offers Fit, Fill and Stretch modes, FSR-style upscaling with sharpening, named stream profiles and a performance overlay. Keep the host, scene and network fixed, change one option at a time, and compare queue wait and present intervals, handheld and docked separately.

Andrew: A neat habit for any pipeline.

Ava: Exactly: don't ask how fast the decoder is, ask where each frame waited. The full write-up has the pipeline diagram and the source links.

Artemis Switch application library, from the repository README
Table of contents

A stream can report a healthy bitrate and still feel late. Artemis Switch is my Moonlight-Switch fork for Nintendo Switch, focused on the path between receiving a frame and presenting it. The useful question is not just “how fast is the decoder?” but “where did this frame wait?”

1. A client with a clear boundary

Artemis builds on XITRIX/Moonlight-Switch: Borealis for the interface, the Moonlight/GameStream protocol for transport, FFmpeg/NVDEC for decoding, and deko3d for Switch presentation. Sunshine and Apollo remain PC hosts. Host administration stays in their own interfaces.

This distinction matters when debugging. A wrong virtual-display mode is a host issue; a growing decoded-frame queue belongs to the client. The repository documents host integrations, but that is not evidence that every host/device combination has passed hardware validation.

2. The frame pipeline

flowchart TD
  H["PC host: Sunshine or Apollo"] --> N["Moonlight / GameStream transport"]
  N --> D["FFmpeg / NVDEC decode"]
  D --> Q["Decoded-frame queue"]
  Q --> S["Deadline and freshness selection"]
  S --> R["deko3d presentation"]
  R --> P["Switch display"]
  T["FramePipelineTelemetry"] -. measures .-> D
  T -. measures .-> Q
  T -. measures .-> R

This is a simplified reading of the streaming code, not a claim about measured end-to-end input latency.

3. The subtle part: when to discard old frames

LowLatencyFrameSelection.hpp[1] checks the oldest frame’s deadline before advancing to the newest frame. Once the queue is eligible, it discards older frames and favors freshness. A backlog can bypass the ordinary gate so a stalled renderer catches up.

Why preserve that oldest deadline? If the gate follows the newest arriving frame, its deadline can keep moving forward. The queue receives frames, yet presentation starves. This small policy is more informative than a generic “low latency” label.

4. Measure stages separately

FramePipelineTelemetry.hpp[2] records decode timing, queue wait, client pipeline timing, render and GPU submission cost, actual video bitrate, and first-packet/decode/present milestones. It uses a monotonic clock and protects shared state with a mutex.

“Client pipeline” begins after network completion in this implementation. It does not include every host encoding, network transit, display scanout, and controller delay.

The README also describes Fit/Fill/Stretch presentation, FSR-style upscaling, RCAS sharpening, named stream profiles, and a performance overlay. These are controls to investigate tradeoffs, not a universal FPS promise.

5. What I would compare on hardware

Keep the host, scene, resolution, and network fixed. Compare queue wait and present intervals with pacing options changed one at a time. Then test handheld and docked presentation separately. A lower average with worse spikes may still feel worse.

The project remains active. Its README explicitly separates portable tests and release builds from device validation. Read the installation and status notes before treating a compile result as a gameplay result.

6. Source trail

References

  1. antoinebou12. (). LowLatencyFrameSelection.hpp. [Source file or documentation] github.com.
  2. antoinebou12. (). FramePipelineTelemetry.hpp. [Source file or documentation] github.com.
  3. antoinebou12. (). Artemis-Switch. [Software repository] github.com.

References use this article’s publication date.