Control messages #
Rubylight docs › For developers · Configuration · Microphone
Besides Moonlight's own control messages, Rubylight takes a few of its own from the client. Their wire formats are defined once, in the rubylight-protocol crate of Nightjar (protocol/core, client/protocol/core in this repo), which the host and Nightjar both build. This page is for client authors.
Negotiation #
From 2.2.0 the host's RTSP DESCRIBE answer lists the Rubylight control messages it takes. The first line lists the built-in messages (0x5530 is omitted when phase_lock = false, and 0x5538 is omitted when bitrate_adaptation = off):
a=x-rl-control:0x5530,0x5531,0x5532,0x5533,0x5534,0x5535,0x5536,0x5537,0x5538
A second line lists the messages offered by setting or by launch request (3.0 extensions). Read every a=x-rl-control: line and merge them. Send a message only when its id is listed. Older hosts and other Moonlight hosts do not send the line; to them, send none of these messages. A host ignores control message ids it does not know.
PyroWave hints in the RTSP ANNOUNCE #
A PyroWave client (record framing, pyrowaveAdaptiveFec or pyrowaveFeatures bit 0) may add these SDP attributes. A host that does not know a key ignores it, so a client sends them unconditionally.
| Attribute | Value | Host behaviour |
|---|---|---|
x-ss-video[0].pyrowaveLinkMbps |
the client's wired link, Mbps | Caps the requested bitrate at 80% of the link (network_pacing). |
x-ss-video[0].pyrowavePaceMbps |
the pace the client's calibration found loss-free, Mbps | The sender's pacing rate when present (network_pacing). |
x-ss-video[0].pyrowaveRowOrder |
1 |
Sends the fine records of each 64-row picture band together, with what a band needs before the next band's, after the coarse records as always. Any other value, or no key, keeps the order by block index. A value that is not a number fails the ANNOUNCE, like the other numeric keys. |
Row order changes only the order of the records and the padding between packets (within 1% of the size on the test fixtures). Every record still carries its own block index, so a client that sorts or places records by index decodes either order. Under a lost tail, row order loses the last rows at every level and index order the finest level of the bottom rows; the coarse records and the critical FEC block are the same in both.
Framing #
Each message travels on the control stream like Moonlight's client-to-host control messages: the 16-bit message type, then the payload, encrypted when the session encrypts its control stream. All fields are little-endian. Every payload starts with a version byte, currently 1. A newer client may append fields; the host reads the fields it knows and ignores the rest. A payload that is too short, has another version or carries implausible values is ignored (logged at debug).
| Id | Name | Crate type | Host behaviour |
|---|---|---|---|
0x5530 |
Phase lock report | phase_lock::Report |
Times captures to the client's display latch while reports arrive about every 500 ms and phase_lock is enabled; after 3 s without one (or when phase_lock is turned off) the host returns to its own pacing. |
0x5531 |
Display luminance | control::DisplayCaps |
Records the client's screen capabilities, and targets Dolby Vision metadata at its peak (below). |
0x5532 |
Reconfigure | control::Reconfigure |
Changes the stream's resolution or frame rate without reconnecting (below). |
0x5533 |
Controller speaker | none (host: controller_audio::SPEAKER) |
Host to client: the virtual DualSense's speaker PCM (DualSense haptics). |
0x5534 |
Controller microphone | none (host: controller_audio::MICROPHONE) |
Client to host: the physical controller's microphone PCM. |
0x5535 |
Controller audio state | none (host: controller_audio::CONTROL) |
Both ways: capability, mute and volume state of controller audio. The wire formats of 0x5533-0x5535 are in Nightjar's DualSense guide. |
0x5536 |
Host timing | control::HostTimingRequest |
Sends reports of where each new picture's time went on the host, after its last packet left (below). |
0x5537 |
Clock sync | control::ClockSyncRequest |
Answers at once with a control::ClockSyncReply on the video RTP clock (below). |
0x5538 |
Link notice | control::LinkNoticeRequest, control::LinkNotice |
Tells the client when it lowers the video bitrate for the network, and when it is back (below). |
0x5508 |
Clipboard sync | clipboard_sync::Frame |
Both ways: puts the client's copies on the PC's clipboard and sends the PC's copies back. Listed on the second a=x-rl-control line only for a /launch or /resume with rlClipboardSync=1 from a device that may view and read or write the clipboard. The frame is Moonlight V+'s: version 1, kind (1 UTF-8 text, 2 PNG, 3 blob reference, which the host refuses), a u32 echo token, a u32 length and the payload, at most 65500 bytes in all. An empty text frame starts the PC's copies without touching its clipboard. The client's copies need "Write to the clipboard", the PC's "Read the clipboard", PNGs clipboard_image; a frame that comes back with a token the sender used recently is dropped. |
0x5536 host timing #
A client asks for per-picture host timing and the host answers with reports; Moonlight's frame header holds only one host latency, written before the first packet, so it cannot hold the send.
The request is 4 bytes: version 1, a flags byte (bit 0 turns reports on, 0 turns them off) and two reserved bytes. Send it once the stream starts. The host sends no reports to a client that did not ask, and keeps nothing for it.
The host answers on the same message type, unreliably. A report is a 4-byte header, version 1, the record count, extra (see below) and a reserved byte, followed by count 20-byte records of five 32-bit words:
| Word | Field | Meaning |
|---|---|---|
| 0 | frame |
The frame number in the video packets (Moonlight's frame index). |
| 1 | host_us |
The picture's present stamp to its last packet handed to the socket. |
| 2 | queue_us |
Present to the encoder taking the picture: capture, the wait for the claim and the conversion. |
| 3 | encode_us |
The encoder taking the picture to the encoded frame in the host's hands. |
| 4 | send_us |
The first packet to the last one handed to the socket. |
host_us = queue_us + encode_us + residual + send_us; the residual (waiting for the sender and packetizing) is what the named stages leave. A record whose stages add up to more than host_us rejects the whole report. Only new pictures get a record, not static repeats.
The extension #
Header byte 2, extra, is the number of bytes per record in a trailing block: 0 in a v1 report, 16 from Rubylight 3.0. The version stays 1. After the count records, count × extra bytes follow, one entry per record, in the same order:
| Offset | Field | Meaning |
|---|---|---|
| 0 | presented_at_us (u64) |
The capture's present stamp, in microseconds on the video RTP clock (the clock of clock sync). |
| 8 | capture_us (u32) |
Present to the picture acquired. |
| 12 | convert_us (u32) |
The host's claim of the picture to the encoder taking it. |
A reader takes the first 16 bytes of each entry and skips the rest, so later fields can be appended. The extension is valid only when capture_us + convert_us <= queue_us; a client drops the extension of a record that breaks this, or of a report that is cut short, and keeps the base records. With it, a client has every host stage on the host clock: capture present P = presented_at_us, acquired P + capture_us, submitted P + queue_us, encoded P + queue_us + encode_us, last packet sent P + host_us, first packet sent P + host_us - send_us. Hold and claim are queue_us - capture_us - convert_us. The game's own present is the frame's RTP timestamp.
An extended report carries at most 17 records (616 bytes). The limit is not the ENet packet size: older Nightjar builds' patched moonlight-common-c hands a 0x5536 message to its Java layer only when it is at most 644 bytes (a v1 report of 32 records) and drops anything longer in native code; 17 extended records (4 + 17 × 36) fit and 18 do not. Current Nightjar accepts up to 1156 bytes (4 + 32 × 36). A v1 report carries up to 32. The Rust and Java decoders check only that the data holds 4 + count × 20 bytes and ignore the rest, so they read an extended report as a v1 one, but only if the transport delivers it. The host sends the extension for H.264, HEVC, AV1 and PyroWave alike.
0x5537 clock sync #
A client probes the host's video clock, NTP style, to map frame timestamps to its own clock. Rubylight's VRR presentation (present_clock in rubylight-protocol) needs no shared clock to schedule frames; clock sync adds the host-present-to-client-present latency.
The request is 16 bytes: version 1, three reserved bytes, a 32-bit sequence number and the client's send time as 64-bit microseconds of its own monotonic clock. The host answers each request with 32 bytes on the same message type, unreliably: version, three reserved bytes, the sequence, the client's time unchanged, then the times the host received the request and sent the reply. Host times are microseconds on the video stream's RTP clock: a frame stamped at t µs carries the RTP timestamp t × 90 / 1000 modulo 2³². The host does not answer before the video stream starts. Four probes a second are plenty; the client keeps the exchanges with the shortest round trips (present_clock::ClockOffset).
0x5538 link notice #
When the link-rate controller lowers the video bitrate because the network between the host and the device lost video, the picture gets softer and nothing else tells the player why. A client that asks hears about it and can say so in its overlay. Without the request the host sends nothing, so stock Moonlight clients never see the message.
The request (client to host) is 4 bytes: version 1, a flags byte (bit 0 turns notices on, 0 off) and two reserved bytes. Send it once the stream starts, to a host that lists 0x5538 in a=x-rl-control. A client that asks while the host is already below the requested bitrate gets the standing notice at once.
The notice (host to client) is 12 bytes, sent reliably:
| Bytes | Field | Value |
|---|---|---|
| 0 | version | 1 |
| 1 | state | 0 full (the requested bitrate), 1 limited (lowered, probing back up), 2 floor (at the lowest bitrate the host uses, and the network still loses video) |
| 2 | reason | 0 none (only with state 0), 1 network |
| 3 | reserved | 0 |
| 4-7 | ceiling | the video bitrate the client asked for, as the encoder is given it, in kbps |
| 8-11 | current | the encoder bitrate now, in kbps |
The host sends one on each change of the controller's state or bitrate: a step down, a probe up, a failed probe, a floor, and the return to full. It sends at most one a second; when changes come faster, the newest follows when the second is up, and a return to full is never dropped. A change of state goes out when the second is up. A bitrate that only moves inside one state is calmed so the overlay does not flicker: it goes out after 5 seconds, or after the second when it moved by more than a tenth of the last one sent. A second enable request repeats the standing limit. It also sends the return to full when a reconfigure (0x5532) rebuilds the controller or the client takes over the bitrate itself (/bitrate). The first notice a client gets is never state 0; it assumes full. A client clears its notice on state 0. A payload that is shorter, has another version, state or reason, has a zero bitrate, or pairs state 0 with a reason or another state with none is ignored. The notice is off the video send path and adds no latency to it. LinkNotice::decode in rubylight-protocol parses it.
0x5531 display luminance #
Send it once the control stream is connected and again whenever the display changes, for example when a foldable switches screens or the window moves to another display. Sending the same values again is harmless; the host logs only changes. Brightness changes on the same screen do not need another report.
| Bytes | Field | Value |
|---|---|---|
| 0 | version | 1 |
| 1 | flags | bit 0: the display can show HDR (HDR10 or HLG) right now |
| 2–3 | reserved | 0 |
| 4–7 | peak | peak luminance in hundredths of a nit (1000 nits = 100000); 0 if unknown |
| 8–11 | average | maximum frame-average luminance in hundredths of a nit; 0 if unknown |
| 12–15 | black | minimum luminance in ten-thousandths of a nit (0.0005 nits = 5); 0 if unknown |
The host ignores a message whose peak is outside 1–10,000 nits, whose average is above the peak, or whose black level is 1 nit or more.
The host logs the reported values for diagnostics. The reported peak is also the target display luminance of the Dolby Vision metadata the host writes (level 2); without a report that is the host display's peak, else 1000 nits. The values do not replace HDR10 mastering luminance, MaxCLL, MaxFALL or black level, change the virtual display, or trigger an HDR mode update.
HDR10 metadata describes the captured source and the light levels of its pixels. Receiver capabilities are not content light levels. Earlier versions substituted the client's luminance without tone-mapping the pixels, which could change Android tone mapping and restart its decoder when brightness reports changed. The stream now keeps the source metadata; genuine source HDR changes still update the control message and encoded bitstream. An HDR profile or peak brightness selected on the host continues to configure the source display before capture.
0x5532 reconfigure #
A client whose display changes during a stream, such as a foldable phone opening its inner screen or a window being resized, can ask for another size and rate. The stream continues on the same connection; there is no new RTSP exchange.
The message #
Send it on the encrypted control stream like any other control message (the keyframe request 0x0302, for example), with type 0x5532 and this 12-byte payload, little-endian:
| Bytes | Field | Value |
|---|---|---|
| 0 | version | 1 |
| 1 | reserved | 0 |
| 2–3 | width | pixels, even, 256–8192 |
| 4–5 | height | pixels, even, 256–8192 |
| 6–7 | reserved | 0 |
| 8–11 | frame rate | thousandths of a frame per second, 10 000–500 000 (120 fps is 120000, 59.94 fps is 59940) |
A payload that is shorter, has another version or has a value outside these limits is ignored. Reconfigure::encode in rubylight-protocol (rp_reconfigure_encode in C) writes it.
What the host does #
- It waits for the client to settle. The latest request is applied once no other has come for 200 ms, so a window being dragged or a hinge moving causes one switch, not many. Repeating the same request does not extend the wait. The host switches at most once a second; a request that comes sooner waits for that.
- A request for the current size and rate changes nothing, and withdraws a request still waiting.
- The switch happens between frames. The encoder is recreated at the new size and rate, and its first frame is a keyframe whose sequence header (SPS/PPS for H.264 and HEVC, the sequence header OBU for AV1) carries the new size. Frames already encoded at the old size can still arrive before it. Frame numbers continue without a gap.
- Pacing follows the new rate. A phase lock (
0x5530) is released at a rate change and locks again from the client's next reports. - The PC's display keeps its mode. The picture is scaled to the new size on the GPU, keeping its aspect ratio, with black bars where the shapes differ. Absolute mouse, touch and pen positions follow the new size. The display's refresh rate and a game's frame limit stay as they were set when the stream started, so a frame rate above the display's refresh repeats pictures.
- Everything else stays as negotiated: codec, HDR, chroma, bitrate and audio. To change the bitrate as well, use the client's usual bitrate request.
The host does not reply. It keeps the old size when:
- the stream uses PyroWave, whose sender and error correction are sized when the stream starts;
stream_reconfigureis off for the host, the device or the app;- the encoder cannot be created at the new size; it is then recreated at the old size, and the client receives a keyframe at the old size.
The host logs each switch as reconfigure with the old and new mode and how long the switch took, and each refusal as reconfigure refused with the reason.
Client advice #
- Send the message once the new display size is known, and round odd sizes to even ones.
- Keep decoding the old size until the keyframe at the new size arrives, then reconfigure the decoder from its sequence header. On Android, a decoder configured with the largest size the device can show (
KEY_MAX_WIDTH,KEY_MAX_HEIGHT) and adaptive playback takes the new size without being recreated. - Read the size of the picture from the stream, not from the request: the host may have kept the old one.
- Send it only to a host that supports it (Rubylight 2.2.0 and later). Other hosts ignore it, and the stream then keeps its size.
Controller messages of other forks #
The host also takes and sends these, with the wire formats of the projects that defined them. None is listed in a=x-rl-control; each is gated as its origin gates it.
| Id | Direction | Message | Gate |
|---|---|---|---|
0x5500 |
host to client | Trigger rumble | The client's controller arrival (Sunshine family) |
0x5501 |
host to client | Motion event request | The client's controller arrival (Sunshine family) |
0x5502 |
host to client / client to host | RGB LED / frame FEC status (below) | As in moonlight-common-c |
0x5503 |
host to client | Adaptive triggers | The client's controller arrival (Sunshine family) |
0x5504 |
host to client | Steam Controller haptic report | A Steam Controller arrival with capability 0x800 (Vibepollo's format, steam_controller::SteamHaptic) |
0x5505 |
host to client | Steam Controller settings write | A Steam Controller arrival with capability 0x2000 (steam_controller::SteamSettings) |
0x5601 |
host to client | DualSense waveform haptics | Connection feature 0x04 and controller capability 0x8000 (DualSense haptics) |
0x5602 |
host to client | PlayStation controller speaker PCM | Connection feature 0x08, an encrypted control stream (x-nv-general.useReliableUdp 13) and a speaker binding before a PlayStation arrival with capability 0x4000 (Nonary's format, ps_speaker_pcm::SpeakerBlock) |
Error correction reports #
Moonlight's own FEC status message (0x5502, SS_FRAME_FEC_STATUS in moonlight-common-c) needs no announcement. A client that sends it for frames it had to repair or could not rebuild gets adaptive error correction only when it asks for Automatic (rlFecPercentage=auto). The PC's own Adapt error correction (adaptive_fec, off by default, no longer a setting) is retired: it saved traffic but no picture bitrate. A client that does not ask keeps the configured fec_percentage.
Reports are checked against sent frame numbers and deduplicated before they affect a controller.
/api/abr/capabilities retains supported: false for older client controllers
and adds host_adaptive_bitrate (always false: the host controller it named
is retired), client_bitrate_takes_ownership: true and the
host_loss_adaptation feature. A successful authenticated /bitrate request
atomically disables host bitrate and adaptive pacing control for that client's
current sessions. A client should send its current encoder bitrate once when
starting its own controller; no lease renewal is needed. New sessions reset
ownership.
By default (bitrate_adaptation, configuration) the host also lowers the bitrate when the network cannot carry the stream. It reads the same validated 0x5502 reports (frames the client could not rebuild, and the share of packets reported missing), and the standard 0x0200 periodic pings (8-byte payload beginning with little-endian 4) for freshness. The keyframe request 0x0302 and reference invalidation count as network evidence only from a client that sends no 0x5502 at all, and only when the host or the client's decode queue did not cause them. A /bitrate request from the client turns it off for that session.
3.0 extensions #
These are defined for 3.0, in the same crate. A host that takes some of them adds a second a=x-rl-control line to its DESCRIBE answer, after the first, the packed 4:4:4 lines and before the microphone's m=audio. With the default settings it is:
a=x-rl-control:0x5539,0x553b,0x553d,0x553e,0x5543,0x5544,0x5545,0x5546,0x5549,0x554a
The second line appears only when the host offers something, and stock clients ignore it. Each message is also announced in serverinfo or asked for in the launch; send it only when both say so.
| Id | Name | Crate type | Direction | Offered | Serverinfo element |
|---|---|---|---|---|---|
0x5539 |
FEC report | fec_report::FecReport |
client to host | always | FecControlVersion |
0x553A |
USB forwarding | usb::UsbMessage |
both | while usb_forwarding is on and the USB/IP driver is installed |
none (native API feature usb) |
0x553B |
Text input | text_input::TextInputRequest, text_input::TextInputNotice |
both | while keyboard and keyboard_follows_focus are on (the default) |
TextInputVersion |
0x553C |
Rate change | rate_change::RateChangeRequest, rate_change::RateChangeResult |
both | for a launch with rlRateChange=1 |
none |
0x553D |
Pipeline rates | pipeline_rates::PipelineRatesRequest, pipeline_rates::PipelineRatesReport |
both | always | PipelineRatesVersion |
0x553E |
Keyboard layout | keyboard_layout::KeyboardLayout |
client to host | while keyboard is on and keyboard_layout = client (the default) |
KeyboardLayoutVersion |
0x5540 |
Cursor shape request | cursor_shape::CursorShapeRequest |
client to host | while client_cursor is on (the default) and capture is ddx/dxgi, or idd-push (auto virtual display) with a hardware-cursor-capable rubylight-vdisplay driver |
CursorShapeVersion |
0x5541 |
Cursor shape | cursor_shape::CursorShape |
host to client | with 0x5540 |
CursorShapeVersion |
0x5542 |
Cursor position | cursor_shape::CursorPosition |
host to client | with 0x5540 |
CursorShapeVersion |
0x5543 |
Frame Warp request | frame_warp_v2::RequestV2 |
client to host | while frame_warp is on (the default) |
FrameWarpProtocol |
0x5544 |
Frame Warp model | frame_warp::Model |
host to client | with 0x5543 |
FrameWarpProtocol |
0x5545 |
Frame Warp tags | frame_warp::Tags |
host to client | with 0x5543 |
FrameWarpProtocol |
0x5546 |
Frame Warp HUD mask | frame_warp::Mask |
host to client | with 0x5543 |
FrameWarpProtocol |
0x5549 |
Frame Warp meta | frame_warp_v2::FrameWarpV2Meta |
host to client | with 0x5543 |
FrameWarpProtocol |
0x554A |
Stream DVR | stream_dvr::Message (Request, HostState, ClipResult) |
both | always (whether the replay buffer runs is in HostState) |
StreamDvrVersion |
0x5547 |
Transport feedback | transport_feedback::TransportFeedback |
client to host | while bitrate_adaptation is delay (not the default) |
none |
0x554B |
Quick Suspend | quick_suspend::ClientRequest, quick_suspend::HostState |
both | while quick_suspend is manual (not the default) |
QuickSuspendVersion |
0x5548 |
Launch curtain | launch_curtain::CurtainState |
host to client | on a stream whose launch sent rlLaunchCurtain=1, while launch_curtain is on (not the default) |
LaunchCurtainVersion |
0x5508 (clipboard sync, above) goes on the same second line. 0x5506-0x5510 belong to other clients and hosts: Rubylight takes 0x5508 with Moonlight V+'s frame unchanged and defines nothing else there. Nightjar sends 0x5510 (FEC summary, Moonlight V+'s format) only to a host whose DESCRIBE has x-ss-video[0].fecControlVersion, which Rubylight does not send.
The layouts below are little-endian; byte 0 is the version, 1.
0x5539 FEC report (24 bytes) #
| Offset | Type | Field | Rule |
|---|---|---|---|
| 0 | u8 | version | 1 |
| 1 | u8 | flags | 0 (reserved) |
| 2 | u16 | reserved | 0 |
| 4 | u32 | seq | 0 for the stream's first report, then +1 |
| 8 | u32 | data_shards | data shards of the video FEC blocks finished in this interval whose fate the client could see: up to the last shard that arrived in a block that recovered, all of a block that did not, and whole blocks that never arrived |
| 12 | u32 | parity_shards | parity shards of those blocks |
| 16 | u32 | missing_shards | shards of those that never arrived, at most data + parity |
| 20 | u16 | unrecovered_blocks | blocks that lost more shards than they had parity |
| 22 | u16 | interval_ms | the measured interval, 250-5000 (nominally 1000) |
The client sends one every second while 0x5539 is offered, from its first video block on; a second without video sends one with zero shards, which keeps the host's reports fresh. The host acts on it only when the launch asked for rlFecPercentage=auto, and logs it otherwise.
0x553A USB forwarding #
Every message starts with an 8-byte header: 0 version u8, 1 kind u8, 2 reserved u16, 4 request_id u32. The client picks a non-zero request_id, unique per attachment in the stream, and every later message about that device carries it.
| Kind | Direction | Body after the header | Size |
|---|---|---|---|
| 0 ATTACH_REQUEST | client to host | 8 vid u16, 10 pid u16, 12 class u8 (bDeviceClass, or the first interface's class when that is 0), 13 speed u8 (USB/IP: 1 low, 2 full, 3 high, 4 wireless, 5 super, 6 super+), 14 busid_len u8 (1-31), 15 name_len u8 (0-64), then the USB/IP busid in ASCII and the name in UTF-8 |
16 + busid + name |
| 1 TUNNEL_READY | host to client | 8 token [u8; 16]: open the USB tunnel within 30 s |
24 |
| 2 DETACH | both | none. From the client: the user detached or unplugged the device. From the host: it detached the device (console, limit, end of session), so the client stops exporting it. | 8 |
| 3 STATUS | host to client | 8 state u8 (0 attached, 1 detached, 2 refused, 3 failed), 9 reason u8 (0 none, 1 permission, 2 disabled, 3 limit, 4 driver, 5 tunnel timeout, 6 device error, 7 session end), 10 reserved u16 |
12 |
Nothing attaches by itself, and every attachment ends with the session or the connection.
0x553B text input #
The request (client to host, 4 bytes): 0 version; 1 flags, where bit 0 asks for raise and lower notices (0 stops them), bit 1 for the text around the cursor and bit 2 for element ids (TextInputVersion 2; an older host ignores it); 2 max_text u16, 0-4096 bytes, at which the host cuts the text on a UTF-8 boundary.
The notice (host to client, 16 bytes and the text, then from version 2 the element id):
| Offset | Type | Field | Rule |
|---|---|---|---|
| 0 | u8 | version | 1, or 2 with the element id |
| 1 | u8 | kind | 0 lower, 1 raise, 2 update (the field changed while raised) |
| 2 | u8 | input_type | 0 text, 1 number, 2 decimal, 3 phone, 4 email, 5 URL, 6 password, 7 search, 8 multiline |
| 3 | u8 | flags | bit 0 sensitive (never any text), bit 1 no autocorrect, bit 2 no capitalisation, bit 3 Enter is an action |
| 4 | u32 | serial | +1 per notice; apply only a newer serial than the last |
| 8 | u16 | selection_start | UTF-16 code units into text, 0xFFFF when unknown |
| 10 | u16 | selection_end | the same |
| 12 | u16 | text_len | bytes; 0 unless the client asked, text_input_surrounding_text is on and the field is not sensitive |
| 14 | u16 | reserved | 0 |
| 16 | bytes | text | the text around the cursor, UTF-8 |
| 16 + text_len | u32 | element | version 2 only: the focused element's id, never 0, the same while that element lives |
Committed text still travels as Moonlight's UTF-8 text input. A reader takes the fields it knows and ignores any bytes after them.
The host sends version 2 only to a client that set bit 2, and only in raises and updates; a lower names no element and is version 1, and every other client gets version 1 byte for byte. The id is a hash of the element's UI Automation runtime id, so a client can keep its keyboard closed for the one field the user closed it on, also when the focus comes back to that field, and open it for any other.
The host watches the focus (UI Automation) only while a client asked and the device has the Keyboard permission; otherwise it answers nothing and watches nothing. It sends the text around the cursor only over encrypted control. A notice goes out at most every 50 ms with the newest focus winning, and a lower only once no text field has had the focus for 150 ms, so moving between two fields does not flash the keyboard. A focus event that leaves the focus where it was (a tooltip over the field, the host's own window, an app too busy to answer UI Automation) sends nothing. Every request starts afresh: a client that asks while a field has the focus hears a raise at once. A client that never asks, such as stock Moonlight, hears nothing.
0x553C rate change #
A client that wants to change its bitrate or frame rate mid-stream sends rlRateChange=1 with /launch or /resume (0 or nothing is off; any other value fails the launch). Only then does that stream's DESCRIBE list 0x553c; serverinfo has no element, so a stock client's serverinfo and DESCRIBE stay the same.
The request (client to host, 16 bytes): 0 version, 1 reserved u8, 2 reserved u16, 4 serial u32 (the client's, echoed in the answer), 8 bitrate_kbps u32 and 12 fps_millihz u32 (10000-500000), where 0 keeps a value. A request with both at 0 is invalid as a change and is the query for what the stream runs at: every host that takes 0x553C answers it without changing anything (the encoder's bitrate stays, and so do the host's link-rate and congestion controllers, which a bitrate change makes stand back). Its result carries the stream's bitrate and rate as the host counts them, the bitrate in the unit the host takes requests in, as the query changed nothing; its statuses say so in two ways (the bitrate unchanged and the rate refused as invalid, or both unchanged when the host could not load the device's configuration), and a client reads only the values. Sending that bitrate back leaves the encoder where it is on a host of either kind below, so Nightjar asks first and keeps or steers the bitrate from the answer.
The result (host to client, 20 bytes): 0 version, 1 3 reserved bytes, 4 serial u32, 8 bitrate_kbps u32 and 12 fps_millihz u32, the values the stream runs at, then 16 bitrate_status, 17 bitrate_reason, 18 fps_status and 19 fps_reason, each a u8. Status: 0 unchanged, 1 applied, 2 clamped, 3 refused. Reason: 0 none, 1 invalid, 2 disabled (stream_reconfigure is off), 3 codec (PyroWave or packed 4:4:4 keep their rate), 4 host limit (max_bitrate and the 500 Mbps runtime cap), 5 encoder limit (the encoder's measured throughput at the stream's size), 6 encoder failed (the stream went back to its rate), 7 superseded (a later request replaced it), 255 other (such as a device configuration the host could not load); read an unknown reason as other.
A bitrate is in the unit of the launch, in the request and in the result. A client that sent the bitrate its user set with x-ml-video.configuredBitrateKbps asks in that unit, and the encoder gets what a launch with the number would have: less the share for error correction (fec_percentage), audio and overhead, so 20000 keeps the encoder of a stream launched with 20000 at its 14988. max_bitrate caps the client's number, as at launch. The share is the one the launch took, whatever fec_percentage says by then, since the stream keeps the error correction it started with. A client that sent none asks for the encoder's own bitrate. A result names the stream's bitrate in the same unit, also when it set none: the number last asked for, else the launch's, or the lowest number that gives the encoder what it runs at when max_bitrate capped the launch or the host lowered the bitrate since. Rubylight 6.0.1 and older took every number as the encoder's own, so 20000 raised that encoder to 20000.
The host sets a bitrate at once; the encoder takes it on the next frame, without a keyframe (NVENC on a driver that cannot change the bitrate in place waits for the frames in flight and sends a keyframe, NVENC). A new rate switches like a 0x5532 request, keeping the size the stream runs at or was last asked for, and is answered once the encoder runs at it: about 200 ms after the request, or later when the last switch was under a second ago. Every request is answered once, reliably and in order. Clients send a new request only for a new value, and 0x5532 stays the way to change the size.
0x553D pipeline rates #
The request (client to host, 4 bytes): 0 version, 1 enabled u8 (0 or 1), 2 interval_ms u16 (500-10000).
The report (host to client, 28 bytes): 0 version; 1 flags, where bit 0 means the window was shorter than the interval; 2 reserved u16; 4 window_ms u32; then 8 source_mhz, 12 capture_mhz, 16 submit_mhz, 20 output_mhz and 24 repeat_mhz, each a u32 in millihertz and 0xFFFFFFFF when the host can't count it. In order they are the frames the game or desktop presented, the frames captured, the frames submitted to the encoder, the encoded frames sent and the frames sent again without new content.
The host sends a report unreliably at the asked interval until the client turns them off. It counts the stages at the capture and send stamps it already takes, so the frame path waits on nothing; a stream that changed its capture source counts from the change.
0x553E keyboard layout (8 bytes and the tag) #
| Offset | Type | Field | Rule |
|---|---|---|---|
| 0 | u8 | version | 1 |
| 1 | u8 | source | 0 unknown, 1 Windows KLID, 2 BCP 47, 3 XKB |
| 2 | u8 | tag_len | 0-64 |
| 3 | u8 | reserved | 0 |
| 4 | u32 | klid | for example 0x00000407 (de-DE), 0 when unknown |
| 8 | bytes | tag | ASCII, for example de-DE or de(nodeadkeys) |
The client sends it when the stream starts and whenever the layout changes; the host keeps the latest while keyboard_layout = client, and maps the keys that are not normalized with it. Reports from a device without the Keyboard permission are ignored. The host applies at most one report every 125 ms, always the newest, and reads each layout's file once per stream, up to 16 layouts; a setting change applies without a reconnect.
With always_send_scancodes on (the default), a key the client did not normalize gets the scan code it has on that layout, so it lands where it is on the device's keyboard; keys the layout file does not name (AltGr, the numpad, the keys between the main block and the numpad) keep the host's mapping, which is the same on every layout. Normalized keys keep the US table. A new layout takes over only once no key is held, so every release sends its press's scan code. The host reads the scan code table from the layout's file (Layout File under HKLM\SYSTEM\CurrentControlSet\Control\Keyboard Layouts) and loads no layout into Windows: the user's input switcher shows nothing new during a stream. A layout this PC does not know leaves keys to the host's layout and raises a stream warning.
0x5540, 0x5541 and 0x5542 cursor shape and position #
As Nightjar's cursor shape protocol: a 4-byte v1 request (or 5-byte v2 request with flags bit 0 set to opt into position sync), shapes (0x5541) with an 8-byte header (and for an image 12 more bytes, or 16 in version 2, plus width × height × 4 bytes of RGBA; at most 96 pixels a side unless the client asked for more on a CursorShapeVersion 2 host, up to 127, where a shrunk image also carries its original extent; 32 cached ids on each side), and optional unreliable 12-byte normalized cursor positions (0x5542: 0 version = 1, 1 flags bit 0 = visible, 2 x_norm u16, 4 y_norm u16, 6 reserved u16, 8 seq u32) sent whenever the host cursor moves or toggles visibility while the client opted in. Clients that send a v1 request never receive 0x5542.
0x5543 to 0x5546 Frame Warp #
As Frame Warp and Nightjar's protocol document, version 2 (Frame Warp 2, which replaces version 1). The client sends the 12-byte request once the stream runs; the host then keeps the input history, measures the picture's motion and sends the model (reliable) when it locks, unlocks or changes, a tag for every video frame with the three before it (unreliable, unsequenced) and the HUD mask (reliable) when it changes. A request with enabled 0 stops all three. The request's flags say whether the client draws the lens; only such a client is sent the model's focal length, any other gets 0. The tags' frame numbers are the video frame numbers the client decodes. Nothing is sent to a client that did not ask, and the host does no Frame Warp work for it.
0x5549 Frame Warp meta (40 bytes) #
Protocol. The host lists FrameWarpProtocol 2 and 0x5549 beside 0x5543 to 0x5546; the client's request names the gyro's controller and axes, and the host then sends one meta per tagged frame after its tags, unreliable and unsequenced: the camera confidence, HUD stability, the gyro packet the frame reflects and the gyro's gain, the measured turn rate and the fill hints. Versions do not mix: a host ignores an older client's 8-byte version 1 request and sends nothing for it, and no longer lists FrameWarpVersion, so an older client sees no Frame Warp; a current client sends nothing to a host without 0x5549. The id is in the 0x5548 to 0x554F range introduced in 6.5.
0x554A stream DVR (8-byte header and a body) #
Instant replay and recording on the host (configuration). The host lists StreamDvrVersion 1 and 0x554A whether or not dvr_enabled is on; the state says whether the replay buffer runs for this stream, so a client can explain why a clip cannot be saved. Reliable, both ways. Header: version 1, kind (1 request, 2 host state, 3 clip result), flags u16 (0), request id u32 (the client's, echoed; 0 when the host sends a state on its own).
| Kind | Body |
|---|---|
1 request, client to host |
op u8 (1 query state, 2 save clip, 3 start recording, 4 stop recording), clip seconds u16 (0 = the whole buffer; clamped to 5 and the buffer) |
2 host state |
state u8 (0 off, 1 armed, 2 recording, 3 saving, 4 unsupported, 5 error), reason u8, buffered seconds u16, buffer seconds u16, recording seconds u32, quota used u64, quota limit u64 |
3 clip result |
outcome u8 (0 saved, 1 refused, 2 failed), reason u8, clip seconds u16, file bytes u64, clip id length u16 (at most 64), clip id UTF-8 |
Reasons: 0 none, 1 disabled, 2 pyrowave, 3 disk full, 4 quota exceeded, 5 no keyframe yet, 6 busy, 7 permission denied, 8 audio codec unsupported (passthrough audio), 9 I/O error, 10 not streaming; a value the client does not know reads as unknown. The host answers a query and a start with a state, a save and a stop with a clip result, and sends a state when it changes, while the device has sent a request. A refused start is answered with a clip result (refused and its reason); a stop with nothing recording gets refused with reason none. While a recording runs the state stays recording, also while a clip is written or after a save failed (that save's clip result carries the reason). Saving and recording need an encrypted request. Only the stream's owner with Launch apps may save or record; a guest gets refused, permission denied. A PyroWave stream is unsupported, pyrowave. Unknown ops, kinds and versions are dropped.
0x554B Quick Suspend (9 or 20 bytes) #
Pausing the running game's processes on the host and resuming them (configuration). A host lists QuickSuspendVersion 1 and 0x554B while quick_suspend is manual; a client sends it only then, reliable and encrypted (a plaintext one is dropped). Every frame starts with the same 8 bytes:
| Bytes | Field | Meaning |
|---|---|---|
| 0 | version |
1 |
| 1 | kind |
1 client request, 2 host state |
| 2-3 | flags u16 |
reserved, 0 |
| 4-7 | request_id u32 |
the client's request; the host echoes it, and pushes a change no request caused with 0 |
A client request adds op at byte 8: 1 query the state, 2 suspend, 3 resume. A host state adds 12 bytes: state (0 unavailable, 1 ready, 2 suspended, 3 resuming, 4 refused), reason (0 none, 1 off on the host, 2 no game process the host launched, or only a launcher, 3 anti-cheat, 4 a protected process, 5 a system process or the host, 6 guests, 7 co-op, 8 not the session's owner, 9 a launch or session end under way, 10 no game, 11 Windows failed), the suspended process count (u16) and since when (Unix ms, u64), both 0 unless suspended. A reason a client does not know reads as 11.
The host answers each request on a worker of its own, never on the control loop (requests a device sends while its previous one runs fold into one: at most 16 ids waiting are echoed, the latest suspend or resume always among them, and the rest learn the outcome from those answers), and after a device's first request also tells it each change another device or the console made. Only the device that owns the session, or one with Host control, may suspend or resume; the stream stays connected and shows the game's last frame. The next stream of the game, the session's end, the game's stop, the grace period running out and the host's shutdown resume it first. A host crash leaves the journal quick-suspend.json in the profile, which a watchdog beside the host, or the next host start, resumes.
0x554C Couch Party Audio (24-byte header and optional 12-byte slots) #
Per-listener game/voice balance, voice ducking, per-guest spatial panning, and owner-controlled PC speaker mirroring (client/protocol/core/src/party_audio.rs). The host lists <PartyAudioVersion>1</PartyAudioVersion> in /serverinfo. Only a stream launched or resumed with rlPartyAudio=1 receives a=x-rl-control:0x554C in DESCRIBE and accepts or sends 0x554C packets; stock Moonlight clients see zero new DESCRIBE lines and zero 0x554C traffic. Reliable and encrypted, little-endian:
| Bytes | Type | Field | Meaning |
|---|---|---|---|
| 0 | u8 |
version |
1 (any other version is dropped) |
| 1 | u8 |
opcode |
1 SetOwnMix, 2 SetGuestSlot, 3 SetHostOutput (client to host); 4 StateSync (host to client) |
| 2-3 | u16 |
flags |
bit 0 muted, bit 1 ducking_enabled, bit 2 host_couch_mirror, bit 3 party_active |
| 4-7 | u32 |
revision |
Monotonic party-mix revision |
| 8-9 | u16 |
game_gain_q15 |
0..=32768 (32768 = 1.00x) |
| 10-11 | u16 |
voice_gain_q15 |
0..=65535 (32768 = 1.00x, 65535 ~= 2.00x) |
| 12-13 | u16 |
duck_depth_q15 |
8192..=32768 (32768 = off, 16422 = -6 dB, 8231 = -12 dB) |
| 14-15 | i16 |
target_pan_q15 |
-32767..=32767 (0 = center) |
| 16-19 | u32 |
target_slot_id |
0 for own stream; guest slot id (1..=8) for SetGuestSlot |
| 20 | u8 |
slot_count |
0 for opcodes 1-3; 0..=8 trailing 12-byte slot records for StateSync |
| 21-23 | [u8; 3] |
reserved |
0 |
Each trailing 12-byte SlotSummary in StateSync carries slot_id u32, flags u16 (bit 0 muted, bit 1 speaking, bit 2 is_self, bit 3 is_owner, bit 4 mic_active), gain_q15 u16, pan_q15 i16, and reserved u16 (0). Clients coalesce continuous slider drags to at most 20 Hz (50 ms) and flush the final value on release or sheet close. Only the session owner (or a device with Host control) may send SetHostOutput; a guest's SetHostOutput is refused and answered with an authoritative StateSync. Every slot always excludes its own microphone from its own headphone mix.
0x5548 launch curtain (17 bytes and three texts) #
Where the start of a game on the PC is, so a client can keep its own screen over the stream until the game's window is in front (configuration). A host lists LaunchCurtainVersion 1 while launch_curtain is on; a launch or resume that sends rlLaunchCurtain=1 gets 0x5548 in its DESCRIBE (not a guest's, a co-op player's or a background stream's), and the host sends the state reliable and encrypted when the stream's control peer first polls, on every change, and unchanged every 2 s while the curtain is up. Little-endian:
| Bytes | Field | Meaning |
|---|---|---|
| 0 | version |
1; 0 is refused, a newer one is read as far as this layout goes |
| 1 | phase |
0 preparing, 1 starting the app, 2 waiting for its window, 3 focusing it, 4 attention needed, 5 ready, 6 dismissed, 7 timed out, 8 failed; an unknown phase reads as 5 |
| 2 | flags |
0x01 no game window to wait for (desktop, a launcher's own window, a resume), 0x02 the game's window was seen, 0x04 Windows shows its secure desktop, 0x08 the player may lift the curtain |
| 3 | prompt_kind |
0 none, 1 update, 2 sign in, 3 another prompt, 4 Windows' administrator prompt; an unknown kind reads as 3 |
| 4-7 | sequence u32 |
grows with every frame of a launch; a client keeps the newest |
| 8-11 | elapsed_ms u32 |
since the launch; never shown as progress |
| 12 | launcher_len u8 |
at most 32 |
| 13-14 | title_len u16 |
at most 256 |
| 15-16 | reason_len u16 |
at most 256 |
| 17- | texts | the launcher id (steam, epic, ea, ubisoft, xbox, battlenet, gog, riot, windows), the prompt window's title and the reason, UTF-8 |
Phases 5 to 8 lift the curtain for good. The host looks at the PC every 250 ms while the curtain is up, off the stream's threads: the game's window in front for two looks in a row is 5; a launcher prompt that launcher_watch holds for two looks, or Windows' secure desktop at once, is 4; the launched app ending is 8; 45 s after the launch it is 7 whatever the PC shows. POST /api/native/v1/session/curtain/dismiss makes it 6. A launch with no game window to wait for, a resume and a stream whose launch has no curtain get 5 with 0x01 at once. The host only reads the PC: it never clicks or types into a launcher or a prompt.
A client lifts the curtain on any of those phases, and by itself when the state stops coming for 10 s once pictures arrive; the stream runs underneath the curtain the whole time.
0x5547 transport feedback (20 bytes and the entries) #
Per-packet arrival times of the video stream, for the host's congestion control (configuration). The client sends them only to a host that lists 0x5547 in a=x-rl-control, unreliable and unsequenced, about every 50 ms while video arrives, and drops a report rather than queue it behind a backlog.
| Bytes | Field | Meaning |
|---|---|---|
| 0 | version |
1 |
| 1 | flags |
bit 0: the client skipped ahead, ids between the previous report's end and base arrived too late or never |
| 2-3 | count u16 |
entries that follow, 1 to 480 |
| 4-5 | base u16 |
packet id of the first entry |
| 6-7 | stride u16 |
ids between entries, 1 to 64: every packet at 1, every stride-th id when the packet rate would overflow 480 entries per report |
| 8-11 | seq u32 |
report number, +1 per report |
| 12-15 | base_arrival_us u32 |
the client's arrival clock in microseconds, wrapping; only differences count |
| 16-17 | late u16 |
packets that arrived for ids an earlier report already closed |
| 18-19 | reserved | 0 |
| 20- | entries u16[count] |
arrival of id base + i × stride, in 4 µs units after base_arrival_us (at most 0xFFFE); 0xFFFF when it did not arrive |
The packet id is the 16 bits a datagram carries in the clear: bytes 0-1 little-endian (the low bits of the IV counter) for an encrypted video datagram, the RTP sequence number in bytes 2-3 big-endian otherwise. The client reads it before reassembly, so parity it never needed still counts as arrived. A report is at most 980 bytes. The host keeps no send record until a client's first report, ignores reports it cannot parse, and stops using them when the client sets the bitrate itself.
Pen barrel roll (input packet 0x5500000B, 40 bytes) #
Bytes 0-35 are Moonlight's pen packet (0x55000003) with this magic at offset 4, and its declared big-endian length is 36. Bytes 36-37 are barrel_roll u16, in degrees clockwise from 0 to 359 or 0xFFFF when unknown, and bytes 38-39 are reserved (0). The client sends it instead of the pen packet only when serverinfo has PenBarrelRollVersion and the DESCRIBE answer has a=x-ss-general.penBarrelRoll:1.
Controller identity (input packet 0x55000080, 16 bytes) and the C button #
rubylight_protocol::controller_identity::ControllerIdentity, sent on the controller's gamepad channel before its arrival (0x55000004), so the host knows which controller it is when it picks the virtual pad. After the big-endian length (12) and the magic: controller u8 (0-15), a reserved byte (0), vendor u16 and product u16 (the USB ids the client's controller reports, little-endian) and two reserved bytes (0). A Switch 2 Pro Controller is 057E:2069. Clients send it again when another controller takes the number.
Controller packets carry the Switch 2 controllers' C button as button flag 0x400000 (in the upper 16 bits that Sunshine-family hosts take). The flag is also a Steam Controller's left grip touch (LEFT_GRIP_TOUCH_FLAG), so a client keeps it in every controller packet; only the C press of a Switch 2 controller is dropped for a host without ControllerIdentityVersion (the desktop does that itself).
The client sends the identity only when serverinfo has ControllerIdentityVersion (1), which the host offers while controller is on; Nightjar's capability is controller_identity. Any other host never sees the packet. The magic lies in the block reserved for controller extensions (0x55000080-0x55000087).
Touchpad contacts (input packets 0x55000009 and 0x5500000A) #
A device's physical touchpad (a tablet's keyboard cover, a laptop's precision touchpad) sends its fingers in Foundation Sunshine's touchpad packets, which Moonlight V+ also sends; no new control message is used. The host offers them in the DESCRIBE answer's a=x-ss-general.featureFlags: 0x10 single contacts and 0x20 frames, set while Mouse and Touchpad gestures from devices (native_touchpad) are on and usbip-win2 is installed. A client without the flags keeps its touchpad as a mouse. Fields are little-endian; positions are on the touchpad's own surface.
| Packet | Bytes | Layout |
|---|---|---|
0x55000009 single contact |
40 | event u8 at 8, buttons u8 at 9 (bit 0 the click), rotation u16 at 10, pointer id u32 at 12, width mm u16 at 16, height mm u16 at 18, then x, y, pressure, contact major and minor as f32 0-1 from 20 |
0x5500000A frame |
76 | contact count u8 at 8 (at most 5), buttons u8 at 9, rotation u16 at 10, width mm u16 at 12, height mm u16 at 14, then five 12-byte contacts from 16: event u8, reserved u8, pressure u16, id u32, x u16, y u16 (0-65535) |
Events are Moonlight's touch events (1 down, 2 up, 3 move, 4 cancel, 5 the button only, 7 cancel all). A size of 0 means unknown; the host then uses 105 x 70 mm. The host replays the fingers on a virtual Windows precision touchpad over USB/IP (butterpollo_core::virtual_hid::PrecisionTouchpad) and lifts what a device still holds when its stream ends or loses focus. Nightjar sends frames from Android (SOURCE_TOUCHPAD with pointer capture) and the desktop (Raw Input on Windows, evdev on Linux, the trackpad on macOS).
Controller speaker binding (input packet 0x55000009, 20 bytes) #
Nonary's Moonlight and other clients of Vibepollo's format play a PlayStation controller's speaker from 0x5602 blocks instead of Rubylight's 0x5533. Such a client sets 0x08 in x-ml-general.featureFlags and, right before the controller's arrival on the same reliable input channel, sends a binding: the big-endian length 16, the magic 0x55000009 (little-endian), slot u16 (below 16), version u16 (1) and a nonzero owner u64, all little-endian after the length. The arrival carries capability 0x4000, which means speaker PCM only on a PlayStation arrival (type 2); on a Steam Controller (type 4) it stays LI_CCAP_STEAM_ATTRIBUTES.
The magic is also the single-contact touchpad packet's above. The host tells them apart by exact length before decoding: 20 bytes with length 16 is a binding, 40 bytes with length 36 a touchpad contact, and any other length is neither (rubylight-wire's input_shared_magic_tests prove no packet is both). A binding counts only on a session that negotiated 0x08 over encrypted control with ENet channel 8, only for a slot without a controller, and only once, at that slot's next arrival. A PlayStation arrival without one loses 0x4000. A bound controller gets a USB DualSense on the host even without 0x8000, plays the game's speaker channels within the same controller speaker policy as 0x5533, and gets its sound as 0x5602 blocks on channel 8 (unreliable): version 2, format 1 (48 kHz S16LE stereo), controller, a generation that changes with each binding, sequence, sample position, frame count (at most 240), flags (bit 0 a gap) and the owner, then the samples. Such a controller never gets 0x5533 or 0x5535 too, and the host ignores 0x5535 for it. Nightjar uses the binding only with a host that offers neither 0x5533 in a=x-rl-control nor touchpad packets (x-ss-general.featureFlags 0x10).
Stream negotiation #
Each is absent until the host offers it.
| Where | Name | Meaning |
|---|---|---|
| serverinfo | HdrFormats |
HDR formats as bits: 1 PQ, 2 HLG, 4 Dolby Vision 8.1, 8 Dolby Vision 8.4, 16 Dolby Vision 10.1; and offer flags, which are not formats: 128 HLG is also offered on PyroWave Main10 streams, 64 Dolby Vision 8.1 can be full range |
DESCRIBE |
a=x-rl-video.hdrFormats:{bits} |
the formats this stream can carry, with the same offer flags (128: HLG on PyroWave; 64: Dolby Vision 8.1 can be full range) |
ANNOUNCE |
x-rl-video[0].hdrFormat:{bit} |
one format; 0 or absent is Moonlight's HDR (PQ). It needs HDR on; Dolby Vision 8.1 and 8.4 need HEVC, 10.1 needs AV1, and HLG needs HEVC or AV1, or PyroWave when flag 128 was offered. An offer flag is never a format. A Dolby Vision stream is limited range (the host clears the full-range bit of encoderCscMode), except 8.1 asked for full range with the row below, and every frame carries an RPU, except while the stream has fallen back to SDR, or for a whole stream that is 4:4:4 or 10-bit SDR. A client must keep frames without one from a Dolby Vision decoder |
ANNOUNCE |
x-rl-video[0].dolbyVisionFullRange:1 |
the Dolby Vision 8.1 stream is full range, and its RPUs carry the full-range YCbCr-to-RGB matrix and offsets (bl_video_full_range_flag stays 0). Only with flag 64 offered, hdrFormat:4, HEVC, HDR and the full-range bit of encoderCscMode; anything else is refused |
| serverinfo | MaxVideoPacket |
the largest video packet this host can accept, in bytes: 8192, a multiple of 16. This is the capability; the per-stream DESCRIBE value is what the host accepts for that stream. Absent or 0 without jumbo packets |
DESCRIBE |
a=x-rl-max-packet-size:{bytes} |
the largest video packet this stream's path carries: the interface MTU Windows routes to the client through (only when the client is on-link, with no gateway), less the 64 bytes of RTP, UDP and IPv6 headers, rounded down to 16. It is a client's packet size including its 32-byte encryption header, so an encrypted client announces 32 less. 0 or absent on a path of 1500 bytes or less; only a path above 1500 offers a jumbo size |
ANNOUNCE |
x-nv-video[0].packetSize:{bytes} |
Moonlight's video packet size. Above 1400 it must be a multiple of 16, and the host accepts it only up to what that stream offered, refusing anything larger with 400 naming the attribute; the packetizer, its FEC, and the host's PyroWave UDP probe (packetsize, up to 8192) carry it |
| serverinfo | AudioCodecs |
audio codecs as bits: 1 Opus (always set), 2 PCM, 4 AC-3, 8 E-AC-3 |
DESCRIBE |
a=x-rl-audio.codecs:{bits} |
the codecs of this stream |
ANNOUNCE |
x-rl-audio.codec:{bit} |
one codec; 0, 1 or absent is Opus |
| serverinfo | AudioLayouts |
15 (stereo, 5.1, 7.1 and 7.1.4), sent only with 7.1.4 |
DESCRIBE |
a=x-rl-audio.layout714:…, a=x-rl-audio.layout714Hq:…, then a=fmtp:97 surround-params=12,8,4,0,…,11 and …=12,12,0,0,…,11 |
the 7.1.4 Opus layouts (Foundation Sunshine's): channels, streams, coupled streams and 12 mapping entries, comma-separated; the surround-params pair is what Foundation Sunshine sends and Moonlight V+ reads |
ANNOUNCE |
x-nv-audio.surround.numChannels:12, x-nv-audio.surround.channelMask:63039 |
7.1.4 (FL FR FC LFE BL BR SL SR TFL TFR TBL TBR); the launch says surroundAudioInfo = 0xF63F << 16 | 12, Moonlight V+'s AUDIO_CONFIGURATION_714_SURROUND. The host reads the channel count only |
| serverinfo | BandwidthProbeVersion |
the host serves GET /bandwidth-probe?bytes=N on the paired port |
| serverinfo | NvidiaEnhancements |
the NVIDIA image enhancements this PC can run, as bits: 1 RTX HDR, 2 RTX Video enhancement; absent or 0 without the NVIDIA components and where neither runs |
| serverinfo | HdrDynamicControl |
1: the host reads rlHdrDynamic |
| serverinfo | DisplayScaleVersion |
the host reads rlDisplayScale |
| serverinfo | SecondScreenVersion |
the host reads rlSecondScreen |
| serverinfo | RustHostInternetPlayVersion |
paired only: 1 while internet_play is on (else 0): the host serves GET /internet-play/v1 on the paired port and answers hole punches (Play over the internet) |
| serverinfo | ExternalIP |
paired only: the router's public IPv4 address, while upnp or internet_play is on and the host knows it (Moonlight's remote address) |
| serverinfo | QuickSuspendVersion |
1 while quick_suspend is manual: the host takes 0x554B and serves /api/native/v1/session/suspend and /session/resume (feature session.quick_suspend) |
| serverinfo | LaunchCurtainVersion |
1 while launch_curtain is on: a launch may ask with rlLaunchCurtain=1 for 0x5548, and the host serves /api/native/v1/session/curtain (feature session.launch_curtain) |
| launch | rlLaunchCurtain |
1: this launch's stream gets 0x5548 in its DESCRIBE and the curtain's state |
| serverinfo | FrameWarpProtocol |
2 while frame_warp is on: the host takes the 12-byte 0x5543 and sends 0x5544 to 0x5546 and 0x5549. Hosts before 6.5 listed FrameWarpVersion 1 instead, which a current host no longer sends |
| serverinfo | StreamDvrVersion |
1: the host keeps instant-replay clips and takes 0x554A (listed in a=x-rl-control); the native API lists stream.dvr. Whether the replay buffer runs is in 0x554A's host state and GET /api/native/v1/dvr |
| every HTTPS request | rlSecondScreen |
1 marks a request of a paired device's second screen (Nightjar's Dual screen mode). On /launch and /resume it starts or resumes that screen's stream, which the host keeps beside the device's first stream as a device of its own under the same pairing, and lays the two displays out as the user left them. The second screen always has a display of its own: a virtual display beside the first screen's, also when it resumes the game the first screen plays (it never joins the game's display), or, when the device's streams show physical displays, the PC's other monitor (the same one only when there is no other). The second screen's process sends it on every other request too (/bitrate, /api/abr/capabilities, /api/network-path, /api/hardware-metrics, /actions/clipboard, the native API), so each reaches its own stream; without it a request is the device's first screen's. Permissions, the enabled switch and the device's settings are the device's for both screens, except the resolution and scale kept from a stream, which each screen keeps for itself; a second screen takes no Nucleus Co-op seat. Unpairing or turning the device off ends both and releases what both held. Any other value is the device itself |
/launch |
rlDisplayScale |
the Windows scale (text and interface size) of the stream's virtual display in percent, one of 100, 125, 150, 175, 200, 225, 250, 300, 350, 400, 450 or 500; anything else is refused. Sent with or without virtualDisplay=1, since the host may make a virtual display of its own; ignored for a stream on a physical display. It comes before the device, app and host dd_virtual_display_scale, is lowered, with a warning, to the largest the display's resolution allows, and a scale Windows refuses is a warning, not a failed stream. scaleFactor is the render size, not this |
/launch, /resume |
rlFecPercentage |
host or absent keeps the host's settings, auto follows the 0x5539 reports, 0-255 fixes the share; anything else is refused |
/launch |
rlRtxHdr, rlRtxVideo |
1 turns RTX HDR or RTX Video enhancement on for this stream and 0 off, over the app's setting; anything else or absent follows the app. Send each only when its NvidiaEnhancements bit is set |
/launch, /resume |
rlHdrDynamic |
0 leaves HDR10+ and HDR Vivid metadata out of this stream, over hdr_dynamic_metadata; 1 or absent keeps the host's setting; anything else is refused. Dolby Vision RPUs still carry per-frame values. Send it only with HdrDynamicControl |
/launch |
rlConfirmReplace |
1 closes the running game for this launch, as the user's answer to the host's 410 prompt; any other value never closes it and asks again. Absent keeps Vibepollo's rule: the same launch again within 60 seconds confirms |
A host refuses an ANNOUNCE that picks something it did not offer, with 400 and the attribute's name.
Jumbo video packets need an MTU of at least 9000 on every hop: the host's NIC, a virtual switch's physical NIC, a VM's adapter, the switch and the client's adapter. A 1500-byte path (Wi-Fi included) offers nothing, because 1424 saves little and would turn on fragmentation refusal below 1488. The host never sets IP_DONTFRAGMENT/IPV6_DONTFRAG on the shared video socket: a flag set for one stream would govern every stream on the process-wide socket, and a stock client behind a WireGuard or Tailscale tunnel of 1280 bytes would have every datagram refused. The path is checked before the stream: the client runs the PyroWave UDP probe at the announced size (the packet size less 32 bytes, whether or not the stream encrypts, so the probe's own framing keeps the datagram within the path), not at the config value, and the host sets the flag on the probe's own socket for that check, so a hop without jumbo frames is found first. A stream's datagrams then use the OS's normal fragmentation and send accounting.