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

Audio crackle/distortion in Final Fantasy Tactics #9956

Closed
MarauderEX opened this issue Sep 5, 2017 · 28 comments · Fixed by #12270
Closed

Audio crackle/distortion in Final Fantasy Tactics #9956

MarauderEX opened this issue Sep 5, 2017 · 28 comments · Fixed by #12270
Labels
Milestone

Comments

@MarauderEX
Copy link

I am having issues with audio crackle and distortion while using ppsspp.

The issue started as constant crackling, present in multiple games, here is an example from 2
https://www.youtube.com/watch?v=9N6GNLPJWSM

after posting on the ppsspp forums and some adjustments to audio drivers the crackle went from being constant to only when certain sound effects are playing, the thunder effect in the first battle of Final Fantasy Tactics, as well as some of the menu loading options in Valkyria chronicles 3.

However with the reduced crackle, new audio distortions popped up at certain segments of the music tracks, heres an example:
https://www.youtube.com/watch?v=sOa9kcOqmUo

The theory is that I am using a dedicated sound card which is not as common these days and could be the likely variable causing the issue. For completion sake here is a list of my current hardware just in case its not that or a combination of things
Intel Core I7 7700k 4.20 GHz
16gb ddr4 ram
windows 10 64bit
asus geforce gtx 960 strix
gigabyte z270x ultra gaming motherboard
asus xonar dgx sound card

also here is a link to the ppsspp forum thread with all the suggestions made to try and attempt the fix
https://forums.ppsspp.org/showthread.php?tid=23430

@TehPlayer14
Copy link

TehPlayer14 commented Sep 5, 2017

Have you tried the improve audio setting?
Have you tried to limit the fps?
What Windows are you on?
Have you changed the sound interface?

@MarauderEX
Copy link
Author

I'm not sure what improve audio setting you are referring to, the settings I have tried are
audio back end of WASAPI and Dsound both with the audio latency set to low medium and high, and each combination with the speed hack on or off.

I have also tried the Extra Audio Buffering in the ini file as mentioned in the thread linked.

I'm not sure what you mean by limiting the FPS, I don't see an option to limit other than frameskipping and I have tried that with no luck.

I'm on windows 10 as stated above

I'm guessing you mean bypassing the soundcard and using the motherboards on board sound? I have tried but still got the same audio distortion

@unknownbrackets
Copy link
Collaborator

Has this improved at all in 1.6.0 or the latest git builds?

Does the rendering backend have any impact? Normally you would get audio issues if the game wasn't running full speed (e.g. if it dipped for a second due to aggressive texture scaling settings, or something.)

-[Unknown]

@litvand
Copy link

litvand commented Sep 14, 2018

I tried several different versions of PPSSPP (1.5.4, 1.6.0, latest), but in the end my fix was to use JPCSP. It is slower and has worse graphics, but no audio crackling, which is more important for me (playing visual novels on Linux with overkill hardware).

@dojima
Copy link

dojima commented Sep 30, 2018

I'm getting the exact same issue in the exact same spot as OP's second video. Have tried various combinations of settings, different versions of the game, and nothing seems to help. In the YouTube comments, the OP mentions solving it by using an old version of PPSSPP, but unfortunately he doesn't mention which version.

edit: All right, after testing a bunch of versions, I found that the issue starts to present itself in v1.2. The audio also sounds a bit different, but at least isn't glitchy. This leads me to believe it likely has something to do with the way reverb was implemented. According to this post, improved reverb is planned for the future. Perhaps in the meantime, giving users the option to disable reverb would be better than nothing?

Thanks.

@LunaMoo
Copy link
Collaborator

LunaMoo commented Oct 1, 2018

Improvements in reverb would be to make it closer to psp and not about sound popping, which few users experience and what can't be reproduced by most other people despite looking at same games in same places.

Disable the thing altogether isn't really a good solution, if there will be an option to disable sound effect which should be there, someone out there will certainly be bright enough to make a video that ppsspp has a new option that "fixes sound!!!!!!" and if he has a lot of very bright viewers they will activate that option disabling the effect for themselves without ever checking if they have a problem and the actual issue will never be figured out by anyone and fixed.

The only thing where I can hear sound popping is when I abuse awfuly heavy texture scaling effect like Hybrid+bicubic or even just hybrid as that's the heaviest scaling algorithm in ppsspp and even that mostly on Vulkan which is a bit worse in texture scaling, it's also not a constant popping, it's only happening on frames when textures are scaled.
Things to keep in mind I have a Zen+(ryzen 5 2600) cpu which at stock clocks has 25% higher multithreaded performance than OP with his OC i7 7700k and that's what actually matters in texture scaling. I had a much weaker haswell i5 in the past where texture scaling was causing popping much more commonly despite also running games at full speed.

So I would say from my experience sound popping is still a performance issue, but even when that's not reflected on fps counter.
Potentially even without using texture scaling, I guess this could be caused by something like #9736 which supposedly is happening to some users, but again it's something specific to their setup maybe an nvidia 900 series gpu which OP's of both issues have, I couldn't reproduce it on any amd gpu neither on the OC 6gb gtx 1060 from nvidia.

It could also be caused by video recording software/hardware or driver hacks that could explain how rare the problem is and how nobody here could reproduce it.

@unknownbrackets
Copy link
Collaborator

unknownbrackets commented Oct 1, 2018

It can also be caused by specific performance issues. For example, there was a performance issue in Final Fantasy 3 when entering shops, iirc. It caused a temporary FPS drop right when the shop was entered.

That's been fixed, but if you're seeing specific cases that are reproducible (happen every time the same way), then it's probably a performance issue we could try to do something about (or it might just be the game doing something awful that is VERY hard on modern GPUs...)

If it's random though, yeah - it's usually just texture scaling or the like.

Also, using Windows 10 game center features or other screen recording software has been reported to cause problems too.

-[Unknown]

@dojima
Copy link

dojima commented Oct 1, 2018

@LunaMoo
Well, in this case, resolving the audio distortions with Final Fantasy Tactics would make it closer to a PSP. I own the game, and it doesn't exhibit the issue on my actual PSP. Are you actually unable to reproduce the issue in the second video linked in the first post? If so, I'd love to know how. Two other people in the comments of the YouTube video have the same problem. I see that you're a participant in the associated forum post for the game, so you're aware that complaints about the audio in this game are fairly common.

I initially thought it was performance related as well, since my computer is pretty ancient, but I only ever get audio distortions at that exact part in the song, and they manifest in the exact same way as the OP's video. Viewing the debug statistics, I also noticed that it happens to be when the most number of "Pitch" values appear on screen, but I'm not a programmer, and I have absolutely no clue how PSP emulation is done, so it could be a mere coincidence.

@unknownbrackets unknownbrackets changed the title Audio crackle/distortion Audio crackle/distortion in Final Fantasy Tactics Oct 1, 2018
@LunaMoo
Copy link
Collaborator

LunaMoo commented Oct 1, 2018

Dunno about FFT, seeing how [Unknown] renamed this maybe he reproduced it there, however in FFT that might not be a PPSSPP problem, I do recall FFT had a nasty popping also on PSP if you set volume high and/or were listening in closely, I'm a pretty big fan of FF music, but the FFT on PSP wasn't really sounding great. The thing is psp speakers are too small to make volume high enough to hear the popping clearly, but popping or some other nasty artifacts are definitely there, it's just a port of PSX version so that might be why.

I tested some other games I had on recent list and definitely can't hear any popping in Valkyria Chronicles 3 despite hearing it all the time in the included video. The sound is crystal clear for me unless as I said I abuse extremely heavy texture scaling especially on vulkan, but it's not constant, just happens during scaling.

@dojima
Copy link

dojima commented Oct 1, 2018

Yeah, I'm not getting any problems similar to the first video at all, and I've played through various other games on PPSSPP without issue. The issue I'm referring to is solely with Final Fantasy Tactics, and it's identical to the second video.

I agree that the general audio quality in WotL is lower than the original PS1 game, but it still doesn't present glitches in the manner of the video. When I get some time later today, I'll make a direct recording of that section of audio from my PSP, recorded with a field recorder.

@MarauderEX
Copy link
Author

Since this seems to be picking back up I thought I should chime in with the information I have.

I have tried ppsspp 1.6.0 on 3 different devices and all have had the same audio distortion as the original video I posted, 2 PCs and a laptop, all with vastly different hardware configs. No matter what I do I get the distortion in FFT, and the crackle in VC3 on 1.6.0

I have tried adjusting the graphical settings as much as possible to see if there wasn't some hidden slowdown causing the audio in that one spot of the song, no matter what else was going on on screen to see if there was some texture upscaling issue, I have tried every option and every available combination of options in 1.6.0 to try and fix the sound issue to no avail. This problem is also persistent when not using OBS to try and record.

I have only been able to get the audio to work properly in ppsspp 1.0.1, but then I have other issues as the emulator seems to want to freeze for a moment before performing certain actions. its inconsistent as to what actions or how long the pause is. However switching to 1.0.1 has also fixed the valkyria chronicles audio crackling as well, but the stuttering seems to be present just not as pronounced

I have also recorded straight from the PSP using composite cables and its video out settings to get a clear indication of what the audio should be bypassing whatever quality the PSP speaker might produce.
https://www.youtube.com/watch?v=m_18V3Mj11o

I have also seen others on YouTube have this same issue, though they either seem to not notice or care
https://www.youtube.com/watch?v=vOcHLdF23FU
https://www.youtube.com/watch?v=N92gZDy2Fpw
https://www.youtube.com/watch?v=PR-gXMz_r_c

Regarding FFT, at first I wondered if it was the patch to remove the slowdown from special attacks, but I have tried both patched and unpatched versions and the audio distortion is still there

@litvand
Copy link

litvand commented Oct 1, 2018

For the record, this is the game I had trouble with: https://vndb.org/r5724 (not CPU intensive)
I have an i5 2500, GTX 1080 and 8GB of RAM, running Ubuntu 16.04.

@unknownbrackets
Copy link
Collaborator

I will say, Final Fantasy Tactics definitely had issues last I checked, which I think was after #8950 was merged. Since it's a game that uses variable pitch, I'm pretty sure it's related to that. I do think #8950 (which was in v1.4.0) improved it.

I haven't really noticed issues in other games, including Valkyria Chronicles 3 (with one exception: there are a couple places where it reads from the memstick and I've experienced dropped frames.)

One thing to try, in case disk access is dropping frames, is to change "I/O timing" in your System settings to "Host". Be warned, this breaks some games (and also fixes some others), but most games are unaffected.

When "I/O timing" is not host, you drop frames if your disk is slower than expected. When it is host, it exposes whatever timing you actually had to the game - but you'll see a loading screen and keep hearing music while it waits. The downside is this can cause different timing for different people, and sometimes means bugs when games were dumb and relied on memory stick or UMD timing.

-[Unknown]

@DjDiabolik
Copy link

A very recent thread... i will add my feedback.

It's related another games.... Crash Team Racing.

I have tryed whit latest stable 1.7.4.
My pc have an I3-6098P 4GB DDR4 whit a video card AMD R7-360OC.
I have tryed also so many version and apparently the games run ok..... but the sound CRACKLY and choppy ever in every situation.
In the default i see it's setted Vulkan but i don't have idea if it's exist a better solution........
Inside audio preferences......... there's all setted to "Medium".........

If someone can suggest some specific tweak or setting to test...... thanks in advance.

@jacobc-eth
Copy link

Can confirm this issue persists in 1.8, regardless of the settings chosen.

@hrydgard hrydgard added this to the v1.9.0 milestone Jun 18, 2019
@hrydgard
Copy link
Owner

Also think it's likely to have something to do with #8950. will investigate before 1.9.0.

@dingdongbannu
Copy link

Same issue with FFT. Even happens in menus and on the world map. Sounds like its an FPS issue yet the FPS are solid 60

@rgardnercook
Copy link

I'm having the same exact issue with FFT.

@jordanjs
Copy link

jordanjs commented Jul 22, 2019

Echoing the same issue with Final Fantasy Tactics audio glitches. Really good example of it happening here: https://www.youtube.com/watch?v=PrCU0qgaNxM

Edit: GPU is Geforce GTX970. Another common reference point.
Edit 2: Tested the game in 1.1.1 and I can confirm that NO audio glitch occurs, leading me to believe it's got something to do with the implementation in later versions of PPSSPP that does it, as others have mentioned. (Audio is "brighter" than in the current release, but I like it better since it doesn't glitch and kill my ears.)

@hrydgard
Copy link
Owner

Okay, have the game here now and can reproduce. Thank you all for your persistence in reporting, it does sound quite annoying and definitely needs fixing.

@hrydgard
Copy link
Owner

hrydgard commented Aug 22, 2019

Just rebuilt at #8950 to try some debugging, but the artifacts are still there. So it's an even older issue.

EDIT: This is not good at all, trying to check out old glslang versions:

Fetched in submodule path 'ext/glslang', but it did not contain 4b3e84f0eb3b528bd0d7094ae9be87ede0e25fbb. Direct fetching of that commit failed.

this will throw a wrench into bisecting...

@hrydgard
Copy link
Owner

Ok, so looking at the waveform, when it sounds bad it has little silences like this:

waveform

It seems that it's actually not a bug in the mixing itself, but in buffering or something...

@hrydgard
Copy link
Owner

It seems that EstimateMixUs() , which is supposed to estimate the time in cycles it takes to mix the audio, overestimates enough that the game somehow doesn't have time to mix the next block in time, or something like that. Having it return 0 or the normal value minus 120 cycles restores correct audio.

@unknownbrackets, what do you think, should we cap it maybe, or just adjust it down a bit for this game? It's playing around 20 voices when it breaks.

I suspected this because part of the music with artifacts has a lot of instruments playing...

@ggrtk
Copy link

ggrtk commented Sep 27, 2019

@hrydgard There's still an audio issue I'm hearing on 1.9.0 Windows that I'm not sure is exclusive to this game or not. When background tracks play, there's a ringing or buzzing sound on certain instruments. For example with the DSound backend, the track that plays immediately after starting a New Game has audible ringing when the violins begin playing. With the WASAPI backend, there's a constant buzzing sound present from the very start with the aforementioned ringing sound beginning with the violins. I don't have real hardware on hand to test right now but I don't remember this being an issue when I originally played this game on it.

On a side note, there are issues on real hardware with many sound effects in this game such as death screams lacking reverb or magic/sword abilities sounding tinny or making beeping sounds (possibly also due to lack of reverb?). This seems to result from poor porting of the original game on PSX to PSP unfortunately rather than any emulator issues. Just thought it'd be worth to mention in case anyone brings up this SFX issue in the future.

@hrydgard
Copy link
Owner

Yeah, that ringing is called aliasing, and is the result of not using very high quality sample interpolation. We use linear interpolation just like the PSP, you would hear less of it if we switched to higher order interpolation. It would be possible to add an option for that.

Normally DSound and WASAPI should sound identical, we're playing the same stream after all. WASAPI buzzing might be a result of us using too small buffers on your hardware or something, that's probably an entirely separate issue and should probably be made into a proper issue report.

@dojima
Copy link

dojima commented Sep 27, 2019

Here's that section recorded directly from my PSP for anyone who wants to compare:

https://mega.nz/#!B551ECTJ!kC32E2nk0KDAimFbROfTa5A1Y7x9jXQNr6i6Cdtm-mU

@ggrtk
Copy link

ggrtk commented Sep 28, 2019

Huh, so it does sound the same way on PSP hardware -- guess my memory fails me. Just checked it out on PSX hardware and interestingly the aliasing isn't present (or at least very minimal), which I'm guessing is thanks to Gaussian interpolation in the SPU.

Thanks for the responses.

@unknownbrackets
Copy link
Collaborator

Actually, when I was testing interpolation (by sending PCM samples specifically to determine interpolation at different pitches), it looked like the PSP was doing trilinear, not bilinear iirc.

-[Unknown]

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

Successfully merging a pull request may close this issue.