Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mac autostart fail #1909

Closed
3 tasks done
d-dandrew opened this issue Dec 11, 2023 · 20 comments
Closed
3 tasks done

Mac autostart fail #1909

d-dandrew opened this issue Dec 11, 2023 · 20 comments
Labels

Comments

@d-dandrew
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Is your issue described in the documentation?

  • I have read the documentation

Is your issue present in the nightly release?

  • This issue is present in the nightly release

Describe the Bug

After running sudo port load Sunshine, Sunshine can't autostart on Mac startup. launchctl shows it is loaded

% sudo launchctl list | grep macports
-	0	org.macports.Sunshine
-	0	org.macports.shared-mime-info-updater

Expected Behavior

No response

Additional Context

what is checked:
running sunshine directly in the terminal apps is working
screen recording enable the terminal app and sunshine excutable (sunshine softlink is deleted and rename sunshine-0.21.0 is renamed to sunshine)
run sudo port load Sunshine multiple times without fail-info
tried launchctl load -w /Library/LaunchAgents/org.freedesktop.dbus-session.plist but not fixing this

Host Operating System

macOS

Operating System Version

12.7.1

Architecture

64 bit

Sunshine commit or version

0.21.0

Package

macOS - Portfile

GPU Type

Intel

GPU Model

Intel Iris Pro 1536 MB

GPU Driver/Mesa Version

Metal GPUFamily macOS 1

Capture Method (Linux Only)

No response

Config

~/.config/sunshine/sunshine.conf

controller = disabled

Apps

No response

Relevant log output

cant find a log file in launchctl
@ReenigneArcher
Copy link
Member

sunshine softlink is deleted and rename sunshine-0.21.0 is renamed to sunshine

Why?

@d-dandrew
Copy link
Author

d-dandrew commented Dec 12, 2023

sunshine softlink is deleted and rename sunshine-0.21.0 is renamed to sunshine

Why?

sunshine-0.21.0 can't be recognize in Finder as an Unix Excutable file but shown as unknow document file, even after I chmod +x the sunshine-0.21.0 file.

@Mirarchi
Copy link

Same here, any clues or workarounds for this? Thanks

@CHEETAHJinni
Copy link

I tried replacing the filename, but when I run it I get the following message:

Last login: Fri Jan 19 03:53:51 on ttys000
mac@Macintosh ~ % /Applications/usr/bin/sunshine ; exit;
dyld[38449]: Library not loaded: '/usr/local/opt/opus/lib/libopus.0.dylib'
Referenced from: '/Applications/usr/bin/sunshine'
Reason: tried: '/usr/local/opt/opus/lib/libopus.0.dylib' (no such file), '/usr/local/lib/libopus.0.dylib' (no such file), '/usr/lib/libopus.0.dylib' (no such file)
zsh: abort /Applications/usr/bin/sunshine

Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.

[进程已完成]

@miwagner1
Copy link

Ah I was wondering why sunshine was not working for me.

@XuXianTao
Copy link

XuXianTao commented Mar 3, 2024

I try to add a new plist to run sunshine to solve the problem.

  1. sudo vi /Library/LaunchDaemons/my-autostart.macports.sunshine.plist
  2. press i to insert code
  3. copy the next code to the file and replace [your current account name] to your current account name.
  4. sudo launchctl load /Library/LaunchDaemons/my-autostart.macports.sunshine.plist
  5. Reboot your mac and it run successfully in my case
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>my-autostart.macports.sunshine</string>
	<key>UserName</key>
	<string>[your current account name]</string>

    <key>RunAtLoad</key>
    <true/>

    <key>KeepAlive</key>
    <true/>

    <key>ProgramArguments</key>
    <array>
        <string>/opt/local/bin/sunshine</string>
    </array>
</dict>
</plist>


There is also a org.macports.Sunshine.plist in /Library/LaunchDaemons/ and it look like to run sunshine, but it seems like not work successfully, no idea why it doesn't work

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd" >
<plist version='1.0'>
<dict>
<key>Label</key><string>org.macports.Sunshine</string>
<key>ProgramArguments</key>
<array>
        <string>/opt/local/bin/daemondo</string>
        <string>--label=Sunshine</string>
        <string>--start-cmd</string>
        <string>/opt/local/bin/{Sunshine}</string>
        <string>;</string>
        <string>--restart-netchange</string>
        <string>--pid=exec</string>
</array>
<key>Disabled</key><true/>
<key>KeepAlive</key><true/>
</dict>
</plist>

@ReenigneArcher
Copy link
Member

My guess is it's trying to load the macport one before the user is actually logged in.

@ReenigneArcher ReenigneArcher added the os:macOS OS is macOS label Mar 27, 2024
@wbrione
Copy link

wbrione commented Mar 31, 2024

There is also a org.macports.Sunshine.plist in /Library/LaunchDaemons/ and it look like to run sunshine, but it seems like not work successfully, no idea why it doesn't work

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd" >
<plist version='1.0'>
<dict>
<key>Label</key><string>org.macports.Sunshine</string>
<key>ProgramArguments</key>
<array>
        <string>/opt/local/bin/daemondo</string>
        <string>--label=Sunshine</string>
        <string>--start-cmd</string>
        <string>/opt/local/bin/{Sunshine}</string>
        <string>;</string>
        <string>--restart-netchange</string>
        <string>--pid=exec</string>
</array>
<key>Disabled</key><true/>
<key>KeepAlive</key><true/>
</dict>
</plist>

@XuXianTao , just replace "{Sunshine}" on original .plist to "sunshine"...

Grant "screen recording permission" to the executable "/opt/local/bin/daemondo"

After the service starts, its settings, logs, etc. can be accessed in ~root/.config/sunshine

So, auto start "fixed", however, I still have a problem...

When accessing the desktop, the MacOS desktop is displayed, however, that's it... there are no more screen updates.

If I open an application, I don't see the new window for it in my "moonlight" client :-(

This happens whether running sunshine as a service, in the context of "root", or interactively, via terminal, from my user.

@wbrione
Copy link

wbrione commented Apr 1, 2024

(...)

So, auto start "fixed", however, I still have a problem...

When accessing the desktop, the MacOS desktop is displayed, however, that's it... there are no more screen updates.

If I open an application, I don't see the new window for it in my "moonlight" client :-(

This happens whether running sunshine as a service, in the context of "root", or interactively, via terminal, from my user.

Thank God.... I'm not the only one to face this type of problem on the Mac 😂... Would the "solution" be to downgrade Sunshine?!

https://www.reddit.com/r/MoonlightStreaming/comments/197g7pu/sunshine_does_it_only_support_latest_macos_v20/

@Hazer
Copy link
Member

Hazer commented May 16, 2024

@wbrione Hey, can you try again with the new nightly? My PR #2485 that fixes encoding issues with macOS got merged and seems to fix issues for most users.

@wbrione
Copy link

wbrione commented May 19, 2024

@wbrione Hey, can you try again with the new nightly? My PR #2485 that fixes encoding issues with macOS got merged and seems to fix issues for most users.

Apologies for my delay @Hazer ... So, because I found it easier to manage, I ended up adopting the "brew" installation method, which did not present the problems to setup auto start services as like macport.

Anyway, assuming I were to use the method via macport again, how do I install the "nightly" version with this fix ?

@ReenigneArcher
Copy link
Member

You download the Portfile from the release of interest, in this case https://github.com/LizardByte/Sunshine/releases/nightly-dev

@wbrione
Copy link

wbrione commented May 19, 2024

You download the Portfile from the release of interest, in this case https://github.com/LizardByte/Sunshine/releases/nightly-dev

@ReenigneArcher ... I would really like to stay with the "brew installation method"...

How to download and install the latest version (pre-release)?! You know how ?!

When trying to install, it always downloads the source of the current release (v0.23.1 8b21db6)

:-(

@ReenigneArcher
Copy link
Member

I thought you asked how to use the nightly Portfile.

For brew, I'm not 100% sure but I think you can use the head branch somehow.

@Hazer
Copy link
Member

Hazer commented May 19, 2024

How to download and install the latest version (pre-release)?! You know how ?!

@wbrione

brew tap LizardByte/homebrew
brew install sunshine --HEAD

@ReenigneArcher I should probably submit a PR including instructions for nightly macOS installation to the docs, shouldn't I?

@wbrione
Copy link

wbrione commented May 19, 2024

How to download and install the latest version (pre-release)?! You know how ?!

@wbrione

brew tap LizardByte/homebrew
brew install sunshine --HEAD

@ReenigneArcher I should probably submit a PR including instructions for nightly macOS installation to the docs, shouldn't I?

@Hazer ... Thank you very much... It worked!!! Now just wait a few hours to finish the compilation/installation... I'll be back with feedback soon ;-)

About improving documentation... It would be very good, especially for people like me, who are "newbies" when it comes to the MacOS universe and its tools.

You would be amazed at how many people on the internet have exactly this doubt... I researched a lot before before asking for help here ;-)

Once again, thank you very much for everyone's attention.

@wbrione
Copy link

wbrione commented May 20, 2024

@Hazer , everything works Ok now... The only question for me now is understand why my mouse pointer disappears when I open, for example, Safari ;-) ... The pointer works, it just doesn't appear in the streaming (only while streaming), perhaps due to interference from another software, like Barrier (KVM), since I don't have a physical mouse connected to MacOS

Thank you very, very much for the support.

@wgalternate
Copy link

@wbrione Do you have the steps to get it to autostart using the homebrew method?

@LizardByte-bot
Copy link
Member

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

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

@LizardByte-bot LizardByte-bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

10 participants