[PR #506] Apps added over the API never get a display #500

Open
opened 2026-10-15 13:01:03 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/games-on-whales/wolf/pull/506
Author: @tonybart1337
Created: 9/20/2026
Status: 🔄 Open

Base: beta ← Head: fix/api-app-producer-caps


📝 Commits (1)

  • 0ebbd3c fix(api): apps added over the API can stream

📊 Changes

2 files changed (+25 additions, -1 deletions)

View changed files

📝 src/moonlight-server/api/endpoints.cpp (+10 -1)
📝 src/moonlight-server/events/reflectors.hpp (+15 -0)

📄 Description

An app registered through POST /api/v1/apps/add never reaches a compositor.

Reflector<events::App> does not carry video_producer_buffer_caps, so an API-added app is constructed with an empty string, and start_video_producer then formats:

waylanddisplaysrc name=wolf_wayland_source render_node=/dev/dri/renderD128 ! , width=1280, height=720, framerate=60/1 !
interpipesink ...

gst_parse_launch rejects that ([GSTREAMER] Pipeline parse error (recovered): syntax error), the Wayland socket is never created, the app container's Xwayland exits with could not connect to wayland server, and Moonlight shows No video received from host.

Apps loaded from config.toml are unaffected: configTOML.cpp assigns default_video_settings.producer_buffer_caps to each of them. That is also why the same app streams fine right after a Wolf restart and breaks again the next time a client re-adds it over the API.

Change: video_producer_buffer_caps becomes part of the reflector, optional on the wire. An add that omits it inherits the caps from an app that already has them — the value follows from the encoder Wolf picked at startup and from zero copy, which no API client can know, and endpoint_CreateSession already inherits it from a sample app the same way. With no app to inherit from it falls back to video/x-raw rather than an empty string.

Reproduced and verified on Linux/NVIDIA (RTX 5090, nvcodec encoders) with a Moonlight client: before, every API-added app failed as above; after, the same app streams and its runner starts.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/games-on-whales/wolf/pull/506 **Author:** [@tonybart1337](https://github.com/tonybart1337) **Created:** 9/20/2026 **Status:** 🔄 Open **Base:** `beta` ← **Head:** `fix/api-app-producer-caps` --- ### 📝 Commits (1) - [`0ebbd3c`](https://github.com/games-on-whales/wolf/commit/0ebbd3c4e9627e8131aaf39b9abd69f377396273) fix(api): apps added over the API can stream ### 📊 Changes **2 files changed** (+25 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/moonlight-server/api/endpoints.cpp` (+10 -1) 📝 `src/moonlight-server/events/reflectors.hpp` (+15 -0) </details> ### 📄 Description An app registered through `POST /api/v1/apps/add` never reaches a compositor. `Reflector<events::App>` does not carry `video_producer_buffer_caps`, so an API-added app is constructed with an empty string, and `start_video_producer` then formats: ``` waylanddisplaysrc name=wolf_wayland_source render_node=/dev/dri/renderD128 ! , width=1280, height=720, framerate=60/1 ! interpipesink ... ``` `gst_parse_launch` rejects that (`[GSTREAMER] Pipeline parse error (recovered): syntax error`), the Wayland socket is never created, the app container's Xwayland exits with `could not connect to wayland server`, and Moonlight shows *No video received from host*. Apps loaded from `config.toml` are unaffected: `configTOML.cpp` assigns `default_video_settings.producer_buffer_caps` to each of them. That is also why the same app streams fine right after a Wolf restart and breaks again the next time a client re-adds it over the API. **Change:** `video_producer_buffer_caps` becomes part of the reflector, optional on the wire. An add that omits it inherits the caps from an app that already has them — the value follows from the encoder Wolf picked at startup and from zero copy, which no API client can know, and `endpoint_CreateSession` already inherits it from a sample app the same way. With no app to inherit from it falls back to `video/x-raw` rather than an empty string. Reproduced and verified on Linux/NVIDIA (RTX 5090, nvcodec encoders) with a Moonlight client: before, every API-added app failed as above; after, the same app streams and its runner starts. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
games-on-whales/wolf#500
No description provided.