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

Needs of gstreamer libraries in sniper #748

Open
saif-ellafi opened this issue Feb 28, 2025 · 4 comments
Open

Needs of gstreamer libraries in sniper #748

saif-ellafi opened this issue Feb 28, 2025 · 4 comments

Comments

@saif-ellafi
Copy link

saif-ellafi commented Feb 28, 2025

Dear steam-runtime team,

I hope this issue does not bring trouble, I really tried to read as much as I could.

I am a new indie-single game developer, trying to get my game working on Steam natively on Linux. The game is very simple, and developed in Flutter, runs in Windowed mode.

However, it needs to play audio, and the current dependency makes use of libgstreamer1.0-dev and libgstreamer-plugins-base1.0-dev to run, which are typically available in host systems (but not always).

I am personally fine with asking users to install these libraries, however I wish I could bundle a safe container. I tried a few things but no success, for example packing the .so files in a directory, and running the game from a script that appends the LD_LIBRARY_PATH.

# Copy GStreamer libraries with fixed paths
RUN mkdir -p /app/pum/build/linux/x64/release/bundle/lib/ && \
    cp /usr/lib/x86_64-linux-gnu/libgstapp-1.0.so.0 /app/pum/build/linux/x64/release/bundle/lib/ && \
    cp /usr/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0 /app/pum/build/linux/x64/release/bundle/lib/ && \
    cp /usr/lib/x86_64-linux-gnu/libgstbase-1.0.so.0 /app/pum/build/linux/x64/release/bundle/lib/ && \
    cp /usr/lib/x86_64-linux-gnu/libgstpbutils-1.0.so.0 /app/pum/build/linux/x64/release/bundle/lib/ && \
    cp /usr/lib/x86_64-linux-gnu/libgstvideo-1.0.so.0 /app/pum/build/linux/x64/release/bundle/lib/ && \
    cp /usr/lib/x86_64-linux-gnu/libunwind.so.8 /app/pum/build/linux/x64/release/bundle/lib/ && \
    cp /usr/lib/x86_64-linux-gnu/libdw.so.1 /app/pum/build/linux/x64/release/bundle/lib/


# Create a script to set LD_LIBRARY_PATH and run the pum executable
RUN echo '#!/bin/bash\n' \
         'export LD_LIBRARY_PATH="$(dirname "$0")/lib:$LD_LIBRARY_PATH"\n' \
         '"$(dirname "$0")/pum" "$@"\n' \
         > /app/pum/build/linux/x64/release/bundle/pum.sh && \
    chmod +x /app/pum/build/linux/x64/release/bundle/pum.sh

However all of this put me in an endless loop of trial and error, ultimately getting me stuck in

chdir "/storage/SteamLibrary/steamapps/common/PUM Companion"
ERROR: ld.so: object '/home/saif/.steam/debian-installation/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/home/saif/.steam/debian-installation/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/home/saif/.steam/debian-installation/ubuntu12_64/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.
ERROR: ld.so: object '/home/saif/.steam/debian-installation/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/home/saif/.steam/debian-installation/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
Game Recording - would start recording game 3564960, but recording for this game is disabled

(pum:171139): dbind-WARNING **: 20:40:15.590: Couldn't connect to accessibility bus: Failed to connect to socket /run/user/1000/at-spi/bus: No such file or directory
Adding process 171137 for gameID 3564960
Adding process 171138 for gameID 3564960
Adding process 171139 for gameID 3564960
Gdk-Message: 20:40:16.207: Unable to load  from the cursor theme

(pum:171139): Atk-CRITICAL **: 20:40:16.207: atk_socket_embed: assertion 'plug_id != NULL' failed
Game Recording - game stopped [gameid=3564960]

Which could either mean I am getting closer to a solution, or that I am in a tunnel without light at the end of it :)

Any advice is welcome, I am trying hard not to run my app on proton.

Alternative 2: I could be fine to not provide this library and ask users to install these on their host. But how should I package my game then? Would sdk 1.0 do this?

Alternative 3: My app works in the form of a Flatpak, if ever could Steam run a flatpak container instead of a native runtime?

Best regards
Saif

@saif-ellafi saif-ellafi changed the title Needs of extra libraries in sniper Needs of gstreamer libraries in sniper Feb 28, 2025
@saif-ellafi
Copy link
Author

Update: current work around

  • I removed the dependency needing gstreamer (perhaps that's even a good thing all around!)
  • Switched to runtime 1.0. At first it didn't work, but seems to work after I tried going back to native legacy. Not sure yet if the extra step is needed, but this way it works at least.

@saif-ellafi
Copy link
Author

Ok it wasn't so simply to drop dependencies, I went back to dependencies, and switched back to runtime 1.0.

This "seems" to be working fine

# Copy GStreamer libraries with fixed paths
RUN mkdir -p /app/pum/build/linux/x64/release/bundle/lib/ && \
    cp /usr/lib/x86_64-linux-gnu/libgst*.so /app/pum/build/linux/x64/release/bundle/lib/ && \
    cp /usr/lib/x86_64-linux-gnu/libunwind.so.8 /app/pum/build/linux/x64/release/bundle/lib/ && \
    cp /usr/lib/x86_64-linux-gnu/libdw.so.1 /app/pum/build/linux/x64/release/bundle/lib/

# Create a script to set LD_LIBRARY_PATH and run the pum executable
RUN echo '#!/bin/bash\n' \
         'export LD_LIBRARY_PATH="$(dirname "$0")/lib:$LD_LIBRARY_PATH"\n' \
         '"$(dirname "$0")/pum" "$@"\n' \
         > /app/pum/build/linux/x64/release/bundle/pum.sh && \
    chmod +x /app/pum/build/linux/x64/release/bundle/pum.sh

@jessbowers
Copy link

@saif-ellafi does this technique allow you to ship a game for SteamOS, or would you need to compile the libraries a different way for that - for example for the Steam Deck

@TTimo
Copy link
Collaborator

TTimo commented Mar 21, 2025

does this technique allow you to ship a game for SteamOS

Unfortunately no, it doesn't. The title will not pass the compatibility testing review process for Steam Deck and only the Windows version will be considered.

Relying on users setting the 'Legacy Runtime 1.0' compatibility tool and installing additional libraries on their host is a burden on the user, it is fragile and will not work reliably across distributions or OS updates, which is why it should be avoided.

Native titles built towards Steam for Linux should be compiled against the Steam for Linux SDK. Documentation for game developers is available at https://gitlab.steamos.cloud/steamrt/steam-runtime-tools/-/blob/main/docs/slr-for-game-developers.md

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

No branches or pull requests

3 participants