r/ps5homebrew • u/Darkatek7 • 25m ago
I got AMD's FSR 3 frame generation running on a jailbroken base PS5, and v1.0 is out (30 -> 60 fps, HDR, open source)
Less than a week ago the first FSR pass ran on my PS5. Today I'm releasing v1.0.0 of ps5-fsr-framegen: AMD's FSR 3 frame generation injected into a running game on a base PS5. The game renders at 30 fps, and every second frame on a 60 Hz screen is generated by FSR 3 from the game's own motion vectors and depth. It works in SDR and HDR.
The video is one recording of the console's output, slowed down 4x. On the left are only the game's own frames, which is what you normally get. On the right is every frame, with FSR 3's frames in between. Watch the shop icon too, that's new in 1.0.
How do you even run FSR on a PS5?
There's no FSR for the PS5 and no Vulkan. The open part of AMD's FidelityFX SDK, FSR 3's frame interpolation and optical flow, is MIT-licensed shader code. I compile it on my PC with Mesa's Linux GPU driver, set to target a PS5-class AMD GPU without a GPU attached. That gives raw machine code, and the payload feeds it to the console's GPU through command lists it writes itself. The injection, the menu and the display handling come from LPZ-Framegen (https://github.com/Lilpez/LPZ-Framegen), which already did frame generation with its own interpolators. I put AMD's passes in their place.
Every stage is checked. I capture the GPU's intermediate images on the console and compare them pixel by pixel with the same shaders running on my PC.
The walls I hit on the way
• HDR. In HDR, the game's motion vectors are already overwritten by the time a frame reaches the screen. The fix was to hook the game's own upscaler and append a tiny copy job to the game's command buffer, right after it runs. That copy arms itself through a ladder of safety checks before frame generation turns on.
• Driving. The first builds painted a ghostly copy of the car's rear bumper and number plate onto the road behind it, and the car's shadow wobbled. That took the most work: about a dozen rules on top of FSR. The vehicle's rear, its shadow, its lower edge and its plate now stay where they belong. None of it uses constants for one specific car.
• A sneaky crash. The tool that turns the driver's disassembly into binaries silently dropped repeated instructions, so a few kernels were some words short. That crashed the game three builds in a row before I found it.
• The game fighting back. The game sometimes asks the console to drop to 30 Hz, for example in menus and cutscenes. While frame generation is on, the payload politely holds those requests.
What v1.0 does, all in all
• 60 frames on screen: all ten passes of FSR 3's frame interpolation plus its optical flow, on every game frame.
• HDR on 10-bit display buffers.
• A HUD that stays put. The game's HUD isn't interpolated or dragged along with the scene, and the payload's own FPS counter and menu don't flicker.
• New: map icons in the world move with the world. Shop and vehicle markers used to jump at 30 fps because the HUD stays fixed to the real frame. Now every 32x32 tile of the HUD is classified on each frame. Icons that move with the world are drawn half way along their motion, and anything the classifier can't explain stays put rather than being moved wrong. The idea comes from VibePorter's UI motion in ps5-mvfg, reimplemented here, and it costs about 0.1 ms.
• New default: 1080p internal rendering (50%). The game holds its 30 fps much better. 60% (2304x1296) is one menu switch away and applies at the next game start.
• Frames are never interpolated without the game's vectors. In menus, while loading, at camera cuts, and when the copied vectors look invalid (a check taken from ps5-mvfg), you see the real frame instead.
• No line at the screen edges. The game's frames have a dark border that FSR would pull into the picture during turns, so it gets repaired first.
• A frosted-glass in-game menu with frame generation on/off, the FPS counter, the render resolution, graphics, latency and shortcuts. Hold L1 + R1 + Right to open it. L1 + R1 + Left toggles frame generation.
• About 6 to 9 ms of GPU time per game frame.
What's not perfect yet
• Very fast camera turns still show some stock FSR 3 artefacts near the screen edges and beside close objects.
• In bright sun, a shadow's edge beside the car can tear in single generated frames.
• A wheel seen from the side while driving can lose a piece of its tyre in the generated frames. I found this one today and I'm on it.
• At 60% the game can drop below 30 fps in heavy scenes, which is why 1.0 defaults to 50%.
• Twice in testing, the console went down while I was streaming its picture with ProsperoSunshine/Moonlight with the payload running. Don't stream while you use it.
Requirements and install
• A base PS5 (Fat, Slim or Digital), jailbroken. The SDK covers firmware 1.00 to 13.60, but I've only tested a Slim on 13.00. No PS5 Pro.
• kstuff, an ELF loader on port 9021, and optionally a payload manager.
• Title PPSA38500, version 01.002.001. Every address is tied to that version.
To install, copy config.txt to /data/lpz/config.txt and send ps5-fsr-framegen-v1.0.0.elf with the game closed, then start the game. Frame generation comes on about 40 seconds after loading. After each start, let frame generation run for about a minute before you close the game, otherwise a safety file keeps it off at later starts (the README explains).
This is experimental software that patches the memory of a running game. Use it on your own console, with a game you own, at your own risk.
Thanks to Lilpez for LPZ-Framegen (https://github.com/Lilpez/LPZ-Framegen), the base all of this runs on. Thanks to Swordpdf for ps5-mvfg (https://github.com/Swordpdf/ps5-mvfg) and ps5-framegen (https://github.com/Swordpdf/ps5-framegen), and to arctco and VibePorter, whose ideas I reimplemented. And to AMD for open-sourcing FidelityFX. Everything is GPL-3.0-or-later.
Release and source: https://github.com/Darkatek7/ps5-fsr-framegen/releases/tag/v1.0.0
If you try it, especially on another firmware, I'd love to hear how it goes.
