build: add freebsd support - #4049

Merged
ReenigneArcher merged 6 commits into
masterfrom
build/add-freebsd-support
Nov 12, 2025
Merged

build: add freebsd support#4049
ReenigneArcher merged 6 commits into
masterfrom
build/add-freebsd-support

Conversation

@ReenigneArcher

@ReenigneArcherReenigneArcher commented Jul 5, 2025

Copy link
Copy Markdown
Member

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
ReenigneArcherforce-pushed the build/add-freebsd-support branch 2 times, most recently from 8221db2 to 15f2b42CompareJuly 5, 2025 00:32
@codecov

codecovBot commented Jul 5, 2025

Copy link
Copy Markdown

Bundle Report

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

Detailed changes
Bundle nameSizeChange
sunshine-esm966.71kB1.68kB (0.17%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: sunshine-esm

Assets Changed:

Asset NameSize ChangeTotal SizeChange (%)
assets/config-*.js1.68kB60.45kB2.85%

Files inassets/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

codecovBot commented Jul 5, 2025

Copy link
Copy Markdown

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 112 commits behind head on master.

Files with missing linesPatch %Lines
src/platform/linux/misc.cpp0.00%35 Missing ⚠️
src/stream.cpp0.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 
FlagCoverage Δ
FreeBSD-14.3-amd6413.56% <0.00%> (?)
Linux-AppImage11.56% <0.00%> (-0.01%)⬇️
Windows-AMD6413.35% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing linesCoverage Δ
src/system_tray.cpp0.00% <ø> (ø)
src/video.cpp29.46% <ø> (+8.60%)⬆️
src/video.h61.11% <ø> (+14.95%)⬆️
src/stream.cpp2.84% <0.00%> (+0.35%)⬆️
src/platform/linux/misc.cpp14.45% <0.00%> (+4.45%)⬆️

... and 79 files with indirect coverage changes

@ReenigneArcher
ReenigneArcherforce-pushed the build/add-freebsd-support branch 6 times, most recently from 920e292 to 1f75e94CompareJuly 5, 2025 21:37
@ReenigneArcher
ReenigneArcherforce-pushed the build/add-freebsd-support branch 19 times, most recently from e820ce8 to 082dc51CompareJuly 8, 2025 01:10
Revised README to clarify supported controllers and operating systems, including FreeBSD and updated Windows requirements. Updated getting_started.md to note that DualSense/DS5 emulation is not available due to missing uhid features.
@ReenigneArcher

Copy link
Copy Markdown
MemberAuthor

@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
Copy Markdown

@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
Copy Markdown
MemberAuthor

@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
Copy Markdown
MemberAuthor

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.

Comment threadsrc_assets/bsd/misc/+POST_INSTALL Outdated
Comment threadsrc_assets/bsd/misc/+PRE_DEINSTALL Outdated
Comment threadsrc_assets/bsd/misc/+POST_INSTALL Outdated
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
Copy Markdown

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
Copy Markdown
MemberAuthor

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

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

Copy link
Copy Markdown

Quality Gate FailedQuality 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

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

roadmapThis 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

@ReenigneArcher@danieljg
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

build: add freebsd support - #4049

Merged
ReenigneArcher merged 6 commits into
masterfrom
build/add-freebsd-support
Nov 12, 2025
Merged

build: add freebsd support#4049
ReenigneArcher merged 6 commits into
masterfrom
build/add-freebsd-support

Conversation

@ReenigneArcher

@ReenigneArcherReenigneArcher commented Jul 5, 2025

Copy link
Copy Markdown
Member

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
ReenigneArcherforce-pushed the build/add-freebsd-support branch 2 times, most recently from 8221db2 to 15f2b42CompareJuly 5, 2025 00:32
@codecov

codecovBot commented Jul 5, 2025

Copy link
Copy Markdown

Bundle Report

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

Detailed changes
Bundle nameSizeChange
sunshine-esm966.71kB1.68kB (0.17%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: sunshine-esm

Assets Changed:

Asset NameSize ChangeTotal SizeChange (%)
assets/config-*.js1.68kB60.45kB2.85%

Files inassets/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

codecovBot commented Jul 5, 2025

Copy link
Copy Markdown

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 112 commits behind head on master.

Files with missing linesPatch %Lines
src/platform/linux/misc.cpp0.00%35 Missing ⚠️
src/stream.cpp0.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 
FlagCoverage Δ
FreeBSD-14.3-amd6413.56% <0.00%> (?)
Linux-AppImage11.56% <0.00%> (-0.01%)⬇️
Windows-AMD6413.35% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing linesCoverage Δ
src/system_tray.cpp0.00% <ø> (ø)
src/video.cpp29.46% <ø> (+8.60%)⬆️
src/video.h61.11% <ø> (+14.95%)⬆️
src/stream.cpp2.84% <0.00%> (+0.35%)⬆️
src/platform/linux/misc.cpp14.45% <0.00%> (+4.45%)⬆️

... and 79 files with indirect coverage changes

@ReenigneArcher
ReenigneArcherforce-pushed the build/add-freebsd-support branch 6 times, most recently from 920e292 to 1f75e94CompareJuly 5, 2025 21:37
@ReenigneArcher
ReenigneArcherforce-pushed the build/add-freebsd-support branch 19 times, most recently from e820ce8 to 082dc51CompareJuly 8, 2025 01:10
Revised README to clarify supported controllers and operating systems, including FreeBSD and updated Windows requirements. Updated getting_started.md to note that DualSense/DS5 emulation is not available due to missing uhid features.
@ReenigneArcher

Copy link
Copy Markdown
MemberAuthor

@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
Copy Markdown

@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
Copy Markdown
MemberAuthor

@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
Copy Markdown
MemberAuthor

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.

Comment threadsrc_assets/bsd/misc/+POST_INSTALL Outdated
Comment threadsrc_assets/bsd/misc/+PRE_DEINSTALL Outdated
Comment threadsrc_assets/bsd/misc/+POST_INSTALL Outdated
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
Copy Markdown

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
Copy Markdown
MemberAuthor

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

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

Copy link
Copy Markdown

Quality Gate FailedQuality 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

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

roadmapThis 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

@ReenigneArcher@danieljg
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

build: add freebsd support - #4049

Merged
ReenigneArcher merged 6 commits into
masterfrom
build/add-freebsd-support
Nov 12, 2025
Merged

build: add freebsd support#4049
ReenigneArcher merged 6 commits into
masterfrom
build/add-freebsd-support

Conversation

@ReenigneArcher

@ReenigneArcherReenigneArcher commented Jul 5, 2025

Copy link
Copy Markdown
Member

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
ReenigneArcherforce-pushed the build/add-freebsd-support branch 2 times, most recently from 8221db2 to 15f2b42CompareJuly 5, 2025 00:32
@codecov

codecovBot commented Jul 5, 2025

Copy link
Copy Markdown

Bundle Report

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

Detailed changes
Bundle nameSizeChange
sunshine-esm966.71kB1.68kB (0.17%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: sunshine-esm

Assets Changed:

Asset NameSize ChangeTotal SizeChange (%)
assets/config-*.js1.68kB60.45kB2.85%

Files inassets/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

codecovBot commented Jul 5, 2025

Copy link
Copy Markdown

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 112 commits behind head on master.

Files with missing linesPatch %Lines
src/platform/linux/misc.cpp0.00%35 Missing ⚠️
src/stream.cpp0.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 
FlagCoverage Δ
FreeBSD-14.3-amd6413.56% <0.00%> (?)
Linux-AppImage11.56% <0.00%> (-0.01%)⬇️
Windows-AMD6413.35% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing linesCoverage Δ
src/system_tray.cpp0.00% <ø> (ø)
src/video.cpp29.46% <ø> (+8.60%)⬆️
src/video.h61.11% <ø> (+14.95%)⬆️
src/stream.cpp2.84% <0.00%> (+0.35%)⬆️
src/platform/linux/misc.cpp14.45% <0.00%> (+4.45%)⬆️

... and 79 files with indirect coverage changes

@ReenigneArcher
ReenigneArcherforce-pushed the build/add-freebsd-support branch 6 times, most recently from 920e292 to 1f75e94CompareJuly 5, 2025 21:37
@ReenigneArcher
ReenigneArcherforce-pushed the build/add-freebsd-support branch 19 times, most recently from e820ce8 to 082dc51CompareJuly 8, 2025 01:10
Revised README to clarify supported controllers and operating systems, including FreeBSD and updated Windows requirements. Updated getting_started.md to note that DualSense/DS5 emulation is not available due to missing uhid features.
@ReenigneArcher

Copy link
Copy Markdown
MemberAuthor

@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
Copy Markdown

@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
Copy Markdown
MemberAuthor

@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
Copy Markdown
MemberAuthor

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.

Comment threadsrc_assets/bsd/misc/+POST_INSTALL Outdated
Comment threadsrc_assets/bsd/misc/+PRE_DEINSTALL Outdated
Comment threadsrc_assets/bsd/misc/+POST_INSTALL Outdated
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
Copy Markdown

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
Copy Markdown
MemberAuthor

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

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

Copy link
Copy Markdown

Quality Gate FailedQuality 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

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

roadmapThis 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

@ReenigneArcher@danieljg
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

build: add freebsd support - #4049

Merged
ReenigneArcher merged 6 commits into
masterfrom
build/add-freebsd-support
Nov 12, 2025
Merged

build: add freebsd support#4049
ReenigneArcher merged 6 commits into
masterfrom
build/add-freebsd-support

Conversation

@ReenigneArcher

@ReenigneArcherReenigneArcher commented Jul 5, 2025

Copy link
Copy Markdown
Member

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
ReenigneArcherforce-pushed the build/add-freebsd-support branch 2 times, most recently from 8221db2 to 15f2b42CompareJuly 5, 2025 00:32
@codecov

codecovBot commented Jul 5, 2025

Copy link
Copy Markdown

Bundle Report

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

Detailed changes
Bundle nameSizeChange
sunshine-esm966.71kB1.68kB (0.17%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: sunshine-esm

Assets Changed:

Asset NameSize ChangeTotal SizeChange (%)
assets/config-*.js1.68kB60.45kB2.85%

Files inassets/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

codecovBot commented Jul 5, 2025

Copy link
Copy Markdown

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 112 commits behind head on master.

Files with missing linesPatch %Lines
src/platform/linux/misc.cpp0.00%35 Missing ⚠️
src/stream.cpp0.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 
FlagCoverage Δ
FreeBSD-14.3-amd6413.56% <0.00%> (?)
Linux-AppImage11.56% <0.00%> (-0.01%)⬇️
Windows-AMD6413.35% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing linesCoverage Δ
src/system_tray.cpp0.00% <ø> (ø)
src/video.cpp29.46% <ø> (+8.60%)⬆️
src/video.h61.11% <ø> (+14.95%)⬆️
src/stream.cpp2.84% <0.00%> (+0.35%)⬆️
src/platform/linux/misc.cpp14.45% <0.00%> (+4.45%)⬆️

... and 79 files with indirect coverage changes

@ReenigneArcher
ReenigneArcherforce-pushed the build/add-freebsd-support branch 6 times, most recently from 920e292 to 1f75e94CompareJuly 5, 2025 21:37
@ReenigneArcher
ReenigneArcherforce-pushed the build/add-freebsd-support branch 19 times, most recently from e820ce8 to 082dc51CompareJuly 8, 2025 01:10
Revised README to clarify supported controllers and operating systems, including FreeBSD and updated Windows requirements. Updated getting_started.md to note that DualSense/DS5 emulation is not available due to missing uhid features.
@ReenigneArcher

Copy link
Copy Markdown
MemberAuthor

@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
Copy Markdown

@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
Copy Markdown
MemberAuthor

@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
Copy Markdown
MemberAuthor

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.

Comment threadsrc_assets/bsd/misc/+POST_INSTALL Outdated
Comment threadsrc_assets/bsd/misc/+PRE_DEINSTALL Outdated
Comment threadsrc_assets/bsd/misc/+POST_INSTALL Outdated
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
Copy Markdown

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
Copy Markdown
MemberAuthor

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

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

Copy link
Copy Markdown

Quality Gate FailedQuality 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

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

roadmapThis 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

@ReenigneArcher@danieljg
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

build: add freebsd support - #4049

Merged
ReenigneArcher merged 6 commits into
masterfrom
build/add-freebsd-support
Nov 12, 2025
Merged

build: add freebsd support#4049
ReenigneArcher merged 6 commits into
masterfrom
build/add-freebsd-support

Conversation

@ReenigneArcher

@ReenigneArcherReenigneArcher commented Jul 5, 2025

Copy link
Copy Markdown
Member

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
ReenigneArcherforce-pushed the build/add-freebsd-support branch 2 times, most recently from 8221db2 to 15f2b42CompareJuly 5, 2025 00:32
@codecov

codecovBot commented Jul 5, 2025

Copy link
Copy Markdown

Bundle Report

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

Detailed changes
Bundle nameSizeChange
sunshine-esm966.71kB1.68kB (0.17%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: sunshine-esm

Assets Changed:

Asset NameSize ChangeTotal SizeChange (%)
assets/config-*.js1.68kB60.45kB2.85%

Files inassets/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

codecovBot commented Jul 5, 2025

Copy link
Copy Markdown

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 112 commits behind head on master.

Files with missing linesPatch %Lines
src/platform/linux/misc.cpp0.00%35 Missing ⚠️
src/stream.cpp0.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 
FlagCoverage Δ
FreeBSD-14.3-amd6413.56% <0.00%> (?)
Linux-AppImage11.56% <0.00%> (-0.01%)⬇️
Windows-AMD6413.35% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing linesCoverage Δ
src/system_tray.cpp0.00% <ø> (ø)
src/video.cpp29.46% <ø> (+8.60%)⬆️
src/video.h61.11% <ø> (+14.95%)⬆️
src/stream.cpp2.84% <0.00%> (+0.35%)⬆️
src/platform/linux/misc.cpp14.45% <0.00%> (+4.45%)⬆️

... and 79 files with indirect coverage changes

@ReenigneArcher
ReenigneArcherforce-pushed the build/add-freebsd-support branch 6 times, most recently from 920e292 to 1f75e94CompareJuly 5, 2025 21:37
@ReenigneArcher
ReenigneArcherforce-pushed the build/add-freebsd-support branch 19 times, most recently from e820ce8 to 082dc51CompareJuly 8, 2025 01:10
Revised README to clarify supported controllers and operating systems, including FreeBSD and updated Windows requirements. Updated getting_started.md to note that DualSense/DS5 emulation is not available due to missing uhid features.
@ReenigneArcher

Copy link
Copy Markdown
MemberAuthor

@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
Copy Markdown

@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
Copy Markdown
MemberAuthor

@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
Copy Markdown
MemberAuthor

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.

Comment threadsrc_assets/bsd/misc/+POST_INSTALL Outdated
Comment threadsrc_assets/bsd/misc/+PRE_DEINSTALL Outdated
Comment threadsrc_assets/bsd/misc/+POST_INSTALL Outdated
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
Copy Markdown

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
Copy Markdown
MemberAuthor

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

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

Copy link
Copy Markdown

Quality Gate FailedQuality 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

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

roadmapThis 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

@ReenigneArcher@danieljg
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

build: add freebsd support - #4049

Merged
ReenigneArcher merged 6 commits into
masterfrom
build/add-freebsd-support
Nov 12, 2025
Merged

build: add freebsd support#4049
ReenigneArcher merged 6 commits into
masterfrom
build/add-freebsd-support

Conversation

@ReenigneArcher

@ReenigneArcherReenigneArcher commented Jul 5, 2025

Copy link
Copy Markdown
Member

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
ReenigneArcherforce-pushed the build/add-freebsd-support branch 2 times, most recently from 8221db2 to 15f2b42CompareJuly 5, 2025 00:32
@codecov

codecovBot commented Jul 5, 2025

Copy link
Copy Markdown

Bundle Report

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

Detailed changes
Bundle nameSizeChange
sunshine-esm966.71kB1.68kB (0.17%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: sunshine-esm

Assets Changed:

Asset NameSize ChangeTotal SizeChange (%)
assets/config-*.js1.68kB60.45kB2.85%

Files inassets/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

codecovBot commented Jul 5, 2025

Copy link
Copy Markdown

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 112 commits behind head on master.

Files with missing linesPatch %Lines
src/platform/linux/misc.cpp0.00%35 Missing ⚠️
src/stream.cpp0.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 
FlagCoverage Δ
FreeBSD-14.3-amd6413.56% <0.00%> (?)
Linux-AppImage11.56% <0.00%> (-0.01%)⬇️
Windows-AMD6413.35% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing linesCoverage Δ
src/system_tray.cpp0.00% <ø> (ø)
src/video.cpp29.46% <ø> (+8.60%)⬆️
src/video.h61.11% <ø> (+14.95%)⬆️
src/stream.cpp2.84% <0.00%> (+0.35%)⬆️
src/platform/linux/misc.cpp14.45% <0.00%> (+4.45%)⬆️

... and 79 files with indirect coverage changes

@ReenigneArcher
ReenigneArcherforce-pushed the build/add-freebsd-support branch 6 times, most recently from 920e292 to 1f75e94CompareJuly 5, 2025 21:37
@ReenigneArcher
ReenigneArcherforce-pushed the build/add-freebsd-support branch 19 times, most recently from e820ce8 to 082dc51CompareJuly 8, 2025 01:10
Revised README to clarify supported controllers and operating systems, including FreeBSD and updated Windows requirements. Updated getting_started.md to note that DualSense/DS5 emulation is not available due to missing uhid features.
@ReenigneArcher

Copy link
Copy Markdown
MemberAuthor

@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
Copy Markdown

@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
Copy Markdown
MemberAuthor

@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
Copy Markdown
MemberAuthor

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.

Comment threadsrc_assets/bsd/misc/+POST_INSTALL Outdated
Comment threadsrc_assets/bsd/misc/+PRE_DEINSTALL Outdated
Comment threadsrc_assets/bsd/misc/+POST_INSTALL Outdated
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
Copy Markdown

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
Copy Markdown
MemberAuthor

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

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

Copy link
Copy Markdown

Quality Gate FailedQuality 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

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

roadmapThis 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

@ReenigneArcher@danieljg
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

build: add freebsd support - #4049

Merged
ReenigneArcher merged 6 commits into
masterfrom
build/add-freebsd-support
Nov 12, 2025
Merged

build: add freebsd support#4049
ReenigneArcher merged 6 commits into
masterfrom
build/add-freebsd-support

Conversation

@ReenigneArcher

@ReenigneArcherReenigneArcher commented Jul 5, 2025

Copy link
Copy Markdown
Member

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
ReenigneArcherforce-pushed the build/add-freebsd-support branch 2 times, most recently from 8221db2 to 15f2b42CompareJuly 5, 2025 00:32
@codecov

codecovBot commented Jul 5, 2025

Copy link
Copy Markdown

Bundle Report

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

Detailed changes
Bundle nameSizeChange
sunshine-esm966.71kB1.68kB (0.17%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: sunshine-esm

Assets Changed:

Asset NameSize ChangeTotal SizeChange (%)
assets/config-*.js1.68kB60.45kB2.85%

Files inassets/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

codecovBot commented Jul 5, 2025

Copy link
Copy Markdown

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 112 commits behind head on master.

Files with missing linesPatch %Lines
src/platform/linux/misc.cpp0.00%35 Missing ⚠️
src/stream.cpp0.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 
FlagCoverage Δ
FreeBSD-14.3-amd6413.56% <0.00%> (?)
Linux-AppImage11.56% <0.00%> (-0.01%)⬇️
Windows-AMD6413.35% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing linesCoverage Δ
src/system_tray.cpp0.00% <ø> (ø)
src/video.cpp29.46% <ø> (+8.60%)⬆️
src/video.h61.11% <ø> (+14.95%)⬆️
src/stream.cpp2.84% <0.00%> (+0.35%)⬆️
src/platform/linux/misc.cpp14.45% <0.00%> (+4.45%)⬆️

... and 79 files with indirect coverage changes

@ReenigneArcher
ReenigneArcherforce-pushed the build/add-freebsd-support branch 6 times, most recently from 920e292 to 1f75e94CompareJuly 5, 2025 21:37
@ReenigneArcher
ReenigneArcherforce-pushed the build/add-freebsd-support branch 19 times, most recently from e820ce8 to 082dc51CompareJuly 8, 2025 01:10
Revised README to clarify supported controllers and operating systems, including FreeBSD and updated Windows requirements. Updated getting_started.md to note that DualSense/DS5 emulation is not available due to missing uhid features.
@ReenigneArcher

Copy link
Copy Markdown
MemberAuthor

@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
Copy Markdown

@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
Copy Markdown
MemberAuthor

@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
Copy Markdown
MemberAuthor

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.

Comment threadsrc_assets/bsd/misc/+POST_INSTALL Outdated
Comment threadsrc_assets/bsd/misc/+PRE_DEINSTALL Outdated
Comment threadsrc_assets/bsd/misc/+POST_INSTALL Outdated
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
Copy Markdown

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
Copy Markdown
MemberAuthor

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

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

Copy link
Copy Markdown

Quality Gate FailedQuality 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

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

roadmapThis 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

@ReenigneArcher@danieljg
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

build: add freebsd support - #4049

Merged
ReenigneArcher merged 6 commits into
masterfrom
build/add-freebsd-support
Nov 12, 2025
Merged

build: add freebsd support#4049
ReenigneArcher merged 6 commits into
masterfrom
build/add-freebsd-support

Conversation

@ReenigneArcher

@ReenigneArcherReenigneArcher commented Jul 5, 2025

Copy link
Copy Markdown
Member

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
ReenigneArcherforce-pushed the build/add-freebsd-support branch 2 times, most recently from 8221db2 to 15f2b42CompareJuly 5, 2025 00:32
@codecov

codecovBot commented Jul 5, 2025

Copy link
Copy Markdown

Bundle Report

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

Detailed changes
Bundle nameSizeChange
sunshine-esm966.71kB1.68kB (0.17%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: sunshine-esm

Assets Changed:

Asset NameSize ChangeTotal SizeChange (%)
assets/config-*.js1.68kB60.45kB2.85%

Files inassets/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

codecovBot commented Jul 5, 2025

Copy link
Copy Markdown

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 112 commits behind head on master.

Files with missing linesPatch %Lines
src/platform/linux/misc.cpp0.00%35 Missing ⚠️
src/stream.cpp0.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 
FlagCoverage Δ
FreeBSD-14.3-amd6413.56% <0.00%> (?)
Linux-AppImage11.56% <0.00%> (-0.01%)⬇️
Windows-AMD6413.35% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing linesCoverage Δ
src/system_tray.cpp0.00% <ø> (ø)
src/video.cpp29.46% <ø> (+8.60%)⬆️
src/video.h61.11% <ø> (+14.95%)⬆️
src/stream.cpp2.84% <0.00%> (+0.35%)⬆️
src/platform/linux/misc.cpp14.45% <0.00%> (+4.45%)⬆️

... and 79 files with indirect coverage changes

@ReenigneArcher
ReenigneArcherforce-pushed the build/add-freebsd-support branch 6 times, most recently from 920e292 to 1f75e94CompareJuly 5, 2025 21:37
@ReenigneArcher
ReenigneArcherforce-pushed the build/add-freebsd-support branch 19 times, most recently from e820ce8 to 082dc51CompareJuly 8, 2025 01:10
Revised README to clarify supported controllers and operating systems, including FreeBSD and updated Windows requirements. Updated getting_started.md to note that DualSense/DS5 emulation is not available due to missing uhid features.
@ReenigneArcher

Copy link
Copy Markdown
MemberAuthor

@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
Copy Markdown

@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
Copy Markdown
MemberAuthor

@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
Copy Markdown
MemberAuthor

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.

Comment threadsrc_assets/bsd/misc/+POST_INSTALL Outdated
Comment threadsrc_assets/bsd/misc/+PRE_DEINSTALL Outdated
Comment threadsrc_assets/bsd/misc/+POST_INSTALL Outdated
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
Copy Markdown

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
Copy Markdown
MemberAuthor

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

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

Copy link
Copy Markdown

Quality Gate FailedQuality 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

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

roadmapThis 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

@ReenigneArcher@danieljg