hrydgard / ppsspp

A PSP emulator for Android, Windows, Mac and Linux, written in C++. Want to contribute? Join us on Discord at https://discord.gg/5NJB6dD or just send pull requests / issues. For discussion use the forums at forums.ppsspp.org.
https://www.ppsspp.org
Other
10.81k stars 2.13k forks source link

GTA LCS,VCS and CHW Radio loading delays still there #7863

Closed PlayerGameSK closed 8 years ago

PlayerGameSK commented 8 years ago

Hi all,

I just wanna tell ya all that there's still the radio delay issue in version 1.0 and up (not sure about ones between 0.9.9.1 and 1.0 but 0.9.9.1 works fine) but I have performance problems in 0.9.9.1 so I use newer ones. This issue was there already so you probably know what I mean.

Thanks for any replies :)

EDIT: I forgot to mention,it happens on PC (I have Windows 7 Professional)

thedax commented 8 years ago

Never mind, I was wrong.

PlayerGameSK commented 8 years ago

Ok,but do you know something about the issue?

gamelaster commented 8 years ago

A radio delay? Can u more descript your problem? I have LCS and play long at PPSSPP and i didnt get this trouble..

PlayerGameSK commented 8 years ago

The radio stations load longer that they are supposed to,but,the closer they are to end,the longer they load,so for example if RISE FM is at beggining of itself,it will load imediately,but if it's about to end,it will load for about 5-6 seconds.

A nazdar GAMELASTER :D

gamelaster commented 8 years ago

Nazdar :D Poznáme sa ? :D počkať, 5 sekund trvá načítanie stanice? :D Trošičku nechápem :D Ale ak si to zoberem, tak trošku tam tú latenciu cítim :D , ale asi iba 1 sekundu (po tom čo prestane zvuk preladenia).

Well, my latency when i changing radio is little hear, but i dont know its normal or bad. Example, i retunning to RISE FM, i hear the tunning sound, and after end of sound is acc. 1 second latency of loading i though... mmm.

hrydgard commented 8 years ago

Yeah, this is known. It's a side effect of some improvements by @unknownbrackets to the Atrac3 playback code that fixed some other games, but unfortunately had this effect. Our Atrac3 emulation is still not fully correct, leading to issues like this, and needs more work. Still, this doesn't hinder playability very much so until we can improve it further we'll have to live with it.

PlayerGameSK commented 8 years ago

Yeah,the game's playable and all but it just annoys me.

GAMELASTER ja som ten nový čo sa pridal k prekladu (ty vieš ktorý myslím) a tých 5 sekúnd som tak randomne hodil aj s tým RISE-om.

(GAMELASTER I am the new one that joined the translation (you know which i mean) and that 5 seconds along with the RISE were just randomly placed by me :D (hope you know what I mean) :D )

PlayerGameSK commented 8 years ago

And can't you just make like one version with the old Atrac3 plugin?

DemiKraw commented 8 years ago

I would like to add that problems are more serious than delay. I posted these on the forum

Grand Theft Auto: Liberty City Stories ppsspp-v1.0.1-757-g73e9c3b

Grand Theft Auto: Chinatown Wars So, there are really bad things going on here ppsspp-v1.0.1-757-g73e9c3b

Windows 7. Intel Quad q9505 3.4 Ghz, 4 GB RAM, GT9800 1 Gb

Another proof you can see (or hear) here: https://www.youtube.com/watch?v=XgiF7Bj-aMs Note that when Tony gets in the car the radio does not play. But it should play some classic music.

And here https://www.youtube.com/watch?v=x2P_GqNTxtk Note that sound disappears after our protagonist gets out of a car and starts to swim However the video does not show that, as I mentioned above, when switching to the most of stations the sound disappears completely.

P.S. i know that video shows Nvidia SHIELD emulation, but isuues on my Windows 7 look exactly the same,

hrydgard commented 8 years ago

Hm, that's not very good. I'm really confused about the increased system requirements though - if anything it should have become faster since 500 revs ago. Are you sure it's not just some setting? If you switch to an old version, do you get the old speed back?

But yeah, our Atrac3 stuff needs work. It's really, REALLY hard to keep all games working the same when developing emulators, what improves one game greatly can hurt another very easily...

DemiKraw commented 8 years ago

Hello! Thanks for the reply! So I have just doublechecked performance. Default Settings with V-sync and 5x res. 1.0.1-31 works smooth and stutters a bit when new area of the city loading.

Latest revision stutters constantly and lag very badly (10-15 fps) in the points from where I can see the whole city. Stutters heavily (20-22 fps) when new area of the city loading. Another weird thing that in places where it shows 30 fps the gameplay is very choppy and feels like stutter.

BTW, Chinatown Wars has almost the same performance problem.

Changing settings does not make things better, I can only have some speed up disabling settings that prevent graphical bugs.

1x-2x res plays smooth on both mentioned revisions. The difference starts from 3x and become worse with higher resolutions.

LunaMoo commented 8 years ago

Did you tried turning off Vertex Cache? I remember "The Warriors" - which is also rockstar game likely using same engine as GTA VCS/LCS - runs terrible with it.

hrydgard commented 8 years ago

On what hardware do you see the large performance difference? It really shouldn't be resolution dependent either, as we've barely changed the shader generators in that interval and the only reason resolution should make a difference should be more complex fragment shaders, or any CPU readbacks, which AFAIK does not happen in GTA.

If the difference is as obvious as you say, the best way to track the issue down probably is a good old bisect or binary search. So, try the revision right in the middle of the two (~375-ish). Then if that is also fast, try the one right between that and 750, while if it's slower, try the one in the middle in the other direction, and so on, until you find which revision got slow.

DemiKraw commented 8 years ago

LunaMoo, Turning off Vertex Cache helps with stuttering when new city area loading. But that is the only thing that become "fixed"

hrydgard, My specs: Windows 7. Intel Quad q9505 3.4 Ghz, 4 GB RAM, GT9800 1 Gb Hey, could it be connected with video drivers? As you can see my GPU is pretty old and there have been few months already since Nvidia stopped updating its drivers, so my drivers are 6-7 months outdated.

I will try the older version of the drivers. If noone of you, guys dont get such a performance problem - then it is weird, indeed. If nothing changes I will try binary search. I will report about any results.

unknownbrackets commented 8 years ago

Binary search will be fast, don't worry. For 700 versions it'll mean trying less than 10 downloads of PPSSPP to find the range. What we ideally want is the first one that was bad and the last one that was good.

I also have a 9800 GT. I haven't noticed any significant impacts to render speed. However, there was a change to force CPU for framebuf conversion on older NVIDIA devices (159c8baeef6ae5f6c991). It should not affect a 9800 GT, though.

Maybe be7d1d1169a55 is hurting here or even 5fa3bf0eb95828fb?

-[Unknown]

DemiKraw commented 8 years ago

unknownbrackets, thanks for pointing! Indeed v1.0.1-580-g159c8ba is exact revision where all performance problems begin. 579 rev was the last decently working one and 580, 582 and further are problematic.

Also if its necessary I found exact revision where LCS and CW serious sound problems begin - v1.0.1-221-g62e621f. 216 rev has only long delays as before. Hope it helps :)

hrydgard commented 8 years ago

@DemiKraw thank you for testing! That helps a lot, and explains why you'd see the performance problem and I not, because I have a much more modern nVidia card.

That change was made to solve this issue on old nVidias: https://github.com/hrydgard/native/pull/228 . It hasn't been well tested exactly which nVidia GPU this workaround is needed for, it might be that it's not needed for your GPU.

unknownbrackets commented 8 years ago

What's weird is, I have a 9800 GT and my drivers support GL 3 just fine. I wonder what's causing it to use OpenGL 2?

-[Unknown]

DemiKraw commented 8 years ago

hrydgard, nice! Notify me if there is something else I can do :)

unknownbrackets, I dont have any programming/coding skills so I have no idea :) I dont know if it matters but I have some other problems that not related to PPSSPP. For example I cant use any WebGL based feature in any browser (like human model on zygotebody.com) and Im unable to see 360 degree videos on youtube, I see only it's 'unwrapped' version. I'm telling this only to show that there may be some reasons to think that my exact GPU has some issues or malfunctions.

hrydgard commented 8 years ago

@DemiKraw Could you go into Settings / Tools / System Information and take a screenshot of the GPU page?

DemiKraw commented 8 years ago

Sure. This?

sshot-37 sshot-39

DemiKraw commented 8 years ago

Daaamn! I've just realized that I was confusing the model of my GPU for the long time. I hope it is not serious. I feel so dumb :(

DonelBueno commented 8 years ago

Really off topic, but I've always been curious about your PC specs, @hrydgard. What are they?

hrydgard commented 8 years ago

@DemiKraw no worries. But hm, with that card, which reports GL 3.3, the commit should not do anything. If it does, either the GL version is reported as < 3, or the build is taking the wrong #ifdef path there, which seems unlikely. Very odd....

@DonelBueno , nothing super special, a 3770K Ivy main CPU, 16 gigs of RAM, and nVidia GeForce 770GTX if I remember correctly. SSD + harddrives. Plus a large pile of Android devices and a Macbook Pro.

DemiKraw commented 8 years ago

hrydgard, I see. Looks like you need a few more people with that GPU to confirm your doubts. If reveals that this problem is exclusive to me, this might be the case, when the new video card is the only possible fix :) I've just tried The Warriors and Midnight Clubs and FF7CC, Kingdom Hearts, Monster Hunter Freedom 1 and Unite and none of them seem to be affected. Looks like it's GTA only problem.

unknownbrackets commented 8 years ago

You may be able to workaround the problem by disabling "simulate block transfer" or checking "disable slow effects". However, it will look worse.

Maybe gl_extensions.ver[0] is somehow getting cleared? @DemiKraw if you want to try compiling PPSSPP (there's a post on the forum about how, it's not that hard and you might find it interesting), I could tell you a file to change that might give us more insight.

-[Unknown]

DemiKraw commented 8 years ago

unknownbrackets, So first of all I have to compile a PPSSPP via this guide? http://forums.ppsspp.org/showthread.php?tid=5231 Ok will try it. It does not look too difficult in that guide. While I'm trying to figure it out, tell me please, what I have to do after compilling?

vnctdj commented 8 years ago

Yes, this tutorial is very good :) It will help you compile the latest version of PPSSPP. Afterwards, @unknownbrackets will propose you to edit one or more files and then compile again :)

_Note :_ Bad luck, at the moment, the latest commit (which is https://github.com/hrydgard/ppsspp/commit/11f64ee27b1f8c5bcff318a4a37b64d54b6968ec) have a problem which prevents to compile with success...

hrydgard commented 8 years ago

Until I can fix it, work around that by doing

cd native
git checkout master
git pull --rebase
cd ..
DemiKraw commented 8 years ago

Ufff, so I spent 2 hours trying to bypass the "7 GB of free space across ALL drives" requirement while trying to install Visual Studio Express 2013 for Windows Desktop. I have 5 drives and tons of free space on every except the system one on which I have only 1 gb free approximately. I disabled Pagefile.sys and got 500 mb more. I have only Windows and few other Microsoft redists on system drive. I think I cant get more free space there. So is it possible to bypass 7GB requirement ? O_o

unknownbrackets commented 8 years ago

Hmm, I didn't even know about that requirement. Well, what you can do (if you're on Windows 7 or similar) is move some files under Program Files to another disk and use symlinks. Depends really on what's keeping you from 7gb free.

Another option might even be using a virtual machine but that's a bit advanced too. I guess the requirement is due to all the .NET framework stuff.

Sorry.

Well, if you do get it working, the change I'm thinking is to open up GPU/GLES/Framebuffer.cpp and find:

    if (g_Config.iRenderingMode == FB_BUFFERED_MODE) {
        if (gl_extensions.gpuVendor != GPU_VENDOR_NVIDIA || gl_extensions.ver[0] < 3) {
            useCPU = true;
        }
    }

And first off, try making that instead:

    if (g_Config.iRenderingMode == FB_BUFFERED_MODE) {
        if (gl_extensions.gpuVendor != GPU_VENDOR_NVIDIA || gl_extensions.ver[0] < 3) {
            //useCPU = true;
            NOTICE_LOG(G3D, "Would use CPU for pixconv, vendor: %d, ver: %d, buf: %08x", gl_extensions.gpuVendor, gl_extensions.ver[0], vfb->fb_address);
        }
    }

I'm most interested in:

-[Unknown]

DemiKraw commented 8 years ago

Ok, I think I got it working, but first Build Failed sshot-50

Earlier I got this sshot-43 -

Is this because of problem with latest commit vnctdj was talking about?

vnctdj commented 8 years ago

Yes, and @hrydgard has provided a workaround in this comment :)

DemiKraw commented 8 years ago

I know I tried that but nothing changed for me O_o still failed. I assume I should wait ?

hrydgard commented 8 years ago

Sorry about the mess @DemiKraw , was working on both my mac and my pc and forgot to push some changes from the mac.. Fixed now, just update both ppsspp and native to latest.

DemiKraw commented 8 years ago

No problem :) ========== Build: 7 succeeded, 0 failed, 4 up-to-date, 0 skipped ========== Oh, thanks God! Will proceed tomorrow. Is it important x32 or x64? I made x64 release.

DemiKraw commented 8 years ago

Ok, so I changed framebuffer.cpp. I have to recompile? Done.

unknownbrackets said: I'm most interested in: Whether this works around the issue in the latest build. ^ I should check the performance after changing the framebuffer.cpp?

How frequently it logs the message. What the log message is. ^^where is that log? Debug-Log Console? What should the message look like?

hrydgard commented 8 years ago

1) Yes, after changing and then compiling, then running. (Ctrl+F5 in Visual Studio)

2) Yeah, the log console that can be enabled from a menu.

DemiKraw commented 8 years ago

Still what message should I look for? Log strings do not tell me anything and I see nothing special there. Should that message you talk about be there 100% ? I might have done something wrong.

unknownbrackets commented 8 years ago

If you're not seeing "Would use CPU for pixconv" during gameplay, then it's highly unlikely that the change here actually caused your performance problem. Maybe we were wrong that it was the cause.

-[Unknown]

DemiKraw commented 8 years ago

I see. Checked every line of log - nothing similar to "Would use CPU for pixconv". Further orders?

hrydgard commented 8 years ago

If you don't see that, there's no way I can see that v1.0.1-580-g159c8ba is the exact commit that slowed things down, as that log line gets executed at the same time as the only thing that changed in that commit. Can you once again try the commits before and after and confirm that that is the first slow one?

Also, you're not just seeing something like overheating slowing down the card, it's really, really consistent that the version matters?

DemiKraw commented 8 years ago

I've just doublechecked that again. Same problems with v1.0.1-580-g159c8ba. Everything is fine with 579 except audio.

Well the GPU itself is 70C without games and 80-85C with games. But I have overclocked CPU and it is pretty hot (75-90 and up to 100 in heavy games) and unstable in summer. For example a was getting overheating BSODs in Oddworld New'n'Tasty, Sleeping Dogs and sometimes get them in Mafia 2. But performance spikes in PSP GTA games clearly obvious begin in v1.0.1-580-g159c8ba. So maybe I should also check the temperature in 579 and 580 revs?

hrydgard commented 8 years ago

It makes no sense - like I said before, if you are not seeing that log message when you add it and build, the v1.0.1-580-g159c8ba change should do nothing. I don't get it.

DemiKraw commented 8 years ago

You definitely should check it on another 9600GT. If that another card OK I will fix mine with a trash can :) So is there something alse I can do? I'm ready to go to the end to clear this problem. But please note, I'm still a programming noob, your instructions should be really detailed :)

unknownbrackets commented 8 years ago

So, when you run from Visual Studio using Ctrl-F5, the performance has not changed?

The change I suggested basically disables 159c8baeef6ae5f6c991ceb6df80d8b1e81ee611, in addition to logging whenever it would change. So, has the performance improved with that change, or is it still bad?

If it's still bad, there are basically these options:

  1. The performance is affected by multiple factors. One was introduced by that commit, and another completely separate one was introduced later. This feels unlikely, but you never know.
  2. Something else is causing the performance issue, and it's somehow coincidence that those builds perform the way you've noticed. This also seems unlikely at this point.
  3. You're not actually running the new build, or you're using different settings in the new build. If you're using Ctrl-F5, this shouldn't be either.

Either way, we can try something else to verify. Get a git prompt in the directory with the ppsspp code in it, and then run the following command:

git reset --hard 00e57b1483fde6cd31b22d8e5a1069d5ecb33584

When you switch back to Visual Studio, it'll ask if you want to reload. Say Yes to All. Then recompile. This will send you back to before 159c8baeef6ae5f6c991ceb6df80d8b1e81ee611 - to v1.0.1-579-g00e57b1. If it's still slow, that means we've eliminated (probably) option 1 above. It has to be either option 2 or option 3 then.

If this is fast again, then we've verified it's definitely not option 3 above. At that point, the next step is:

git reset --hard 159c8baeef6ae5f6c991ceb6df80d8b1e81ee611

This will send you to v1.0.1-580-g159c8ba. Ideally, double check that the performance problem is back (since this problem seems weird.)

After that, apply my change to Framebuffer.cpp from above.

If it logs things and the performance improves, then that means it's most likely option 1 above. If performance doesn't improve, it's probably option 2. If it does improve, but it's not logging anything, it could still be option 1 or 2.

-[Unknown]

DemiKraw commented 8 years ago

unknownbrackets, Performance was still bad. Got 579 via git reset --hard 00e57b1 - FAST again. Got 580 via git reset --hard 159c8ba - SLOW again. Applied changes to Framebuffer.cpp - SLOW and does not log anything :( So this is probably option 2? Whats next?

unknownbrackets commented 8 years ago

Erp, I'm stupid. My change is wrong. I feel stupid I didn't give it a second look until now, sorry. All my fault.

Replace this:

    if (g_Config.iRenderingMode == FB_BUFFERED_MODE) {
        if (gl_extensions.gpuVendor != GPU_VENDOR_NVIDIA || gl_extensions.ver[0] < 3) {
            useCPU = true;
        }
    }

With:

    if (g_Config.iRenderingMode == FB_BUFFERED_MODE) {
        if (gl_extensions.gpuVendor != GPU_VENDOR_NVIDIA || gl_extensions.ver[0] < 3) {
            useCPU = true;
        } else {
            NOTICE_LOG(G3D, "Would use CPU for pixconv, vendor: %d, ver: %d, buf: %08x", gl_extensions.gpuVendor, gl_extensions.ver[0], vfb->fb_address);
            useCPU = true;
        }
    }

So sorry.

-[Unknown]

DemiKraw commented 8 years ago

unknownbrackets, Dont worry, sh*t happens :) I repeated and double checked everything from the beginning and then changed Framebuffer.cpp with ^. Ahh, sadly everything is exactly the same as in my previous comment :(

hrydgard commented 8 years ago

You should be seeing some logging. What if you put the NOTICE_LOG line above the "if (g_Config.iRenderingMode)"? If you are still not seeing any logging, that code isn't called and I can't see any possible way that 159c8ba can have such an impact..

EDIT: I just put a breakpoint there and jumped into my GTA:LCS save and nothing, this code doesn't run at all. Which really makes it a mystery how that change could have any impact whatsoever.