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

Discord can't access /proc #115

Open
noeltheblank opened this issue Oct 1, 2020 · 13 comments
Open

Discord can't access /proc #115

noeltheblank opened this issue Oct 1, 2020 · 13 comments
Labels
upstream Issues that we can't fix because they are Discord's

Comments

@noeltheblank
Copy link

This is the usual problem I have with discord. It just won't recognize my games. On the snap and native version, it recognizes the game too easily. But for the flatpak version, it doesn't recognize my games, it only recognizes stuff like bash, sandbox, and such. And I have to manually add in the game's names. Please find a way to fix this.

@lionirdeadman
Copy link
Collaborator

@mavit
Copy link

mavit commented Nov 8, 2020

I believe this should still work : https://github.com/flathub/com.discordapp.Discord/wiki/Rich-Precense-(discord-rpc)

The Steam Flatpak package does the things mentioned in the wiki page, so does that mean that this should automatically work for (all?) Steam games? It doesn't for me. Is there some extra step I'm missing, either in Steam or Discord or the game itself?

@Mrbinaer
Copy link

Mrbinaer commented Dec 5, 2020

I believe discord detects running steam games by reading running processes from /proc, which seems to be prohibited by the flatpak. As long as the game itself does not use the discord-rpc interface, discord does not get any information.

@lionirdeadman lionirdeadman added the upstream Issues that we can't fix because they are Discord's label Jan 9, 2021
@lionirdeadman
Copy link
Collaborator

The Steam Flatpak package does the things mentioned in the wiki page, so does that mean that this should automatically work for (all?) Steam games? It doesn't for me. Is there some extra step I'm missing, either in Steam or Discord or the game itself?

Have you done the symlink the page suggests to do?

I believe discord detects running steam games by reading running processes from /proc, which seems to be prohibited by the flatpak. As long as the game itself does not use the discord-rpc interface, discord does not get any information.

Just wanna clarify that this is a flatpak restriction, nothing we can do specifically about this.

I'm inclined to close this because I don't think this is something that we can ever fix. RPC is supported and non-RPC games can't work assuming Discord is reading /proc.

@soredake
Copy link

soredake commented Jan 9, 2021

flatpak/flatpak#3922

@mavit
Copy link

mavit commented Jan 9, 2021

Have you done the symlink the page suggests to do?

As I say, the Steam Flatpak package does that.

@lionirdeadman
Copy link
Collaborator

I just tried an RPC client outside of Flatpak, PreMID and it worked after the symlink for non-flatpak apps. Do you have an application using RPC in Steam that I can try to test?

@mavit
Copy link

mavit commented Jan 15, 2021

Iʼm not sure. I couldnʼt find a list of Discord-supporting native Linux games distributed via Steam.

I know that, for example, Among Us on Windows integrates with Discord. However, if you run on Linux with Steamʼs Proton fork of Wine, the differences between Discord on Windows and Linux are going to complicate the situation, so that's not a good test.

@lionirdeadman
Copy link
Collaborator

What are you testing for then? Is this about process access (can't fix) or rich presence (doesn't seem broken)? 🤔

@mavit
Copy link

mavit commented Jan 17, 2021

The Steam Flatpak package does the things mentioned in the wiki page, so does that mean that this should automatically work for (all?) Steam games? It doesn't for me. Is there some extra step I'm missing, either in Steam or Discord or the game itself?

Do you have an application using RPC in Steam that I can try to test?

It turns out that the Steam Flatpak bundles a small example game from the Discord RPC library. It can be launched in the following way while Steam is running:

flatpak enter com.valvesoftware.Steam /app/bin/send-presence

There seems to be no documentation, but you can read the source to discover the available commands.

To answer my own question:

  • Yes, this should work for the Steam Flatpak.
  • Your status in Discord must not be set to invisible.
  • In Discordʼs Settings -> Gaming Settings -> Game Activity, Display currently running game as a status message must be set to on.

On this settings page, it will say “No game detected”, but this canʼt be trusted. When a game connects via RPC, it will say this even if things are working correctly and a status message is properly shown.

@lionirdeadman
Copy link
Collaborator

Oh cool! It works so I guess this issue is only about /proc then.

@lionirdeadman lionirdeadman changed the title Discord won't recognize my games Discord can't access /proc Jan 17, 2021
@lineber
Copy link

lineber commented Mar 21, 2021

Sorry if I don't understand the issue correctly but I was wondering the following two things:

(1)
Can Discord be added to the Steam flatpak? I run three Steam flatpak add-ons that work seamlessly:

com.valvesoftware.Steam.CompatibilityTool.Proton-GE
com.valvesoftware.Steam.Utility.MangoHud
com.valvesoftware.Steam.Utility.protontricks

Something like: com.valvesoftware.Steam.Utility.Discord As I almost always have Discord open when I open Steam. This way they share the same internal /proc ipc data, right?

(2)
Or is there a way to add little programs running in each flatpak to exchange the /proc information?
com.valvesoftware.Steam.Utility.Discord-bridge
com.discordapp.Discord.Utility.Steam-bridge

Since access to the system /proc is forbidden, couldn't these programs fake each other and duplicate or link the respective internal /proc files? Since both programs are on the same system, wouldn't hard linking the directories work since a program should be able to write to it's own /proc file.

Or are these bad ideas? Would that be even more difficult or cause more problems?

@lionirdeadman
Copy link
Collaborator

Making Discord a Steam extension is possible however that's definitely not happening,

I'm not sure if it's possible to share /proc with a bridge system but I wouldn't want to maintain that personally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream Issues that we can't fix because they are Discord's
Projects
None yet
Development

No branches or pull requests

6 participants