Skip to content

Conversation

@ReenigneArcher
Copy link
Member

@ReenigneArcher ReenigneArcher commented Jul 5, 2025

Description

This PR adds initial support for FreeBSD.

Issues:

TODO

Improvements for the future:

Screenshot

Issues Fixed or Closed

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • 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)
  • Documentation update (changes to documentation)
  • Repository update (changes to repository files, e.g. .github/...)

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • 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

@ReenigneArcher ReenigneArcher force-pushed the build/add-freebsd-support branch 2 times, most recently from 8221db2 to 15f2b42 Compare July 5, 2025 00:32
@codecov
Copy link

codecov bot commented Jul 5, 2025

Bundle Report

Changes will increase total bundle size by 1.68kB (0.17%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
sunshine-esm 966.71kB 1.68kB (0.17%) ⬆️

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
Copy link

codecov bot commented Jul 5, 2025

Codecov Report

❌ Patch coverage is 0% with 40 lines in your changes missing coverage. Please review.
✅ Project coverage is 14.20%. Comparing base (2dbe837) to head (5fc90f9).
⚠️ Report is 1 commits behind head on master.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/platform/linux/misc.cpp 0.00% 35 Missing ⚠️
src/stream.cpp 0.00% 5 Missing ⚠️
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%) ⬇️
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%) ⬆️
src/video.h 61.11% <ø> (+14.95%) ⬆️
src/stream.cpp 2.84% <0.00%> (+0.35%) ⬆️
src/platform/linux/misc.cpp 14.45% <0.00%> (+4.45%) ⬆️

... and 79 files with indirect coverage changes

@ReenigneArcher ReenigneArcher force-pushed the build/add-freebsd-support branch 6 times, most recently from 920e292 to 1f75e94 Compare July 5, 2025 21:37
@ReenigneArcher ReenigneArcher force-pushed the build/add-freebsd-support branch 19 times, most recently from e820ce8 to 082dc51 Compare July 8, 2025 01:10
@ReenigneArcher
Copy link
Member Author

@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.

  • mouse input
  • keyboard input
  • Xbox gamepad input
  • Nintendo Switch Pro gamepad input
  • 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

@danieljg

This comment was marked as outdated.

@danieljg
Copy link

@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
Copy link
Member Author

@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.

@danieljg

This comment was marked as resolved.

@ReenigneArcher

This comment was marked as outdated.

@danieljg

This comment was marked as resolved.

@ReenigneArcher

This comment was marked as outdated.

@danieljg

This comment was marked as outdated.

@danieljg

This comment was marked as outdated.

@ReenigneArcher

This comment was marked as outdated.

@danieljg

This comment was marked as outdated.

@ReenigneArcher

This comment was marked as outdated.

@danieljg

This comment was marked as outdated.

@danieljg

This comment was marked as outdated.

@ReenigneArcher
Copy link
Member Author

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.

Changed devfs ruleset marker from comment to [sunshine=10] in install and uninstall scripts for consistency. Removed DS5 gamepad option from FreeBSD platform in Inputs.vue.
@danieljg

This comment was marked as resolved.

@ReenigneArcher

This comment was marked as outdated.

@danieljg
Copy link

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.

@ReenigneArcher
Copy link
Member Author

According to https://man.freebsd.org/cgi/man.cgi?devfs.rules the rule number should be unique, so I wonder if that was causing you problems before. I'll use a more unique number for sunshine... maybe the default port number for the web ui would be a good candidate.

@danieljg
Copy link

just in case it's useful, i found the fix was manually setting the sink for the audio as:

sink-sunshine-stereo

don't know exactly why this was required, but it's possibly because there was another sink for xrdp configured before

I'll be sure to install the final package when it's released

Hope to be able to test the nvidia P4000 card soon enough

Thanks a lot for the hard work, and be sure to let me know if you need any more testing

Switches devfs ruleset number to 47989 and applies rules immediately during installation if /dev/uinput exists. Improves removal logic in pre-deinstall script by targeting the correct ruleset and cleaning up both file and memory. Enhances reliability and consistency of devfs rules management for Sunshine.
Defines SOL_IP, SOL_IPV6, and SOL_UDP if not present to improve portability. Updates usage of IPPROTO_* constants to SOL_* macros for socket option levels in relevant code paths.
@ReenigneArcher ReenigneArcher force-pushed the build/add-freebsd-support branch from b5cf73e to 5fc90f9 Compare November 12, 2025 03:58
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
2 New issues
6.0% Duplication on New Code (required ≤ 2%)
4 Duplicated Blocks on New Code (required ≤ 0)
2 New Code Smells (required ≤ 0)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@ReenigneArcher ReenigneArcher merged commit 1d6d916 into master Nov 12, 2025
50 of 53 checks passed
@ReenigneArcher ReenigneArcher deleted the build/add-freebsd-support branch November 12, 2025 04:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

roadmap This PR closes a roadmap entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sunshine: add support for FreeBSD

3 participants