[GH-ISSUE #758] Shadps4 not working under wayland on arch linux #194

Closed
opened 2026-02-27 21:05:04 +03:00 by kerem · 13 comments
Owner

Originally created by @h16033 on GitHub (Sep 3, 2024).
Original GitHub issue: https://github.com/shadps4-emu/shadPS4/issues/758

Hello everyone i have problem with shadps4 it’s didn’t want work on arch linux under wayland i have ryzen 3600 and rtx 2070super 32 ram but when log in with X11 its work what is the problem exactly??and I test it with cachyos and same problem

Originally created by @h16033 on GitHub (Sep 3, 2024). Original GitHub issue: https://github.com/shadps4-emu/shadPS4/issues/758 Hello everyone i have problem with shadps4 it’s didn’t want work on arch linux under wayland i have ryzen 3600 and rtx 2070super 32 ram but when log in with X11 its work what is the problem exactly??and I test it with cachyos and same problem
kerem closed this issue 2026-02-27 21:05:04 +03:00
Author
Owner

@chaitan3 commented on GitHub (Sep 3, 2024):

Can reproduce this on Nvidia 4070 Ti Super on KDE Wayland. Using gamescope inside wayland surprisingly works.

<!-- gh-comment-id:2327635927 --> @chaitan3 commented on GitHub (Sep 3, 2024): Can reproduce this on Nvidia 4070 Ti Super on KDE Wayland. Using gamescope inside wayland surprisingly works.
Author
Owner

@enzi commented on GitHub (Sep 5, 2024):

good thing you posted this because i thought it's just broken on my system. turns out it indeed does work when running with gamescope

<!-- gh-comment-id:2331213710 --> @enzi commented on GitHub (Sep 5, 2024): good thing you posted this because i thought it's just broken on my system. turns out it indeed does work when running with gamescope
Author
Owner

@emuyia commented on GitHub (Sep 5, 2024):

Doesn't seem to be working for me. I have a fedora 40 system with KDE wayland, Nvidia GTX 1080. Boots Bloodborne on X11 but not wayland - I get stuck on a black screen before reaching the main menu.

I tried launching with gamescope -- and got the same result, but I don't know if I'm using that right. Same result on both the qt and sdl appimages and the cli executable.

<!-- gh-comment-id:2332190918 --> @emuyia commented on GitHub (Sep 5, 2024): Doesn't seem to be working for me. I have a fedora 40 system with KDE wayland, Nvidia GTX 1080. Boots Bloodborne on X11 but not wayland - I get stuck on a black screen before reaching the main menu. I tried launching with `gamescope --` and got the same result, but I don't know if I'm using that right. Same result on both the qt and sdl appimages and the cli executable.
Author
Owner

@ImanolFotia commented on GitHub (Sep 6, 2024):

Have you tried forcing XWayland?
env -u WAYLAND_DISPLAY env XDG_SESSION_TYPE=x11 gamescope Shadps4-qt.AppImage

<!-- gh-comment-id:2333235994 --> @ImanolFotia commented on GitHub (Sep 6, 2024): Have you tried forcing XWayland? `env -u WAYLAND_DISPLAY env XDG_SESSION_TYPE=x11 gamescope Shadps4-qt.AppImage`
Author
Owner

@HermitsA commented on GitHub (Sep 6, 2024):

Mainline builds have been broken on linux for a while.

<!-- gh-comment-id:2333269179 --> @HermitsA commented on GitHub (Sep 6, 2024): Mainline builds have been broken on linux for a while.
Author
Owner

@ImanolFotia commented on GitHub (Sep 6, 2024):

The builds from this fork are working nicely, if you wanna run bloodborne
https://github.com/Foul-Tarnished/shadPS4

Screenshot_20240906_025257

<!-- gh-comment-id:2333298480 --> @ImanolFotia commented on GitHub (Sep 6, 2024): The builds from this fork are working nicely, if you wanna run bloodborne https://github.com/Foul-Tarnished/shadPS4 ![Screenshot_20240906_025257](https://github.com/user-attachments/assets/89653c86-995a-459b-8742-bf19d5d95f21)
Author
Owner

@luisnunmello commented on GitHub (Sep 6, 2024):

The builds from this fork are working nicely, if you wanna run bloodborne https://github.com/Foul-Tarnished/shadPS4

Screenshot_20240906_025257

Yeah, that's because of a fix that was included in the past but not anymore in any other branch
image

Every branch i want to use with linux, i need to include this hack.
If you have problems running builds, i suggest building with this fix.

<!-- gh-comment-id:2333342395 --> @luisnunmello commented on GitHub (Sep 6, 2024): > The builds from this fork are working nicely, if you wanna run bloodborne https://github.com/Foul-Tarnished/shadPS4 > > ![Screenshot_20240906_025257](https://private-user-images.githubusercontent.com/5194308/365049245-89653c86-995a-459b-8742-bf19d5d95f21.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU2MDQzNjIsIm5iZiI6MTcyNTYwNDA2MiwicGF0aCI6Ii81MTk0MzA4LzM2NTA0OTI0NS04OTY1M2M4Ni05OTVhLTQ1OWItODc0Mi1iZjE5ZDVkOTVmMjEucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDkwNiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA5MDZUMDYyNzQyWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MGE5Yzg3MzEyNjAzMGE0MDhhZWNlNDBiOTc1MmRkMWE3NjJjNmY2YTg3MzFiYzMzYjZkMGRhNjYzNTQ0MTY4NyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.c1AGDR895LdV7M5TUTrMTCkdinXggIRiqGHj1qhbWm4) Yeah, that's because of a fix that was included in the past but not anymore in any other branch ![image](https://github.com/user-attachments/assets/d06c7e11-ddd3-46d9-8de4-4119cf320ca8) Every branch i want to use with linux, i need to include this hack. If you have problems running builds, i suggest building with this fix.
Author
Owner

@ImanolFotia commented on GitHub (Sep 6, 2024):

Nice!!
Thank you!

<!-- gh-comment-id:2333378132 --> @ImanolFotia commented on GitHub (Sep 6, 2024): Nice!! Thank you!
Author
Owner

@emuyia commented on GitHub (Sep 6, 2024):

Have you tried forcing XWayland?
env -u WAYLAND_DISPLAY env XDG_SESSION_TYPE=x11 gamescope Shadps4-qt.AppImage

This didn't work for me, same result.

The builds from this fork are working nicely, if you wanna run bloodborne https://github.com/Foul-Tarnished/shadPS4

Can confirm this works for me, but only with gamescope:

gamescope ./Shadps4-qt.AppImage

For now I no longer have to switch to X11, thank you. I'll try building in future.

<!-- gh-comment-id:2334088483 --> @emuyia commented on GitHub (Sep 6, 2024): > Have you tried forcing XWayland? > env -u WAYLAND_DISPLAY env XDG_SESSION_TYPE=x11 gamescope Shadps4-qt.AppImage This didn't work for me, same result. > The builds from this fork are working nicely, if you wanna run bloodborne https://github.com/Foul-Tarnished/shadPS4 Can confirm this works for me, but only with gamescope: ``` gamescope ./Shadps4-qt.AppImage ``` For now I no longer have to switch to X11, thank you. I'll try building in future.
Author
Owner

@chaitan3 commented on GitHub (Sep 6, 2024):

For folks who are looking for a patch they can apply on latest main branch to get Bloodborne running here it is:

diff --git a/src/core/libraries/kernel/thread_management.cpp b/src/core/libraries/kernel/thread_management.cpp
index 919afcb4..36574607 100644
--- a/src/core/libraries/kernel/thread_management.cpp
+++ b/src/core/libraries/kernel/thread_management.cpp
@@ -1065,7 +1065,16 @@ ScePthread PThreadPool::Create() {
         }
     }

+#ifdef _WIN64
     auto* ret = new PthreadInternal{};
+#else
+    // TODO: Linux specific hack
+    static u8* hint_address = reinterpret_cast<u8*>(0x7FFFFC000ULL);
+    auto* ret = reinterpret_cast<PthreadInternal*>(
+        mmap(hint_address, sizeof(PthreadInternal), PROT_READ | PROT_WRITE,
+             MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED, -1, 0));
+    hint_address += Common::AlignUp(sizeof(PthreadInternal), 4_KB);
+#endif
     ret->is_free = false;
     ret->is_detached = false;
     ret->is_almost_done = false;
<!-- gh-comment-id:2334116757 --> @chaitan3 commented on GitHub (Sep 6, 2024): For folks who are looking for a patch they can apply on latest main branch to get Bloodborne running here it is: ``` diff --git a/src/core/libraries/kernel/thread_management.cpp b/src/core/libraries/kernel/thread_management.cpp index 919afcb4..36574607 100644 --- a/src/core/libraries/kernel/thread_management.cpp +++ b/src/core/libraries/kernel/thread_management.cpp @@ -1065,7 +1065,16 @@ ScePthread PThreadPool::Create() { } } +#ifdef _WIN64 auto* ret = new PthreadInternal{}; +#else + // TODO: Linux specific hack + static u8* hint_address = reinterpret_cast<u8*>(0x7FFFFC000ULL); + auto* ret = reinterpret_cast<PthreadInternal*>( + mmap(hint_address, sizeof(PthreadInternal), PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED, -1, 0)); + hint_address += Common::AlignUp(sizeof(PthreadInternal), 4_KB); +#endif ret->is_free = false; ret->is_detached = false; ret->is_almost_done = false; ```
Author
Owner

@Caliel666 commented on GitHub (Sep 8, 2024):

is there any reason for this patch to not be implemented on main?

<!-- gh-comment-id:2336834111 --> @Caliel666 commented on GitHub (Sep 8, 2024): is there any reason for this patch to not be implemented on main?
Author
Owner

@ImanolFotia commented on GitHub (Sep 8, 2024):

is there any reason for this patch to not be implemented on main?

I think this is much of a hack to be included on main

<!-- gh-comment-id:2336835494 --> @ImanolFotia commented on GitHub (Sep 8, 2024): > is there any reason for this patch to not be implemented on main? I think this is much of a hack to be included on main
Author
Owner
<!-- gh-comment-id:2386266484 --> @ngoquang2708 commented on GitHub (Oct 1, 2024): Guys, please test this build ~~https://github.com/shadps4-emu/shadPS4/actions/runs/11127985710~~ ~~https://github.com/shadps4-emu/shadPS4/actions/runs/11128877736~~ and report to https://github.com/shadps4-emu/shadPS4/pull/1184. Thanks.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/shadPS4#194
No description provided.