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

add Mumble overlay support #1008

Open
wants to merge 1 commit into
base: beta
Choose a base branch
from
Open

Conversation

carlocastoldi
Copy link

adds access to $XDG_RUNTIME_DIR/mumble in order to allow Mumble overlay in games installed with flatpak'ed Steam.
Shared memory is required as well, so I added --device=shm as, to my testing, it is not included in --device=all

Fixes: #997
Depends on: mumble-voip/mumble#5961

It's worth noting that this PR is not enough for having the overlay on Steam. An user has to manually copy overlay libraries in flatpak'ed Steam's directory because /lib and /lib32 are not accessible. For example:

cp /usr/lib/mumble/libmumbleoverlay.x86.so /home/$USER/.var/app/com.valvesoftware.Steam/.local/share/Steam/linux32

and then proceed by setting the game launch options to:

LD_PRELOAD=~/.local/share/Steam/linux32/libmumbleoverlay.x86.so %command%

@flathubbot
Copy link
Contributor

Started test build 6779

@flathubbot
Copy link
Contributor

Build 6779 successful
To test this build, install it from the testing repository:

flatpak install --user https://dl.flathub.org/build-repo/119236/com.valvesoftware.Steam.flatpakref

@gasinvein
Copy link
Member

It's worth noting that this PR is not enough for having the overlay on Steam. An user has to manually copy overlay libraries in flatpak'ed Steam's directory because /lib and /lib32 are not accessible. For example:

cp /usr/lib/mumble/libmumbleoverlay.x86.so /home/$USER/.var/app/com.valvesoftware.Steam/.local/share/Steam/linux32

I think this can be solved by packaging the Mumble overlay as an extension for the Steam flatpak app, e.g. com.valvesoftware.Steam.Utility.MumbleOverlay

@carlocastoldi
Copy link
Author

I think this can be solved by packaging the Mumble overlay as an extension for the Steam flatpak app, e.g. com.valvesoftware.Steam.Utility.MumbleOverlay

That is great!
Additionally some games (e.g, Team Fortress 2), are themself not linked against the OpenGL library. In that case you also need to LD_PRELOAD libGL.so. What would you advise to do?

I see that in my installation I have it under:
data/Steam/steamapps/common/SteamLinuxRuntime_soldier/soldier_platform_0.20220927.0/files/lib/[i386-linux-gnu / x86_64-linux-gnu]/libGL.so.1.7.0

What do you think it's the better approach? Should we also include the OpenGL library in the extension?

@gasinvein
Copy link
Member

some games (e.g, Team Fortress 2), are themself not linked against the OpenGL library. In that case you also need to LD_PRELOAD libGL.so. What would you advise to do?

AFAICT Mumble Overlay has its own wrapper command mumble-overlay; adding libs to LD_PRELOAD along with whatever else is needed to get the overlay working probably should be handled by this wrapper.

@carlocastoldi
Copy link
Author

yeah, that wrapper is in dire state. It merely finds libmumbleoverlay

@carlocastoldi
Copy link
Author

ok, i built my first yaml manifest and it effectively extends Steam with the mumble's library! It installs it in /app/utils/MumbleOverlay/lib/

One thing is not clear, tho: can I only this configuration?

default-branch: beta
runtime: com.valvesoftware.Steam
runtime-version: beta

If i don't use the beta branch i get

error: com.valvesoftware.Steam/x86_64/master not installed
Failed to init: Unable to find runtime com.valvesoftware.Steam version master

@gasinvein
Copy link
Member

If i don't use the beta branch i get

error: com.valvesoftware.Steam/x86_64/master not installed
Failed to init: Unable to find runtime com.valvesoftware.Steam version master

You need to specify stable runtime version.

@carlocastoldi
Copy link
Author

Yeah sorry. That indeed fixed it.
Should i then publish it on flathub and become a maintainer of this extension? :O

@gasinvein
Copy link
Member

Should i then publish it on flathub and become a maintainer of this extension? :O

That'll make sense when/if the upstream accepts your patches.

- --filesystem=xdg-run/app/com.discordapp.Discord:create
- --device=all
- --device=shm
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose this conflicts with --allow=per-app-dev-shm
Also, given this permission is pretty unsafe (many apps use /dev/shm for IPC), are you sure it's strictly required for the overlay to work? If it communicates via a socket in $XDG_RUNTIME_DIR, what does it need /dev/shm for?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I investigated a little and found that the shared memory is used by the overlay to retrieve the image rendered by the Mumble client. We are talking about ~3.7MB of data in shared memory.
As far as I know that is read at least (if not more) every time the overlay and the resolution change.

Metadata for that image is sent through a local socket. I am now trying to understand if it's feasible and a good idea (performance-wise) to move everything to the socket. That includes being able to use the overlay in multiple games, simultaneously

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Over here I have implemented a new protocol for the overlay: https://github.com/carlocastoldi/mumble/tree/socket-overlay-chunked

at the moment it works with /tests/OverlayTest, but if I have a positive feedback upstream I indend to move it to the actual overlay library as well

@carlocastoldi
Copy link
Author

For anyone interested and for the time being, I've published my unofficial extension for Steam over at: https://github.com/carlocastoldi/com.valvesoftware.Steam.Utility.MumbleOverlay

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

Successfully merging this pull request may close these issues.

Can't load the Mumble overlay over a flatpak Steam game
3 participants