OpenDriver2 / REDRIVER2

Driver 2 Playstation game reverse engineering effort
MIT License
1.08k stars 62 forks source link

[Psy-X] frame rate can be low depending on monitor refresh rate, fullscreen mode and vertical sync settings #162

Closed melroy89 closed 2 years ago

melroy89 commented 2 years ago

Describe the bug

I don't know if you are already aware of this. But I'm noticing a low frame rate under Linux in general.

To Reproduce Steps to reproduce the behavior:

  1. Play the latest release(s) for Linux (eg. the tar.gz file)
  2. Drive around.
  3. Notice the low FPS / low responsiveness of REDRIVER2 in comparison with Beetle PSX HW emulator.

Expected behavior

I expect at least the same / similar FPS rate and responsiveness as with the Beetle PSX HW Emulator under Linux. (ideally better.. but at least the same)

Screenshots If applicable, add screenshots to help explain your problem.

Environment and game (please complete the following information):

ps. I suspect the psy cross to be the root issue.

SoapyMan commented 2 years ago

That's quite a strange problem and It's probably could be debugged on your machine. I'd love to see any profiling details.

Also need to know how fast game runs when you press BACKSPACE.

melroy89 commented 2 years ago

I was using the release build. Should I download the debug build?

And how to create a profiling file?

melroy89 commented 2 years ago

I was using the release build. Should I download the debug build?

And how to create a profiling file?

Anything? Please help me to create such a profiling report you want.

Ps. My display was a TV screen, with 30 FPS. But it felt like 15 FPS with stutter. While looking at my hardware specs, this is the most powerful PC in my house.

EDIT: I guessed you want the log file? ...!? See attachment: REDRIVER2.log

melroy89 commented 2 years ago

Also need to know how fast game runs when you press BACKSPACE.

It runs insanely insanely fast when I hold the backspace button.

I'm running windowed mode. You updated the title, but I'm not fully convinced yet if we pin pointed the root cause already. Until then maybe don't take too much assumptions?

Also when using gdb, it says that the dev build doesn't have debug symbols included, why??

`(No debugging symbols found in ./REDRIVER2_dev)

SoapyMan commented 2 years ago

The root cause is how Vsync is handled by the PsyCross and it's bound to how OpenGL swap interval works, I just need a programmer with same hardware as you rn who can fix it and make a Pull Request.

melroy89 commented 2 years ago

I can allow you to access via ssh? If that helps you.

Also I'm a software engineer myself. Although I'm not very familiar with this code base.

melroy89 commented 2 years ago

Anyone?

PrgmrAtHrt commented 2 years ago

This issue still persists in version 7.4.618

melroy89 commented 2 years ago

This issue still persists in version 7.4.618

PR is also still open.

SoapyMan commented 2 years ago

Added vsync option to config.ini, tests with on and off would be helpful. If with vsync=0 it is not reproducible - screen refresh rate option will be added (and Vsync will be permanently disabled in windowed mode)

melroy89 commented 2 years ago

Let me test it. EDIT: Is there a new release RC2 for this?

PrgmrAtHrt commented 2 years ago

Tested the latest artifact and can confirm that without V-sync turned on, the game runs exactly as it should.

SoapyMan commented 2 years ago

Let me test it. EDIT: Is there a new release RC2 for this?

not yet, but AppVeyor builds are posted https://ci.appveyor.com/project/SoapyMan/redriver2-10jm8/builds/42334386

SoapyMan commented 2 years ago

Fixed, see comment at https://github.com/OpenDriver2/PsyCross/issues/2

melroy89 commented 2 years ago

Very strange. I put the bin/cue files in the install directory.

I run ./_convert_cd_fmv_xa.sh script. Every seems fine. It extract all the data from the bin files (both from cd1 and cd2).

After that, I run REDRIVER Linux binary. But it says it can't find the game files!??

It says: "Cannot initialize REDRIVER2. Game files not found by folder 'DRIVER2\'.

Ps. [Psy-X] Build date: Jan 29 2022:14:02:23

SoapyMan commented 2 years ago

@danger89 the log doesn't seem to be full.

melroy89 commented 2 years ago

The log doesn't reelly give you any useful errors. I could post the full terminal output if you want.

SoapyMan commented 2 years ago

Would be good to see the log anyway. Or check your config.ini

melroy89 commented 2 years ago

I didn't modify the config.ini yet. I just wanted to test out the latest version. But I can't get it running (again giving the error Game files not found by folder 'DRIVER2\',as a popup).

Give me a sec. I will post the full log.

melroy89 commented 2 years ago

Here you go:

REDRIVER2_Release_dev$ ./REDRIVER2_dev 
[Psy-X] Initialising Psy-X 2.8
[Psy-X] Build date: Jan 29 2022:14:02:23
[Psy-X] *Video adapter: Radeon RX Vega (VEGA10, DRM 3.41.0, 5.13.0-27-generic, LLVM 13.0.0) by AMD
[Psy-X] *OpenGL version: 4.6 (Core Profile) Mesa 21.3.5 - kisak-mesa PPA
[Psy-X] *GLSL version: 4.60
REDRIVER2 7.4.675 Jan 29 2022 14:02:49 (Release_dev)
[Psy-X] found sound device: OpenAL Soft
[Psy-X] PSX SPU effects are supported and initialized
---- LOG CLOSED ----
AL lib: (EE) alc_cleanup: 1 device not closed

Update: I was using the artifacts from this build: https://ci.appveyor.com/project/SoapyMan/redriver2-10jm8/builds/42382151/job/9d1w92ybk992wkm8/artifacts

image

SoapyMan commented 2 years ago

Please check config.ini for cdfs section image parameter. It was commented. usually it reports like that:

[Psy-X] Using 'install/Driver2CD1.bin' image, sector size: 2352, frames: 275199
melroy89 commented 2 years ago

Please check config.ini for cdfs section image parameter. It was commented. usually it reports like that:

[Psy-X] Using 'install/Driver2CD1.bin' image, sector size: 2352, frames: 275199

You are right! This needed to be uncommented. I did not need to do that in the past. Why?

Ps. Now I do see indeed: [Psy-X] Using 'install/Driver2CD1.bin' image, sector size: 2352, frames: 274417

Can't you automatically detect this?

melroy89 commented 2 years ago

That being said, this unreleased version I was testing is not causing any low frame rates (even when vsync=1), so that is great news. It solved my initial issue for sure.

SoapyMan commented 2 years ago

Can't you automatically detect this?

Running from CD image is going to be deprecated for ReD2 as it is still may be unstable and soon Linux version of Launcher is going to be completed.

melroy89 commented 2 years ago

Can't you automatically detect this?

Running from CD image is going to be deprecated for ReD2 as it is still may be unstable and soon Linux version of Launcher is going to be completed.

ah so you only need to run the convert once and be done with it 👍🏽 ? (in the future)

awsms commented 2 years ago

Please check config.ini for cdfs section image parameter. It was commented. usually it reports like that:

[Psy-X] Using 'install/Driver2CD1.bin' image, sector size: 2352, frames: 275199

Wait you actually need both the extracted files and the two .bin discs in order to launch the program?