EnderIce2 / rpc-bridge

Enable Rich Presence between your Wine applications and the native Discord client on Linux and macOS.
https://enderice2.github.io/rpc-bridge/
MIT License
58 stars 3 forks source link

Doesn't work in Vesktop at all, but works with official Discord #9

Closed shvedes closed 1 week ago

shvedes commented 1 week ago

Describe the bug Title is self-explanatory

To Reproduce Steps to reproduce the behavior:

  1. Open your game with installed bridge.exe
  2. Check your Discord activity in Vesktop => nothing
  3. Check you Discord activity in Discord official app => activity is shown
Screenshots Vesktop Discord
image image

Log File

Running as service
Starting service
Service started
Pipe \\.\pipe\discord-ipc-0(0x98) created
Waiting for pipe connection

Device (please complete the following information):

Additional context

Nov 16 10:54:28 CachyOS arrpc[868]: code: 'EPIPE', Nov 16 10:54:28 CachyOS arrpc[868]: syscall: 'write' Nov 16 10:54:28 CachyOS arrpc[868]: } Nov 16 10:54:28 CachyOS arrpc[868]: [arRPC > ipc] socket closed true Nov 16 11:00:30 CachyOS arrpc[868]: [arRPC > ipc] new connection! Nov 16 14:25:12 CachyOS arrpc[868]: [arRPC > ipc] new connection! Nov 16 14:48:43 CachyOS arrpc[868]: [arRPC > ipc] new connection! Nov 16 14:51:55 CachyOS arrpc[868]: [arRPC > bridge] web connected Nov 16 14:53:50 CachyOS arrpc[868]: [arRPC > bridge] web disconnected Nov 16 14:53:58 CachyOS arrpc[868]: [arRPC > bridge] web connected

Arcitec commented 1 week ago

arRPC is not great at parsing Rich Presence data. Probably arRPC bug! Please check and report to arRPC instead.

https://github.com/EnderIce2/rpc-bridge/blob/master/docs/index.md#known-issues

EnderIce2 commented 1 week ago

@shvedes Based on the screenshots, looks like you are playing Burnout™ Paradise Remastered? If so, the game doesn't have Discord GameSDK. That's up to the game developer to add it. This project targets games with this SDK (more info under Now Playing aka rich presence).

shvedes commented 1 week ago

Yes, it is, but despite this, RPC is still shows game's process in disord app, which means that your programm actually works, but again, only with original discord app. I will try another game and tell how it's going

shvedes commented 1 week ago
Death Stranding (I am sure that this game has RPC support). RPC Still using game process: Discord Vesktop
image image

Gof of War (2018). Still the same situation: Discord Vesktop
image image

God of War Ragnarok:

Discord Vesktop
image image
shvedes commented 1 week ago

bridge.exe can automatically detect /run/user/$UID/discord-ipc-1, which is official discord, but can't detect the primary one, which is discord-ipc-0 taken by vesktop

EnderIce2 commented 1 week ago

Death Stranding (I am sure that this game has RPC support). RPC Still using game process: Gof of War (2018) God of War Ragnarok

I think you are confusing the game detection and RPC (which are not the same). Official Discord client detects what game are you running (even if it's under Proton/Wine) and shows in the profile, but it's known that is not showing correctly the names, but you can edit this in settings.

Vesktop doesn't have this feature. That's why it's showing only in official Discord client.

Example of rich presence: image

As you can see, we have info such "In a Group" and a button to join. This project makes this to appear on your profile ONLY on games that have this implemented.

shvedes commented 1 week ago

Okay, probabbly we are misunderstooding each other. I don't have the goal to achive buttons, groups, etc in RPC, i just want one thing: display my current game in profile, like windows client does. If i open my game on windows (which is not supports parties and same stuff, just game name and it's icon). For example, Death Stranding mentioned above does not have multi-player, so we can't get buttons for this activity (AKA "Ask to Join") and detailed info about game locations, where i currently in. The only thing that works and works well - it's displaying game's name and i'ts icon. Thats what i am trying to achive.

If your project do a slightly different thing, then it's my bad for missunderstanding how this thing works

Arcitec commented 1 week ago

Vesktop doesn't have this feature. That's why it's showing only in official Discord client.

Vesktop has this feature. People just don't know what they are doing.

Arcitec commented 1 week ago

Death Stranding (I am sure that this game has RPC support). RPC Still using game process:

Your screenshots are not showing RPC. It's showing Discord's super-shitty process scanner on Linux, which picks up random .exe files and displays them with their basic exe name (and no game screenshot). If you run Steam games it often shows stuff like wineserver or pressure-vessel as the game name.

So in fact none of your screenshot are showing any RPC anywhere.

Let's go back to basics:

  1. arRPC is the ONLY good Process Scanner for Linux, capable of detecting game processes and displaying the correct names.
  2. If you use arRPC, it must run on the host (not Flatpak), see my previous comment.
  3. Your RPC is not working at all. Are your games running inside a Flatpak app such as Steam Flatpak, Lutris Flatpak, Bottles Flatpak, Heroic Flatpak? If so, you need to use my bridge. There is no other way: https://github.com/EnderIce2/rpc-bridge/issues/8 (and yes, since Vesktop or at least arRPC should be running on the host, you WILL NEED my bridge to connect the host RPC socket to the Flatpak RPC socket).
  4. Beware that arRPC's support for Rich Presence statuses coming from games is limited as mentioned here. If you know that a game uses RPC and it's failing in arRPC, report it to arRPC: https://github.com/EnderIce2/rpc-bridge/issues/9#issuecomment-2480670098
shvedes commented 1 week ago

The only thing that works and works well - it's displaying game's name and i'ts icon. Thats what i am trying to achive.

image Screenshot from Windows

Arcitec commented 1 week ago

Read my last 2 comments. Every answer is there. All of it.

shvedes commented 1 week ago

Read my last 2 comments. Every answer is there. All of it.

Just have to screenshot it and reboot again. No, i don't use flatpaks at all arRPC is running on host. I've mentioned this in the first message

Arcitec commented 1 week ago

Okay good. And you aren't using AppImages or Snaps or any other container formats to run your games, I hope?

Anyway, as for game detection, the easiest way to debug what is happening is to clone the arRPC repo here:

https://github.com/OpenAsar/arRPC

Then run it locally via npm install and node src on the host.

It will show a terminal explaining each game process that arRPC's scanner is detecting.

Run some Windows games. If their exe filenames are supported by the game list, you will see messages in the arRPC console saying that a game was detected.

If you are curious about the game list and what .exe files it scans for, it's somewhere inside their repo in a .json file. The list comes directly from Discord themselves.

shvedes commented 1 week ago

Will try this now. Thanks

Arcitec commented 1 week ago

Good luck. And remember, this only deals with game detection for non-RPC games. If you want Rich Presence, you need to use rpc-bridge inside wine, which will connect the Windows RPC socket to the UNIX RPC socket. So that Windows games Rich Presence messages are being bridged to Linux.

Then close all other discord clients completely (to ensure that $XDG_RUNTIME_DIR/discord-ipc-* files DO NOT EXIST anymore). Then start arRPC standalone and ensure you get the discord-ipc-0 socket.

Then run a Wine game that uses rpc-bridge.

Watch the arRPC console to see if it receives the Rich Presence message.

Then you have to hope that arRPC supports the incoming RPC Message, because as mentioned, they have some problems parsing some of the messages that games send out. :/

Arcitec commented 1 week ago

I also saw a big problem in your Vesktop config. You have disabled arRPC. :)

shvedes commented 1 week ago

I also saw a big problem in your Vesktop config. You have disabled arRPC. :)

Huh? How did you know that?

Arcitec commented 1 week ago

This is NOT arRPC:

image

THIS is arRPC:

image

The first image (WebRichPresence) is a plugin if you want to disable Vesktop's built-in arRPC and instead connect to a standalone arRPC instance running via Node. If you enable it then you MUST also manually start a separate arRPC standalone instance via Node.

The second image is the built-in arRPC server instead, which means you do not need to run arRPC separately. The built-in instance is great, but only works when Vesktop runs Natively (not inside Flatpak/Snap/AppImage/containers), because container sandboxing prevents arRPC from working. You already mentioned that your Vesktop is natively installed, so it will work.

shvedes commented 1 week ago

This is NOT arRPC:

image It's enabled.

image

Arcitec commented 1 week ago

It's enabled.

Read carefully. ;) https://github.com/EnderIce2/rpc-bridge/issues/9#issuecomment-2480830422

Disable that plugin which you showed in your 1st post: https://github.com/EnderIce2/rpc-bridge/issues/9#issue-2664425646


As for detecting Horizon, you must look at arRPC's game list. I won't do everything for you, as mentioned, check the arRPC repo and check if that game is on the list. :)

shvedes commented 1 week ago

Already did a while ago. I only have the vesktop's one

image image

you must look at arRPC's game list

Will do now!

Arcitec commented 1 week ago

https://raw.githubusercontent.com/OpenAsar/arrpc/refs/heads/main/src/process/detectable.json

{"executables": [{"is_launcher": false, "name": "horizon zero dawn/horizonzerodawn.exe", "os": "win32"}], "hook": true, "id": "1124351698740195439", "name": "Horizon Zero Dawn"}

This means arRPC will look for that filename: "horizon zero dawn/horizonzerodawn.exe" (process scanner filenames are always written in lowercase in the json file)

Do ps aux | grep -i zerodawn.

I know there's been some situations where people say arRPC process scanner cannot detect the true path to a game running in Proton and fails to detect it. Personally I never saw any issues with Proton game detection though, so I have no idea what those people are talking about and they probably run arRPC inside a Flatpak (hence cannot see processes).

Arcitec commented 1 week ago

Can confirm, arRPC (running on Host, no sandbox) is detecting Horizon Zero Dawn in Proton @ my machine:

image

Arcitec commented 1 week ago

And native Vesktop's built-in arRPC is also detecting it:

image

shvedes commented 1 week ago

Weird af. Sorry for my language Will try one more time. Thank you for trying to help!

shvedes commented 1 week ago

Ok, lets start from scratch. I have vesktop, which is not flatpak version. I have games, which is not in any sandbox (pure system wine staging 9.21) For the test i will use God of War (2018). I checked this game in the arrpc database, and it exist there (Horizon Zero Dawn Remastered is not shown there). I have system-wide arrpc installed from AUR (git version), version 3.5.0. The cloned one is the same version as system's, so i will use the AUR ver. In vesktop settings RichPresence setting is ON and arrpc plugin in plugins section is OFF. Bridge is installed in game's wine prefix, so no problems with it.

What i should to do, step by step?

Right?

Arcitec commented 1 week ago

Okay that means your Vesktop is:

Your games are:

So that means arRPC is able to scan all your game processes, for sure.

So process scanning will work (detecting game based on its EXE name). But Rich Presence (actual game sending its own data) may not work.

You showed how running arRPC standalone on the host does not detect the game via its process scanner. THAT is very weird.

To verify why it's not finding your game, you need to do two things:

If you know some programming you might also want to open src/process/ in arRPC source code and mess around with some extra print statements to see what processes it's finding and rejecting, but you shouldn't have to do any of that.

My guess right now is one of three things:

shvedes commented 1 week ago
  • Most EXEs in Discord's list are paths like "folder name/exe name.exe".

image

Well, i guess that was a problem, maybe. Will rename my game folder now and try again

Arcitec commented 1 week ago

I personally just verified a Bottles game too, running it with wine-ge-proton8-26:

image

So at least we know for sure that Steam and Bottles environment EXE names are understandable by arRPC.

shvedes commented 1 week ago

image I have no words... This was insanely simple and dumb at the same time! THANK YOU for the help, i appreciate it!!!

Arcitec commented 1 week ago

@shvedes :heart: Okay cool so that also taught me (verified) that the folder name also matters. Useful to know. Also taught me that arRPC process scanner can find games in plain Wine too, doesn't need Steam/Bottles environments. :)

So... now you can uninstall arRPC on the host and rely completely on Vesktop's built-in arRPC. Unless you wanna use standalone arRPC for some easier debugging another time.

Vesktop built-in arRPC is nice because it's starting and stopping internally every time Vesktop starts. No need for a separate process.


For the second issue: Rich Presence, where the game tells Discord "Hey they are playing XYZ game and they are currently in Lobby and Cooking Apples", is being handled by rpc-bridge, which sends that data from Wine to Linux.

That Rich Presence feature exists in arRPC, but it seems like many games send data in a way that arRPC doesn't understand, but the official Discord client apparently works. That's a bug with arRPC.

If you run a game that Rich Presence doesn't work with, then I recommend reading the discussion in https://github.com/EnderIce2/rpc-bridge/issues/4#issuecomment-2143549407 and somewhere there's some method to debug what error arRPC is giving about the incoming game status data. It will be some big error message about corrupt message data. Then report it to https://github.com/OpenAsar/arRPC.


And lastly, if you ever run any software in a Flatpak, remember that you need this bridge between Flatpak socket and Native socket: https://github.com/Arcitec/discord-flatpak-rpc-bridge

Have fun with your gaming! :) If all is okay now, you can press Close Ticket. :)

shvedes commented 1 week ago

Thank you again!!! :heart: