Skip to content
Projects

About

Frame generation for PPSA38500 on a jailbroken PS5: 30 -> 60 FPS with MihawkGen + Guard and Lossless Scaling!

AI & Machine Learning

How these counts are measured

Measured star growth

in 24h
Collecting history
in 7 days
Collecting history
in 15 days
Collecting history
in 1 month
Collecting history

Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.

README.md

Original

LPZ Framegen

Frame generation injected into a PS5 game on a jailbroken base PS5: the game runs at a locked 30 FPS and LPZ Framegen inserts a generated frame between every two real ones, so the TV gets 60 frames per second. Research code.

30 FPS vs 60 FPS on foot, slowed down 4x

30 FPS vs 60 FPS driving, slowed down 4x

v1.2, MihawkGen, Performance preset. Same 1.5 seconds on both sides, slowed down 4x. Right: 60 FPS with LPZ Framegen, as recorded by the console. Left: the same recording with every other frame left out, which is what 30 FPS looks like. Full-speed comparison of all four modes in the v1.2 release.

Built and tested against one title so far: PPSA38500. Two frame generators are available:

  • MihawkGen (built in, works for everyone): a small neural network that runs on the PS5's own GPU.
  • Lossless (optional): the frame generation from Lossless Scaling. LPZ does not include it. If you own Lossless Scaling, the LPZ Lossless Builder turns your own copy into a file the PS5 can load (how).

On top of either one, Guard uses the game's own motion vectors and depth (in SDR) to fix what the generator gets wrong: the character's head and hair, subtitles copied by the generator, the dark band at the screen edge, and text that smears when it moves.

What's new in v1.3.3

Bug fixes for v1.3.2. Just replace the elf. Your lossless.pack keeps working.

  1. Text artifacts in SDR are gone. The v1.3.2 subtitle change also copied the see-through backgrounds behind on-screen text from the real frame, which left blocky smears around text when the camera moved (HDR was not affected). Guard is back to the v1.3.1 version, which many players used without this problem. Subtitles can shimmer slightly again, as in v1.3.1; a better fix comes after testing.
  2. Frame generation starts with VI-Patch's 1080p option on. LPZ used to leave the resolution to VI-Patch when its config (/data/vi-patch/vipatch.txt) had 1080p=1, even when VI-Patch was not running. The game then stayed at its default resolution and frame generation refused to start. LPZ now always applies its own resolution (60% by default). If it still cannot, the notification says to set 1080p=0 in that file.
  3. Clearer 120 Hz notice. VI-Patch ships with its "120 Hz" option on, which keeps the display at 120 Hz even when 120 Hz is off in the PS5 settings. When that option is on, the notification now says to turn it off in VI-Patch.

What's new in v1.3.2

Bug fixes for v1.3.1. Just replace the elf. Your lossless.pack keeps working.

  1. Works together with VI-Patch. LPZ's code and data no longer use the same free memory as VI-Patch options (Freecam, Gyro aim, No clothing and others): they now live at the end of a game section that nothing else uses (method from Kuri - LPZ). Where both do the same thing (weather fix, no vignette, 1080p), LPZ leaves it to VI-Patch. If a VI-Patch option still needs LPZ's memory, LPZ stays off and the notification names the option.
  2. Works with the Arabic / Persian translation patches (same memory change).
  3. HDR is no longer experimental. In HDR the third buffer uses the right memory type (the freeze some testers saw when closing the game in HDR), and LPZ waits for the game's display to settle before starting. If the game changes its display mode mid-session, frame generation pauses safely until you restart the game.
  4. Subtitles no longer shake or double. The whole subtitle, outline included, now comes from the real frame. (Undone in v1.3.3: it caused text artifacts in SDR.)
  5. Clearer notifications. Short messages that say what is going on: "ready - open the game", "game detected, 60 FPS turns on by itself after loading", "60 FPS ON". When something stops it, the notification says why and that the game keeps running at 30 FPS. No more "MihawkGen OFF" when you just close the game.
  6. One log file, /data/lpz/LPZ_LOG.txt, with the reason when frame generation does not start. "Report a problem" sends it.
  7. Second video output: LPZ no longer replaces its first buffer.

What's new in v1.3.1

Bug fixes for v1.3. Just replace the elf. Your lossless.pack keeps working.

  1. Game freezing at start with VI-Patch "Skip intro logos". Without the intro, LPZ found the game's textures while it was still loading and started frame generation on the very first frame, and the GPU hung. LPZ now waits until the game scene is really drawing (about 1 second), so skipping the intro is safe.
  2. Safer game close. When you close the game, LPZ does nothing until the game is completely gone, then waits quietly for the next start. No more "ready. Start the game" notification every time you close it.
  3. FPS counter: cleaner 6 and 9.

What's new in v1.3

Bug fixes and polish for v1.2.1. Just replace the elf. Your lossless.pack keeps working: LPZ updates the FPS counter and Guard inside it when it loads, so there is no need to build it again.

Fixes

  1. Kernel panic when closing the game, and crashes in rest mode. LPZ now stops touching the game the moment it starts closing or is suspended, and picks up again when you come back.
  2. Crash after staying a while on the map. LPZ could switch the HUD layer it reads to the map's own texture.
  3. LPZ not starting on firmware 11.60. The new-version check is gone (it never downloaded anything, but on that firmware it stopped LPZ from starting).
  4. Stutter and moments of double speed. LPZ kept asking the screen for 60 Hz several times per second (a rule from v1.2.1); with fix 5 it is no longer needed. LPZ also never lets the game run faster than its own 30 FPS.
  5. Menus and cutscenes at 60 FPS. The game switched the screen to 30 Hz there; LPZ now keeps 60 Hz.
  6. Map, minimap and mission icons at 60 FPS (Lossless). Guard now takes only the HUD that stands still (subtitles, fixed text) from the real frame. With MihawkGen the big map can still look rough while it scrolls.
  7. FPS counter no longer flickers, and has a new look: the frame rate on screen in large type, the game's own frame rate small below.
  8. One LPZ at a time. Loading it twice no longer runs two copies (idea by thegl0w).
  9. Waiting more than 10 minutes before starting the game no longer leaves LPZ inactive.
  10. Clear messages when LPZ was loaded after the game, or another tool uses the memory it needs.
  11. 120 Hz warning when the PS5 outputs 120 Hz.
  12. One-time notice that HDR mode is experimental.
  13. Crash logs are kept (mihawk_prev.txt) and go with the report.

Menu

  • Main page: Frame generation, Generator, Preset (Balanced, Performance and the new Custom) and More settings.
  • More settings: Image fixes (Full / Light) and Motion blur, which Custom uses, then Sharpness, Render resolution, Input lag, FPS counter, the game tweaks, Menu shortcut and Report a problem (moved here).
  • Frame generation keeps running while the menu is open.
  • Faster to navigate, and a notification shows while the generator switches.

New options

  • Built-in weather fix can be turned off, to use VI-Patch's weather fix instead (idea by danidomi).
  • network=0 in /data/lpz/config.txt turns off the browser menu and reports (idea by danidomi).
  • PS5 Payload Manager: add https://raw.githubusercontent.com/Lilpez/LPZ-Framegen/main/payloads.json as a source to update LPZ from the console.

Lossless builder

  • Needs Lossless Scaling 3.2.2 or newer (the version that ships the Vulkan shaders). An older Lossless.dll now gets a clear message instead of KeyError.
  • Finds the shaders by their content, so a Lossless Scaling update that renumbers them keeps working.

What's new in v1.2.1

Fixes for what you reported on v1.2. Just replace the elf: LPZ cleans up old settings and test files by itself the first time it runs.

  1. Character flicker on some consoles. If the game closed in the first seconds after starting (quitting, rest mode), LPZ thought it had crashed and switched for good to MihawkGen without Guard, which has no character fix. Many reports were stuck there. That no longer happens, and anyone stuck there goes back to the normal mode.
  2. Cleaner head in Performance. Guard now checks the area around your character in the Performance preset too, so the edge of the head and hair stays clean when you spin the camera. Lossless users: build your pack again with the LPZ Lossless Builder to get this.
  3. Works next to other game patches. LPZ moved to a memory area that VI-Patch, ps-patch-system and similar patches don't use, and checks that it's free before writing. If another patch is using it, LPZ tells you and leaves the game alone instead of crashing it. Feedback welcome.
  4. Menu in your browser. Open http://<PS5 IP>:7979 on your phone or PC: it's the same menu as in the game, and changes apply right away. The IP shows in the first LPZ notification. Works with the game closed too.
  5. Menu not opening. L3 + R3 + Right (press both sticks) now also opens the menu, and new shortcut options without L1 + R1 avoid clashing with cheat menus. If the controller hook fails on your console, LPZ tells you to use the browser menu.
  6. Crash at the splash screen after picking 65% or 67% on v1.1: old settings above 60% are set back to 60%.
  7. Stuck at 15 FPS after some missions or menus: when the game switches the screen back to 30 Hz by itself, LPZ sets 60 Hz again.
  8. New version notice. LPZ checks GitHub once when it loads and tells you when a new version is out. It never downloads or installs anything.

What's new in v1.2

The three most requested

  1. HDR. Leave HDR on and LPZ just works: frame generation runs in HDR, with a notification that this mode is experimental. Turn HDR off for the best image. Details
  2. Lossless Scaling frame generation. If you own Lossless Scaling, open the LPZ Lossless Builder, drop your own Lossless.dll and copy the file it makes to the PS5. It runs in your browser: your file is not uploaded anywhere. Step by step
  3. Character fix. The head and upper body no longer flicker or vanish when you spin the camera: the character is now taken from the real frame inside her outline, instead of being guessed pixel by pixel.

Also new

  • Subtitle fix. No more copies of the subtitle above and below the text while you drive.
  • Car shadow fix. The part of the screen under your car is left to the generator, which removed the split line and the flickering shadow behind the car.
  • Generator and preset, separately. Pick the generator (MihawkGen or Lossless) and the preset (Performance or Balanced).
  • Performance preset is much lighter. About 1.5 ms less GPU time per frame with MihawkGen.
  • Motion blur (optional). A soft blur on moving scenery; your character, your car and the HUD stay sharp.
  • New in-game menu, with a short explanation under every option.
  • Report a problem, from the menu, tagged with your own ID.
  • Fixes: frame generation starts at launch at 60% resolution; no screen tearing when the game asks for a flip without vsync; the game no longer jumps to 60 FPS with frame generation off; resolution and motion blur are put back if another patch changes them; resolution in the menu is limited to 50% and 60%.

Requirements

Console Base PS5 (Fat or Slim), jailbroken. Developed on firmware 13.60; testers report it running on 4.03, 7.61, 11.60 and 13.40 too. PS5 Pro is not supported.
Homebrew kstuff (kernel patches), elfldr listening on port 9021, and PS5 Payload Manager to load payloads automatically.
Game PPSA38500, version 01.002.001 (tested). Testers report 01.002.002 working too. Other regions or versions are untested.
Display A 60 Hz TV or monitor. HDR on or off. SDR has more presets (see HDR).

On a PS5 Pro? Check out ps5-mvfg by Sword, with 40 → 120 frame generation for the Pro.

Installation

LPZ Framegen is a single file: lpz_framegen.elf (download it from the latest release).

  1. Add it to PS5 Payload Manager as a local payload and enable it for autoload. Put it after kstuff and elfldr in the autoload order.
  2. Restart the console (or load it once by hand), then start the game. Always start the game after LPZ Framegen is loaded.

When frame generation starts you will see "60 FPS on. Menu: hold L1+R1+Right (or L3+R3+Right), or open http://:7979".

Updating? Just replace the elf. Your settings are kept; values that break the game (65/67% resolution, leftover test files) are fixed automatically.

What LPZ changes in the game

LPZ does not need any other FPS unlocker. When the game starts, it applies only what frame generation needs:

  • internal resolution of 60% (2304x1296 on a 4K output), or 50% if you pick it in the menu;
  • motion blur off (the game's own blur smears the generated frames; LPZ has its own, optional, that does not);
  • fixes for the error when closing the game (CE-108255-1) and for weather variation;
  • lighter shadows and fog (Lighter graphics, on by default) for GPU headroom. Turn it off in More settings if you prefer the game's own, or if another patch sets them;
  • no vignette (the dark screen edges when driving or aiming). Turn Vignette back on in More settings if you want it.

Each change is written only if the game code matches the expected bytes, so a different game version is left untouched. Do not run another FPS unlocker or another patch that changes resolution, FPS or motion blur together with LPZ: LPZ puts its values back while you play and tells you once.

Using it

The LPZ Framegen in-game menu

Shortcut (hold) Action
L1 + R1 + Right or L3 + R3 + Right Open / close the menu
L1 + R1 + Left Turn frame generation on / off

Frame generation keeps running while the menu is open.

Menu in the browser: open http://<PS5 IP>:7979 on a phone or PC on the same network. Same options as the in-game menu; changes apply right away while you play.

Generator and preset

Generator
MihawkGen (default) Built in. Works on every console.
Lossless Lighter on the GPU and the smoothest in fast motion. Only available after you install your lossless.pack (see below); until then it is shown in grey.
Preset What it does
Performance (default) The generator plus the character and subtitle fixes. Lightest. Recommended for most players.
Balanced Every image fix (edges, moving text, the rest of the screen) plus motion blur (Medium). Best image, about 2-3 ms more GPU time.
Custom Your own mix: Image fixes and Motion blur in More settings. Changing either of them on Balanced or Performance switches to Custom.

Changing the generator applies when the menu closes (a notification shows while it switches). Presets apply immediately.

More settings

Option Notes
Image fixes Full (every image fix, as in Balanced) or Light (character and subtitle fixes, as in Performance).
Motion blur Off / Low / Medium / High. A soft blur on moving scenery; your character, your car and the HUD stay sharp.
Sharpness Sharpening of the final image (4 is the default).
Render resolution 60% (recommended) or 50%. 50% is unstable and shows visual glitches. Applies the next time the game starts.
Input lag Lower lag (default, frame queue of 2) or Smoother (3: steadier pacing, a little more delay).
FPS counter Shows the frame rate in the corner: the frame rate on screen in large type, the game's own below.
Lighter graphics Lighter shadows and fog (on by default). Applies the next time the game starts.
Vignette The game's dark screen edges (off by default). Applies the next time the game starts.
Built-in weather fix On by default. Turn it off to use VI-Patch's weather fix instead. Applies the next time the game starts.
Menu shortcut Change the button combination.
Report a problem Sends the LPZ log to the developer. Only use it if something went wrong.

The Report a problem line shows your ID (6 letters and numbers). It is random, created once on your console, and not linked to your account.

Lossless generator (optional)

Lossless Scaling is a paid app by THS. LPZ does not include any of it. If you own it, you can build a small file from your own copy that LPZ loads on the PS5:

  1. Open the LPZ Lossless Builder in Chrome, Edge or Firefox, on Windows, macOS or Linux. Nothing to install. (Prefer to keep it offline? LPZ-Lossless-Builder.zip in the latest release has the same page: unzip it and open index.html.)
  2. Update Lossless Scaling on Steam (3.2.2 or newer is needed), then find Lossless.dll in its folder, usually C:\Program Files (x86)\Steam\steamapps\common\Lossless Scaling\Lossless.dll (in Steam: right click Lossless Scaling > Manage > Browse local files).
  3. Drop Lossless.dll on the page. It extracts the shaders and compiles them for the PS5 GPU, all inside your browser: the file is not uploaded anywhere. It takes about 20 seconds.
  4. Click Download lossless.pack.
  5. With the game closed, copy it to the PS5 by FTP: /data/lpz/lossless.pack.
  6. Start the game, open the menu and switch Generator to Lossless.

The pack is made for your copy and for this version of LPZ. Do not share it. After updating LPZ, if Lossless turns grey again, build the pack again with the builder from the same release. The page needs an internet connection the first time it opens (to load its Python runtime); your file still stays on your computer.

HDR

Nothing to set up: if HDR is on in the PS5 settings, LPZ just works in HDR (10-bit, the same picture the game outputs).

  • In HDR the game does not provide its motion vectors, so only the Performance preset is available: the character and subtitle fixes, without motion blur. In HDR the character fix keeps her animation at 30 while the scenery runs at 60.
  • Turning HDR on while the game is already running does not give real HDR: the console only converts the picture.

Known issues

  • The menu does not open for some players (remapped controller buttons, some firmwares). Try L3 + R3 + Right, or use the browser menu at http://<PS5 IP>:7979.
  • Other game patches: since v1.3.2 LPZ works together with VI-Patch and the translation patches. Patches that change resolution, FPS or motion blur can still conflict: turn those options off in the other patch (VI-Patch keeps its settings in /data/vi-patch/vipatch.txt, even when it is not running). If a VI-Patch option needs the same memory, LPZ stays off and tells you which option to turn off.
  • 50% resolution shows visual glitches.
  • MihawkGen and the big map: the map can look rough while it scrolls (its motion estimation misses there). Lossless handles it.
  • Hair can still look a little soft in motion; the game gives no motion vectors for it.
  • Firmware 9.60: generated frames may never reach the screen (not fixed yet).

Reporting a problem

  • In the game: menu > More settings > Report a problem. It sends the LPZ log (no personal data) and shows your ID. Tell the ID to the developer when you get in touch.
  • On GitHub: fill a test report.

Settings are saved in /data/lpz/config.txt. Logs are in /data/lpz/*.txt.

What testers asked for

Request Status
HDR support v1.2; no longer experimental in v1.3.2 (Performance preset)
Lossless Scaling frame generation v1.2, from your own copy
Head and upper body flicker when spinning the camera Fixed in v1.2 (character fix)
Subtitles tearing / doubling while driving Fixed in v1.2 (subtitle fix)
Frame generation never starting at 60% resolution Fixed in v1.2
Game crashing above 60% resolution Menu limited to 50% / 60%
Screen tearing Fixed in v1.2 (vsync forced)
Menu not opening on some consoles v1.2.1: second shortcut (L3 + R3 + Right) and browser menu
Working together with other game patches v1.2.1: separate memory area, checked before use (feedback welcome)
Menus and cutscenes stuck at 30 FPS v1.3
Map, minimap and mission icons at 30 FPS v1.3 (Lossless)
Crash when closing the game / in rest mode v1.3
FPS counter flickering v1.3
Update from the PS5 Payload Manager v1.3 (payloads.json source)
Skip intro Not in LPZ: use VI-Patch (works with LPZ since v1.3.1)
Game freezing at start with VI-Patch intro skip v1.3.1
Kernel panic when closing the game v1.3.1: LPZ stays out of the way while the game closes (feedback welcome)
Character flicker in Performance v1.2.1
Working together with VI-Patch (Freecam, No clothing, Gyro aim) v1.3.2
Arabic / Persian translation patches v1.3.2
Subtitles shaking or doubling v1.3.2; undone in v1.3.3 (text artifacts in SDR), better fix after testing
Confusing notifications v1.3.2
Text artifacts in SDR after v1.3.2 v1.3.3
Frame generation not starting with VI-Patch 1080p on v1.3.3
"Your PS5 outputs 120 Hz" with 120 Hz off v1.3.3: the notice names VI-Patch's 120 Hz option
Firmware 9.60 Investigating

Changelog

v1.3.3

v1.3.2

v1.3.1

v1.3

v1.2.1

  • See What's new in v1.2.1. Thanks to the authors of PR #12 and PR #25 for the memory-area findings and the 30 Hz fix.

v1.2

v1.1.1

  • If a mode crashes the game, LPZ switches back to a safe mode and shows a notification.

v1.1

  • Graphics option (Performance / Native). HDR handling: the game is left untouched in HDR.

v1.0

  • First release.

Uninstall

Remove LPZ Framegen from PS5 Payload Manager and delete the /data/lpz/ folder.

Building from source

source/ has everything needed to rebuild the payloads and the builder (no Lossless Scaling code or data):

  • source/mihawk: the injector (main.c, menu, GPU command lists), the in-game blob, and the MihawkGen shaders and network.
  • source/vg: Guard, the block mask, the motion blur and the game-vector shaders (*.comp; compiled binaries in vg/out).
  • source/lsfg: builds the GPU sequence. MihawkGen: LSFG_MIHAWK=1 LSFG_NAME=MG python mklsfg.py. The Lossless pack: LSFG_PSBC=1 LSFG_GUARD=1 LSFG_PACK=1 (what the builder runs).
  • source/boot3: prepares the game at launch (third display buffer and memory, resolution, graphics, close and weather fixes).
  • source/auto: the resident launcher. It embeds the other two payloads: build boot3 and the injector first, then the launcher with -DBOOT3_ELF=<path> -DMIHAWK_ELF=<path>.
  • source/packer: the Lossless Builder. opengnm-psbc (SPIR-V to PS5 shader compiler) is compiled to WebAssembly with Emscripten (build_wasm.sh, with the OS-only adjustments in patch_psbc_wasm.py); make_bundle.py packs the scripts and LPZ's own shaders for the page.

Shaders are compiled for gfx1030 with Mesa RADV. The payloads build with the ps5-payload-sdk: set PS5_PAYLOAD_SDK and compile the injector with -DMODE=2 -DAUTO -DNO_LSFG. "Report a problem" needs a private source/mihawk/report_topic.h (template in report_topic.h.example); without it the build works and the report is disabled.

Credits and license

  • MihawkGen neural frame generation, by Mihawk: github.com/mihawk-99/PS5_MihawkGen (GPL-3.0-or-later; see third_party/MihawkGen-LICENSE.md).
  • Sword (Swordpdf), author of ps5-mvfg, for ideas shared between both projects.
  • Darkatek7 and danzig666, for the HDR findings (display format, third buffer, testing notes) in the issues and pull requests of this repository.
  • Game patch locations (resolution scale, motion blur, shadows, volumetrics, vignette, close and weather fixes) as found by leomars32012-cyber. No code from that project is included.
  • opengnm-psbc (MIT), built on Mesa (MIT), with the PS5 patch from ps5-opengl (GPL-3.0); Pyodide (MPL-2.0) runs the builder's Python in the browser.
  • The menu uses the Inter font (SIL Open Font License 1.1; see third_party/Inter-LICENSE.txt).
  • Kuri - LPZ (github.com/kuribox/LPZ-kuri, GPL-3.0): placing LPZ's code at the end of the game's .eh_frame and the VI-Patch option checks, so both run together (v1.3.2).
  • gk-lzp-lsfg (github.com/gangouskhan/gk-lzp-lsfg, GPL-3.0): HDR ideas (third buffer memory type, waiting for the display to settle) (v1.3.2).
  • Built with the ps5-payload-sdk.
  • Lossless Scaling is a product of THS and is not part of this project.

LPZ Framegen is free software, released under the GNU General Public License v3.0 or later (see LICENSE). It comes with no warranty. Use at your own risk.

Explore related projects

Loading…