Post subject: PCSX: How to sync OpenGL GPU with software GPU
Publisher
Joined: 4/23/2009
Posts: 1283
When using .kkapture with OpenGL GPU plugin (unsure about OGL2 plugin), the capture files seem to be missing load/duplicate frames that the software GPU has. The audio can also be messed up for the OpenGL capture. To fix this, try the following: 1. Capture with OpenGL plugin without audio (we will use software audio) at normal 60 FPS (there may be exceptions to this) 2. Capture with software plugin with audio 3. Create the dup and times file for the software capture making sure you only get the unique frames. For example:
Language: AviSynth

AVISource("software.avi") ExactDedup(firstpass=true, dupinfo="software_dups.txt", times="software_times.txt", maxdupcount=999999)
4. Create the dup and times file for the OpenGL capture making sure you only get the unique frames. For example:
Language: AviSynth

AVISource("OpenGL.avi") ExactDedup(firstpass=true, dupinfo="OpenGL_dups.txt", times="OpenGL_times.txt", maxdupcount=999999)
5. Compare the amount of unique frames the software capture has versus the OpenGL capture. You can do this by setting ExactDedup parameter "firstpass" to false and open up the AVS in VDub to get a frame count. If the amount of unique frames are different, see below under "What to do if the frame count is different" 6. Do a quick check to see if the two captures have the same unique frames. You can do this by opening both of the captures with only unique frames up and go to a random frame number on both captures and compare to see if they are the same 7. Encode the OpenGL capture using the times file created with the software capture. For example: The AVS being sent to x264:
Language: AviSynth

AVISource("OpenGL.avi") ExactDedup(firstpass=false, dupinfo="OpenGL_dups.txt", maxdupcount=999999)
Notice dupinfo is using "OpenGL_dups.txt" The x264 line:
x264.exe --tcfile-in "software_times.txt" --output OpenGL.mkv OpenGL.avs
Notice tcfile-in is set to "software_times.txt" 8. When combining the audio with the OpenGL encode, use the audio from the software capture What to do if the frame count is different Assuming the count difference is minimal, there are a couple of solutions. If there are more unique frames in the OpenGL capture than the software capture, you could do one of the following: 1. It's more than likely the OpenGL has some near duplicate frames that was just rendered a bit off, so you can compare the two captures, find those extra frames, and remove them with DeleteFrame lines added in the AVS 2. You could also just modify the software_times.txt file to add in new times for those near duplicate frames in the OpenGL capture Now, if there are more unique frames in the software capture than the OpenGL capture, you could do one of the following: 1. Modify the software_times.txt to remove the times of extra frames that don't exist in the OpenGL capture 2. Make a duplicate OpenGL frame to act as the extra frame in the software capture via using trim If the difference in unique frames is not small, I don't really have a solution. Here is an example fix using Spike's Crash sample (requires 64-bit AviSynth or get the 32-bit versions of the plugin) (FixFPS here) (Also can use VFRtoCFR to do the same thing): https://www.mediafire.com/file/gx22ljdn3fcpx2r/Crash.zip/file
Darth_Marios
He/Him
Joined: 5/11/2015
Posts: 106
That's cool, hope to see some OpenGL TASes... Anyway i have 32-bit system so i cant use FixFPS_64.dll, and i can't find the 32-bit version nowhere
Publisher
Joined: 4/23/2009
Posts: 1283
As said by my post, you can also use VFRtoCFR to do the same thing but also FixFPS is also found on this forum. I'll update my post.
Darth_Marios
He/Him
Joined: 5/11/2015
Posts: 106
Thanks, now it worked (i've tried that Crash 2 example, but the final encode lead to a very slow frames video, idk)
Publisher
Joined: 4/23/2009
Posts: 1283
Darth Marios wrote:
Thanks, now it worked (i've tried that Crash 2 example, but the final encode lead to a very slow frames video, idk)
What do you mean a very slow frames video?
Darth_Marios
He/Him
Joined: 5/11/2015
Posts: 106
The video runs slow, like it was around 10 fps
Publisher
Joined: 4/23/2009
Posts: 1283
Weird, the sample was working fine here. Did you use VFRtoCFR? If so, post your script.
Darth_Marios
He/Him
Joined: 5/11/2015
Posts: 106
Well, i lost the script lol maybe i'll try again soon. Anyway why n64 have OpenGL antialiasing (in emuhawk too) and psx not? (or it is anisotropic? anyway hi-res texture and enhancements when psx have nothing and need them more than n64)
Spikestuff
They/Them
Editor, Publisher, Expert player (2283)
Joined: 10/12/2011
Posts: 6335
Location: The land down under.
Cause Octoshock (mednafen core) doesn't rely on plugin crap to run the emulator.
WebNations/Sabih wrote:
+fsvgm777 never censoring anything.
Disables Comments and Ratings for the YouTube account. Something better for yourself and also others.
Darth_Marios
He/Him
Joined: 5/11/2015
Posts: 106
Spikestuff wrote:
Cause Octoshock (mednafen core) doesn't rely on plugin crap to run the emulator.
And no one else works on that solution, right? (so we never get PSX OpenGL core, uh)
Spikestuff
They/Them
Editor, Publisher, Expert player (2283)
Joined: 10/12/2011
Posts: 6335
Location: The land down under.
It's better that it won't get an openGL core honestly. Because again to expand my other post. Brimming with Plugin crap is literally N64's motto in current emulation and PlayStation is accurate enough where it doesn't need that and is preferable that it doesn't. Edit: I was reminded that N64 emulation is so incompetently put together they need plugins to just barely function. Also forgot to mention, then we'd hit the loop of being inaccurate to console. Where we're striving for accuracy.
WebNations/Sabih wrote:
+fsvgm777 never censoring anything.
Disables Comments and Ratings for the YouTube account. Something better for yourself and also others.
Site Admin, Skilled player (1235)
Joined: 4/17/2010
Posts: 11264
Location: RU
Darth Marios wrote:
Spikestuff wrote:
Cause Octoshock (mednafen core) doesn't rely on plugin crap to run the emulator.
And no one else works on that solution, right? (so we never get PSX OpenGL core, uh)
https://forums.libretro.com/t/mednafen-beetle-psx-how-to-improve-visuals/12867
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
Darth_Marios
He/Him
Joined: 5/11/2015
Posts: 106
feos wrote:
Darth Marios wrote:
Spikestuff wrote:
Cause Octoshock (mednafen core) doesn't rely on plugin crap to run the emulator.
And no one else works on that solution, right? (so we never get PSX OpenGL core, uh)
https://forums.libretro.com/t/mednafen-beetle-psx-how-to-improve-visuals/12867
I know that core, its for RA. Could it work for BizHawk too?
Site Admin, Skilled player (1235)
Joined: 4/17/2010
Posts: 11264
Location: RU
No.
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
Darth_Marios
He/Him
Joined: 5/11/2015
Posts: 106
and so we cant get OpenGL psx TASes xD
Spikestuff
They/Them
Editor, Publisher, Expert player (2283)
Joined: 10/12/2011
Posts: 6335
Location: The land down under.
Darth Marios wrote:
and so we cant get OpenGL psx TASes
Good. Better be accurate than inaccurate like I already mentioned.
WebNations/Sabih wrote:
+fsvgm777 never censoring anything.
Disables Comments and Ratings for the YouTube account. Something better for yourself and also others.
Darth_Marios
He/Him
Joined: 5/11/2015
Posts: 106
Spikestuff wrote:
Darth Marios wrote:
and so we cant get OpenGL psx TASes
Good. Better be accurate than inaccurate like I already mentioned.
Inaccurate you mean desync, frame issue or just some graphic glitches?