Minimig Discussion Forum

Discussing the Open Source FPGA Amiga Project
It is currently Tue Nov 21, 2017 4:22 am

All times are UTC




Post new topic Reply to topic  [ 121 posts ]  Go to page Previous  1, 2, 3, 4, 5 ... 13  Next
Author Message
 Post subject: Re: Minimig Sigma-Delta and the noise in Gods!
PostPosted: Tue Aug 21, 2012 5:48 pm 
Offline

Joined: Mon Dec 01, 2008 9:58 pm
Posts: 1568
Location: .de
MMrobinsonb5 wrote:
Oh yes - so it does! Yet in FSB120420 (the zipfile here: http://www.minimig.net/viewtopic.php?f=5&t=485 ) it's at 7Mhz (clk rather than clk28m) - I wonder why?


Oops, I missed that! Thanks!
Must be changed in the process of finding the DAC bug.
I will build another core with 28MHz and test Gods on it. If the problem is gone, the Core woll be released!

_________________
_____________________________
JMP $00000BED ; will guru-meditation until next morning


Top
 Profile  
 
 Post subject: Re: Minimig Sigma-Delta and the noise in Gods!
PostPosted: Tue Aug 21, 2012 5:54 pm 
Offline

Joined: Tue Dec 13, 2011 7:48 pm
Posts: 341
boing4000 wrote:
Oops, I missed that! Thanks!
Must be changed in the process of finding the DAC bug.
I will build another core with 28MHz and test Gods on it. If the problem is gone, the Core woll be released!


Unfortunately I don't think it's going to be that easy! I've tried three different sigma/delta converters now, some at 7MHz and all three at 28MHz, and the problem remains - it sounds different between the various versions, though. When I next get a chance to play with it I'll share the code - maybe someone else will see something I'm missing.

_________________
~ Amiga 4000/030 ~ Amiga 1200 030/50MHz ~ Turbo Chameleon 64 ~ Altera DE1 with Minimig core ~
Details of my projects: http://retroramblings.net


Top
 Profile  
 
 Post subject: Re: Minimig Sigma-Delta and the noise in Gods!
PostPosted: Thu Aug 23, 2012 10:00 pm 
Offline

Joined: Tue Dec 13, 2011 7:48 pm
Posts: 341
For anyone who's interested, there are three variants of the core available at:
http://retroramblings.net/minimig/

All three run the DAC at 28MHz, and all three artificially silence an audio channel when the sample repeat length is 0 or 1. The idea behind this is to test my theory that the standing tones are coming from certain samples leaving the audio channel "parked" with a DC offset; zeroing the parked channels eliminates this.

(The source changes for each core were restricted to audio.v, so that file alone is included in the zipfiles.)

The three DACs used are the version added by Tobiflex:
acculeft[12:1] <= (acculeft[12:1] + {acculeft[12],acculeft[12],~ldatasum[14],ldatasum[13:5]});
assign left = acculeft[12];

The 3rd order converter posted by Frenchshark some time ago. (This one still has standing tones - probably because I haven't yet got any filtering working.)

And finally, since I don't fully understand Tobiflex's DAC, I've tried with the simplest possible sigma-delta DAC:
{lout,acculeft[12:0]} <= acculeft[12:0] + {~ldatasum[14],ldatasum[13:5],3'b000}; // Last three bits zeroed so DAC has the same resolution as the stock DAC.
assign left = lout;

(This one is louder than the others; I think the parts of Tobiflex's DAC I don't understand are for reducing the amplitude.)

_________________
~ Amiga 4000/030 ~ Amiga 1200 030/50MHz ~ Turbo Chameleon 64 ~ Altera DE1 with Minimig core ~
Details of my projects: http://retroramblings.net


Top
 Profile  
 
 Post subject: Re: Minimig Sigma-Delta and the noise in Gods!
PostPosted: Sun Aug 26, 2012 2:10 pm 
Offline

Joined: Thu Jun 18, 2009 9:54 am
Posts: 349
<Invalid post: be carefull next time where you put things...>


Last edited by gaula92 on Mon Aug 27, 2012 2:07 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Minimig Sigma-Delta and the noise in Gods!
PostPosted: Sun Aug 26, 2012 4:30 pm 
Offline

Joined: Tue Dec 13, 2011 7:48 pm
Posts: 341
gaula92 wrote:
I've tried all three versions and yes, they still produce that high-pitch sound in GODS :(
@boing4000: since you're german, maybe you could share it on the a1k.org board? There's people there who could bring some light to this mistery.


Thanks for testing - I'm surprised actually. Is there any audible difference between the stock (or rather FSB120420) version and orig28Mhz+silence? Just so we know we're chasing the same artifact, does the noise occur on every jump or just occasionally? Is it immediately after the jump noise or the "landing" noise?

Any chance of getting a recording of it?

_________________
~ Amiga 4000/030 ~ Amiga 1200 030/50MHz ~ Turbo Chameleon 64 ~ Altera DE1 with Minimig core ~
Details of my projects: http://retroramblings.net


Top
 Profile  
 
 Post subject: Re: Minimig Sigma-Delta and the noise in Gods!
PostPosted: Mon Aug 27, 2012 12:58 pm 
Offline

Joined: Thu Jun 18, 2009 9:54 am
Posts: 349
In the first place, I'm sorry for not testing them properly yesterday: I think I decompressed Orig28MHz+Silence in the wrong filesystem and then overwrote it with the other files...
I've been all morning trying to record something from Minimig to my Lubuntu computer using arecord, tweaking alsa config files, etc... with no luck. I'm sorry, I tried my best, but this ALSA stuff is sluggish.

So I will try to be AS PRECISSE AS POSSIBLE with my report:

-FSB120420 version: The high pitch sound is activated when jumping. Normally, it sounds in mid-air until you land, BUT if you land too fast (like when you jump under a low ceiling) the high pitch keeps sounding. Then, if you wait for a while, the sound slowly vanishes again but does NOT dissapear completely. Yes, I KNOW it all sounds like I'm mad or something, but I swear this is how it happens.

-Orig28MHz+Silence version: No artifacts can be hear when jumping. AT ALL. Just perfect. But I understand this is a hack to test the origin of the problem. If it is, then you found it :D

- 3rdOrder28MhzNoFilter version: It has some artifacts in each sample but not the same high-pitch sound. Sound seems to be more dirty in general.

-Simple28Mhz+Silence version: No artifacts either! Sound seems to be more crude, raw, unfiltered.

Every version has another problem I also commented here, and I don't know if it's related or not: in Gauntlet III, if you let intro music to play to the end, you'll heard some strange blips and blops when volume has totally faded: in other words, volume fades totally and then blips'n blops appear.


Top
 Profile  
 
 Post subject: Re: Minimig Sigma-Delta and the noise in Gods!
PostPosted: Mon Aug 27, 2012 2:07 pm 
Offline

Joined: Thu Jun 18, 2009 9:54 am
Posts: 349
I have also got GODS to work on the Chameleon 64 fampiga (latest version by yourself :P)

There are no artifacts there because you inherited bing4000's temporal solution, wich caused a constant high-pith noise in every game and app, but "masked" the GODS audio problems. That temporal solution was disabled in FSB120420.
This fampiga Chameleon version also does play Gauntlet III music ending without any blips and blops at the ending.

Just in case, to make GODS run, I use:
-Plain 68000
-ECS
-Kickstart 1.3 ROM (256KB)
-2MB Chip, 0 other

And here's the release I use, it's a very nice no-cracktro version I got at EAB:


Attachments:
gods_chameleon.zip [1.05 MiB]
Downloaded 105 times
Top
 Profile  
 
 Post subject: Re: Minimig Sigma-Delta and the noise in Gods!
PostPosted: Mon Aug 27, 2012 6:00 pm 
Offline

Joined: Tue Dec 13, 2011 7:48 pm
Posts: 341
Hi :)

gaula92 wrote:
In the first place, I'm sorry for not testing them properly yesterday: I think I decompressed Orig28MHz+Silence in the wrong filesystem and then overwrote it with the other files...

Easily done - it's harder still keeping the various version straight when every few minutes you're tweaking something and rebuilding the core! :)

Quote:
I've been all morning trying to record something from Minimig to my Lubuntu computer using arecord, tweaking alsa config files, etc... with no luck. I'm sorry, I tried my best, but this ALSA stuff is sluggish.

OK no worries. For the record I use Audacity to record, but I end up using the command-line alsamixer to set the recording levels - the GUIs do a pretty terrible job of soundcard control on Linux.

Quote:
Yes, I KNOW it all sounds like I'm mad or something, but I swear this is how it happens.

It makes a certain sort of sense actually - the key is how the sound channels are allocated, and that depends on how closely together two sound effects are played.

Quote:
-Orig28MHz+Silence version: No artifacts can be hear when jumping. AT ALL. Just perfect. But I understand this is a hack to test the origin of the problem. If it is, then you found it :D

OK that's great news!

So in the interests of fully documenting this, here's the problem:
Some of the sound samples in Gods have a DC offset. When sound samples are played on the Amiga, the usual approach is to set the sound position and sample length, give the hardware a moment to pick up those values, then set the sample length to minimum. This results in the sound playing just once, then the first two samples of the sound being played repeatedly until the sound channel's needed again. If, however, the first two samples in the sound effect aren't zeros, this can interact with the sigma delta converter.

The sigma delta converter has only two output levels avaiable to it. The minimum and maximum sample levels are easy to deal with:
Attachment:
MinMax.jpg
MinMax.jpg [ 5.51 KiB | Viewed 897 times ]


The zero point, half way between minimum and maximum is also fairly easy:
Attachment:
Med.jpg
Med.jpg [ 24.99 KiB | Viewed 897 times ]


This very-high-frequency noise is filtered out by capacitors in the output circuit, so you don't hear it.

The problem comes with values close to either the centre point or the extremities. As the sample level rises from the centre, the sigma delta converter throws in extra high pulses, so the signal averages out to the correct level - which works fairly well for a broad-spectrum sound, since the errors remain high frequency and get filtered out. A DC offset is a problem, though:
When the source signal is constant, the sigma-delta pulses form a regular pattern:
Attachment:
DCOffset.jpg
DCOffset.jpg [ 24.21 KiB | Viewed 897 times ]

When the target value is very close to either the centre, or the extremities, that pattern's frequency can descend into the audible spectrum, which is what's happening with Gods.

What my hack does is set the audio channel's output to zero any time the sample repeat length is set to minimum, to eliminate the DC offset.

Quote:
- 3rdOrder28MhzNoFilter version: It has some artifacts in each sample but not the same high-pitch sound. Sound seems to be more dirty in general.

Yes, that was my impression - I will try and get a box filter working on this one at some point. My first attempt didn't fit in the Minimig so I'm thinking I'm going to be better off with four much simpler filters, one on each channel, than trying to make a single filter that's too clever!

Quote:
-Simple28Mhz+Silence version: No artifacts either! Sound seems to be more crude, raw, unfiltered.

Yup, it's also louder. That one's the simplest possible Sigma Delta converter, which like i said, I tried simply because I understand how it works.

Quote:
Every version has another problem I also commented here, and I don't know if it's related or not: in Gauntlet III, if you let intro music to play to the end, you'll heard some strange blips and blops when volume has totally faded: in other words, volume fades totally and then blips'n blops appear.

OK I'll look into that soon!

_________________
~ Amiga 4000/030 ~ Amiga 1200 030/50MHz ~ Turbo Chameleon 64 ~ Altera DE1 with Minimig core ~
Details of my projects: http://retroramblings.net


Top
 Profile  
 
 Post subject: Re: Minimig Sigma-Delta and the noise in Gods!
PostPosted: Mon Aug 27, 2012 7:33 pm 
Offline

Joined: Tue Dec 13, 2011 7:48 pm
Posts: 341
gaula92 wrote:
And here's the release I use, it's a very nice no-cracktro version I got at EAB:


Awesome - thanks for that - it works on the latest DE1 builds too, as long as you use Kick 1.3 :)

_________________
~ Amiga 4000/030 ~ Amiga 1200 030/50MHz ~ Turbo Chameleon 64 ~ Altera DE1 with Minimig core ~
Details of my projects: http://retroramblings.net


Top
 Profile  
 
 Post subject: Re: Minimig Sigma-Delta and the noise in Gods!
PostPosted: Tue Aug 28, 2012 10:59 am 
Offline

Joined: Thu Jun 18, 2009 9:54 am
Posts: 349
If I understand it correctly then, it's not a hack but a fix: there's no way to get around the problem without setting the audio channel's output to zero any time the sample repeat length is set to minimum, right? Are you saying the box filter would eliminate this without the "hack", being a correct solution instead?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 121 posts ]  Go to page Previous  1, 2, 3, 4, 5 ... 13  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Translated by Xaphos © 2007, 2008, 2009 phpBB.fr