17 October 2018, 18:36 | #1 | |
Registered User
Join Date: Jul 2008
Location: Netherlands
Posts: 485
|
Possible enhancements to Paula audio emulation
Hi Toni,
We had some discussion about this in the past I think (years ago probably..). I'm still intrigued by the theory behind it so I thought it could do no harm to post a separate topic about it. Some time ago kb_ posted code in the pouet forum for a module replayer with the object of recreating the Amiga sound faithfully. Or to quote the author, the whole purpose of the experiment was Quote:
After searching the forums I encountered one thread where number 2 is discussed: Low-level workings of Paula The blog referenced in that thread no longer exists, but "kebby" references the same author as from the attached code. (See https://twitter.com/kebby ) Does the current WinUAE implementation incorporate any of the volume behaviour discussed in that thread? With regards to point 1) I would very much appreciate it if the main difference with the current WinUAE implementation could be explained? |
|
17 October 2018, 21:28 | #2 | |
Registered User
Join Date: Sep 2017
Location: Kansas, USA
Posts: 324
|
The internet archive has that blog post archived: https://web.archive.org/web/20140924...ebby.org/?p=11
Quote:
|
|
18 October 2018, 10:18 | #3 | ||
Registered User
Join Date: Jul 2008
Location: Netherlands
Posts: 485
|
Quote:
With regards to the sample rate, the Sameboy author changed the audio rate at which the libretro core generates audio to 384Khz, saying Quote:
Then again, alankila, who seems to have quite some knowledge on the subject and the creator of the Sinc resampler (interpolate.txt), suggested here in the forums that using the Sinc resampler with a "high enough" pc host output rate, like 48000Hz, would lead to most accurate sound. His tests however were done in 2006 however (judging by the date of when he posted the results, see modguide folder). I think the Soundblaster X-Fi had just came out then, which had a max playback rate of 96Khz. So maybe he never had a real chance to contemplate or test what would happen when you have 192Khz or even 384Khz playback rates available? It makes me curious whether somewhere down the line a testcase could be made following the line of the tinymod player and see whether generating at 3.5Mhz and downsampling to 192Khz (most soundboards these days) or 384Khz (e.g. Soundblaster X AE-5) would lead to an audible quality difference versus Sinc+48Khz output. The Amiga sound is so special, that to me personally any chance of possibly improving the emulation would make it worthwhile. But I guess this all depends on what there is to see in Toni's Crystal Ball.. |
||
20 October 2018, 13:57 | #4 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,506
|
Remind me after next official version is out.
|
21 October 2018, 10:18 | #5 |
Registered User
Join Date: Jul 2008
Location: Netherlands
Posts: 485
|
Awesome, will do
|
01 November 2018, 11:46 | #6 | |
Registered User
Join Date: Jul 2008
Location: Netherlands
Posts: 485
|
Quote:
My personal conclusion:
Since audio quality is a somewhat subjective topic, I tried to find a simple repeatable "real" test which may be interesting to judge for yourself. One such example is that in GODS the sound the knifes makes when hitting a wall sounds different when using 48Khz versus 96Khz. Personally I find it to be slightly less noisy / scratchy when using 96Khz. A subjective test to try yourself (config and statefile attached) I've attached a config file and statefile (just copy to your respective WinUAE folders) that loads GODS. Just use Right-CTRL to throw a knife at the wall and switch between soundrates by using the keys "1" (48Khz) and "2" (96Khz). If you slowly keep throwing knifes at the wall and at the same time alternate between 48Khz and 96Khz, you'll probably notice the "knife hits wall sound" to sound different between the two rates. I think it goes without saying that you probably need decent equipment to distuingish a difference at all. I'm using Sennheiser HD 600 headphones which makes the difference between 48Khz and 96Khz quite apparent. So, it might be that when you like to listen to your WinUAE Amiga audio without interpolation and without filters that you may experience a slight increase in audio quality when using 96Khz or higher versus 48Khz. Will be interesting to know whether other people can disguingish a noticeable difference themselves. If you care to try out above mentioned (attached) testcase, please report back *To be able do quickly switch between the rates during runtime I configured keys "1" to "4" to switch between the various rates. Code:
input.1.keyboard.0.button.2.1=KEY_1.0,'sound_frequency=48000'.0,'sound_max_buff=8192'.0,'sound_output=exact'.0 input.1.keyboard.0.button.3.2=KEY_2.0,'sound_frequency=96000'.0,'sound_max_buff=16384'.0,'sound_output=exact'.0 input.1.keyboard.0.button.4.3=KEY_3.0,'sound_frequency=192000'.0,'sound_max_buff=32768'.0,'sound_output=exact'.0 input.1.keyboard.0.button.5.4=KEY_4.0,'sound_frequency=384000'.0,'sound_max_buff=65536'.0,'sound_output=exact'.0 |
|
31 December 2018, 15:12 | #7 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,506
|
I added mixing algorithm (volume counter/3.58MHz) from tinymod but I can't get it to work (or I am missing something), there is high pitch whine in the background (if volume is less than max) and imho it also sounds too different. PWM volume will cause high pitch noise but I don't think it should be that obvious. Or does it need filter modifications? It is also possible "ReadFrac" logic conversion isn't correct.
Option in Sound GUI (Only added to make switching easier). It probably is good idea to disable interpolation, it is not bypassed. CPU load can be very noticeably higher.. Last edited by Toni Wilen; 31 December 2018 at 15:25. |
13 January 2019, 21:48 | #8 | |
Zone Friend
|
Quote:
|
|
13 January 2019, 21:54 | #9 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,506
|
3.58MHz "volume counter rate" to output rate resampling already uses sinc-like filtering internally. It probably isn't good idea to do filtering twice.
|
13 January 2019, 22:01 | #10 | |
Zone Friend
|
Quote:
If it's not available in the curent (non-libretro) version, is Sinc still the best option - or should I switch it to disabled ? Last edited by mcbpete; 13 January 2019 at 22:34. |
|
14 January 2019, 10:02 | #11 | |
Registered User
Join Date: Jul 2008
Location: Netherlands
Posts: 485
|
Quote:
Hi Toni, thanks for looking into this! I tried it and it indeed does sound quite different, it's almost as if there's some surround effect going on and/or some frequency bands are missing or something. Pretty difficult to pinpoint what's really off with it. Do you see any room to improve / find out where the issue may be? With regards to the 3.58Mhz output I have also been thinking about another possibility. Suppose on a breadboard it is possible to build the Amiga DAC + real analogue filter stage, would there be some sort of possibility to feed the 3.58Mhz signal right into that from WinUAE? I'm not too well versed in hardware, but from looking at some youtube examples of building simple DACs with filter and audio output, it seems doable (I think at least with some help of the people with more hardware building knowledge on this board). The end goal would be to have a simple list of components and a small build guide such that every user interested could build this Amiga audio output stage on a breadboard*, and together with the 3.58Mhz output option in WinUAE, experience 99.9% faithful Amiga audio through WinUAE. I would love to hear your opinion on this: could outputting the 3.58Mhz signal into an external (breadboard like) device belong to the potential possibilities? * We could even have things like a hardware switch on the breadboard for switching between A500 and A1200 filter stage and such.. |
|
14 January 2019, 12:50 | #12 |
Zone Friend
|
There's a developer in an audio forum I frequent (alas notoriously full of grumpy people!) who seems to know quite a bit about the subject (and made a VSTi that sounds (to my ears) very Amiga-ish in the filters):
Here's where he discusses the issue: https://www.kvraudio.com/forum/viewtopic.php?p=7281871 And here's his possible solution with code examples: https://www.kvraudio.com/forum/viewtopic.php?p=7282800 |
14 January 2019, 13:29 | #13 | |
Registered User
Join Date: Jul 2008
Location: Netherlands
Posts: 485
|
Quote:
Solution to what problem? |
|
14 January 2019, 13:35 | #14 |
Zone Friend
|
The 'Possible enhancements to Paula audio emulation' problem
|
14 January 2019, 15:04 | #15 | |
Registered User
Join Date: Jul 2008
Location: Netherlands
Posts: 485
|
I wouldn't call that a "problem" to be honest.
But in a broad sense every suggestion to improve audio emulation is welcome of course From reading the thread you mentioned, he (aciddose) seems to have more of an issue with OpenMPT code than with WinUAE? Also his comment about WinUAE is based on some stuff he saw in the past? Is he of the same opinion when using current WinUAE / codebase? (See quote below...) But in case he does see a specific part that could be improved in current WinUAE, it will definitely help if you get him to be much more specific what his issue is with the current WinUAE soundcode, and what part of his code should improve on it. At least that's my 2 cents.. Quote:
|
|
14 January 2019, 15:39 | #16 |
Zone Friend
|
Apologies, looks like my links don't go to the specific posts in that thread. The reason he mentions OpenModTracker is that apparently he says it uses the UAE code for the sound playback of Amiga Mods - whether it's true or not I can't say
When he flagged it I said the following - 'Toni seems like he's always striving to make WinUAE the best it can be so I totally would imagine he'd be interested in code that can make the emulation be improved ....' but whether aciddose is willing to share his knowledge or not is another story. |
14 January 2019, 15:54 | #17 | ||
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,506
|
Quote:
Quote:
About other sound updates: I only care about digital side where everything is logical enough. When it goes to "analog"/filter side: I require full code that is confirmed working and work as expected. |
||
14 January 2019, 17:10 | #18 |
Zone Friend
|
Ah sorry yeah, just seen that this rabbit hole was greatly explored on here already - http://eab.abime.net/showthread.php?t=71580
|
20 January 2019, 15:02 | #19 |
Zone Friend
|
So just to clarify: As it currently stands ( v4.1.0 - the build from http://www.winuae.net/download/ ) is the closest accuracy as to what you'd hear coming from a real Amiga achieved by setting Interpolation to 'Sinc' or 'disabled' ?
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Looking for the most accurate Paula audio emulation | craig64 | support.Other | 69 | 23 July 2023 19:36 |
Paula's audio range is 9 octaves | Foebane | Nostalgia & memories | 51 | 03 March 2018 14:00 |
Change Paula/CD Audio volume with a commodity | Leandro Jardim | request.UAE Wishlist | 19 | 18 August 2015 00:01 |
Paula audio in RTG modes | Mad-Matt | support.WinUAE | 8 | 13 May 2007 15:28 |
Amiga 4000 Paula Audio | CU_AMiGA | support.Hardware | 50 | 01 March 2007 21:26 |
|
|