(08-13-2014, 04:18 PM)VIRGIN KLM Wrote: I just want to raise a point about audio interpolation and the curves/techniques used in emulators and their quality results.
While in image standars Linear-type interpolation methods are considered by most people that give the least desirable results, in audio standars the truth is the opposite.
When an image gets resampled you want it to look and retain as much crispness as possible without looking pixelated. Linear-type interpolation results into the least pixelated results but it's way too blurry so most people won't use it unless it's a matter of performance.
Then it comes Cubic-type interpolation that tries to defeat that blurriness but it brings back the pixelation and introduces some ringing effects. Here comes Hermite, Lanczos and Catmull-Rom which are very near to Cubic results but try to defeat it's issues. The outcome of this is generaly good but there is always a ringing/pixelation factor to the results plus they give that feeling of "fake/artficial fidelity" that we all seem to like in image (I'm one of them too).
Now in audio standars things are quite different. These fake fidelity and pixelation and ringing effects that Cubic-type, Hermite, Lanczos and Catmull-Rom interpolation methods translate into aliasing artifacts in the audible spectrum of human's hearing, which always mean worse quality/results.
Here's a comment I found online that is short and explains nicely the reason of what I said above:
http://www.avsforum.com/forum/26-home-th...ost4552394
I know, It's funny to think that Linear interpolation results into the best possible solution for audio interpolation but It's true and I'm gonna prove my point with examples.
Let's take a very hardware limited device that uses low fidelity ADPCM samples for audio, like NDS and Desmume.
Play a game and get to a place with music. While playing the game jump on the Audio Settings and jump between No Interpolation, Linear and Cubic settings. No interpolation means nearest neighbor and has these ringing frequencies we all recognize in NDS. Bicubic does a great job (but not quite there) defeating this aliasing and finaly Linear kills completely these aliasing artifacts we all hate giving a PS2-like audio quality. Strange right?! Well it's because of the reasons I explained above. The least artificial results an algorithm produces in audio, the least artifacts will be generated on the audible spectrum of human's hearing which translates to better quality.
So what applies to PS2/PCSX2 you ask?
Exactly the same, even though the ADPCM samples used on PS2 are far better quality than the ones on NDS, so the artifacting is already less prominent when you use no interpolation/nearest neighbor.
Here are some audio samples that prove my point:
No Interpolation/Nearest Neighbor:
http://www.mediafire.com/download/ugk9hz...lation.wav
Linear:
http://www.mediafire.com/download/3tvkca...Linear.wav
Catmull-Rom:
http://www.mediafire.com/download/q9si8t...ll-Rom.wav
Notice the esses and the "e"s in "seaweed" word for example. You can hear somekind of sharp frequencies somewhere between 10000Hz and 15000Hz, which are the artifacts generated by the absence of an interpolation method (nearest neighbor) or by trying to "guess" what should be there (Catmull-Rom). These metalic sound artifacts you hear translate into sharp pixelation and ringing in image interpolation.
If you can't hear the difference, there is a mathematical way to explain the difference by subtracting the audio with phase inversion.
No Interpolation - Linear Interpolation:
http://www.mediafire.com/download/tka0jc...Linear.wav
No Interpolation - Catmull-Rom Interpolation:
http://www.mediafire.com/download/8b884w...ll-Rom.wav
(Ignore the bubble effects, they don't match so they don't count, just concentrate on the speech)
Louder file means less things get cancelled/subtracted so it means that the interpolated file contains less artifacts too.
Less loud file means more things get cancelled/subtracted so it means that the interpolated file contains more artifacts that match the artifacts generated when you use no interpolation.
So my final point:
*People should not confuse what is good for image = good for audio too. There are alot of similarities but alot of stuff too work EXACTLY the opposite.
*Audio interpolation is not Texture Filtering or Texture Scalling, so the quality results will not match and that's not a matter of personal preference.
*It's a bad idea to advertise Linear as "Bad quality" and Catmull-Rom for audio interpolation as "Best Quality", even for the user that has no idea what these are and what they do because it's simply not true in audio standars, it is generaly true in image standars.
*I'm not trying to insult or change anything here. I just want to make some people go like "Oh yeah, now I see the difference" or like "Oh, yeah indeed that sounds more acceptable" and generaly break that misconception on emulators of what applies to image interpolation quality applies to audio interpolation quality too.
Sorry for missing this nice writeup, VIRGIN KLM.
You make good points there but I haven't checked your examples yet.
I can tell you how we came to the current interpolation settings and defaults though:
They were implemented and tested against 2 difficult sound sources by yours truly
One test was an eery wind sound from Devil May Cry:
http://youtu.be/ayAm_XfTqak?t=12m16s
The sound of that "background music" is drastically affected by the interpolation method.
I found that nearest and cubic were pretty bad at it, linear was okay, hermite and catmul-rom sounded best overal.
It can well be that I settled on catmul-rom because I got tricked by it's artifical detail over linear.
If you want to help finding out if that's the case, please do a comparison with your method, using just the "linear" and "catmul-rom" methods.
We can easily change the defaults to linear, should that method win
Blyss and vsub:
You talk about 3 bugs at once, wow
1st: The sound slowdown when clicking in and out of the GS window is okay/expected. It happens because of some gui thread forced updates
that help avoid some issues we couldn't get around of otherwise. It's a necessary evil at this point.
2nd: There is a huge rendering time increase in GSdx hardware in Ar Tonelico games when the menu is drawn. This takes so much time, it can
cause the audio to drop out.
3rd: The wait loop hack should not affect game compatibility. If it does, it's because it exposes an emulation flaw somewhere else, most likely SPU2 timing.