English Amiga Board

Go Back   English Amiga Board > Support > support.WinUAE

Thread Tools
Old 17 October 2018, 19:36   #1
Registered User
Join Date: Jul 2008
Location: Netherlands
Posts: 402
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

To get the "non interpolated at 3.5MHz" sound and these subtle ring modulation artifacts that come out of the cheap way Paula does volume
The main features/objectives were:
  1. Rendering audio at the Paula clock rate of 3.5Mhz and then downsampling to the PC host output rate
  2. Incorporate complete (?) volume behaviour
I've attached the code, which also can be found here: http://www.1337haxorz.de/drugs/tinymod.cpp

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?
Attached Files
File Type: txt tinymod.cpp.txt (20.2 KB, 36 views)
Dr.Venom is offline  
Old 17 October 2018, 22:28   #2
Registered User

Join Date: Sep 2017
Location: Kansas, USA
Posts: 63
The internet archive has that blog post archived: https://web.archive.org/web/20140924...ebby.org/?p=11

“But wait, shouldn’t that color the sound, ring modulation artifacts and such?” I thought. The answer is of course a resounding no (also all artifacts introduced by the PWM are outside the audible range) but that didn’t stop me from trying to emulate a Paula voice at the full 3.5MHz and then filtering it down to find out how it sounds.
Rotareneg is offline  
Old 18 October 2018, 11:18   #3
Registered User
Join Date: Jul 2008
Location: Netherlands
Posts: 402
Originally Posted by Rotareneg View Post
The internet archive has that blog post archived: https://web.archive.org/web/20140924...ebby.org/?p=11
Thanks, so apparently he changed his mind to the audible effects of the volume counter .

With regards to the sample rate, the Sameboy author changed the audio rate at which the libretro core generates audio to 384Khz, saying

“Just pushed a commit that redid the way the libretro port did audio. Audio is now sent to libretro at 384KHz, which is then resampled by RetroArch to whatever rate the user configured. This should greatly improve audio quality on the RetroArch port, which by this commit should sound even better than the standalone versions.”
The Gameboy generates audio at a high pulse rate (1Mhz or 2Mhz), which I guess is the reason a difference may be heard in sound quality. It may be somewhat similar to the Amiga case?

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..
Dr.Venom is offline  
Old 20 October 2018, 14:57   #4
Toni Wilen
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 43
Posts: 22,128
Remind me after next official version is out.
Toni Wilen is offline  
Old 21 October 2018, 11:18   #5
Registered User
Join Date: Jul 2008
Location: Netherlands
Posts: 402
Awesome, will do
Dr.Venom is offline  
Old 01 November 2018, 12:46   #6
Registered User
Join Date: Jul 2008
Location: Netherlands
Posts: 402
Originally Posted by alankila View Post
Amiga produces audio at 3.54 MHz sampling rate. This is because Paula, the sound chip, runs at this clock, and it's more or less directly hooked into the analog audio output plugs.

Now Amiga could not make use of much of this immense bandwidth. The way WinUAE and UADE are built mean that the higher sampling rate you use at PC, the better approximation of genuine Amiga sound you get.
Since the Soundblaster X AE-5 can do up to 384Khz (and given above quote which made me curious), I've been doing some tests whether a difference in sound quality can be distinguished when switching between 48Khz, 96Khz, 192Khz and 384Khz. For this both interpolation and filters are disabled.*

My personal conclusion:
  1. I cannot hear a noticable difference between 96Khz, 192Khz and 384Khz
  2. But interestingly I can hear a clear difference between using 48Khz versus 96Khz when interpolation and filters are disabled, the 96Khz (or higher) setting sounding just that tiny bit less noisy / with less aliasing than the 48Khz setting.

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.
Attached Files
File Type: zip WinUAE_soundtest_(GODS_knife_against_wall).zip (427.3 KB, 25 views)
Dr.Venom is offline  

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Paula's audio range is 9 octaves Foebane Nostalgia & memories 51 03 March 2018 15:00
Change Paula/CD Audio volume with a commodity Leandro Jardim request.UAE Wishlist 19 18 August 2015 01:01
Looking for the most accurate Paula audio emulation craig64 support.Other 12 03 November 2013 03:02
Paula audio in RTG modes Mad-Matt support.WinUAE 8 13 May 2007 16:28
Amiga 4000 Paula Audio CU_AMiGA support.Hardware 50 01 March 2007 22:26

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +2. The time now is 03:18.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.
Page generated in 0.06745 seconds with 14 queries