mordesku / PS4-Debian-Drivers

1 stars 0 forks source link

Linux Mint #2

Open Blackdragon897a opened 6 months ago

Blackdragon897a commented 6 months ago

Hello there Mordesku !

I'm trying to port Linux Mint on PS4 but nobody want to help me lmao. I'm asking help everywhere and it's been two or three months i'm trying to do this. I finally found a good repo with debian drivers for ps4. I'm happy now because there are no tutorials on internet to show us how to apply patches on linux drivers for PS4.

I was running my linux mint distro on a VM and then installed your drivers but when I tried to install the i386 drivers, it returned me an error code with dpkg...

Also, I've got a ps4pro and I know that there are some differences between ps4 patches and PS4 PRO patches so... can you help me with Linux mint drivers for ps4 pro please ?

My knowledge level with linux : near to 2/10 My configuration : PS4 Pro Belize What I have to make linux mint on ps4 possible : Time !

mordesku commented 6 months ago

Hi @Blackdragon897a

Lets start from your installation problem. You gave me almost no information about the errors so I really can only guess. It looks like you haven't enabled multiarch, please read this if you want to learn, TLDR run bellow commands:

sudo dpkg --add-architecture i386
sudo apt update

and then try installation one more time.

When it comes to patching packages I don't think there is an universal guide. I am a software engineer with 10+ years of experience in many programming language so patching sources manually was really trivial to me. I can share steps I did to build patched packages.

  1. Read the Debian guide of building packages.
  2. Download sources of packages you want to patch using apt.
  3. Download build dependencies
  4. Apply patches (this is tricky, I'll explain it little bit more later)
  5. Build packages using method from the guide (debuild -b -uc -us)
  6. Install packages
  7. Profit :)

Now when it comes to applying patches. If you would like to patch sources that the original patch file was created it is usually simple. You can use patch program. But usually the files are different and simple patching will fail do to different line offsets. So you will need to apply patches manually.

Bellow you can see sample diff.

diff -ruN libdrm/radeon/r600_pci_ids.h libdrm-mod/radeon/r600_pci_ids.h
--- libdrm/radeon/r600_pci_ids.h    2020-05-25 18:24:34.398124762 +0200
+++ libdrm-mod/radeon/r600_pci_ids.h    2020-05-25 18:40:57.654848297 +0200
@@ -473,6 +473,11 @@
 CHIPSET(0x131C, KAVERI_131C, KAVERI)
 CHIPSET(0x131D, KAVERI_131D, KAVERI)

+CHIPSET(0x9920, LIVERPOOL_9920, LIVERPOOL)
+CHIPSET(0x9922, LIVERPOOL_9922, LIVERPOOL)
+CHIPSET(0x9923, LIVERPOOL_9923, LIVERPOOL)
+CHIPSET(0x9924, GLADIUS_9924, GLADIUS)
+
 CHIPSET(0x67A0, HAWAII_67A0, HAWAII)
 CHIPSET(0x67A1, HAWAII_67A1, HAWAII)
 CHIPSET(0x67A2, HAWAII_67A2, HAWAII)

First line is a command line diff was executed and it has also information about the file we need to patch. Which in this case is libdrm/radeon/r600_pci_ids.h later we have information about line numbers @@ -473,6 +473,11 @@ that are helpful in locating place of change but these are usually incorrect. Most important thins are following lines starting with + or with -. The one with + means we need to add a line the - means we need to delete a line.

So you need to open every patch file and go thru every diff entry and apply it to downloaded sources one by one, when you're done you build the packages and if you didn't messed up something (if you did compilation probably would fail) you got your fresh new packages ready to work on ps4.

Blackdragon897a commented 5 months ago

Hi @mordesku !!!!!

It's true that I provide you no information on the error I was facing ! I'm terribly sorry ! In my case, I'm just a 20 years old french student with just a tiny little experience in C# coding. So yep. Trying to port that on ps4 without tutorials IS TERRIBLY HARD for someone like me. XD

Yesterday, I was thinking about Linux Mint and I wondered : Linux Mint is an Ubuntu based system. And Ubuntu is a Debian based system... So, was that okay if I installed directly Debian drivers on Linux mint ?? Maybe, It's better to directly take the source code of Linux mint packages and patch them manually like you said.

But anyway, I took some screenshots !

Screenshot from 2024-03-13 17-15-12 Screenshot from 2024-03-13 17-15-53 Screenshot from 2024-03-13 17-19-23 Screenshot from 2024-03-13 17-19-38 Screenshot from 2024-03-13 17-20-54 Screenshot from 2024-03-13 17-21-05 Screenshot from 2024-03-13 17-22-16 Screenshot from 2024-03-13 17-23-40

Above, you can see all the commands I entered in the terminal.

To create a distribution for PS4, I followed this tutorial : https://ps4linux.com/make-ps4-linux-distro/ Sadly you will see on that website, there is nothing about drivers patching and package building :'( .

Yesterday, I have downloaded a .patch file for mesa 23.2.1 from the PS4-Overlay from Dr3kk4n. And I have patched and installed the mesa with these commands :

meson setup builddir ninja -C builddir/ ninja -C builddir/ install

When I booted the distro, then, on PS4 Pro, the graphical glitches were gone. OpenGL worked but Vulkan doesn't seem to work. Well, I don't know how to verify if vulkan is working but I think, you gave the command on the first issue.

And by the way, I wonder if you have a discord account ? If that's the case, I can send you screenshots faster and you'll be able to help me to port Linux Mint on PS4 easier too ! Just tell me when you have time so, I will not bother you everyday with stupid noob questions XD.

And thank you so much for taking the time to teach me how to patch and build packages for ps4 ! I'll get to work now to see what I can do ! Alright ! LET'S GO !!!!

mordesku commented 5 months ago

There are couple thing I need to address here.

  1. Do not paste screenshots. It is really hard to find something. Next time redirect command output to the file using > and paste that file.
  2. My packages are build for Debian, Mint has special flavor Linux Mint Debian Edition that is build on top of Debian. I assumed you are using this one as you tried Debian packages.
  3. Although Debian and Ubuntu shares some parts and Ubuntu originates from Debian these distributions are not binary compatible and it is not guaranteed that package from one will work on another. Your problem seems to be related to missing dependen(cy/cies) which may be the result of using debian packages on ubuntu base
  4. Vulkan on PS4 require at least 5.X kernel or maybe 5.5+ I'm not sure but it doesn't work on 4.X kernel. You can test this by typing vulkaninfo in terminal. If you see something like below it doesn't work:
    ERROR: [Loader Message] Code 0 : vkCreateInstance: Found no drivers!
    Cannot create Vulkan instance.
    This problem is often caused by a faulty installation of the Vulkan driver or attempting to use a GPU that does not support Vulkan.
    ERROR at /usr/src/debug/vulkan-tools/Vulkan-Tools-1.3.269/vulkaninfo/./vulkaninfo.h:688:vkCreateInstance failed with ERROR_INCOMPATIBLE_DRIVER
Blackdragon897a commented 5 months ago

Hello @mordesku !

1 - I'm sorry !!!! As you can see, I begin with github 😥 I though It was easier to post screenshots ! Sorry again ! 2/3 - Yes. Each time I wanted to install Debian drivers on Linux Mint, It results with a messy distro. 3 - I'm using a 5.15.25 FULL LTO linux kernel. I have installed vulkan-tools and wrote vkcube to test vulkan but... It crashed.

So, where am I ?

Let's begin with mesa 23.2.1 :

About libdrm2.4.113-2ubuntu :

About xserver-xorg-video-amdgpu 22.0.0-1ubuntu0.2 :

As you can see, trying to compile mesa correctly is a big pain for a newbie like me and make Vulkan work is hopeless. Tell me if you want the output when I'm trying to compile mesa !

mordesku commented 5 months ago

Hello @Blackdragon897a

So according to what you wrote you haven't compiled any packaged and definitely you haven't installed any packages on your system. You took sources and patch them and then "installed" them on your system. I wrote installed in quotes because i don't think it was installed in the right location. You need to distinguish two things.

  1. building packages from source which produces installable packages (*.deb) that can be installed using dpkg.
  2. building some tools and libraries from source and installing it as it is. (this is what you did)

In the first scenario package sources and install script is prepared by the system developer (we just patch some sources) and when installed all files are placed in the right location.

In your case you compiled some programs and libraries. Installed it in i assume default prefix which usually is /usr/local. Which is fine for some additional libraries you want o use and you don't want to mess the system. But if you want to replace system libraries you should not install in /usr/local but in /usr.

There is additional advantage of using deb packages rather than manual builds. When Ubuntu package maintainer will release an update of a modified packages. If it was installed the way you did it will get simply overridden because the system have no knowledge about your modification (apt/dpkg keeps records of every installed packages). If you install manually created package (.deb), the system will recognize it was not Ubuntu package and will not overwrite it if not explicitly asked. (Well I'm not sure about Ubuntu but Debian wouldn't overwrite it).

So please learn how to build DEB packages from source (there is a link in my first reply, it is more about debian but it should work with ubuntu). Take a look at this thread especially on "New Approach"

https://askubuntu.com/questions/81870/how-to-download-modify-build-and-install-a-debian-source-package