skmp / reicast-emulator

Reicast was a multiplatform Sega Dreamcast emulator
https://reicast.emudev.org
Other
1.1k stars 344 forks source link

Unstable optimizations / Crackling sound #118

Closed skmp closed 10 years ago

skmp commented 10 years ago

It is time for the release!

I'm merging in #113, then we gotta test abit for all platforms, and rls ?

Seems like #109 will be for r7 (with some code to edit input config?)

hooby3dfx commented 10 years ago

I'll test more tonight. I saw the lag on shield... On Feb 12, 2014 5:06 PM, "TwistedUmbrella" notifications@github.com wrote:

@hooby3dfx https://github.com/hooby3dfx I tried with and without that. I tried with and without the thread priority. The only other thing I could think of it some of these devices were using software rendering and now that it is either on or off without just being whatever, the lacking hardware support is showing. Maybe I should set software as default.

Reply to this email directly or view it on GitHubhttps://github.com/reicast/reicast-emulator/issues/118#issuecomment-34923923 .

AbandonedCart commented 10 years ago

Make sure to sync the repo. The packages are laid out differently, the settings are different, the menus have been reorganized. It's all getting updated to cut down loading unnecessary stuff.

hooby3dfx commented 10 years ago

initial testing with a fresh install from latest build on your bot was good. biggest issue i can see atm is when you press back after going into the popup menu.

On Wed, Feb 12, 2014 at 5:24 PM, TwistedUmbrella notifications@github.comwrote:

Make sure to sync the repo. The packages are laid out differently, the settings are different, the menus have been reorganized. It's all getting updated to cut down loading unnecessary stuff.

Reply to this email directly or view it on GitHubhttps://github.com/reicast/reicast-emulator/issues/118#issuecomment-34925771 .

psennermann commented 10 years ago

http://loungekatt.com/ReicastBot/experimental/compiled/reicast-experimental-b2e3a2a.apk

unfortunately this has the same result as f59da37.apk : a lot of crackling sound

psennermann commented 10 years ago

Just found out that to get rid of the crackling sound I have to enable the "unstable optimizations" option, while in 036be40 I didn't need to (the default "safe" setting worked well)

AbandonedCart commented 10 years ago

In https://github.com/reicast/reicast-emulator/commit/036be40 the settings were semi-broken, too. I doubt that is preferable.

psennermann commented 10 years ago

You mean that unstable optimizations were always enabled?

AbandonedCart commented 10 years ago

I mean who knows. It may have been. Somehow the config file wasn't being updated every time. Now it isn't used.

psennermann commented 10 years ago

Is there still some space for "safe" optimizations or the final r6 default setting will have the performance of that experimental build?

skmp commented 10 years ago

Not in time for r6 (optimisation really need serious time). The speed hit you see is from some optimisations that were moved to unsafe because they broke games (shenmue, others)

On Thu, Feb 13, 2014 at 10:29 PM, psennermann notifications@github.comwrote:

Is there still some space for "safe" optimizations or the final r6 default setting will have the performance of that experimental build?

— Reply to this email directly or view it on GitHubhttps://github.com/reicast/reicast-emulator/issues/118#issuecomment-35022170 .

~skmp

psennermann commented 10 years ago

So wouldn't it be better to have the "unsafe optimizations" splitted in more voices, instead of having only one that includes everything?

AbandonedCart commented 10 years ago

It's only referenced in three functions. u32* ngen_readm_fail_v2(u32* ptrv,u32* regs,u32 fault_addr) of arm_dyna.cpp, void AnalyseBlock(RuntimeBlockInfo* blk) of shil.cpp, and bool DoCheck(u32 pc) of driver.cpp. It isn't really something with much room to split.

psennermann commented 10 years ago

Do you think that adding an option to support PAL refresh rate (50 fps) could help improve performance? (I mean the less fps to disply should help in avoiding crackling due to poor speed emulation...)

AbandonedCart commented 10 years ago

I want to say it's already there just not enabled as a user option

skmp commented 10 years ago

50 hz works just fine, if you use 50 hz games.

psennermann commented 10 years ago

Well since there isn't a show fps option I can't tell, anyway I do think that it should be a user option.

Other than that, what I really can't understand is why without "unstable optimizations" the sound is crackling even in the Dreamcast logo screen (can't believe a 1.2 ghz quad core cannot handle a red dot moving on screen without those optimizations :-/ )

AbandonedCart commented 10 years ago

I can't reproduce the cracking with default options on any of my" supported" devices.

The counter is coming. Trying to prevent it from causing any lag

psennermann commented 10 years ago

Do "unstable optimizations" have a different audio latency setting or what are the main differences in comparison to default setting?

AbandonedCart commented 10 years ago

arm_dyna.cpp: u32* ngen_readm_fail_v2(u32* ptrv,u32* regs,u32 fault_addr) shil.cpp: void AnalyseBlock(RuntimeBlockInfo* blk) driver.cpp: bool DoCheck(u32 pc)

I can't get to them right now, but that is where the setting is checked.

psennermann commented 10 years ago

For me the crackling is very much hearable in the set Date/Time screen after the Dreamcast logo: with the default setting moving fast left or right with the cursor produces some crackling sound (it's just like the audio cannot perfectly sync with the video); with "unstable optimizations" on instead, you can go left or right as fast as you want and you won't hear any audio crackling at all...

P.S. my tablet has a Vsync of 57.5, may it interfere with the default setting while "unstable optimizations" may bypass it?

AbandonedCart commented 10 years ago

Well even with that issue, @skmp it sounds like we are pretty solid for at least an intermediate update.

hooby3dfx commented 10 years ago

we are just going from master at this point right?

On Fri, Feb 14, 2014 at 12:11 PM, TwistedUmbrella notifications@github.comwrote:

Well even with that issue, @skmp https://github.com/skmp it sounds like we are pretty solid for at least an intermediate update.

Reply to this email directly or view it on GitHubhttps://github.com/reicast/reicast-emulator/issues/118#issuecomment-35103570 .

hooby3dfx commented 10 years ago

ill try and test on a bunch of other devices this weekend.

On Fri, Feb 14, 2014 at 12:13 PM, Bryan Barnes hooby3d@gmail.com wrote:

we are just going from master at this point right?

On Fri, Feb 14, 2014 at 12:11 PM, TwistedUmbrella < notifications@github.com> wrote:

Well even with that issue, @skmp https://github.com/skmp it sounds like we are pretty solid for at least an intermediate update.

Reply to this email directly or view it on GitHubhttps://github.com/reicast/reicast-emulator/issues/118#issuecomment-35103570 .

AbandonedCart commented 10 years ago

Testing the Galaxy Camera now, but no the rc branch is caught up to where it is last known stable

AbandonedCart commented 10 years ago

@hooby3dfx I hope you checked IRC. I dropped a link for ya

hooby3dfx commented 10 years ago

Thx got the link! Didn't open yet. On Feb 14, 2014 2:51 PM, "TwistedUmbrella" notifications@github.com wrote:

@hooby3dfx https://github.com/hooby3dfx I hope you checked IRC. I dropped a link for ya

Reply to this email directly or view it on GitHubhttps://github.com/reicast/reicast-emulator/issues/118#issuecomment-35118209 .

AbandonedCart commented 10 years ago

@hooby3dfx it's nothing urgent, just something to test out. I couldn't find the crazy boot animation I heard about but that's the one by link 83

hooby3dfx commented 10 years ago

back to testing: -im pretty sure the first key pressed isnt registering (my fault) -sometime launching games from the browser would go to the bios from where the game could be launched by going to the play icon. this started happening recently - did we make any changes to accommodate the auto start setting? i think it should have been on by default. i went back and made sure to set it to on in the bios and havent seen it crop up again yet. -sometimes launching games from the browser doesnt seem to load the bios and crashes out to the home screen. has anyone else seen this? -the slowdown in virtua tennis is still there. im going to hunt this one down. i swear in r5 and earlier versions of r6 up until a week ago i could play lag free all day long. now within a couple minutes everything gets choppy, maybe about half speed. ill verify the previous versions and work my way through the commits to see where this was introduced.

On Fri, Feb 14, 2014 at 6:43 PM, TwistedUmbrella notifications@github.comwrote:

@hooby3dfx https://github.com/hooby3dfx it's nothing urgent, just something to test out. I couldn't find the crazy boot animation I heard about but that's the one by link 83

Reply to this email directly or view it on GitHubhttps://github.com/reicast/reicast-emulator/issues/118#issuecomment-35139504 .

hooby3dfx commented 10 years ago

ok im not crazy - this branch does not have the issue: https://github.com/hooby3dfx/reicast-emulator/commits/super_stable that is from right after i changed the input handling. i started seeing the slowdown before the vmu shenanigans so that wasnt it either. going to diff this with master tmw.

On Fri, Feb 14, 2014 at 11:52 PM, Bryan Barnes hooby3d@gmail.com wrote:

back to testing: -im pretty sure the first key pressed isnt registering (my fault) -sometime launching games from the browser would go to the bios from where the game could be launched by going to the play icon. this started happening recently - did we make any changes to accommodate the auto start setting? i think it should have been on by default. i went back and made sure to set it to on in the bios and havent seen it crop up again yet. -sometimes launching games from the browser doesnt seem to load the bios and crashes out to the home screen. has anyone else seen this? -the slowdown in virtua tennis is still there. im going to hunt this one down. i swear in r5 and earlier versions of r6 up until a week ago i could play lag free all day long. now within a couple minutes everything gets choppy, maybe about half speed. ill verify the previous versions and work my way through the commits to see where this was introduced.

On Fri, Feb 14, 2014 at 6:43 PM, TwistedUmbrella <notifications@github.com

wrote:

@hooby3dfx https://github.com/hooby3dfx it's nothing urgent, just something to test out. I couldn't find the crazy boot animation I heard about but that's the one by link 83

Reply to this email directly or view it on GitHubhttps://github.com/reicast/reicast-emulator/issues/118#issuecomment-35139504 .

hooby3dfx commented 10 years ago

disregard all of that - that branch does have the issue! (slowdown being my fault is a likely possibility) going to revert that change and test.

On Sat, Feb 15, 2014 at 12:15 AM, Bryan Barnes hooby3d@gmail.com wrote:

ok im not crazy - this branch does not have the issue: https://github.com/hooby3dfx/reicast-emulator/commits/super_stable that is from right after i changed the input handling. i started seeing the slowdown before the vmu shenanigans so that wasnt it either. going to diff this with master tmw.

On Fri, Feb 14, 2014 at 11:52 PM, Bryan Barnes hooby3d@gmail.com wrote:

back to testing: -im pretty sure the first key pressed isnt registering (my fault) -sometime launching games from the browser would go to the bios from where the game could be launched by going to the play icon. this started happening recently - did we make any changes to accommodate the auto start setting? i think it should have been on by default. i went back and made sure to set it to on in the bios and havent seen it crop up again yet. -sometimes launching games from the browser doesnt seem to load the bios and crashes out to the home screen. has anyone else seen this? -the slowdown in virtua tennis is still there. im going to hunt this one down. i swear in r5 and earlier versions of r6 up until a week ago i could play lag free all day long. now within a couple minutes everything gets choppy, maybe about half speed. ill verify the previous versions and work my way through the commits to see where this was introduced.

On Fri, Feb 14, 2014 at 6:43 PM, TwistedUmbrella < notifications@github.com> wrote:

@hooby3dfx https://github.com/hooby3dfx it's nothing urgent, just something to test out. I couldn't find the crazy boot animation I heard about but that's the one by link 83

Reply to this email directly or view it on GitHubhttps://github.com/reicast/reicast-emulator/issues/118#issuecomment-35139504 .

hooby3dfx commented 10 years ago

wtf, still there. the hunt continues. ill stop spamming until i figure it out. sry.

On Sat, Feb 15, 2014 at 12:20 AM, Bryan Barnes hooby3d@gmail.com wrote:

disregard all of that - that branch does have the issue! (slowdown being my fault is a likely possibility) going to revert that change and test.

On Sat, Feb 15, 2014 at 12:15 AM, Bryan Barnes hooby3d@gmail.com wrote:

ok im not crazy - this branch does not have the issue: https://github.com/hooby3dfx/reicast-emulator/commits/super_stable that is from right after i changed the input handling. i started seeing the slowdown before the vmu shenanigans so that wasnt it either. going to diff this with master tmw.

On Fri, Feb 14, 2014 at 11:52 PM, Bryan Barnes hooby3d@gmail.com wrote:

back to testing: -im pretty sure the first key pressed isnt registering (my fault) -sometime launching games from the browser would go to the bios from where the game could be launched by going to the play icon. this started happening recently - did we make any changes to accommodate the auto start setting? i think it should have been on by default. i went back and made sure to set it to on in the bios and havent seen it crop up again yet. -sometimes launching games from the browser doesnt seem to load the bios and crashes out to the home screen. has anyone else seen this? -the slowdown in virtua tennis is still there. im going to hunt this one down. i swear in r5 and earlier versions of r6 up until a week ago i could play lag free all day long. now within a couple minutes everything gets choppy, maybe about half speed. ill verify the previous versions and work my way through the commits to see where this was introduced.

On Fri, Feb 14, 2014 at 6:43 PM, TwistedUmbrella < notifications@github.com> wrote:

@hooby3dfx https://github.com/hooby3dfx it's nothing urgent, just something to test out. I couldn't find the crazy boot animation I heard about but that's the one by link 83

Reply to this email directly or view it on GitHubhttps://github.com/reicast/reicast-emulator/issues/118#issuecomment-35139504 .

psennermann commented 10 years ago

Do you think that this slowdown could be responsible for the crackling sound that I'm always hearing since few revisions? (I've just tested 55d5e31 and it was fine, so it must be due to a very recent revision...)

AbandonedCart commented 10 years ago

@hooby3dfx I had suspected the menu changes (adding the secondary overlay) but the more recent menus are handled rather effectively. It seems to be faster than the original menu was alone in the past.

psennermann commented 10 years ago

Ok, for me the problem came out between revision 55d5e31 (no crackling sound) and 37d9060 (crackling sound)...I couldn't test 7a13236 because it keeps on crashing while starting the emulator...

AbandonedCart commented 10 years ago

That confirms it. it's from when the configuration didn't properly load to when it did.

hooby3dfx commented 10 years ago

thank you @psennermann ! @LoungeKatt any idea which setting is throwing it off? i am testing without the ifndef's in nullDC.cpp and its smooth as butter.

edit: i always speak too soon! still seeing eventual slowdown, but was just experimenting.

AbandonedCart commented 10 years ago

"For me the crackling is very much hearable in the set Date/Time screen after the Dreamcast logo: with the default setting moving fast left or right with the cursor produces some crackling sound (it's just like the audio cannot perfectly sync with the video); with "unstable optimizations" on instead, you can go left or right as fast as you want and you won't hear any audio crackling at all...

P.S. my tablet has a Vsync of 57.5, may it interfere with the default setting while "unstable optimizations" may bypass it?"

psennermann commented 10 years ago

I tested with the last experimental build that has an option to display fps on screen, and I noticed that if I enable "unstable optimizations", in the set Date/Time I have steady 58 fps without any audio cracling while moving left and right, instead without that option frame rate keeps on changing going from 58 to 55 and back causing in this way the audio crackling...

AbandonedCart commented 10 years ago

https://github.com/reicast/reicast-emulator/commit/5a741af03d5afee6c58bc12c8b7c9beb4bb4d14b -> Solved. https://www.youtube.com/watch?v=MjoMQJf5vKI

psennermann commented 10 years ago

And how much unstable are those optimizations? I mean what problems could they give? Only with one specific game or with every game?

AbandonedCart commented 10 years ago

They won't do any long-term damage

Renamed the issue since our r6 merge thread has been hijacked.

AbandonedCart commented 10 years ago

@hooby3dfx those ifdefs need to be expanded so when we get vmem errors it isn't complaining no config was found. The config is never read on Android. it's generated by JNIdc.

hooby3dfx commented 10 years ago

shield, virtua tennis, unstable opts OFF 55d5e31 runs smooth 37d9060 develops slowdown

hooby3dfx commented 10 years ago

https://github.com/reicast/reicast-emulator/compare/55d5e31...37d9060

didnt idleskip used to default to true in the cfg file?

hooby3dfx commented 10 years ago

that was it. fing idleskip!

i thought unstable opts broke shenmue?

AbandonedCart commented 10 years ago

Maybe now I can clean out my email again.

psennermann commented 10 years ago

I've downloaded 3bdb4fa but when I go to the settings menu the emulator crashes returning to "desktop"...when I reload reicast it says that previous crash was caused by Bynary XML file line #445: you must supply a layout width attribute

AbandonedCart commented 10 years ago

Revert to an older one for now. It will be fixed by tomorrow.

psennermann commented 10 years ago

Tried 540fd32 it doesn't crash anymore in the setting, but now when I try to load a game, the emulator only loads the bios...why is that happening?

skmp commented 10 years ago

They are 8.13% unstable.

They make your virtual dreamcast consume silicone alcohol and your games to crash.