build: add freebsd support
Description
This PR adds initial support for FreeBSD.
Issues:
- no libcap available; therefore no kms capture ... https://www.freshports.org
TODO
- [x] pre-compile FFmpeg in build-deps or in a step before compiling Sunshine - https://github.com/LizardByte/build-deps/pull/459
- [x] fix inputtino
__u16/kernel type errors - https://github.com/games-on-whales/inputtino/pull/30 - [x] fix inputtino uhid error - https://github.com/games-on-whales/inputtino/pull/30
- [x] fix cpack pkg generation - https://gitlab.kitware.com/cmake/cmake/-/issues/27055
- [x] enable wayland
- [x] run unit tests
- [x] generate coverage reports
- [x] what is the correct install prefix? ... going to use
/usr/local - [x] double check
src/platform/linux/misc.cpphacks- [x]
local_addressis empty when trying to start a streaming session
- [x]
- [x] document/fix input permissions
- [x] run post install script
Improvements for the future:
- [ ] allow uhid - https://github.com/vmactions/freebsd-vm/issues/106 ... uhid is available on FreeBSD; however doesn't seem to provide a
uhid.hheader file - [ ] enable cuda... seems this is only possible through emulation with Linuxulator
- [ ] enable docs build - https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=279330 ... FreeBSD package of Doxygen is too old right now
Screenshot
Issues Fixed or Closed
- Resolves https://github.com/LizardByte/roadmap/issues/90
Type of Change
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Dependency update (updates to dependencies)
- [x] Documentation update (changes to documentation)
- [x] Repository update (changes to repository files, e.g.
.github/...)
Checklist
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated the in code docstring/documentation-blocks for new or existing methods/components
Bundle Report
Changes will increase total bundle size by 1.68kB (0.17%) :arrow_up:. This is within the configured threshold :white_check_mark:
Detailed changes
| Bundle name | Size | Change |
|---|---|---|
| sunshine-esm | 966.71kB | 1.68kB (0.17%) :arrow_up: |
Affected Assets, Files, and Routes:
view changes for bundle: sunshine-esm
Assets Changed:
| Asset Name | Size Change | Total Size | Change (%) |
|---|---|---|---|
assets/config-*.js |
1.68kB | 60.45kB | 2.85% |
Files in assets/config-*.js:
-
./src_assets/common/assets/web/configs/tabs/Advanced.vue→ Total Size: 9.08kB -
./src_assets/common/assets/web/configs/tabs/audiovideo/AdapterNameSelector.vue→ Total Size: 3.5kB -
./src_assets/common/assets/web/configs/tabs/audiovideo/DisplayDeviceOptions.vue→ Total Size: 23.43kB -
./src_assets/common/assets/web/configs/tabs/audiovideo/DisplayOutputSelector.vue→ Total Size: 3.71kB -
./src_assets/common/assets/web/PlatformLayout.vue→ Total Size: 842 bytes -
./src_assets/common/assets/web/configs/tabs/Inputs.vue→ Total Size: 13.05kB -
./src_assets/common/assets/web/configs/tabs/AudioVideo.vue→ Total Size: 4.85kB -
./src_assets/common/assets/web/config.html→ Total Size: 0 bytes
Codecov Report
:x: Patch coverage is 0% with 40 lines in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 14.20%. Comparing base (2dbe837) to head (5fc90f9).
:warning: Report is 1 commits behind head on master.
:white_check_mark: All tests successful. No failed tests found.
| Files with missing lines | Patch % | Lines |
|---|---|---|
| src/platform/linux/misc.cpp | 0.00% | 35 Missing :warning: |
| src/stream.cpp | 0.00% | 5 Missing :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## master #4049 +/- ##
==========================================
+ Coverage 11.57% 14.20% +2.63%
==========================================
Files 56 89 +33
Lines 12227 18924 +6697
Branches 5839 8668 +2829
==========================================
+ Hits 1415 2689 +1274
- Misses 10405 14465 +4060
- Partials 407 1770 +1363
| Flag | Coverage Δ | |
|---|---|---|
| FreeBSD-14.3-amd64 | 13.56% <0.00%> (?) |
|
| Linux-AppImage | 11.56% <0.00%> (-0.01%) |
:arrow_down: |
| Windows-AMD64 | 13.35% <0.00%> (?) |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Files with missing lines | Coverage Δ | |
|---|---|---|
| src/system_tray.cpp | 0.00% <ø> (ø) |
|
| src/video.cpp | 29.46% <ø> (+8.60%) |
:arrow_up: |
| src/video.h | 61.11% <ø> (+14.95%) |
:arrow_up: |
| src/stream.cpp | 2.84% <0.00%> (+0.35%) |
:arrow_up: |
| src/platform/linux/misc.cpp | 14.45% <0.00%> (+4.45%) |
:arrow_up: |
Things I have tried to fix the cpack generation, none of which had any effect:
chownthebuilddirectory- tried with sudo
- created an
actionuser and ran all commands withsu action -cprefix - lowercase "Sunshine" in package name
- disabled
CPACK_PACKAGE_RELOCATABLEper https://avidemux.org/smif/index.php?topic=16444.0 - shorter path using
/buildper https://gitlab.kitware.com/cmake/cmake/-/issues/17103
@danieljg are you still interested in testing this? (https://github.com/LizardByte/roadmap/issues/90#issuecomment-3217787648)
I was able to get the package to be generated correctly now. You can download it from the PR artifacts. The latest build is here: https://github.com/LizardByte/Sunshine/actions/runs/17801059553?pr=4049#artifacts (build-FreeBSD-14.3-amd64) ... Note: This URL will change for any future builds of this branch.
@ReenigneArcher yes, I am willing to test, and I think I may have time to try today or tomorrow.
My current server is still running 14.2 because it's got a VM running linux with nvidia passthrough in order to run sunshine on it, and the patches for bhyve were only available for 14.2.
My old laptop (really old, thinkpad t420) is running 14.3, hopefully I will be able to test it on that one. If not, I'll have to pull the plug and update my server to 14.3.
Will report back, hopefully it works, as that would mean I don't have to passthrough a GPU any more to begin with, so I wouldn't need to patch bhyve and the like, and that'd be super nice.
Hopefully the link still points to a valid build. Otherwise, a few pointers on how to test would be appreciated.
Cheers, and thanks for the heads up!
@danieljg are you still interested in testing this? (LizardByte/roadmap#90 (comment))
I was able to get the package to be generated correctly now. You can download it from the PR artifacts. The latest build is here: https://github.com/LizardByte/Sunshine/actions/runs/17801059553?pr=4049#artifacts (
build-FreeBSD-14.3-amd64) ... Note: This URL will change for any future builds of this branch.
@danieljg thank you. There should be a new build available here (https://github.com/LizardByte/Sunshine/actions/runs/17903281130?pr=4049#artifacts) once CI finishes (I just started a rebase).
Unfortunately, I think this won't work as is yet. I ended up setting up a FreeBSD VM, and I get an error when I try to start a stream from Moonlight. Not sure if you know how to solve it or not, but the error is happening here: https://github.com/LizardByte/Sunshine/blob/b59264f7b05b0e44e546b45f7b1fbd9f0dcdaadc/src/stream.cpp#L532 because local_address is empty.
The previous versions, for some reason, wouldn't install. Once the new version was built, I installed it on my old t420 machine, it installed without issues.
I ran it, but couldn't connect to it yet. Don't know exactly why, but this isn't the best machine to test anyway.
I will update the server to 14.3 and try to get it connected, that one has a Ryzen 5600g, and an nvidia P4000, first I'll try with the iGPU. Don't know if I will have the chance to try this tomorrow, if not it will have to be on Thursday.
Thanks for the effort, I truly appreciate it, as will many others once it's out.
Best regards,
Daniel
@ReenigneArcher I'm on condition to test again, had a few crazy weeks but will be able to dedicate time to this over the next couple of weeks
Let me know how I can help out here
@danieljg Thanks! I'm still not sure how to get the local_address variable to populate correctly. Open to ideas if you have any.
@copilot this PR doesn't work as is because when a stream is initialized, the local_address is empty on FreeBSD. This is happening in src/stream.cpp at https://github.com/LizardByte/Sunshine/blob/b59264f7b05b0e44e546b45f7b1fbd9f0dcdaadc/src/stream.cpp#L532 - session_p->localAddress = boost::asio::ip::make_address(local_address);
Investigate the issue and provide a proper solution that will make the local_address properly populated when running FreeBSD environments. Note, that the FreeBSD build is 99% the same as the linux build and almost no special considerations have been made as far as the cmake configuration, but there are some changes using macros in the code to handle FreeBSD. The problem may actually lie in src/platform/linux/misc.cpp
The target platform for inital BSD support is FreeBSD 14.3.
@ReenigneArcher I've opened a new pull request, #4366, to work on those changes. Once the pull request is ready, I'll request review from you.
@danieljg This is ready for you to test now. I've done some basic tests from a FreeBSD VM, but wasn't able to test everything in my environment. Anything else you could test would be terrific.
- [x] mouse input
- [x] keyboard input
- [ ] Xbox gamepad input
- [ ] Nintendo Switch Pro gamepad input
- [x] software encoding with x11
- [ ] software encoding with Wayland
- [ ] GPU encoding with x11 (let me know which GPU)
- [ ] GPU encoding with Wayland (let me know which GPU)
- [ ] Audio streaming
Unsupported
- KMS capture (FreeBSD has no libcap)
- DualShock/DS5 gamepad emulation (FreeBSD doesn't provide a uhid.h header file)
Artifacts are available here: https://github.com/LizardByte/Sunshine/actions/runs/19266949618#artifacts
@ReenigneArcher great news!
Will get back to you with a report.
@ReenigneArcher Just last week I updated to 15.0-BETA4, now on 15.0-BETA5 on my laptop, hope that won't cause issues, otherwise I'll have to test on my desktop/server (which doesn't have a DE running right now, but it could use one now, I guess).
@ReenigneArcher Just last week I updated to 15.0-BETA4, now on 15.0-BETA5 on my laptop, hope that won't cause issues, otherwise I'll have to test on my desktop/server (which doesn't have a DE running right now, but it could use one now, I guess).
The artifact is built against 14.3. I don't know the differences between that and the beta. It might work, or might not. If not you would need to self compile for it to work on 15.0.
In the future I'll probably look into including this in the official ports repo.
It seems to have installed just fine on my old thinkpad T420 with the updated ivy bridge cpu.. but there's some issue with it trying to enable the hdmi output instead of just using the LVDS. This isn't my target machine to stream from, so I'll try on the desktop now, which has 14.3 still. I just have to get xfce installed.
[2025-11-11 09:33:53.532]: Info: // Ignore any errors mentioned above, they are not relevant. // [2025-11-11 09:33:53.532]: Info: [2025-11-11 09:33:53.532]: Info: Found H.264 encoder: h264_vaapi [vaapi] [2025-11-11 09:33:53.532]: Info: Executing Do Cmd: [xrandr --output HDMI-1 --mode 1920x1080] [2025-11-11 09:33:53.542]: Error: [xrandr --output HDMI-1 --mode 1920x1080] failed with code [1] [2025-11-11 09:33:55.125]: Warning: Unable to find MAC address for 192.168.1.116 [2025-11-11 09:33:56.670]: Warning: Unable to find MAC address for 192.168.1.116
Try the first desktop entry, not the second one.
Upon choosing the regular resolution desktop entry from moonlight, i get this on the terminal where I ran sunshine:
[2025-11-11 10:04:09.026]: Info: // Ignore any errors mentioned above, they are not relevant. // [2025-11-11 10:04:09.026]: Info: [2025-11-11 10:04:09.026]: Info: Found H.264 encoder: libx264 [software] [2025-11-11 10:04:09.026]: Info: Executing [Desktop] [2025-11-11 10:04:09.069]: Info: New streaming session started [active sessions: 1] [2025-11-11 10:04:09.069]: Warning: Unable to create virtual touch screen: Permission denied [2025-11-11 10:04:09.069]: Warning: Unable to create virtual pen tablet: Permission denied [2025-11-11 10:04:09.094]: Warning: Couldn't get local address for control connection [2025-11-11 10:04:09.094]: Error: boost::system::system_error in address parsing: Invalid argument [system:22] (code: system:22) Terminating due to uncaught exception 0x4e18262ea20 of type boost::wrapexceptboost::system::system_error Abort trap (core dumped)
I've got xfce running now on the server, so I'll try to install and run from there, that one has a 5600g, it's not quite as ancient as the T420. I can also test with an nvidia P4000 which is currently passed-through to a linux vm used pretty much only for sunshine.
[2025-11-11 10:04:09.094]: Warning: Couldn't get local address for control connection [2025-11-11 10:04:09.094]: Error: boost::system::system_error in address parsing: Invalid argument [system:22] (code: system:22) Terminating due to uncaught exception 0x4e18262ea20 of type boost::wrapexceptboost::system::system_error Abort trap (core dumped)
This looks like the error I fixed in enet here: https://github.com/cgutman/enet/pull/20
In fact, those messages are no longer part of the code.
Make sure you installed the latest artifact from https://github.com/LizardByte/Sunshine/actions/runs/19266949618#artifacts ... earlier artifacts will not work correctly.
[2025-11-11 10:04:09.069]: Warning: Unable to create virtual touch screen: Permission denied [2025-11-11 10:04:09.069]: Warning: Unable to create virtual pen tablet: Permission denied
Not sure on those. Do you have similar warnings earlier about no permission to create mouse/keyboard/gamepad?
thanks for letting me know i'm about to start testing on the 14.3 desktop where it never was installed before, i may also delete the package before reinstalling on the T420
ok, I can confirm that video and audio streaming works from the 15.0 T420 laptop into moonlight running on my phone.
I don't have keyboard and mouse working right now, seems to be a permission issue.
Here's the terminal dump, haven't tried running as root quite yet (next up is testing on the 5600g with 14.3, but i think pulseaudio is giving me a bit of trouble that i need to fix before going for it):
daniel@GDJ_T420:~/Downloads $ sunshine [2025-11-11 10:42:47.077022] [0x0000169f844d4010] [info] config: 'output_name' = 0 [2025-11-11 10:42:47.077210] [0x0000169f844d4010] [info] config: 'hevc_mode' = 1 [2025-11-11 10:42:47.077215] [0x0000169f844d4010] [info] config: 'sunshine_name' = T420 [2025-11-11 10:42:47.077219] [0x0000169f844d4010] [info] config: 'encoder' = software [2025-11-11 10:42:47.077222] [0x0000169f844d4010] [info] config: 'av1_mode' = 1 [2025-11-11 10:42:47.077]: Info: Sunshine version: 0.0.4049 commit: af399bd2a4957f40ec19fb02c4b55f5b2dc26996 [2025-11-11 10:42:47.077]: Info: Package Publisher: LizardByte [2025-11-11 10:42:47.077]: Info: Publisher Website: https://app.lizardbyte.dev [2025-11-11 10:42:47.077]: Info: Get support: https://app.lizardbyte.dev/support [2025-11-11 10:42:47.077]: Info: config: 'av1_mode' = 1 [2025-11-11 10:42:47.077]: Info: config: 'encoder' = software [2025-11-11 10:42:47.078]: Info: config: 'sunshine_name' = T420 [2025-11-11 10:42:47.078]: Info: config: 'hevc_mode' = 1 [2025-11-11 10:42:47.078]: Info: config: 'output_name' = 0 [2025-11-11 10:42:47.079]: Info: Detecting displays [2025-11-11 10:42:47.086]: Info: Detected display: LVDS-1 (id: 0)LVDS-1 connected: true [2025-11-11 10:42:47.087]: Info: Detected display: VGA-1 (id: 1)VGA-1 connected: false [2025-11-11 10:42:47.087]: Info: Detected display: HDMI-1 (id: 2)HDMI-1 connected: false [2025-11-11 10:42:47.087]: Info: Detected display: DP-1 (id: 3)DP-1 connected: false [2025-11-11 10:42:47.087]: Info: Detected display: HDMI-2 (id: 4)HDMI-2 connected: false [2025-11-11 10:42:47.087]: Info: Detected display: HDMI-3 (id: 5)HDMI-3 connected: false [2025-11-11 10:42:47.087]: Info: Detected display: DP-2 (id: 6)DP-2 connected: false [2025-11-11 10:42:47.087]: Info: Detected display: DP-3 (id: 7)DP-3 connected: false [2025-11-11 10:42:47.089]: Warning: Unable to create virtual mouse: Permission denied [2025-11-11 10:42:47.089]: Warning: Unable to create virtual keyboard: Permission denied [2025-11-11 10:42:47.089]: Warning: Gamepad xone is disabled due to Permission denied [2025-11-11 10:42:47.089]: Warning: Gamepad ds5 is disabled due to Permission denied [2025-11-11 10:42:47.089]: Warning: Gamepad switch is disabled due to Permission denied [2025-11-11 10:42:47.089]: Warning: No gamepad input is available [2025-11-11 10:42:47.089]: Info: Trying encoder [software] [2025-11-11 10:42:47.089]: Info: Screencasting with X11 [2025-11-11 10:42:47.096]: Info: Configuring selected display (0) to stream [2025-11-11 10:42:47.102]: Info: Streaming display: LVDS-1 with res 1600x900 offset by 0x0 [2025-11-11 10:42:47.102]: Info: Creating encoder [libx264] [2025-11-11 10:42:47.102]: Info: Color coding: SDR (Rec. 601) [2025-11-11 10:42:47.102]: Info: Color depth: 8-bit [2025-11-11 10:42:47.102]: Info: Color range: JPEG [2025-11-11 10:42:47.103]: Info: Streaming bitrate is 1000000 [2025-11-11 10:42:47.103]: Info: [libx264 @ 0x169f84913380] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX [2025-11-11 10:42:47.105]: Info: [libx264 @ 0x169f84913380] profile High, level 4.2, 4:2:0, 8-bit [2025-11-11 10:42:47.134]: Info: [libx264 @ 0x169f84913380] frame I:1 Avg QP:31.00 size: 1203 [2025-11-11 10:42:47.134]: Info: [libx264 @ 0x169f84913380] mb I I16..4: 99.9% 0.0% 0.0% [2025-11-11 10:42:47.134]: Info: [libx264 @ 0x169f84913380] 8x8 transform intra:0.0% [2025-11-11 10:42:47.134]: Info: [libx264 @ 0x169f84913380] coded y,uvDC,uvAC intra: 0.0% 0.0% 0.0% [2025-11-11 10:42:47.134]: Info: [libx264 @ 0x169f84913380] i16 v,h,dc,p: 97% 0% 3% 0% [2025-11-11 10:42:47.134]: Info: [libx264 @ 0x169f84913380] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 0% 0% 75% 12% 0% 0% 0% 0% 12% [2025-11-11 10:42:47.134]: Info: [libx264 @ 0x169f84913380] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 0% 0% 100% 0% 0% 0% 0% 0% 0% [2025-11-11 10:42:47.134]: Info: [libx264 @ 0x169f84913380] i8c dc,h,v,p: 100% 0% 0% 0% [2025-11-11 10:42:47.134]: Info: [libx264 @ 0x169f84913380] kb/s:577.44 [2025-11-11 10:42:47.135]: Info: Creating encoder [libx264] [2025-11-11 10:42:47.135]: Info: Color coding: SDR (Rec. 601) [2025-11-11 10:42:47.135]: Info: Color depth: 8-bit [2025-11-11 10:42:47.135]: Info: Color range: JPEG [2025-11-11 10:42:47.135]: Info: Streaming bitrate is 1000000 [2025-11-11 10:42:47.136]: Info: [libx264 @ 0x169f84913380] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX [2025-11-11 10:42:47.136]: Info: [libx264 @ 0x169f84913380] profile High 4:4:4 Predictive, level 4.2, 4:4:4, 8-bit [2025-11-11 10:42:47.179]: Info: [libx264 @ 0x169f84913380] frame I:1 Avg QP:32.52 size: 1464 [2025-11-11 10:42:47.179]: Info: [libx264 @ 0x169f84913380] mb I I16..4: 99.8% 0.2% 0.0% [2025-11-11 10:42:47.179]: Info: [libx264 @ 0x169f84913380] 8x8 transform intra:0.2% [2025-11-11 10:42:47.179]: Info: [libx264 @ 0x169f84913380] coded y,u,v intra: 0.1% 0.0% 0.0% [2025-11-11 10:42:47.179]: Info: [libx264 @ 0x169f84913380] i16 v,h,dc,p: 87% 10% 3% 0% [2025-11-11 10:42:47.179]: Info: [libx264 @ 0x169f84913380] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 3% 30% 45% 15% 0% 0% 0% 0% 7% [2025-11-11 10:42:47.179]: Info: [libx264 @ 0x169f84913380] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 0% 47% 53% 0% 0% 0% 0% 0% 0% [2025-11-11 10:42:47.179]: Info: [libx264 @ 0x169f84913380] kb/s:702.72 [2025-11-11 10:42:47.189]: Info: Screencasting with X11 [2025-11-11 10:42:47.189]: Info: Configuring selected display (0) to stream [2025-11-11 10:42:47.196]: Info: Streaming display: LVDS-1 with res 1600x900 offset by 0x0 [2025-11-11 10:42:47.196]: Info: // Testing for available encoders, this may generate errors. You can safely ignore those errors. // [2025-11-11 10:42:47.196]: Info: [2025-11-11 10:42:47.196]: Info: // Ignore any errors mentioned above, they are not relevant. // [2025-11-11 10:42:47.196]: Info: [2025-11-11 10:42:47.197]: Info: Found H.264 encoder: libx264 [software] [2025-11-11 10:42:47.197]: Info: Starting system tray [2025-11-11 10:42:47.203]: Info: Configuration UI available at [https://localhost:47990] [2025-11-11 10:42:47.203]: Error: Failed to create client: Daemon not running
(
After installing it tells you to run pw groupmod input -m $USER to add your user to the input group? That should resolve the input issues.
I did run that, i'm sure.. at least my user is in the input group. After rebooting, it's working now on the 15.0 laptop with intel igpu (T420, intel i5-3360m).
I can confirm streaming works on the 14.3 machine, too, with the ryzen 5600g, but on that one I still have the issue of no keyboard and no mouse working via moonlight. I find it odd as I can't think of something that's different between the laptop (working) and the desktop (not-working) at this point.
You can see the groups at the very end here, then after that the groups on the 15.0 machine where mouse/keyborad is working fine:
daniel in 🌐 GDJ_FREEBSD in ~ ➜ sunshine [2025-11-11 11:07:48.961]: Info: Sunshine version: 0.0.4049 commit: af399bd2a4957f40ec19fb02c4b55f5b2dc26996 [2025-11-11 11:07:48.961]: Info: Package Publisher: LizardByte [2025-11-11 11:07:48.961]: Info: Publisher Website: https://app.lizardbyte.dev [2025-11-11 11:07:48.961]: Info: Get support: https://app.lizardbyte.dev/support [2025-11-11 11:07:48.962]: Info: Detecting displays [2025-11-11 11:07:48.963]: Info: Detected display: HDMI-1 (id: 0)HDMI-1 connected: true [2025-11-11 11:07:48.963]: Info: Detected display: HDMI-2 (id: 1)HDMI-2 connected: false [2025-11-11 11:07:48.963]: Info: Detected display: DP-1 (id: 2)DP-1 connected: false [2025-11-11 11:07:48.965]: Warning: Unable to create virtual mouse: Permission denied [2025-11-11 11:07:48.965]: Warning: Unable to create virtual keyboard: Permission denied [2025-11-11 11:07:48.965]: Warning: Gamepad xone is disabled due to Permission denied [2025-11-11 11:07:48.965]: Warning: Gamepad ds5 is disabled due to Permission denied [2025-11-11 11:07:48.965]: Warning: Gamepad switch is disabled due to Permission denied [2025-11-11 11:07:48.965]: Warning: No gamepad input is available [2025-11-11 11:07:48.965]: Info: // Testing for available encoders, this may generate errors. You can safely ignore those errors. // [2025-11-11 11:07:48.965]: Info: Trying encoder [nvenc] [2025-11-11 11:07:48.965]: Info: Screencasting with X11 [2025-11-11 11:07:48.965]: Info: Creating encoder [h264_nvenc] [2025-11-11 11:07:48.965]: Info: Color coding: SDR (Rec. 601) [2025-11-11 11:07:48.965]: Info: Color depth: 8-bit [2025-11-11 11:07:48.965]: Info: Color range: JPEG [2025-11-11 11:07:48.965]: Error: [CUDA @ 0x259c920e3580] Cannot load libcuda.so.1 [2025-11-11 11:07:48.965]: Error: [CUDA @ 0x259c920e3580] Could not dynamically load CUDA [2025-11-11 11:07:48.965]: Error: Failed to create a CUDA device: Operation not permitted [2025-11-11 11:07:48.965]: Info: Creating encoder [h264_nvenc] [2025-11-11 11:07:48.965]: Info: Color coding: SDR (Rec. 601) [2025-11-11 11:07:48.965]: Info: Color depth: 8-bit [2025-11-11 11:07:48.965]: Info: Color range: JPEG [2025-11-11 11:07:48.966]: Error: [CUDA @ 0x259c920e3600] Cannot load libcuda.so.1 [2025-11-11 11:07:48.966]: Error: [CUDA @ 0x259c920e3600] Could not dynamically load CUDA [2025-11-11 11:07:48.966]: Error: Failed to create a CUDA device: Operation not permitted [2025-11-11 11:07:48.966]: Info: Encoder [nvenc] failed [2025-11-11 11:07:48.966]: Info: Trying encoder [vaapi] [2025-11-11 11:07:48.966]: Info: Screencasting with X11 [2025-11-11 11:07:48.966]: Info: Creating encoder [h264_vaapi] [2025-11-11 11:07:48.966]: Info: Color coding: SDR (Rec. 601) [2025-11-11 11:07:48.966]: Info: Color depth: 8-bit [2025-11-11 11:07:48.966]: Info: Color range: JPEG libva info: VA-API version 1.22.0 libva info: Trying to open /usr/local/lib/dri/radeonsi_drv_video.so libva info: va_openDriver() returns -1 [2025-11-11 11:07:49.046]: Error: Couldn't initialize va display: unknown libva error [2025-11-11 11:07:49.048]: Info: Creating encoder [h264_vaapi] [2025-11-11 11:07:49.048]: Info: Color coding: SDR (Rec. 601) [2025-11-11 11:07:49.048]: Info: Color depth: 8-bit [2025-11-11 11:07:49.048]: Info: Color range: JPEG libva info: VA-API version 1.22.0 libva info: Trying to open /usr/local/lib/dri/radeonsi_drv_video.so libva info: va_openDriver() returns -1 [2025-11-11 11:07:49.122]: Error: Couldn't initialize va display: unknown libva error [2025-11-11 11:07:49.123]: Info: Encoder [vaapi] failed [2025-11-11 11:07:49.123]: Info: Trying encoder [software] [2025-11-11 11:07:49.123]: Info: Screencasting with X11 [2025-11-11 11:07:49.124]: Info: Creating encoder [libx264] [2025-11-11 11:07:49.124]: Info: Color coding: SDR (Rec. 601) [2025-11-11 11:07:49.124]: Info: Color depth: 8-bit [2025-11-11 11:07:49.124]: Info: Color range: JPEG [2025-11-11 11:07:49.124]: Info: Streaming bitrate is 1000000 [2025-11-11 11:07:49.124]: Info: [libx264 @ 0x259c9210b700] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2 [2025-11-11 11:07:49.125]: Info: [libx264 @ 0x259c9210b700] profile High, level 4.2, 4:2:0, 8-bit [2025-11-11 11:07:49.137]: Info: [libx264 @ 0x259c9210b700] frame I:1 Avg QP:31.00 size: 1203 [2025-11-11 11:07:49.137]: Info: [libx264 @ 0x259c9210b700] mb I I16..4: 99.9% 0.0% 0.0% [2025-11-11 11:07:49.137]: Info: [libx264 @ 0x259c9210b700] 8x8 transform intra:0.0% [2025-11-11 11:07:49.137]: Info: [libx264 @ 0x259c9210b700] coded y,uvDC,uvAC intra: 0.0% 0.0% 0.0% [2025-11-11 11:07:49.137]: Info: [libx264 @ 0x259c9210b700] i16 v,h,dc,p: 97% 0% 3% 0% [2025-11-11 11:07:49.137]: Info: [libx264 @ 0x259c9210b700] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 0% 0% 75% 12% 0% 0% 0% 0% 12% [2025-11-11 11:07:49.137]: Info: [libx264 @ 0x259c9210b700] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 0% 0% 100% 0% 0% 0% 0% 0% 0% [2025-11-11 11:07:49.137]: Info: [libx264 @ 0x259c9210b700] i8c dc,h,v,p: 100% 0% 0% 0% [2025-11-11 11:07:49.137]: Info: [libx264 @ 0x259c9210b700] kb/s:577.44 [2025-11-11 11:07:49.138]: Info: Creating encoder [libx264] [2025-11-11 11:07:49.138]: Info: Color coding: SDR (Rec. 601) [2025-11-11 11:07:49.138]: Info: Color depth: 8-bit [2025-11-11 11:07:49.138]: Info: Color range: JPEG [2025-11-11 11:07:49.138]: Info: Streaming bitrate is 1000000 [2025-11-11 11:07:49.138]: Info: [libx264 @ 0x259c9210b700] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2 [2025-11-11 11:07:49.139]: Info: [libx264 @ 0x259c9210b700] profile High 4:4:4 Predictive, level 4.2, 4:4:4, 8-bit [2025-11-11 11:07:49.156]: Info: [libx264 @ 0x259c9210b700] frame I:1 Avg QP:31.65 size: 1508 [2025-11-11 11:07:49.156]: Info: [libx264 @ 0x259c9210b700] mb I I16..4: 99.8% 0.2% 0.0% [2025-11-11 11:07:49.156]: Info: [libx264 @ 0x259c9210b700] 8x8 transform intra:0.2% [2025-11-11 11:07:49.156]: Info: [libx264 @ 0x259c9210b700] coded y,u,v intra: 0.2% 0.0% 0.0% [2025-11-11 11:07:49.156]: Info: [libx264 @ 0x259c9210b700] i16 v,h,dc,p: 93% 4% 3% 0% [2025-11-11 11:07:49.156]: Info: [libx264 @ 0x259c9210b700] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 13% 6% 54% 10% 4% 0% 0% 4% 10% [2025-11-11 11:07:49.156]: Info: [libx264 @ 0x259c9210b700] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 0% 0% 100% 0% 0% 0% 0% 0% 0% [2025-11-11 11:07:49.156]: Info: [libx264 @ 0x259c9210b700] kb/s:723.84 [2025-11-11 11:07:49.157]: Info: Screencasting with X11 [2025-11-11 11:07:49.158]: Info: [2025-11-11 11:07:49.158]: Info: // Ignore any errors mentioned above, they are not relevant. // [2025-11-11 11:07:49.158]: Info: [2025-11-11 11:07:49.158]: Info: Found H.264 encoder: libx264 [software] [2025-11-11 11:07:49.158]: Info: Starting system tray [2025-11-11 11:07:49.160]: Info: Configuration UI available at [https://localhost:47990] [2025-11-11 11:07:49.160]: Error: Failed to create client: Daemon not running
(
(
daniel in 🌐 GDJ_FREEBSD in ~ took 2m58s ➜ groups daniel wheel operator video pulse input
daniel@GDJ_T420:~ $ groups wheel tty operator video network pulse daniel usb input
maybe it requires a reboot?
possibly, although i had already rebooted it.. I think there's one difference with the config of my laptop, something I had added to make a usb scanner work before:
daniel@GDJ_T420:~ $ cat /etc/devfs.rules [usbscanner=10] add path 'ugen*' unhide add path 'usb/' unhide add path 'ugen' mode 0660 group usb add path 'usb/*' mode 0666 group usb
Sunshine virtual input device rules
[devfsrules_sunshine=10] add path 'uinput' mode 0660 group input
I've added these to the ruleset (don't think I need all, but anyway), to test this, rebooting now
Can confirm input works now, can't be sure if the second reboot was necessary, or if it was the ruleset update.
In any case, Sunshine is working on FreeBSD.
Wow, thanks for the hard work. Now i can let go of that old linux VM.
Nice.
Can confirm input works now, can't be sure if the second reboot was necessary, or if it was the ruleset update.
In any case, Sunshine is working on FreeBSD.
Wow, thanks for the hard work. Now i can let go of that old linux VM.
Nice.
Awesome, thanks for testing! I'll probably wait a few days before merging this. There will be a few adjustments between this and the final version. I would suggest doing an uninstall before installing new versions to handle cleanup for the differences.
However, for some reason i can't get audio from the desktop's sunshine to my laptop's moonlight (15.0), although phone works ok.
Also ok, from the linux VM's sunshine into the laptop's moonlight.
Have been trying some configs on the moonlight end and with pulseaudio on the freebsd server end, but still can't figure out what's causing this.
However, for some reason i can't get audio from the desktop's sunshine to my laptop's moonlight
Not sure on that. The logs look the same in both from what I can see.
[2025-11-11 11:08:22.119]: Info: Setting default sink to: [sink-sunshine-stereo] [2025-11-11 11:08:22.120]: Info: Found default monitor by name: sink-sunshine-stereo.monitor [2025-11-11 11:08:22.122]: Info: Opus initialized: 48 kHz, 2 channels, 512 kbps (total), LOWDELAY
I had success getting audio working from moonlight-embedded, but the mouse is not great on that one, I'll try to debug later today.
In any case, this is working, which is great.