Azimer / AziAudio

Azimer's Audio Plugin
GNU General Public License v2.0
47 stars 11 forks source link

Choppy and sluggish performance with WIP 10 #3

Closed ghost closed 6 years ago

ghost commented 6 years ago

Something have happened since WIP 9 because the performance is choppy and sluggish with WIP 10 in some games and especially with GoldenEye and Perfect Dark.

First I thought it was because of angrylion-rdp-plus but the performance have been good on both m64p and Project64 in the past so then I decided to revert to WIP 9 and the performance was good again just as it were with WIP 7 too.

I'm using the latest build of Project64 from here along with Windows 10 Enterprise 2016 LTSB x64 and all settings in WIP 9 and WIP 10 have been the default ones.

Do you experience the same @Azimer ?

I will attach the latest angrylion-rdp-plus plugin for you to test with here.

angrylion-plus (17-12-25).zip

Make sure to check that Multi-threaded is enabled in the angrylion-rdp-plus settings!

Azimer commented 6 years ago

Are there specific spots? Is FAT on or off? Which audio driver? Thanks.

cxd4 commented 6 years ago

What is angrylion-rdp-plus?

ghost commented 6 years ago

@Azimer For GoldenEye and Perfect Dark you will pretty much notice right away if it's choppy or not, at least in Perfect Dark with the spinning logos just after you have turned on the game.

They spin real smooth with WIP 7 and WIP 9 but not in WIP 10, so let that set the tone for how the rest of things plays.

As for your question about whether or not FAT is ON or OFF I honestly have no idea since I pretty much use Project64 out of the box with as much default settings possible both in RDB and emulator.

Audio driver is set to XAudio2.

@cxd4 Are you telling me that you never heard or have played with angrylion-rdp-plus, a Multi-threaded fork of the original angrylion project? It's easy the best and only GFX plugin you'll ever gonna need for N64 graphics.

The project can be found here: https://github.com/ata4/angrylion-rdp-plus/

This is Unfiltered + Linear, looks pretty damn good don't you think?

Azimer commented 6 years ago

Thanks for the issue. I will investigate and let you know my findings over the next day or two.

Azimer commented 6 years ago

Try turning off "Sync to Audio" within the Project64. It appears to be a new default setting with hidden requirements unknown to me. Disabling this will allow the emulator to lock at 60 fps. I might have some things to work on with the Sync Audio option... that might alleviate some of the issues I am seeing also...

ghost commented 6 years ago

Well I turned "Sync using audio" OFF with WIP 10 and it got a little better, not as choppy and sluggish as with the option ON.

With WIP 9 it doesn't matter if "Sync using audio" is ON/OFF, the performance is good nevertheless.

Except for the WASAPI (Experimental) option in WIP 10, both WIP 9 and 10 seems to be pretty much on the same page feature and content wise but there is clearly something in 10 that drags down performance.

Azimer commented 6 years ago

It's not dragging down performance. I changed some things in WIP10 with the express concept that we'd be locked at 60fps through the emulator. The old way of "sync" which Project64 seems to be assuming now works on the idea that if both the primary and secondary buffers are full and a third buffer is introduced, the primary buffer is allowed to play to prevent a crackle or pop. The new way of "sync" assumes a locked 60fps and gradual release of audio. In this method, if a third buffer is introduced, the primary buffer is evicted in favor of the secondary buffer (primary is often times no longer valid) and the new buffer replaces the secondary. This is done to prevent an audio artifact that happens when the third buffer introduced is actually the first buffer with an audio artifact. It causes two very loud snaps rather than the one softer snap I introduced by evicting the primary buffer.

I will have to do some thinking on how to best support this behavior. I am finding this setting regrettable.

WASAPI is different because it's low latency; I sample the audio more often reducing the chance of that third buffer issue. You can also alleviate the issue by sliding the buffer level to 5 or 6 though it's not really a solution a like.

ghost commented 6 years ago

Thanks @Azimer

I appreciate taking time to look into this, your audio plugin is pretty much spot on in all games I have and play regularly.

Is there anything else I can test or I can be assistance of to help you? Got plenty of spare-time at the moment.

Azimer commented 6 years ago

AziAudioTest.zip Give this a shot. It partially reverts the change I made... but reintroduces some of those nasty artifacts. I don't hear much of it while 60fps is locked however. Notice "Private" is part of the plugin name. It has a lot of partially working code that is only intended for testing. I was in the middle of working on the game profile configuration code change.

BufferLevel = 4 seems to best for me. Might become the new default...

ghost commented 6 years ago

Thanks, my initial tests with the WIP 11 Private build gave similar outcomes as WIP 10 both with Sync using audio ON/OFF

I didn't touch any of the settings in the audio plugin during my first tests, I did however change the buffer level from 3 to 5 and 6 without noticing any improvements on later tests.

My issue isn't speed per see because it fluctuates between 46-50fps constantly (I'm running PAL by the way since that's the region of the games I'm owning) but my issue is rather dragging/chopping image which makes it seems like the performance is choppy/sluggish.

I don't know really, that's the best I can describe it and it's not happening with WIP 7 or WIP 9.

EDIT: All my tests is based off angrylion-rdp-plus as GFX plugin which is known to be resource hungry, so this may not even be a issue with, let's say GLideN64. Maybe I should test the latest public 3.0 release just in case.

EDIT 2: Nope same behavior with GLideN64 Public Release 3.0 HLE/LLE with WIP 10 and WIP 11 Private. WIP 7 and WIP 9 still good.

Azimer commented 6 years ago

I captured a video so you can help me pinpoint the issue. Below are the timestamps. I will leave the video up for a couple days then remove it. Some N64 games get flagged for copyright protection on the music for some reason...

WIP10 - https://youtu.be/yXea2dTC9lo?t=84 WIP11 Private - https://youtu.be/yXea2dTC9lo?t=142 WIP9 - https://youtu.be/yXea2dTC9lo?t=197 "project64-audio" (DS8 WIP8) - https://youtu.be/yXea2dTC9lo?t=250 WIP10 w/o Sync to Audio option in PJ64 - https://youtu.be/yXea2dTC9lo?t=317

If you could capture a video (if my video is insufficient), that could at least assist me in finding the change. I reverted what I could in WIP11 to go back to WIP9 buffering... but it doesn't appear to have changed anything.

Can you let me know your system specs too... CPU/Ram/Graphics/audio chip (remember HDMI uses the graphics audio endpoint). In my video - I am using VMWare 12.5... 3 allocated CPU Cores, 4GB Ram,SVGA 3D acceleration and whatever audio driver it comes with. Kind of a crappy setup but it's why I like it for development. I also test on my host machine with similar (better) results. My host machine is i7-6700k (4 core), 32GB Ram, 980Ti, HyperX 7.1 USB headset. The audio chip is fairly irrelevant anymore since most audio processing is done in software unless you own a fancy sound card.

ghost commented 6 years ago

Great, I'll look at this tomorrow!

In the mean time these are my specs: i7 4790K @ 4Ghz stock Nvidia GTX 1060 6GB VRAM 16GB XMS3 DDR3 RAM Windows 10 Enterprise 2016 LTSB x64 LG 42" LCD TV with HDMI

EDIT:

I took a quick look at all videos you posted and all of them showed what I'm experiencing but I found it weird that WIP 8 and WIP 9 was choppy, that's not the case for me, only 10 and 11 are that kind of choppy.

I'll have to investigate this further tomorrow, thanks for taking your time recording these videos!

cxd4 commented 6 years ago

This is Unfiltered + Linear, looks pretty damn good don't you think?

Well, not particularly.

ghost commented 6 years ago

Well, it looks better in motion but I guess angrylion isn't for everybody.

ghost commented 6 years ago

I'll have to close this now indefinitely since I got 0 time to test this anymore at the moment.

You keep on working on this awesome plugin @Azimer and I'll let you know when I got the time again if this is even a problem then.

Thanks for taking your time on this!