Bottles icon indicating copy to clipboard operation
Bottles copied to clipboard

[Bug]: unable to launch programs in Steam Deck gaming mode, but can launch from script pointing to executable

Open alpha-tango-kilo opened this issue 1 year ago • 19 comments

Describe the bug

Programs installed into a bottle can't be found by program name when in the Steam Deck's gaming mode, per reproduction steps

I spent a fair while digging at this, and this is what I found:

  • Bottles launched within gaming mode showed only manually added programs, not auto-detected ones
  • Creating a script that called flatpak run --command=bottles-cli com.usebottles.bottles run -b <bottle name> -e <path> and adding it to Steam could launch the game
  • Using the above script approach but with -p <program name> only worked with manually added programs

To Reproduce

  1. Create (gaming) bottle
  2. Install game
  3. Add game to Programs if not present
  4. Add program to Steam (at this point the program will launch fine from Bottles, or from Steam while still in desktop mode)
  5. Switch to gaming mode
  6. Launch game
  7. (either stays on Steam spinner or gives up and goes back to game info)

Package

Flatpak from Flathub

Distribution

Steam Deck

Troubleshooting Logs

Version: 2022.8.28-brescia-2
Display:
    X.org: true
    X.org (port): :99.0
    Wayland: false
Graphics:
    vendors:
        amd:
            vendor: amd
            envs:
                DRI_PRIME: '1'
            icd: /usr/lib/x86_64-linux-gnu/GL/vulkan/icd.d/radeon_icd.x86_64.json:/usr/lib/i386-linux-gnu/GL/vulkan/icd.d/radeon_icd.i686.json
    prime:
        integrated: null
        discrete: null
Kernel:
    Type: Linux
    Version: 5.13.0-valve21.1-1-neptune-02211-gc54cda5a36f3
Distro:
    Name: GNOME
    Version: '"42 (Flatpak runtime)"'
Disk:
    Total: 7778668544
    Free: 7778525184
RAM:
    MemTotal: 14.5GiB
    MemAvailable: 11.4GiB
Bottles_envs: null

Display Protocol

X11, Wayland

Display Backend used by Bottles

No response

Additional context

Flatseal non-default setttings:

image

image

alpha-tango-kilo avatar Sep 03 '22 16:09 alpha-tango-kilo

Some useful logs? I don't have a steam deck to test (and no time for setting up a vm), idk how steam is launched but I assume you can launch it trough your terminal to catch some logs.

mirkobrombin avatar Sep 03 '22 20:09 mirkobrombin

See logs in below message. I'm afraid they're not the most informative. The only way I can get logs when launching games in gaming mode is by using a script I write myself, which is added as a non-Steam game. In this case, it's flatpak run --command=bottles-cli com.usebottles.bottles run -b <bottle name> -p <program name> &>$HOME/bottles.log. The script correctly launches the game if run from a terminal in desktop mode, which eliminates the possibility of user error.

The "ERROR: ld.so" stuff comes from Steam chucking around a whole load of environment variables when you launch a game through it. You also get these logs when successfully launching a game, so I think they're just noise.

alpha-tango-kilo avatar Sep 03 '22 20:09 alpha-tango-kilo

ERROR: ld.so: object '/home/deck/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/home/deck/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/home/deck/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/home/deck/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
[80m21:49:19 [1m(INFO)[0m [36mForcing offline mode[0m [0m
ERROR: ld.so: object '/home/deck/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/home/deck/.local/share/Steam/ubuntu12_64/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.
Program Cult Of The Lamb not found

alpha-tango-kilo avatar Sep 03 '22 20:09 alpha-tango-kilo

I'm getting the exact same thing. At one point I added an export LD_PRELOAD= line to my script before launching, in which case I only ended up with the two lines (Forcing offline mode & Program not found).

Wondering if this is some kind of steam+flatpak issue, and not an issue with bottles (but if you install Chrome it uses flatpak and launches fine, so maybe that's not the case)

codingismy11to7 avatar Sep 10 '22 07:09 codingismy11to7

Can confirm, the game installed in bottles can run in bottles. After using add to steam button the game won't run either in game mode or desktop mode in steam. It even won't run with a desktop shortcut generated by bottles.

mysteriousHerb avatar Sep 11 '22 06:09 mysteriousHerb

Can confirm, the game installed in bottles can run in bottles. After using add to steam button the game won't run either in game mode or desktop mode in steam. It even won't run with a desktop shortcut generated by bottles.

@herbzhao that's a different issue to this one then. I can run games from Bottles fine in desktop mode, and through Steam in desktop mode. You may want to grab some logs and file a separate issue

alpha-tango-kilo avatar Sep 11 '22 11:09 alpha-tango-kilo

In the meantime, i have found this as a solution, as you stated, you can create a .sh file. and add this as a non-steam game. also works.

#!/bin/bash
flatpak run --command=bottles-cli com.usebottles.bottles run -b {bottle_name} -p "{programme name}"

mysteriousHerb avatar Sep 11 '22 12:09 mysteriousHerb

Boilr has successfully implemented the add to steam, for anyone who is still having this problem.

mysteriousHerb avatar Sep 14 '22 14:09 mysteriousHerb

Can confirm Boilr works fine on programs installed in a bottle that have been manually added manually to the programs list. This appears to be because Boilr uses the flatpak run command to launch programs too (seen here), as opposed to the xdg-open command that Bottles adds to Steam

alpha-tango-kilo avatar Sep 17 '22 13:09 alpha-tango-kilo

Also had this problem. I had to add the executable to Programs manually (because I just copied the folder from an external drive) and it didn't launch when I added it to Steam via Bottles. Using Boilr did fix the issue.

apcamargo avatar Nov 13 '22 23:11 apcamargo

Hi all i am trying to launch a wii u game from gaming mode, it worked fine before now it keeps crashing annoyingly, is this forum the fix for it??

theauditioner avatar Mar 22 '23 23:03 theauditioner

Please open a new issue in the programs repository.

The topic issue should be already fixed. Can someone confirm?

mirkobrombin avatar Mar 23 '23 06:03 mirkobrombin

Tested on Bottles 51.5, issue is still present, the xdg-open link Bottles creates in Steam doesn't work in gaming mode. Boilr still works as it uses a flatpak command to start the game

alpha-tango-kilo avatar Mar 23 '23 20:03 alpha-tango-kilo

I have the same experience. My shortcuts only work when I use BoilR.

apcamargo avatar Mar 24 '23 00:03 apcamargo

This is all too much it'd supposed to be a gaming unit for emulators but it doesn't work - should we just return it??

theauditioner avatar Mar 24 '23 11:03 theauditioner

flatpak run --command=bottles-cli com.usebottles.bottles run -b {bottle_name} -p "{programme name}"

For this command I have an error "TypeError: unsupported operand type(s) for +: NoneType and str" I fixed this manually patching in bottles-cli line 574:

- _args = program.get("arguments", "") + " " + _args
+ _args = (program.get("arguments", "") or "") + " " + _args

I don't know, why default value don't work for get(). Maybe it is python version dependent

But I couldn't launch the game from steam even after it.

Scvairy avatar Jan 07 '24 18:01 Scvairy

Workaround: Place a single space as command arguments in the launch options of the program's shortcut. If the launch options dialog doesn't appear, try removing and re-adding the program.

For developers: This issue is not specific to the Steam Deck or SteamOS, my Fedora system is also affected. The above workaround works on different systems and different games. The issue also doesn't involve anything Steam related; just running games through the xdg-open URL interface exhibits the same behavior.

The traceback printed when a game fails to launch is:

09:10:46 (INFO) Forcing offline mode 
Traceback (most recent call last):
  File "/app/bin/bottles-cli", line 652, in <module>
    cli = CLI()
          ^^^^^
  File "/app/bin/bottles-cli", line 150, in __init__
    self.__process_args()
  File "/app/bin/bottles-cli", line 199, in __process_args
    self.run_program()
  File "/app/bin/bottles-cli", line 574, in run_program
    _args = program.get("arguments", "") + " " + _args
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'

The traceback printed when the launch options dialog fails to open is:

Traceback (most recent call last):
  File "/app/share/bottles/bottles/frontend/widgets/program.py", line 134, in show_launch_options_view
    dialog = LaunchOptionsDialog(self, self.config, self.program)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/share/bottles/bottles/frontend/windows/launchoptions.py", line 82, in __init__
    self.entry_arguments.set_text(program.get("arguments", ""))
TypeError: Argument 1 does not allow None as a value

In both cases it seems like the string literal "" isn't interpreted as a string when returned by get() as the default argument. If this is a recent change in Python, you may have a lot of errors like this in your software.

4903000 avatar Jan 21 '24 09:01 4903000

@4903000 Both errors will be fixed by #3211. It was a regression caused by the latest big refactoring, not a recent change in Python, so there shouldn't be more errors like these fortunately

koplo199 avatar Jan 21 '24 09:01 koplo199

This is the exact same issue I am having. Started after updating bottles from 51.9 to 51.10 then 51.9 as some reason there was an update?

Tried that fix with the --argue but it did not work.

DragonKumera avatar Feb 05 '24 01:02 DragonKumera