Feature/background sessions - #261
Draft
lukemarsden wants to merge 3 commits into
Draft
Conversation
**Problem:** API-created apps generate malformed GStreamer video producer pipelines due to missing video_producer_buffer_caps field in the API, while TOML-loaded apps work correctly. **Root Cause:** The API was missing video_producer_buffer_caps field in three critical places: 1. **API Schema** (reflectors.hpp): ReflType struct missing field 2. **Response Serialization** (reflectors.hpp): from() method omitting field 3. **Request Deserialization** (endpoints.cpp): endpoint_AddApp not populating field This caused video producer to generate malformed pipelines: `waylanddisplaysrc render_node=/dev/dri/renderD128 ! , width=3840, height=2160` (Note the stray comma from empty buffer_format parameter) **Solution:** - Add video_producer_buffer_caps to API ReflType struct as optional field - Add field to response serialization in from() method - Add field to request deserialization with proper NVIDIA GPU default - Use video/x-raw(memory:DMABuf) default for optimal GPU zero-copy performance **Testing:** - TOML apps: Continue working as before - API apps: Now generate proper pipelines and stream successfully - Backwards compatible: Missing field gets sensible defaults **Files Changed:** - src/moonlight-server/events/reflectors.hpp: Add field to schema and serialization - src/moonlight-server/api/endpoints.cpp: Add field to deserialization with defaults Fixes API-created apps failing to start streaming due to GStreamer syntax errors.
- Add auto_start_containers configuration flag - Create background sessions with virtual clients when apps are added - Implement session reuse by app ID for multiple client support - Add stop protection for auto-started background sessions - Include full video/audio streaming pipeline for background sessions - Support iPad resolution (2360x1640@120fps) for all auto-started sessions This enables Personal Dev environments to run continuously in background without requiring Moonlight clients, while supporting multiple clients connecting to the same running session.
- Preserve background session display mode instead of creating new session with client's requested mode - Prevents GStreamer DMA buffer format transformation errors - Resume logic now correctly maintains 2360x1640@120fps from background session - Moonlight clients adapt to server's display mode automatically - Video and audio pipelines start successfully on resume - RTSP handshake completes without format negotiation errors Issue: Input devices still missing, causing session pause after successful pipeline start
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.