Sunshine icon indicating copy to clipboard operation
Sunshine copied to clipboard

Support for macOS 26 Beta

Open rena-minami opened this issue 7 months ago • 7 comments

Is there an existing issue for this?

  • [x] I have searched the existing issues

Is your issue described in the documentation?

  • [x] I have read the documentation

Is your issue present in the latest beta/pre-release?

This issue is present in the latest pre-release

Describe the Bug

Currently on macOS 26.0 Beta (25A5279m) (developer beta 1), sunshine compiles but produces a runtime error.

Expected Behavior

Program runs normally.

Additional Context

No response

Host Operating System

macOS

Operating System Version

macOS 26.0 Beta (25A5279m)

Architecture

arm64/aarch64

Sunshine commit or version

v2025.609.163957

Package

macOS - Homebrew

GPU Type

Apple Silicon

GPU Model

M4

GPU Driver/Mesa Version

N/A

Capture Method

None

Config

ping_timeout = 10000
stream_audio = true

Apps


Relevant log output

[2025-06-10 12:24:16.580811] [0x0000000204ce6340] [info]    config: 'stream_audio' = true
[2025-06-10 12:24:16.581060] [0x0000000204ce6340] [info]    config: 'ping_timeout' = 50000
[2025-06-10 12:24:16.581]: Info: Sunshine version: v2025.609.163957
[2025-06-10 12:24:16.581]: Info: Package Publisher: LizardByte
[2025-06-10 12:24:16.581]: Info: Publisher Website: https://app.lizardbyte.dev
[2025-06-10 12:24:16.581]: Info: Get support: https://app.lizardbyte.dev/support
[2025-06-10 12:24:16.581]: Info: config: 'ping_timeout' = 50000
[2025-06-10 12:24:16.581]: Info: config: 'stream_audio' = true
[2025-06-10 12:24:16.630]: Warning: No gamepad input is available
[2025-06-10 12:24:16.630]: Info: // Testing for available encoders, this may generate errors. You can safely ignore those errors. //
[2025-06-10 12:24:16.630]: Info: Trying encoder [videotoolbox]
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[2]'
*** First throw call stack:
(
	0   CoreFoundation                      0x0000000198242690 __exceptionPreprocess + 176
	1   libobjc.A.dylib                     0x0000000197d2a430 objc_exception_throw + 88
	2   CoreFoundation                      0x000000019836be64 -[__NSPlaceholderDictionary initWithObjects:forKeys:count:] + 724
	3   CoreFoundation                      0x000000019830dbd0 +[NSDictionary dictionaryWithObjects:forKeys:count:] + 52
	4   sunshine-v2025.609.163957           0x0000000100ce6ee8 +[AVVideo displayNames] + 252
	5   sunshine-v2025.609.163957           0x0000000100ce7810 _ZN5platf7displayENS_10mem_type_eERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKN5video8config_tE + 320
	6   sunshine-v2025.609.163957           0x0000000100cbfa94 _ZN5video13reset_displayERNSt3__110shared_ptrIN5platf9display_tEEERKNS2_10mem_type_eERKNS0_12basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERKNS_8config_tE + 92
	7   sunshine-v2025.609.163957           0x0000000100cc6724 _ZN5video16validate_encoderERNS_9encoder_tEb + 472
	8   sunshine-v2025.609.163957           0x0000000100cc811c _ZN5video14probe_encodersEv + 2768
	9   sunshine-v2025.609.163957           0x0000000100c1069c main + 2488
	10  dyld                                0x0000000197d9d854 start + 6256
)
libc++abi: terminating due to uncaught exception of type NSException
[1]    38548 abort      sunshine

rena-minami avatar Jun 10 '25 18:06 rena-minami

I also see this crash, Sunshine was working before the update on macOS Sequoia.

Mox4572 avatar Jun 10 '25 23:06 Mox4572

I guess something changed in the API in the new version.

Our tests pass in CI, but we cannot test videotoolbox in CI.

https://github.com/LizardByte/Sunshine/actions/runs/15572866499/job/43852208738?pr=3963

  [----------] 2 tests from EncoderVariants/EncoderTest
  [ RUN      ] EncoderVariants/EncoderTest.ValidateEncoder/videotoolbox
  IOServiceMatchingfailed for: AppleM2ScalerParavirtDriver
  /private/tmp/sunshine-20250611-23075-2ft334/tests/unit/test_video.cpp:18: Skipped
  Encoder not available
  
  [  SKIPPED ] EncoderVariants/EncoderTest.ValidateEncoder/videotoolbox (1902 ms)
  [ RUN      ] EncoderVariants/EncoderTest.ValidateEncoder/software
  [       OK ] EncoderVariants/EncoderTest.ValidateEncoder/software (66 ms)
  [----------] 2 tests from EncoderVariants/EncoderTest (1968 ms total)

ReenigneArcher avatar Jun 11 '25 00:06 ReenigneArcher

I think you mean "Support for macOS 26 Beta" in the title not 15.

Effywolf avatar Jun 11 '25 00:06 Effywolf

Sorry, I misunderstood

ReenigneArcher avatar Jun 11 '25 00:06 ReenigneArcher

I tried to do a clean build of Sunshine on macOS 26 with Xcode 26. I found a couple of minor errors that I'll make a PR for:

diff --git a/src/platform/macos/input.cpp b/src/platform/macos/input.cpp
index 7e61ab4b..49e25eaa 100644
--- a/src/platform/macos/input.cpp
+++ b/src/platform/macos/input.cpp
@@ -534,7 +534,7 @@ const KeyCodeMap kKeyCodesMap[] = {
     if (!output_name.empty()) {
       uint32_t max_display = 32;
       uint32_t display_count;
-      CGDirectDisplayID displays[max_display];
+      CGDirectDisplayID displays[32];
       if (CGGetActiveDisplayList(max_display, displays, &display_count) != kCGErrorSuccess) {
         BOOST_LOG(error) << "Unable to get active display list , error: "sv << std::endl;
       } else {
diff --git a/src/upnp.cpp b/src/upnp.cpp
index 14103ad5..b127a681 100644
--- a/src/upnp.cpp
+++ b/src/upnp.cpp
@@ -3,6 +3,7 @@
  * @brief Definitions for UPnP port mapping.
  */
 // lib includes
+#include <stddef.h> // for size_t
 #include <miniupnpc/miniupnpc.h>
 #include <miniupnpc/upnpcommands.h>

Running test_sunshine has a few strange errors, all of them like this. I am not sure if this is a real error or not.

/Users/andy/dev/Sunshine/tests/unit/../tests_common.h:20: Failure
Value of: platf_deinit
  Actual: false
Expected: true

And then I can reproduce the exact crash mentioned above, which I will keep looking into.

andygrundman avatar Jun 12 '25 16:06 andygrundman

The include was fixed upstream (https://github.com/miniupnp/miniupnp/commit/e263ab6f56c382e10fed31347ec68095d691a0e8), but not yet released. For the homebrew build this shouldn't be a problem anymore as I fixed it here: https://github.com/LizardByte/Sunshine/pull/3952

The other change seems weird. It's just changing from using a variable that's equal to 32, to using 32 directly?

ReenigneArcher avatar Jun 12 '25 17:06 ReenigneArcher

Yeah the full error is this. I suppose a more proper fix would be to set const uint32_t max_display = 32;.

src/platform/macos/input.cpp:537:34: error: variable length arrays in C++ are a Clang extension [-Werror,-Wvla-cxx-extension]
  537 |       CGDirectDisplayID displays[max_display];
      |                                  ^~~~~~~~~~~
/Users/andy/dev/Sunshine/src/platform/macos/input.cpp:537:34: note: read of non-const variable 'max_display' is not allowed in a constant expression
/Users/andy/dev/Sunshine/src/platform/macos/input.cpp:535:16: note: declared here
  535 |       uint32_t max_display = 32;
      |                ^
1 error generated.

Side note: this is maybe the worst designed API I've ever seen.

CGError CGGetActiveDisplayList(uint32_t maxDisplays, CGDirectDisplayID * activeDisplays, uint32_t * displayCount);

andygrundman avatar Jun 12 '25 22:06 andygrundman

It seems this issue hasn't had any activity in the past 90 days. If it's still something you'd like addressed, please let us know by leaving a comment. Otherwise, to help keep our backlog tidy, we'll be closing this issue in 10 days. Thanks!

LizardByte-bot avatar Sep 11 '25 10:09 LizardByte-bot

This issue was closed because it has been stalled for 10 days with no activity.

LizardByte-bot avatar Sep 22 '25 10:09 LizardByte-bot