Summary
Make the browser WebRTC stream available on Linux as an opt-in build (-DSUNSHINE_ENABLE_WEBRTC=ON). No file under src/ changes: src/webrtc_stream.cpp already has the Linux paths and compiles and runs as is. The gaps were the libwebrtc build, CMake wiring, packaging and one runtime crash in the wrapper.
Commits
feat(webrtc): add Linux libwebrtc build and CMake supportscripts/build_linux_webrtc.shsyncs, builds and stageslibwebrtc.soin the same shared cache layout the Windows script uses.cmake/dependencies/linux.cmakeincludeswebrtc.cmake.- The non-Windows library lookup in
webrtc.cmakenever worked:find_libraryskips its search when the cache entry is empty, which the declaration above it leaves it as. The entry is now unset first. libwebrtc.sois installed with the binary and found through an install RPATH of$ORIGIN/../lib.docs/building.mddocuments the Linux build.
fix(linux): accept libwebrtc.so in local deploy payloadslinux_local_deploy.pyrejectedusr/lib/libwebrtc.soas an unexpected artifact.- It also required
vibepollo-profile-normalize.pyandpairing_migration.pyunderusr/libexec/vibeshine. Nothing in the repo installs them, so every payload failed the required-artifact check. I removed those two names. This is not WebRTC-specific; say so if you want it split out.
chore(webrtc): update libwebrtc for dummy audio device fallback- Submodule bump for Nonary/libwebrtc#1. Without that change the host process aborts on the first WebRTC session when no sound server is reachable (
Check failed: 0 == adm->Init()).
- Submodule bump for Nonary/libwebrtc#1. Without that change the host process aborts on the first WebRTC session when no sound server is reachable (
Dependency
The submodule bump points at commit a5d6f75, which currently exists only on CodyECSL/libwebrtc through Nonary/libwebrtc#1. This PR is a draft until that is merged or the commit is otherwise reachable on Nonary/libwebrtc. If it is squashed, the pointer needs updating.
Changing the wrapper changes the cache key computed by scripts/get_webrtc_cache_keys.ps1 (it hashes HEAD:third-party/libwebrtc), so I expect Windows CI to rebuild libwebrtc. I have not run Windows CI.
Testing
Tested manually on one host. Arch-family CachyOS, kernel 7.2.9, RTX 3080 Ti, built through linux_local_deploy.py with the pinned CUDA 12.9.1 toolkit and GCC 14, installed as a package, WebRTC session started from the browser UI.
- The session connected and the browser showed live H.264 video (overlay showed about 115 FPS).
- Audio plays.
- Mouse and keyboard work on the desktop.
- Mouse input does not work properly inside a game (Red Dead Redemption 2). I did not investigate further.
- Reconnect and teardown work.
- Running a Moonlight session and a WebRTC session at the same time does not work.
- A gamepad connects (the host log shows it emulated as an Xbox One or DualShock 5 controller). I did not try it in a game.
- Rebuilding libwebrtc on the host with the script reproduces the same
libwebrtc.sochecksum as a second machine. - The script's argument handling, staging and cleanup guard were checked against stub
gnandninja.
Not tested: HEVC, AV1 and HDR, Linux firewall rules for the WebRTC UDP ports, and any Windows build.
Notes
- The build script defaults to
m125_releaselike the Windows script.docs/building.mdalso mentionsm137_releasepluscustom_audio_source_m137.patchfor a manual build; I did not determine which one is correct. linux_local_deploy.pynever passes-DSUNSHINE_ENABLE_WEBRTC=ON. To deploy a WebRTC build, preconfigurebuild/with that option first.- Capture needs a CUDA build on this host. A
--cuda offbuild gave a black stream because capture fell back to software GL. That is the same for any stream, not specific to WebRTC. - Existing gap, not addressed here:
docs/building.mdanddocs/linux/local-development.mddo not list the Arch packages the local deploy flow needs (vulkan-headers,appstream-glib,libxml2-legacy, andgcc14from the Arch Linux Archive). They appear only inpackaging/linux/Arch/PKGBUILDandci-archlinux.yml. The docs also do not explain the private CUDA 12.9.1 toolkit setup.
This was written with AI assistance (Claude Code). The manual testing is described above.
🤖 Generated with Claude Code
Activity
3This pull request is a draft
Merging is unavailable until it is marked ready for review.