Skip to content

How to play Bloodborne on Linux #1409

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

Closed
PrimalSmite opened this issue Oct 18, 2024 · 22 comments
Closed

How to play Bloodborne on Linux #1409

PrimalSmite opened this issue Oct 18, 2024 · 22 comments

Comments

@PrimalSmite
Copy link

I have an already installed Bloodborne pkg with 1.09 patch. It runs on my Windows, but it not runs on my Arch Linux on the same machine. It just black screen. I know, that in the past, it was possible to run Bloodborne on Linux with hacked shadPS4 build, but now the hacked builds for Bloodborne are expired. Is it possible to run Bloodborne on Linux now?

@Bettehem
Copy link
Contributor

Use this patch

diff --git a/src/core/libraries/kernel/thread_management.cpp b/src/core/libraries/kernel/thread_management.cpp
index 39c0eaf8..a8cee07c 100644
--- a/src/core/libraries/kernel/thread_management.cpp
+++ b/src/core/libraries/kernel/thread_management.cpp
@@ -1075,7 +1075,16 @@ ScePthread PThreadPool::Create(const char* name) {
         }
     }
 
+#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;

Then rebuild and enjoy :D

@KrisCris
Copy link
Contributor

Or use ngoquang2708's build: https://github.com/ngoquang2708/shadPS4/actions

@Litnesslegitimate
Copy link

It runs on my Windows, but it not runs on my Arch Linux on the same machine. It just black screen.

I was having the same issue, using ngoquang2708's build fixed the black screen on arch for me. https://github.com/ngoquang2708/shadPS4/actions

But once I loaded into the game, there was an issue rendering things. It turns out RADV can't properly render bloodborne or something (Example: https://www.youtube.com/watch?v=cYJ8NdJzyTQ), so I had to make ShadPS4 launch with the AMDGPU-PRO driver: https://wiki.archlinux.org/title/Vulkan
After installing them I moved them to their own special location in /opt/amdgpu-stuff/ (Not needed, just wanted to make sure it only uses the PRO if I call it to)

Then you can launch shad with env VK_ICD_FILENAMES=/opt/amdgpu-stuff/amd_pro_icd64.json /ShadLocation/Shadps4-qt.AppImage
(If you don't want to move the driver it'll be env VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/amd_pro_icd64.json /ShadLocation/Shadps4-qt.AppImage)

A more convenient way I found to launch it was through steam though, I prefer having the desktop icon to launching it from the terminal every time (I also have it running with mangohud)
image

@LordDaveTheKind
Copy link

LordDaveTheKind commented Nov 1, 2024

It works great on my AMD card (Radeon RX6900XT), but not on my NVIDIA one (RTX3090).

NVIDIA Vulkan libraries are available and running fine for all the other games on my machine. Anything else I might need to check?

EDIT: nvm. It's actually a Wayland issue. Running it on Xorg works alright.

@TerminusDeus
Copy link

TerminusDeus commented Nov 1, 2024

@LordDaveTheKind maybe it would be helpful: I managed to run Bloodborne on KDE wayland with proprietary nvidia drivers under gamescope with qt appimage fetched from diegolix29's repo actions filtered by MainBB branch & FullBB branch.

@LordDaveTheKind
Copy link

@LordDaveTheKind maybe it would be helpful: I managed to run Bloodborne on KDE wayland with proprietary nvidia drivers under gamescope with qt appimage from fetched from diegolix29's repo actions filtered by MainBB branch & FullBB branch.

@TerminusDeus thank you. I can confirm the game runs perfectly with KDE wayland and gamescope. Even just by getting shadps4 from this repository, patching it and building it, it works as expected.

@ilya-zlobintsev
Copy link

Gamescope isn't actually needed, the issue appears to be related to the emulator not behaving properly on Wayland. Gamescope just forces xwayland incidentally, it seems to run fine for me just with QT_QPA_PLATFORM=xcb.

@gnusenpai
Copy link

For me, gamescope does make the difference for whatever reason. It just blackscreens under Xwayland, in either rootless or rootful mode. Maybe a Hyprland quirk?

@LordDaveTheKind
Copy link

Gamescope just forces xwayland incidentally, it seems to run fine for me just with QT_QPA_PLATFORM=xcb.

It doesn't work for me with Gnome Wayland and QT_QPA_PLATFORM=xcb. But it does work with gamescope, Gnome Wayland and QT_QPA_PLATFORM=wayland. I would keep this configuration for the time being.

@GHU7924
Copy link

GHU7924 commented Nov 18, 2024

Operating System: Fedora Linux 41
KDE Plasma Version: 6.2.3
KDE Frameworks Version: 6.8.0
Qt Version: 6.8.0
Kernel Version: 6.11.7-300.fc41.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 6 × Intel® Core™ i5-8600K CPU @ 3.60GHz
Memory: 31.3 ГиБ of RAM
Graphics Processor: NVIDIA GeForce RTX 3070/PCIe/SSE2

Build ac30fdd (by ngoquang2708)
If I select my video card, I get a black screen.
If I select another option (screenshot), I can get into the game, but the character creation screen freezes.
Снимок экрана_20241118_230605
Снимок экрана_20241118_225426

In this topic #1540, it was indicated why this is happening, but I do not know how plausible it is. I play without mods.

I have a question too:
Why is there no 'User' folder next to the 'Shadps4-qt.AppImage' file?
I could solve the hang problem by adding a save file, but I don't have folder 'User' to host this file.
Снимок экрана_20241118_230649

I wanted to compare the performance of the emulator for different operating systems, but so far it has not worked out.

@ChetanSaini726
Copy link

ChetanSaini726 commented Nov 19, 2024

@GHU7924 Maybe the user folder is in the ~/.local directory. May you please share the save file you have.

@ngoquang2708
Copy link
Contributor

It is in .local/share/shadPS4 by default.

@ngoquang2708
Copy link
Contributor

savedata.zip

@GHU7924
Copy link

GHU7924 commented Nov 19, 2024

@ChetanSaini726 @ngoquang2708 Thanks I found it))
But has it always been like this, or has the path been changed? I just remember what was different or I'm just confusing it with another emulator?

In which case, if someone urgently needs it, you can download the save on NexusMods - Save file after character creator.
(If it is not possible to create the file yourself in another operating system)

The save file has just been created in the Main Build Win-qt.
It didn't work out any further anyway, the emulator closes with a critical failure.
Снимок экрана_20241119_143353
Снимок экрана_20241119_142717

[Debug] signals.cpp:SignalHandler:76: Unreachable code!
Unhandled access violation at code address 0x7fe30e6c880e: Read from address 0x7fdf085c5b58

shad_log.txt

Next attempt

[Debug] liverpool.cpp:operator():298: Assertion Failed!
NOP hint is missing in CB setup sequence

shad_log.txt

Next attempt 2
If you do not press anything in the main menu and the video starts, it will be:

[Debug] liverpool.cpp:ProcessGraphics:200: Unreachable code!
Unsupported PM4 type 0

shad_log1.txt

Next attempt 3
If you do not press anything in the main menu and the video starts, it will be:
Снимок экрана_20241119_145929

[Debug] signals.cpp:SignalHandler:76: Unreachable code!
Unhandled access violation at code address 0x9026bc1c3: Read from address 0xd2

shad_log2.txt

I still can't play Bloodborne on Linux))
Maybe I didn't say anything new, but nevertheless, this is my experience of using ShadPS4 on Linux.

@ngoquang2708
Copy link
Contributor

@GHU7924 Try my linux-hack branch

@ngoquang2708
Copy link
Contributor

bb and bb-more-kernel include unstable PRs

@GHU7924
Copy link

GHU7924 commented Nov 19, 2024

There is no difference. Okay, I can still play on Windows-qt build, maybe I'll come back later to test builds for Linux.

@kingopai1
Copy link

Hey ngoquang, how do you try your linux-hack branch?

@Hermiten Hermiten marked this as a duplicate of #1045 Dec 1, 2024
@Hermiten Hermiten closed this as completed Dec 1, 2024
@Hermiten Hermiten reopened this Dec 1, 2024
@Hermiten Hermiten marked this as not a duplicate of #1045 Dec 1, 2024
@Hermiten
Copy link
Collaborator

A lot of things have been made since this issue and the solution.
I'm closing it and we will open a fresh one if needed

@Barionak
Copy link

Barionak commented Apr 5, 2025

Используйте этот патч

diff --git a/src/core/libraries/kernel/thread_management.cpp b/src/core/libraries/kernel/thread_management.cpp
index 39c0eaf8..a8cee07c 100644
--- a/src/core/libraries/kernel/thread_management.cpp
+++ b/src/core/libraries/kernel/thread_management.cpp
@@ -1075,7 +1075,16 @@ ScePthread PThreadPool::Create(const char* name) {
         }
     }
 
+#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;

Затем перестройте и наслаждайтесь :D

@Barionak
Copy link

Barionak commented Apr 5, 2025

Where should I enter this?

@StevenMiller123
Copy link
Contributor

This is an ancient hack that's no longer needed to run Bloodborne on Linux-based devices.

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