Skip to content

feat(streaming): add Sunshine-based streaming for split-screen sessions#22

Open
hikaps wants to merge 6 commits into
developfrom
feat/sunshine
Open

feat(streaming): add Sunshine-based streaming for split-screen sessions#22
hikaps wants to merge 6 commits into
developfrom
feat/sunshine

Conversation

@hikaps

@hikaps hikaps commented Jun 2, 2026

Copy link
Copy Markdown
Owner

Summary

Implements streaming support via Sunshine, enabling mixed physical + streaming split-screen sessions. Closes #21.

What it does

  • Adds StreamManager — manages Sunshine subprocess lifecycle with crash recovery and configurable startup timeout
  • Adds SunshineConfig — generates per-instance Sunshine config files with port spacing and codec support
  • Extends InstanceConfig with output mode (physical/streaming) and streaming-specific fields (resolution, FPS, bitrate, codec)
  • Extends D-Bus helper with virtual display and PipeWire null-sink creation for streaming targets
  • Extends SessionRunner for mixed physical and streaming session orchestration
  • Extends VirtualDeviceWatcher to recognize Sunshine virtual input patterns
  • Adds UI for output mode selector and streaming options in SessionSetupPage

New test coverage

  • test_streaming_config — SunshineConfig unit tests
  • test_streaming_session — mixed session integration tests
  • test_streammanager — StreamManager unit tests

Test results

16/18 tests passed

Pre-existing failures (not from this branch):
- test_monitormanager: testMonitorsAsVariantFormat — fails in headless env (no monitors)
- test_couchplayhelper: testVersion — D-Bus slot not implemented on develop either

All 3 new streaming tests pass.

Files changed

  • 87 files, +5,335 / −3,338 lines

hikaps added 5 commits June 2, 2026 12:09
…tance streaming

Add standalone spike scripts that validate Sunshine can run as a
managed subprocess with per-display capture. Covers multi-instance
concurrent execution, virtual display creation, config generation,
and virtual input device detection patterns.
…ine config generator

Add per-instance output mode (physical/streaming) to InstanceConfig with
streaming-specific fields. Extend D-Bus helper with virtual display and
PipeWire null-sink creation. Add SunshineConfig utility for per-instance
config generation with port spacing and codec support.
Add StreamManager for Sunshine subprocess lifecycle with crash recovery
and configurable startup timeout. Extend GamescopeInstance with virtual
output mode for streaming targets. Wire SessionRunner for mixed physical
and streaming sessions with Sunshine device attribution. Extend
VirtualDeviceWatcher to recognize Sunshine virtual input patterns.
Add output mode selector and streaming options (resolution, FPS, bitrate,
codec) to SessionSetupPage with i18nc strings and streaming profile
indicator. Add integration tests for mixed session configuration and
StreamManager link fix in test CMake targets.
Spike validation scripts served their purpose proving the Sunshine
subprocess approach. Remove before merge — production code is in
src/core/StreamManager and src/core/SunshineConfig.
P1 fixes:
- Fix command injection in DestroyNullSink (validate sinkName)
- Remove global D-Bus disconnect breaking multi-stream monitoring
- Guard startStream against entry overwrite during auto-restart
- Write Sunshine credentials.json with proper SHA256(salt+password) format
- Clean up streaming resources on natural gamescope exit
- Fix log_file -> log_path config key

P2 fixes:
- Persist virtual display/null-sink state across helper restarts
- Add port range validation (clamp to [MIN_PORT, MAX_PORT])
- Fix startup timeout dead code (Waiting -> Streaming on grace period)
- Fix stopInstance cleanup order (stop gamescope before destroying display)
- Use per-instance borderless instead of global setting
- Fix ComboBox currentIndex bindings breaking on user interaction
- Add cleanupTestCase to test_sunshine_config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant