streetpea / chiaki-ng

Next-Generation of Chiaki (the open-source remote play client for PlayStation)
https://streetpea.github.io/chiaki-ng/
GNU Affero General Public License v3.0
1.15k stars 75 forks source link

[BUG] Unable to launch app in gaming mode #311

Closed dfurdi closed 6 months ago

dfurdi commented 6 months ago

Describe the bug After updating to 1.6.6 I'm unable to launch the app through the steam gaming mode. I click play, screen flashes to black for half a second, then exits out instantly. The app opens normally when launched through desktop mode! I believe the last version that I had before updating was 1.6.4 but I'm not 100% sure.

Troubleshooting steps I tried:

  1. Tried removing non-steam game from library then re-adding shortcut through chiaki4deck.
  2. Tried re-adding the shortcut by right clicking and adding to steam. After which I tried restarting the device.
  3. Tried fully re-installing chiaki4deck through discover, removing the data and config files as well for a full re-install.

Debug Log I'm unable to even create a debug log, I turned on verbose logging while in desktop mode then switched to gaming mode and while opening in gaming mode it doesn't create any logs, no matter how many times I tried.

To Reproduce Steps to reproduce the behavior:

  1. Click on play on steam
  2. Chiaki4deck wont open

Expected behavior I expected the app to open normally.

Screenshots screenshot

Desktop:

streetpea commented 6 months ago

What options do you have for compatibility?

dfurdi commented 6 months ago

What options do you have for compatibility?

None. Enabling it doesn't change anything. But as far as I'm aware it shouldn't be enabled as it's a native linux app?

screenshot

streetpea commented 6 months ago

That’s correct. Having it enabled is one of the reasons it wouldn’t launch in gaming mode which is why I was asking. What happens if you try to launch via Steam in desktop mode?

dfurdi commented 6 months ago

In desktop mode, launching it through both steam and the icon in the start menu works just fine. The moment I switch back or restart into gaming mode it doesn't work anymore.

dfurdi commented 6 months ago

Here is me replicating the bug. To make sure I'm not being dumb lol.

https://youtu.be/1vSfYWkutdQ

streetpea commented 6 months ago

I'm on the same version and it's launching fine for me so I'll need you to grab info on this yourself. Can you make a file in your documents folder named launch-Chiaki.sh and in the file have the line flatpak run io.github.streetpea.Chiaki4deck > ~/Documents/logChiakiErr.txt 2>&1 and then make the script executable with chmod +x ~/Documents/launch-Chiaki.sh. And then add launch-Chiaki.sh as a non-Steam game and then launch it from game mode and then post the output in ~/Documents/logChiakiErr.txt please?

dfurdi commented 6 months ago

Here you go.

logChiakiErr.txt

streetpea commented 6 months ago

Can you run flatpak list and post the output please?

dfurdi commented 6 months ago

Of course, here you go.

flatpakList.txt

streetpea commented 6 months ago

Do you have hdr enabled? If so can you try disabling it and see if it still doesn’t launch?

dfurdi commented 6 months ago

Nope I never tried doing anything with hdr on chiaki4deck, I usually stream from my PS4 slim, so my video settings use H264 and 720p@60fps using vaapi. Is there a way I can specify it to forcefully disable hdr if that might be the case?

streetpea commented 6 months ago

if you’re streaming from your ps slim then hdr wouldn’t be enabled anyway also hdr isn’t enabled in the settings menu so if you aren’t even seeing that, that’s not it so nevermind

dfurdi commented 6 months ago

After a long time of staring at both the logs I provided you, I gave up and tried reinstalling and downgrading some packages related to gamescope and chiaki4deck itself. After downgrading chiaki4deck to 1.6.4, then down to 1.6.3, with neither versions working I assumed there was some deeper issue.

Hopping into the sudo account, I enabled pacman with sudo steamos-readonly disable and installed pacutils, did a paccheck --sha256sum --quiet which spat out a bunch of errors, I began suspecting that discover somehow corrupted a bunch of files. To be sure I ran pacman -Qqn | pacman -S - to re-install all native packages. Lo and behold, after rebooting and practically re-installing the entirety of steamOS I did another paccheck --sha256sum --quiet which now returned absolutely no errors or missing files. Finally, thinking it was solved, I re-installed the latest chiaki4deck and still, the same issue...

None of my other native or non-native(proton) apps/games had or have trouble launching in game mode before or after re-installing all native packages. I'm quite stumped on what's going on...

streetpea commented 6 months ago

Chiaki is starting but it’s hanging on creating the swapchain with the gamescope wsi layer. Desktop mode isn’t running under gamescope so doesn’t use that layer. There is a bug in the gamescope wsi that we worked around in chiaki4deck until it gets patched (there’s an open issue here https://github.com/ValveSoftware/gamescope/issues/1091) but this is with a null swapchain (on start) so not sure what the issue is here

streetpea commented 6 months ago

Try running this command sudo flatpak override --nofilesystem=xdg-run/gamescope-0 io.github.streetpea.Chiaki4deck and see if that fixes your issue

dfurdi commented 6 months ago

Try running this command sudo flatpak override --nofilesystem=xdg-run/gamescope-0 io.github.streetpea.Chiaki4deck and see if that fixes your issue

That made it quite worse... After pressing OK, my deck locked up and I had to reboot it. Possibly unrelated, but this is the same exact error I got when I tried making ori and the will of the wisps run in HDR. Have I possibly messed up my gamescope version? What version are you running? But note that chiaki worked long after my gamescope fiddling, just now breaking after I updated to 1.6.6. Maybe some other related packages also got updated which could break it?

download

streetpea commented 6 months ago

That command would only affect the chiaki4deck flatpak it shouldn't freeze your system. Did you enter your sudo password? Given your system did freeze, are you sure the change took effect? Can you run sudo flatpak override --show io.github.streetpea.Chiaki4deck?

streetpea commented 6 months ago

From what I can tell for you launching with the gamescope-wsi (only used for gaming mode) is causing it to crash ... if you made any change to the gamescope-wsi that is probably the cause of the problem as it doesn't crash on my system with the same os version and I haven't had any other reports of this specific issue. The command I gave should force Chiaki4deck to not the gamescope wsi which should solve your problem if it's taking effect.

dfurdi commented 6 months ago

That command would only affect the chiaki4deck flatpak it shouldn't freeze your system.

I apologize, it was late right as I was going to sleep. The deck didn't quite exactly fully lock up, when I clicked "OK to try to power through" the app froze so badly I couldn't exit or force close it but I was able to open up the steam menu and just restart or shutdown.

But I fixed it! v1.6.6 now launches fine in gaming mode. First I reset the override you suggested, then did a flatpak remove gamescope and removed all 7 occurrences I had installed for some reason. Right after just installed org.freedesktop.Platform.VulkanLayer.gamescope/x86_64/23.08 which didn't fix anything, but then I downgraded it with sudo flatpak update --commit=0b3543a920d07271426945f9ebde207de89232475d6f6ba8bf98ff7cb3f2590e org.freedesktop.Platform.VulkanLayer.gamescope/x86_64/23.08. After that downgrade, it just worked ¯_(ツ)_/¯

This was definitely a bit of my fault for installing multiple versions of gamescope (duplicated both as system and user packages) when I was trying to get gamescope working in lutris, so chiaki was choosing some version which didn't suit it. But as much as it's my fault, it makes no sense why it refuses to launch with the UPDATED gamescope/x86_64/23.08.

Now I'll only have to remember to never update gamescope when discover constantly bugs me to update it... What is also strange is how none of my other native or non-native apps seemed to care about the 7 different gamescope packages.

CarlosVR2 commented 6 months ago

Hello,

I was having the same problem with chiaki4deck not running on Game Mode but working fine in Desktop Mode. At first I thought the problem was with version 1.6.6, but thanks to this thread you made me realize the problem actually started with the April 10, 2024 update to Gamescope 3.14.3.

I installed Gamescope in the first place in order to run Epic Games Store games in HDR using the Heroic Games Launcher. Those games were not working either in Game Mode after the update to 3.14.3, so the problem is definitely Gamescope, not chiaki4deck or the games themselves.

I rolled back to the commit previous to 3.14.3, dated just one day before (version 3.14.2, dated April 09, 2024, commit b8d6fb9b15c0f46e8dddc2d63e810fbf49bd693babd1f66392dd48ecf95d2209) and tested chiaki4deck and Epic Games Store games in Game Mode, and they worked perfectly.

I guess we'll have to test any future Gamescope updates and roll back if necessary.

Hope this helps!

streetpea commented 6 months ago

Thanks for the info @CarlosVR2! Closing this now since it seems like a gamescope issue. I would also suggest making an issue with gamescope for the behavior you’re encountering in case they’re not aware of it.