Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PC]PPSSPP Stutter On External Devices - 1.10.2 #13141

Closed
ghost opened this issue Jul 14, 2020 · 40 comments
Closed

[PC]PPSSPP Stutter On External Devices - 1.10.2 #13141

ghost opened this issue Jul 14, 2020 · 40 comments

Comments

@ghost
Copy link

ghost commented Jul 14, 2020

Hi,me again.I'm reporting this issue as it happens on my neighbor's PC,and lot of friends over Guilded.

Well,real issue is stuttering of emulator itself,and weird points of freeze of simple actions like save,settings,load etc.What is even weirder,games run fine,no stutters or long saving,and it appears only on external devices.I do understand that other games load slower due to external storage,but i don't think it is issue with 25 MB/s on SDXC device.So,if i'm wrong,please correct me and i will close the issue itself and never mention this again. (Before you tell me to put it on storage of my PC,it is full and my 20 games can't fit in there)

TIA

@hrydgard
Copy link
Owner

Sorry, I don't quite understand what the issue is, it's unclear from your description.

Do you mean that it freezes constantly, or only once in a while? Is it when you put the whole emulator on SDXC or just the games?

@ghost
Copy link
Author

ghost commented Jul 14, 2020

Sorry, I don't quite understand what the issue is, it's unclear from your description.

Do you mean that it freezes constantly, or only once in a while? Is it when you put the whole emulator on SDXC or just the games?

Sorry,i worded that pretty terrible.When emulator is on SDXC,it happens all the time (constantly) with actions like saving in-game,navigating through menus,pressing settings/back results in waiting like 10-15 seconds,and it is really annoying,while i tested exact same SD on my phone and saving/loading wasn't problem at all (storage was at Android/data/org.ppsspp.pppsspp)

Maybe related to Windows specifically,drivers for SD are latest,also for GPU and CPU as well.
(Correct me if i worded this terrible again)

@iota97
Copy link
Contributor

iota97 commented Jul 14, 2020

10-15 sec are a lot indeed.

I wonder tho' if you could just place the emulator (with it's settings and savedata) in the PC main storage as it's few MB while keeping just the game ISOs on the external storage (enabling Change full ISO in RAM could also be enabled under System settings as long you have a bit of spare RAM, likely by 2020 standard). Would that help?

@hrydgard
Copy link
Owner

It seems to me that your PC is having problems reading that specific SD card, and I would also suggest that you should simply move the emulator to the PC's internal storage and keep the games on the card. The emulator itself has not been optimized for running from slow storage and isn't always optimal with what it does.

@ghost
Copy link
Author

ghost commented Jul 14, 2020

I would like to try,but note that PC is full,i know emulator is few MB,but talking about FULL here,left something for updates of Windows as PC is not mine and it is friend's,and besides PPSSPP he has other things (don't find this offensive,today i woke up on my left leg and i choose words poorly,sorry).If you recommend me to do so,i could try finding alternative,noting ReadyBoost doesn't really help.If you want to close this or me to close,i appreciate the time you took to reply.

@iota97
Copy link
Contributor

iota97 commented Jul 14, 2020

Haven't used ReadyBoost much myself, but as it seem to use a flash memory as cache for HDD and given how slow your SD is for some reason it might end up slowing down the entire system rather than helping it.

@ghost
Copy link
Author

ghost commented Jul 14, 2020

Haven't used ReadyBoost much myself, but as it seem to use a flash memory as cache for HDD and given how slow your SD is for some reason it might end up slowing down the entire system rather than helping it.

Exactly,that is point why i don't use it,it doesn't serve purpose at all.

@unknownbrackets
Copy link
Collaborator

It's likely that the memory stick storage is the problem here, based on your description.

You can try changing "IO Timing" to "Host" in the settings. But it will also make it wait for your slow storage without stuttering.

If your PC is getting even slower performance than PSP developers ever planned for, this could cause bugs or still cause stutter. But it should reduce it a lot either way.

The downside of this setting is that it means PPSSPP's timing will depend on your storage. So you may experience bugs no one else does (even other people using "Host" as their timing.) The other IO Timing options are consistent across devices, and everyone gets the same bugs or not bugs - but it also means stutter on extremely slow storage.

-[Unknown]

@ghost
Copy link
Author

ghost commented Jul 15, 2020

Well,if that should help,if you want,i can get to friend this afternoon to test it,if it is okay by you,and i will be sure to make a report about it here.

@ghost
Copy link
Author

ghost commented Jul 16, 2020

Hi,me again.This happens same on my neighbor's PC,except it is lot shorter,he is using Windows10 with 8GB RAM.So is this normal or not?

TIA

@iota97
Copy link
Contributor

iota97 commented Jul 16, 2020

It might be the external device being really slow itself

As it worked on Android tho':

  • Android you was saving on internal storage (note PPSSPP save in PSP/SAVEDATA folder that is not in the app folder) while reading the ISOs from the SD?

  • Windows prioritize data safety and doesn't use a cache for write by default on SD while Android might did as SD there are more permanent attached? I found this online to enable a write cache, haven't tested it myself tho' and beware that if you disconnect the device with this enable without safe removing you may incur in data loss/corruption (so might not be a good idea beside from testing).

@ghost
Copy link
Author

ghost commented Jul 16, 2020

It might be the external device being really slow itself

As it worked on Android tho':

  • Android you was saving on internal storage (note PPSSPP save in PSP/SAVEDATA folder that is not in the app folder) while reading the ISOs from the SD?
  • Windows prioritize data safety and doesn't use a cache for write by default on SD while Android might did as SD there are more permanent attached? I found this online to enable a write cache, haven't tested it myself tho' and beware that if you disconnect the device with this enable without safe removing you may incur in data loss/corruption (so might not be a good idea beside from testing).

Yes,ISOs are on SD,and were there upon testing,and while whole PPSSPP was there (yes,even savedata),it worked just fine,no lag upon saving and playing games.While on PC there also wasn't lag in the game,given such circumstances,there was lag in menus and saving,as mentioned in issue itself,and i tested 3 different PCs,i cleaned my MicroSD Adapter and Port,it helped,but not greatly.I will try cache and let you be informed.

@ghost
Copy link
Author

ghost commented Jul 16, 2020

@iota97
I tried the cache just now,and it has helped a bit,but not too much (maybe a second or two less).This is getting really annoying at this point,literally,i even tested with 2 different formats of storage (FAT32,NTFS).Nothing really helped much.I'm wondering is this actually bug by emulator or Windows issue itself.

@unknownbrackets
Copy link
Collaborator

Did changing the IO timing setting help or make no difference?

It does sound like there's a hardware or Windows issue at play here (maybe even some virus scanning software making the slow storage even slower), but it will change my opinion if there's no difference when you change that setting.

-[Unknown]

@ghost
Copy link
Author

ghost commented Jul 16, 2020

Did changing the IO timing setting help or make no difference?

It does sound like there's a hardware or Windows issue at play here (maybe even some virus scanning software making the slow storage even slower), but it will change my opinion if there's no difference when you change that setting.

-[Unknown]

I will try for an hour,i'm not home atm,and i'm going to inform you.

@iota97
Copy link
Contributor

iota97 commented Jul 16, 2020

Just to be sure unknown, does IO timing setting also affect how PPSSPP handle setting.ini/savestate or only PSP emulation part? He seem to be really slow even when he navigate the setting menu, if is not affected he must test in game saving rather than just menu navigation or savestate.

@ghost
Copy link
Author

ghost commented Jul 16, 2020

@unknownbrackets
Hi,me again.I'm here to inform you that Host(bugs,less lag) does not reduce time of saving/navigating through menus.I will try to find some USB pen drive and i will try to fill it up for testing,to be sure that it isn't SD's fault.

@ghost
Copy link
Author

ghost commented Jul 16, 2020

This is getting even weirder,and i found out something really weird.Bigger external device is,more lag it will suffer.SP UltimaU03 doesn't lag at all (8GB),Ultima02(32GB),already lagging.Can this maybe happen because of dust in the USB port of the PC.I will try vacuuming all my ports of USB,including MicroSD,and will give report back tomorrow.

@hrydgard
Copy link
Owner

Seems unlikely to me that dust would be the issue here, but I guess you never know.

@ghost
Copy link
Author

ghost commented Jul 16, 2020

Seems unlikely to me that dust would be the issue here, but I guess you never know.

Yeah,as i said i'm going to clear it out,and see the results.I'll keep you informed.

@ghost
Copy link
Author

ghost commented Jul 17, 2020

@hrydgard
Super cleaned it,vacuum,alchohol and stuff,lag still going strong,so could you tell me what should i expect of this?

TIA

@hrydgard
Copy link
Owner

I am just as confused as you, honestly.

@iota97
Copy link
Contributor

iota97 commented Jul 17, 2020

Beside some faulty driver, hardware or OS doing weird stuff I wonder if you have any antivirus, cloud sync or auto-whatever software that keep the device busy and they do more work the bigger the device size? Even then tho' I can't see a reason partition size would affect them, or speed so much... Out of curiosity could you post all your device specification?

@ghost
Copy link
Author

ghost commented Jul 17, 2020

Beside some faulty driver, hardware or OS doing weird stuff I wonder if you have any antivirus, cloud sync or auto-whatever software that keep the device busy and they do more work the bigger the device size? Even then tho' I can't see a reason partition size would affect them, or speed so much... Out of curiosity could you post all your device specification?

Beside some faulty driver, hardware or OS doing weird stuff I wonder if you have any antivirus, cloud sync or auto-whatever software that keep the device busy and they do more work the bigger the device size? Even then tho' I can't see a reason partition size would affect them, or speed so much... Out of curiosity could you post all your device specification?

I only have Windows Defender,i don't use any cloud sync or other Antivirus softwares,hardware drivers are all latest,including for SD Cards,GPU,CPU,HDD and so on.
SD Card:Toshiba M203 (not 302,to not be mistaken with Exceria)
Speed Class:Class 10 (U1)
Max Read Speed:100 MB/s
Write Speed:25 MB/s (literally same as my PC's HDD),and 40 MB/s on my phone (Honor 9S)
Operating Temperature
-25°C to +85°C (Recommended)
Storage Temperature
-40°C to +85°C (Recommended)

PPSSPP 1.10.2/latest from buildbot.orphis.net
Settings:Default,with exception of I/O Timing Method:Host(bugs,less lag) because @unknownbrackets told me to do so.

PC specifications don't really matter because as i told earlier,it is tested on other PCs,including my phone.

TIA

@ghost
Copy link
Author

ghost commented Jul 20, 2020

@hrydgard
This is getting weirder and weirder.Times of loading went notably down when i changed Audio Backend from Auto to DSound.Do you maybe have any idea why?I will research more and let you know.

TIA

@ghost
Copy link
Author

ghost commented Jul 21, 2020

@hrydgard
Update:I made additional investigation,seems WASAPI (fast) audio backend actually slows down emulator.DSound is lot faster.Now i came to question,what does Audio has to do with loading times,and what aspects does emulator use of Sound backend for basic functions like save/load,navigating through menus etc.?If you would,i would be grateful if i got explanation for this.

TIA

@hrydgard
Copy link
Owner

I am very confused indeed, audio should not be involved and especially not block anything when navigating menus...

Does seem to merit investigation though...

@ghost
Copy link
Author

ghost commented Jul 21, 2020

My theory here,if you would allow me to present it,is actually that DSound is chosen in Auto setting when on HDD,but for some reason,SD/USB gets WASAPI (fast) chosen in Auto setting.But that still does not explain WASAPI's issue with External Device.I will sure make more investigation on this one with more devices i can find around,and i will make report as always,so stay tuned.

My sound driver is Realtek (High Definition Audio)

@unknownbrackets
Copy link
Collaborator

Maybe a crowded USB bus or power issue?

DSound is not chosen on the auto setting ever, actually. Auto is just another word for WASAPI as long as your OS supports WASAPI. We've used WASAPI as the primary audio backend for a while now.

I don't see anything that triggers any specific action in our audio code when browsing the menu (outside hovering over games), and we should only reinit the audio backend on certain situations.

But if your SD card is going through the same bus as your audio, it might be the driver having trouble keeping everything moving. DirectSound might just run different audio driver code that handles the situation better, whether it's better overall or not.

-[Unknown]

@ghost
Copy link
Author

ghost commented Jul 21, 2020

Maybe a crowded USB bus or power issue?

DSound is not chosen on the auto setting ever, actually. Auto is just another word for WASAPI as long as your OS supports WASAPI. We've used WASAPI as the primary audio backend for a while now.

I don't see anything that triggers any specific action in our audio code when browsing the menu (outside hovering over games), and we should only reinit the audio backend on certain situations.

But if your SD card is going through the same bus as your audio, it might be the driver having trouble keeping everything moving. DirectSound might just run different audio driver code that handles the situation better, whether it's better overall or not.

-[Unknown]

To be sure it is not power issue,my laptop is on Charger and does not use Balanced power plan,meaning everything is to limit,and as i said earlier,my friends have it too.I will let them know about my discovery and ask them to do the same and make some tests i did,to be sure it is not specific issue with my PC.But if you have any more ideas how to test this to be sure it is what i just discovered,i would be grateful to hear.

TIA

@iota97
Copy link
Contributor

iota97 commented Jul 21, 2020

Multiple USB device share the same bus (think as a street where only 1 device data that can pass at a time, slowness on one device will affect other as they have to wait their turn), also multiple USB port might be connected internally to the same hub having some power problem so it might not be able to power them all at the same time efficiently (kinda weird tho').

Does using laptop speaker rather than headphone make any difference? If you are using headphone are them USB or Jack one?
Honestly having some more device information of your PC and your friend one might help at this point (do you plug-in any other thing rather than the SD on both?)

@ghost
Copy link
Author

ghost commented Jul 21, 2020

@iota97
Besides charger,MicroSD and my mouse,sometimes headphones when i feel like it,no,i don't have anything plugged in,but i could try unplugging all and see will it happen when only SD Card is there.I will report back for five minutes,stay tuned.

@ghost
Copy link
Author

ghost commented Jul 21, 2020

@iota97 @unknownbrackets
Ok,now this is even weirder.Everything was unplugged,by everything,literally everything except SD Card.I changed to WASAPI,and it seemed to work as same as DSound,but as soon i started game and sound played,i went back to menu and again,emulator went from fast to slow.Any ideas why?

TIA

@ghost
Copy link
Author

ghost commented Jul 21, 2020

Update:I disabled my driver and output (no sound) and tried again.I switched to DSound,went to game and exit again,lag still occured,after that i changed,restarted PPSSPP,and no lag in menus,magically.I'm really annoyed and confused at this point.I will try to see more solutions and report back.

@ghost
Copy link
Author

ghost commented Jul 21, 2020

Update 2.0:I made test using installed.txt,with PPSSPP being on my D:\ Drive,it worked and saved without delay on my SD,so i think this is regarding something either of the app or assets itself.I will try to test more and i will sure let you know more

@ghost
Copy link
Author

ghost commented Jul 21, 2020

Update 3.0:I did same thing with my USB (8GB Ultima U03) that i did with my HDD,and following my steps,there was not any lag that appeared,while SD had,this has to be looked into because this just verified it is not power issue of ports/bus drivers.I also tested all USB ports,also one nearest to the MicroSD port.I sure have lot of to investigate here,because at this point it just doesn't make sense with superior SD than USB i tested this

@ghost
Copy link
Author

ghost commented Jul 21, 2020

Update 4.0:This just got weirder.After running PPSSPP on HDD with installed.txt to SD's memstick path,then running PPSSPP on SD,seems lag is gone,even following my steps.Maybe because of that or because i disabled - enabled my sound drivers.Whatever reason is,it makes no sense for PPSSPP to behave like this,and it clearly needs investigation.I also enabled Stereo Mix which was disabled,and i sure need to test does it have to anything with this.

Update 4.1:After 4 times rebooting my PC and disconnecting my SD card,lag is still reduced notably,i have no idea why,but now i'm not really sure is it my audio driver issue or,again,some emulator issue.Can i just ask you if you can keep this open for few more days until i don't come to conclusion of this

TIA

@hrydgard
Copy link
Owner

Sure, I'll keep it open. Good job with your investigations so far!

@ghost
Copy link
Author

ghost commented Jul 22, 2020

Update 5.0:So far everything good,i had lag when i locked screen of PC and ran PPSSPP,but it was just at boot,and everything works as expected so far,but i still think it would need investigation of this behaviour.

@unknownbrackets
Copy link
Collaborator

It sounds like things were resolved after either an update or drive disable/enable, so this might've been something outside of PPSSPP's control.

We'll always monitor PPSSPP's performance and we're always looking for ways to reduce any unnecessary disk activity, but we can't do anything if other programs or drivers are causing it.

I'm going to close this but if you have more information or the issue presents again, we can reopen - just comment.

-[Unknown]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants