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 Support #1

Open
The-Dumb-Dino opened this issue Jan 22, 2024 · 39 comments
Open

Mac Support #1

The-Dumb-Dino opened this issue Jan 22, 2024 · 39 comments
Assignees
Labels
enhancement New feature or request

Comments

@The-Dumb-Dino
Copy link

It is possible to add support for Darwin systems? I may have done a mistake in setting up the bridge but I am not certain.

@EnderIce2
Copy link
Owner

It is possible to add support for Darwin systems?

Unfortunately I don't think it's possible.

I may have done a mistake in setting up the bridge but I am not certain.

The bridge relies on direct calls to the Linux kernel for operations beyond the Wine prefix.

@EnderIce2 EnderIce2 self-assigned this Mar 7, 2024
@EnderIce2 EnderIce2 added the enhancement New feature or request label Mar 7, 2024
@EnderIce2
Copy link
Owner

Check if v1.1-rc1 works for you.

@OrigamingWasTaken
Copy link
Contributor

CleanShot 2024-05-07 at 19 19 15@2x
I tried using the version you said and I'm getting this error after some minutes (playing ULTRAKILL btw)

@EnderIce2
Copy link
Owner

I couldn't reproduce the issue you're having (unless I kill Discord).
I updated the bridge to retry the connection in this build.

@OrigamingWasTaken
Copy link
Contributor

With the last build I'm getting this error:
CleanShot 2024-05-08 at 18 13 21@2x

Im launching the bridge, then launching the app

@EnderIce2
Copy link
Owner

Weird, I tested on macOS Monterey and it works without any issues. What version of macOS you are running? How did you launch the bridge?

@OrigamingWasTaken
Copy link
Contributor

I'm on MacOS Sonoma (Using Whisky btw). I launch the executable from the gui and then launch steam and my game.

@EnderIce2
Copy link
Owner

I see, the issue is that the bridge can't get $TMPDIR:

char *value = getenv(name);

Unfortunately, $TMPDIR is not hard-coded and I don't know yet how to get it without getenv().
Launching Whisky from the terminal may work?

@OrigamingWasTaken
Copy link
Contributor

I may be able to find a solution. How do you launch the progam on your machine? Also does $TMPDIR changes or it is a static value?

@OrigamingWasTaken
Copy link
Contributor

OrigamingWasTaken commented May 10, 2024

This is currently my bash script to launch Steam and the bridge.exe:

#!/bin/bash
echo "$TMPDIR"
WINEDEBUG="fixme-all" WINEPREFIX="/Users/marlon/Library/Containers/com.isaacmarovitz.Whisky/Bottles/AA8F5A78-D5C8-47C9-910E-56E81DEEB64A" GST_DEBUG="1" WINEESYNC="1" WINEDLLOVERRIDES="dxgi,d3d9,d3d10core,d3d11=n,b" DXVK_ASYNC="1" /Users/marlon/Library/Application\ Support/com.isaacmarovitz.Whisky/Libraries/Wine/bin/wine64 start /unix /Users/marlon/Library/Containers/com.isaacmarovitz.Whisky/Bottles/AA8F5A78-D5C8-47C9-910E-56E81DEEB64A/drive_c/bridge.exe
WINEDLLOVERRIDES="dxgi,d3d9,d3d10core,d3d11=b" WINEPREFIX="/Users/marlon/Library/Containers/com.isaacmarovitz.Whisky/Bottles/AA8F5A78-D5C8-47C9-910E-56E81DEEB64A" WINEDEBUG="fixme-all" GST_DEBUG="1" DXVK_ASYNC="1" WINEESYNC="1" /Users/marlon/Library/Application\ Support/com.isaacmarovitz.Whisky/Libraries/Wine/bin/wine64 start /unix /Users/marlon/Library/Containers/com.isaacmarovitz.Whisky/Bottles/AA8F5A78-D5C8-47C9-910E-56E81DEEB64A/drive_c/Program\ Files\ \(x86\)/Steam/steam.exe

When I run it from the terminal (./launch.sh), it returns:

/var/folders/kp/jpy0mvxn6dsdcybqh96j39ph0000gn/T/
esync: up and running.

So the variable is correctly set, but not accessible in the program. How am I supposed to launch the program with the args then?

@EnderIce2
Copy link
Owner

Ok so I did some changes and I added --rpc argument

Add --rpc "$TMPDIR" at the end of

 (...) /drive_c/bridge.exe --rpc "$TMPDIR"

The binary: bridge.zip

@OrigamingWasTaken
Copy link
Contributor

Okay! This seems to work. After narrowing the problem a bit more, I found that this was Whisky's fault as it escapes env variables 😅. Appart from that, the problem where the bridge was printing EOF is also fixed.
Thanks for the work and help :D!

@OrigamingWasTaken
Copy link
Contributor

Got another problem on mac sorry 😅
After playing 5-10min of ULTRAKILL, i get the error: EOF count exeeded
Here's the logs:

:"P-2: WAIT OF THE WORE WORLD","small_image":"6807LD","small_image":"rank_b","sm
all_text":"Brutal"}56752073228391","small_text":"Brutal"},"party":{},"secrets":{
},"name":"ULTRAKILL","application_id":"68,"party":{},"secrets":{},"instance":tru
e}}}�E0748054038577165","flags":1,"type":�{"cmd":"SET_ACTIVITY","nonce":"31","ev
t":null,"args":{"pid":1384,"activity":{"state":"DIFFICULTY: STANDARD","details":
"STYLE: 772","timestamps":{"start":1716054213},"assets":{"large_image":"missing"
,"large_text":"P-2: WAIT OF THE WORLD","small_image":"rank_b","small_text":"Brut
al"},"party":{},"secrets":{}0},"evt":null,"nonce":"25"}"
,"instance":true}}}�E�{"cmd"Reading 76 bytes from unix pipe: "�D{"code":1003,"me
ssage":"data size does not match what was received"}"
:"SET_ACTIVITY","nonce":"32","evt":n"
EOF
Failed to write to socket: -32
Writing 1024 bytes to unix pipe: "ull,"args":{"pid":1384,"activity":{"state":"DI
FFICULTY: STANDARD","details":"STYLE: 781","timestamps":{"start":1716054213},"as
sets":{"large_image":"missing","large_text":"P-2: WAIT OF THE WORLD","small_imag
e":"rank_b","small_text":"Brutal"},"party":{},"secrets":{},"instance":true}}}�E�
{"cmd":"SET_ACTIVITY","nonce":"33","evt":null,"args":{"pid":1384,"activity":{"st
ate":"DIFFICULTY: STANDARD","details":"STYLE: 799","timestamps":{"start":1716054
213},"assets":{"large_image":"missing","large_text":"P-2: WAIT OF THE WORLD","sm
all_image":"rank_b","small_text":"Brutal"},"party":{},"secrets":{},"instance":tr
ue}}}�E�{"cmd":"SET_ACTIVITY","nonce":"34","evt":null,"args":{"pid":1384,"activi
ty":{"state":"DIFFICULTY: STANDARD","details":"STYLE: 815","timestamps":{"start"
:1716054213},"assets":{"large_image":"missing","large_text":"P-2: WAIT OF THE WO
RLD","small_image":"rank_b","small_text":"Brutal"},"party":{},"secrets":{},"inst
ance":true}}}�E�{"cmd":"SET_ACTIVITY","nonce":"35","evt":null,"args":{"pid":1384
,"a"
Failed to write to socket: -32
Writing 1024 bytes to unix pipe: "ctivity":{"state":"DIFFICULTY: STANDARD","deta
ils":"STYLE: 839","timestamps":{"start":1716054213},"assets":{"large_image":"mis
sing","large_text":"P-2: WAIT OF THE WORLD","small_image":"rank_b","small_text":
"Brutal"},"party":{},"secrets":{},"instance":true}}}�E�{"cmd":"SET_ACTIVITY","no
nce":"36","evt":null,"args":{"pid":1384,"activity":{"state":"DIFFICULTY: STANDAR
D","details":"STYLE: 848","timestamps":{"start":1716054213},"assets":{"large_ima
ge":"missing","large_text":"P-2: WAIT OF THE WORLD","small_image":"rank_b","smal
l_text":"Brutal"},"party":{},"secrets":{},"instance":true}}}�E�{"cmd":"SET_ACTIV
ITY","nonce":"37","evt":null,"args":{"pid":1384,"activity":{"state":"DIFFICULTY:
 STANDARD","details":"STYLE: 857","timestamps":{"start":1716054213},"assets":{"l
arge_image":"missing","large_text":"P-2: WAIT OF THE WORLD","small_image":"rank_
b","small_text":"Brutal"},"party":{},"secrets":{},"instance":true}}}�E�{"cmd":"S
ET_ACTIVITY","nonce":"38","evt":null,"args":{"pid":1384,"activity":{"state":"DIF
FIC"
Failed to write to socket: -32
Writing 1024 bytes to unix pipe: "ULTY: STANDARD","details":"STYLE: 866","timest
amps":{"start":1716054213},"assets":{"large_image":"missing","large_text":"P-2:
WAIT OF THE WORLD","small_image":"rank_b","small_text":"Brutal"},"party":{},"sec
rets":{},"instance":true}}}�E�{"cmd":"SET_ACTIVITY","nonce":"39","evt":null,"arg
s":{"pid":1384,"activity":{"state":"DIFFICULTY: STANDARD","details":"STYLE: 884"
,"timestamps":{"start":1716054213},"assets":{"large_image":"missing","large_text
":"P-2: WAIT OF THE WORLD","small_image":"rank_b","small_text":"Brutal"},"party"
:{},"secrets":{},"instance":true}}}�E�{"cmd":"SET_ACTIVITY","nonce":"40","evt":n
ull,"args":{"pid":1384,"activity":{"state":"DIFFICULTY: STANDARD","details":"STY
LE: 893","timestamps":{"start":1716054213},"assets":{"large_image":"missing","la
rge_text":"P-2: WAIT OF THE WORLD","small_image":"rank_b","small_text":"Brutal"}
,"party":{},"secreEOF
ts":{},"instance":true}}}�E�{"cmd":"SET_ACTIVITY","nonce":"41","evt":null,"args"
:{"pid":1384,"activity":{"state":"DIFFICULTY: STANDARD","details""
Failed to write to socket: -32
Writing 1024 bytes to unix pipe: ":"STYLE: 902","timestamps":{"start":1716054213
},"assets":{"large_image":"missing","large_text":"P-2: WAIT OF THE WORLD","small
_image":"rank_b","small_text":"Brutal"},"party":{},"secrets":{},"instance":true}
}}�E�{"cmd":"SET_ACTIVITY","nonce":"42","evt":null,"args":{"pid":1384,"activity"
:{"state":"DIFFICULTY: STANDARD","details":"STYLE: 911","timestamps":{"start":17
16054213},"assets":{"large_image":"missing","large_text":"P-2: WAIT OF THE WORLD
","small_image":"rank_b","small_text":"Brutal"},"party":{},"secrets":{},"instanc
e":true}}}�E�{"cmd":"SET_ACTIVITY","nonce":"43","evt":null,"args":{"pid":1384,"a
ctivity":{"state":"DIFFICULTY: STANDARD","details":"STYLE: 920","timestamps":{"s
tart":1716054213},"assets":{"large_image":"missing","large_text":"P-2: WAIT OF T
HE WORLD","small_image":"rank_b","small_text":"Brutal"},"party":{},"secrets":{},
"instance":true}}}�E�{"cmd":"SET_ACTIVITY","nonce":"44","evt":null,"args":{"pid"
:1384,"activity":{"state":"DIFFICULTY: STANDARD","details":"STYLE: 929","timesta
mps"
Failed to write to socket: -32
Writing 183 bytes to unix pipe: "":{"start":1716054213},"assets":{"large_image":
"missing","large_text":"P-2: WAIT OF THE WORLD","small_image":"rank_b","small_te
xt":"Brutal"},"party":{},"secrets":{},"instance":true}}}"
Failed to write to socket: -32
Writing 335 bytes to unix pipe: "�G�{"cmd":"SET_ACTIVITY","nonce":"45","evt":nul
l,"args":{"pid":1384,"activity":{"state":"DIFFICULTY: STANDARD","details":"STYLE
: 929","timestamps":{"start":1716054213},"assets":{"large_image":"missing","larg
e_text":"P-2: WAIT OF THE WORLD","small_image":"rank_a","small_text":"Anarchic"}
,"party":{},"secrets":{},"instance":true}}}"
Failed to write to socket: -32
Writing 672 bytes to unix pipe: "�H�{"cmd":"SET_ACTIVITY","nonce":"46","evt":nul
l,"args":{"pid":1384,"activity":{"state":"DIFFICULTY: STANDARD","details":"STYLE
: 1064","timestamps":{"start":1716054213},"assets":{"large_image":"missing","lar
ge_text":"P-2: WAIT OF THE WORLD","small_image":"rank_a","small_text":"Anarchic"
},"party":{},"secrets":{},"instance":true}}}�H�{"cmd":"SET_ACTIVITY","nonce":"47
","evt":null,"args":{"pid":1384,"activity":{"state":"DIFEOF
FICULTY: STANDARD","details":"STYLE: 1097","timestamps":{"start":1716054213},"as
sets":{"large_image":"missing","large_text":"P-2: WAIT OF THE WORLD","small_imag
e":"rank_a","small_text":"Anarchic"},"party":{},"secrets":{},"instance":true}}}"

Failed to write to socket: -32
Writing 336 bytes to unix pipe: "�H�{"cmd":"SET_ACTIVITY","nonce":"48","evt":nul
l,"args":{"pid":1384,"activity":{"state":"DIFFICULTY: STANDARD","details":"STYLE
: 1119","timestamps":{"start":1716054213},"assets":{"large_image":"missing","lar
ge_text":"P-2: WAIT OF THE WORLD","small_image":"rank_a","small_text":"Anarchic"
},"party":{},"secrets":{},"instance":true}}}"
Failed to write to socket: -32
Writing 334 bytes to unix pipe: "�F�{"cmd":"SET_ACTIVITY","nonce":"49","evt":nul
l,"args":{"pid":1384,"activity":{"state":"DIFFICULTY: STANDARD","details":"STYLE
: 1119","timestamps":{"start":1716054213},"assets":{"large_image":"missing","lar
ge_text":"P-2: WAIT OF THE WORLD","small_image":"rank_b","small_text":"Brutal"},
"party":{},"secrets":{},"instance":true}}}"
Failed to write to socket: -32
Writing 334 bytes to unix pipe: "�F�{"cmd":"SET_ACTIVITY","nonce":"50","evt":nul
l,"args":{"pid":1384,"activity":{"state":"DIFFICULTY: STANDARD","details":"STYLE
: 1084","timestamps":{"start":1716054213},"assets":{"large_image":"missing","lar
ge_text":"P-2: WAIT OF THE WORLD","small_image":"rank_b","small_text":"Brutal"},
"party":{},"secrets":{},"instance":true}}}"
Failed to write to socket: -32
EOF
Writing 336 bytes to unix pipe: "�H�{"cmd":"SET_ACTIVITY","nonce":"51","evt":nul
l,"args":{"pid":1384,"activity":{"state":"DIFFICULTY: STANDARD","details":"STYLE
: 1084","timestamps":{"start":1716054213},"assets":{"large_image":"missing","lar
ge_text":"P-2: WAIT OF THE WORLD","small_image":"rank_a","small_text":"Anarchic"
},"party":{},"secrets":{},"instance":true}}}"
Failed to write to socket: -32
Writing 336 bytes to unix pipe: "�H�{"cmd":"SET_ACTIVITY","nonce":"52","evt":nul
l,"args":{"pid":1384,"activity":{"state":"DIFFICULTY: STANDARD","details":"STYLE
: 1345","timestamps":{"start":1716054213},"assets":{"large_image":"missing","lar
ge_text":"P-2: WAIT OF THE WORLD","small_image":"rank_a","small_text":"Anarchic"
},"party":{},"secrets":{},"instance":true}}}"
Failed to write to socket: -32
EOF
Writing 336 bytes to unix pipe: "�H�{"cmd":"SET_ACTIVITY","nonce":"53","evt":nul
l,"args":{"pid":1384,"activity":{"state":"DIFFICULTY: STANDARD","details":"STYLE
: 1532","timestamps":{"start":1716054213},"assets":{"large_image":"missing","lar
ge_text":"P-2: WAIT OF THE WORLD","small_image":"rank_a","small_text":"Anarchic"
},"party":{},"secrets":{},"instance":true}}}"
Failed to write to socket: -32
Writing 670 bytes to unix pipe: "�G�{"cmd":"SET_ACTIVITY","nonce":"54","evt":nul
l,"args":{"pid":1384,"activity":{"state":"DIFFICULTY: STANDARD","details":"STYLE
: 1532","timestamps":{"start":1716054213},"assets":{"large_image":"missing","lar
ge_text":"P-2: WAIT OF THE WORLD","small_image":"rank_s","small_text":"Supreme"}
,"party":{},"secrets":{},"instance":true}}}�G�{"cmd":"SET_ACTIVITY","nonce":"55"
,"evt":null,"args":{"pid":1384,"activity":{"state":"DIFFICULTY: STANDARD","detai
ls":"STYLE: 1657","timestamps":{"start":1716054213},"assets":{"large_image":"mis
sing","large_text":"P-2: WAIT OF THE WORLD","small_image":"rank_s","small_text":
"Supreme"},"party":{},"secrets":{},"instance":true}}}"
Failed to write to socket: -32
Writing 335 bytes to unix pipe: "�G�{"cmd":"SET_ACTIVITY","nonce":"56","evt":nul
l,"args":{"pid":1384,"activity":{"state":"DIFFICULTY: STANDARD","details":"STYLE
: 1828","timestamps":{"start":1716054213},"assets":{"large_image":"missing","lar
ge_text":"P-2: WAIT OF THE WORLD","small_image":"rank_s","small_text":"Supreme"}
,"party":{},"secrets":{},"instance":true}}}"
Failed to write to socket: -32
EOF count exceeded

@EnderIce2
Copy link
Owner

Failed to write to socket: -32 means broken pipe
I guess the buffer is too small? Try this build:
bridge.zip
And let me know if the issue is fixed.

@OrigamingWasTaken
Copy link
Contributor

After some testing, I haven't encountered an error for a long while 👍

@OrigamingWasTaken
Copy link
Contributor

I've just had an idea to support installing in the wine prefix on MacOS. You said it was not possible due to the $TMPDIR folder changing each reboot. What if there was a simple bash script that launched with launchctl every reboot, and that symlinked the $TMPDIR folder to a static path? If you don't know how to do that on Mac, I would be glad to help.

@OrigamingWasTaken
Copy link
Contributor

After some tinkering, I managed to make it work! Here's a bare bone fix. Basically, you have to use the macos.sh bash script to create a launchd agent that will symlink the $TMPDIR folder to /tmp/rpc-bridge/tmpdir. This allows to use the service in MacOS. Here's the release: https://github.com/OrigamingWasTaken/rpc-bridge-macos-fix/releases/tag/0.0.1

@EnderIce2
Copy link
Owner

Oh wow! I didn't know about launchd agent. I will look in your code and integrate the patches, if that is okay.

@OrigamingWasTaken
Copy link
Contributor

If you want, I can make a pull request once you're done reviewing the code. Some things may be strange because I don't know C very well.

@EnderIce2
Copy link
Owner

Yes, the code is okay, you can make a pull request.

@OrigamingWasTaken
Copy link
Contributor

I made a pull request :D
#3

@amisukarei
Copy link

I made a pull request :D
#3

I don't know if this is the right place to ask but I really can't get it to work on macOS 15.0.1 on my m2 mac air with whisky

@OrigamingWasTaken
Copy link
Contributor

What are you having trouble with?

@amisukarei
Copy link

I can't get the bridge working. I have done the extra steps for macOS for the launch agent and I have followed the documentation but I just can't get my game activity in whisky to show on my discord (modded with vencord). The rpc-bridge just won't work for me.

Macbook air m2 macOS 15.0.1 and 15.1.

@EnderIce2 EnderIce2 reopened this Oct 29, 2024
@EnderIce2 EnderIce2 pinned this issue Oct 29, 2024
@OrigamingWasTaken
Copy link
Contributor

Does this directory exist for you?
/tmp/rpc-bridge/tmpdir

@amisukarei
Copy link

It does yes.

@OrigamingWasTaken
Copy link
Contributor

Have you opened the bridge.exe file manually at least once?

@amisukarei
Copy link

I have yes

@OrigamingWasTaken
Copy link
Contributor

Does RPC work if you uninstall the windows service (by opening the bridge.exe and clicking Remove), start the bridge manually, and start your game? If it doesn't, what program are you trying to get working?

@amisukarei
Copy link

I swear I tried that and it didn't work. Now it works if I just start the service. It only works for rain world though. If I try little nightmares 1 it won't show the rpc.

@amisukarei
Copy link

Will I have to just start the service manually everytime I play a game?

@OrigamingWasTaken
Copy link
Contributor

Will I have to just start the service manually everytime I play a game?

No you shouldn't have to.
@EnderIce2 It's been a long time since I looked at your code, could you guide us on where to find the logs and maybe other debugging information?

@EnderIce2
Copy link
Owner

Sure, the logs are in C:\windows\logs\bridge.log.

Will I have to just start the service manually everytime I play a game?

The service should start by itself if it's installed using the GUI. Weird...

@amisukarei
Copy link

I think I got it working with the install option instead of "start" option. I can get it to work when I have my games located in ~/documents/games/...

I couldn't get it to work with steams default directory for game installation files.
I do not know why it didn't work before. I can say that I somehow was able to get it working.

@ginotto8
Copy link

Hii, I'm having a problem. I've got an M2 macbook air running Sequoia 15.0.1. I've installed the rpc Launch Agent without problems, but when it comes to the bridge itself I have some issues. I'm using a Steam game on Crossover. After I've installed the windows service and opened the game nothing comes up on discord...Am I doing something wrong?

@OrigamingWasTaken
Copy link
Contributor

Hii, I'm having a problem. I've got an M2 macbook air running Sequoia 15.0.1. I've installed the rpc Launch Agent without problems, but when it comes to the bridge itself I have some issues. I'm using a Steam game on Crossover. After I've installed the windows service and opened the game nothing comes up on discord...Am I doing something wrong?

Does the bridge work when started manually?

@ginotto8
Copy link

Sadly no, it doesn't. Do I have to place the launching string for steam on Crossover? If yes what do I have to write? Also do I have to start it after or before opening the game?

@amisukarei
Copy link

Have you tried multiple games? I could only have discord rpc working on 1 of my games

@ginotto8
Copy link

Not really, I'm kinda restricted on having too many games at once since I don't have that much space to store games :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants