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
11.38k stars 2.19k forks source link

.Hack//link movie is very slow. #2188

Closed daniel229 closed 10 years ago

daniel229 commented 11 years ago

fraps tell me the movie play at 9fps.the sound also terrible.

log: http://pastebin.com/QiZq7vZy 03

dbz400 commented 11 years ago

Just wonder if this game slow video playback fixed in latest build ?

daniel229 commented 11 years ago

No,it doesn't,still slow with v0.7.6-1386-gc8bbad2

dbz400 commented 11 years ago

I see. Hope the commit that have new ringbuffer for mpeg one can help .

unknownbrackets commented 11 years ago

In a recent build, does this show an fps like "10" along with a vps of 60, or does it show 30/60 fps?

-[Unknown]

unknownbrackets commented 11 years ago

The game in general (at least the demo) seems to slow, but it's not GPU timing. Mana Khemia seems to share this issue.

The demo shows 20 fps in game.

-[Unknown]

daniel229 commented 11 years ago

No improvement in video speed with 0.8.1 -147.

unknownbrackets commented 11 years ago

In game is very slow in the demo. I found that it was calling sceDisplayWaitVblankStartCB() twice generally, and then it seems to take an entire vblank for some reason. Not sure why yet.

In the demo at least, forcing the byte at 08D42111 to be 1 makes it run at normal speed (30 fps.) But I think it may be correct to wait two frames and something is going wrong (taking too long) after it stops waiting.

-[Unknown]

hrydgard commented 11 years ago

Maybe we do some things in enterVBlank that should be done in exitVBlank or something, confusing the game into waiting twice?

unknownbrackets commented 11 years ago

@daniel229 can you test this after #3182 is merged / with it merged? I think it will fix it.

-[Unknown]

daniel229 commented 11 years ago

The video is not fixed,it fixes the internal FPS. 05

these games still have wrong FPS. 03 04

unknownbrackets commented 11 years ago

I found that Mana Khemia, which is 20 fps, is waiting on sceCtrl buffers twice per frame. I'm not sure why. Are any of those doing the same thing?

-[Unknown]

daniel229 commented 11 years ago

how to find out whether the game is waiting on sceCtrl buffers twice per frame?

unknownbrackets commented 11 years ago

If you pause, the disasm will often show a thread is waiting on "Control". If you even just see that, it's possible it's the same issue.

-[Unknown]

daniel229 commented 11 years ago

how about this 01

unknownbrackets commented 11 years ago

Right now the UI is a bit iffy. Click the lower pane and hit tab a few times, you'll end up with a list of threads.

Where you're paused now is just at kernel idle, which is fairly normal.

-[Unknown]

daniel229 commented 11 years ago

and this? just click step into from kernel idle,and then looping. 02

unknownbrackets commented 11 years ago

Hmm, a lot of games call __sceSasGetEndFlag a lot. I'm more interested in where they are waiting. The bottom part (all the FFs) will show it, but you have to hit the Tab key twice. Normally you will look for "user_main" and see what it says under "Wait type". You'll probably need to pause/start it ~5-10 times to see what it's most commonly waiting on.

-[Unknown]

daniel229 commented 11 years ago

In user_main,Digimon World Re Digitize most commonly waiting on Vbank,saw Control twice in clicking over 100 times,I think. 01

Kamen Rider Chou Climax Heroes most commonly waiting on Thread end,never change,and in main most commonly waiting on Control 02

unknownbrackets commented 11 years ago

Ah, so it might also be waiting on control. Digimon seems different...

I've been unsuccessful so far checking what FPS Mana Khemia should run at on the actual PSP... Maybe I'm doing something wrong. JpcspTrace crashes and the HUD thing reports an obviously incorrect number.

Anyway, you can try changing in sceCtrl.cpp:

int done = __CtrlReadBuffer(ctrlDataPtr, nBufs, false, false);
->
int done = __CtrlReadBuffer(ctrlDataPtr, nBufs, false, true);

int done = __CtrlReadBuffer(ctrlDataPtr, nBufs, true, false);
->
int done = __CtrlReadBuffer(ctrlDataPtr, nBufs, true, true);

This is definitely wrong, but if this makes the game faster, maybe we can figure out what needs to happen...

-[Unknown]

daniel229 commented 11 years ago

With that change,Kamen Rider Chou Climax Heroes seems to be OKay.in Digimon World Re Digitize,the FPS is right,but the controller seems to delay 0.5second.

unknownbrackets commented 11 years ago

Well, I wonder what the timing should be. Ctrl definitely wakes at the beginning of the vblank (with a low current hcount)...

-[Unknown]

daniel229 commented 11 years ago

Dantes.Inferno It's 60FPS in PSP 03 04

unknownbrackets commented 10 years ago

Has anything changed here with the vblank and ctrl timing changes?

-[Unknown]

Ritori commented 10 years ago

Still give 10/10 FPS on latest version :)

daniel229 commented 10 years ago

Digimon World Re Digitize and Kamen Rider Chou Climax Heroes works fine. Dantes Inferno still not right. 04

unknownbrackets commented 10 years ago

From a debug log:

23:24:408 idle0 D[KERNEL]: HLE\sceKernelThread.cpp:3204 Context switch: RootTh -> idle0 (313->272, pc: 0886669c->08000000, interrupt) +16589us

So basically it's just spinning the cpu not calling any syscalls. Grr. Is there a timer that will preempt on the PSP or something maybe?

-[Unknown]

hrydgard commented 10 years ago

Well, there are the vblank interrupts, but I don't think many (or any) other interrupts bubble up to user mode.

unknownbrackets commented 10 years ago

Another game affected by this sort of thing (spin, no syscalls) is Tactics Ogre when deciding which way to face after ending a turn.

Just need to test a lot to see if it's safe...

-[Unknown]