Mame - Adding Discrete Sound


slaanesh

Certified Guru
Joined
Nov 9, 2005
Messages
1,995
Age
55
Location
Melbourne, Australia
Website
www.slaanesh.net
What's discrete sound? Basically it's hardwired sound - not a sound chip as such - a bunch of electronic bits generating the noise and effects. Generally it requires a dedicated cluster of hardware for each sound effect, so it wasn't really very efficient and most likely expensive for the game manufacturer.

MAME often uses sampled sounds to emulate these discrete sound effects. I've always found this as "cheating" for some reason. Everything else about MAME games is generated from the ROM. The samples, whilst sounding the same as the original (based on some dim memory) are not actually as accurate as you may remember.

Emulation of discrete sound is only starting to become more commonly used in the last few years. Why was this?

So, I've added discrete sound to MAME for the GP2X and GP32.

An now I know why it's only been added lately - it's slow. Well it's a complicated task emulating the discrete sound components.

A good, classic example is Asteroids. On the GP2X and GP32 it runs at fullspeed at around 133Mhz using samples for sound.
Change over to discrete sound system and now it barely does 5FPS. Not good!

Overclock the GP2X to 250Mhz with RAM settings tweaked, not much difference. It's still now really playable.

So I added the Atari classic Fire Truck. Better results, but this required some changes to the CPU to get it to run.

It looks like there's a fair amount of variance between discrete sound games.
I will add a few more and see if any of these are worth worrying about on the GP2X.

Anyway, bottom line is that it looks like it's going to be a good reason to have MAME on Pandora!

Anyway, if you want to see discrete sound in action, for now check it out on a PC. Good examples are Donkey Kong, Galaga and of course Asteroids.
 
Added discrete sound for Canyon Bomber. My favourite old Atari B&W game.

It's also slow! Oh the humanity!

The base game without sound runs at full speed on my GP32 at like 66Mhz and yet is half speed at 166Mhz :-/
It's looking like 250Mhz or so is required. But it does have sound! The whir of the engine, the whistle of the bombs and the roar of the explosions.

I've had a look through some of the discrete code; there are loads of divides and the whole thing looks pretty CPU intensive. Looks like this can be optimized a bit, I'll give it a try. Not expecting much though.

May be okay on the GP2X, so I'll give that a try too.
 
Bloody hell!

I ported the updated discrete sound code to the GP2X. Tried Canyon Bomber... It's still slow. Overclocked my GP2X to its max (250Mhz + RAM timings) and it's STILL slow.

Ran the profiler - sound is taking up 90% of the CPU. :blink:

I'm really disappointed. Looks like the code will need some mega-optimizing. Or this is for Pandora only.

Anyone who knows anything about the discrete sound code in MAME that can offer some advice would be appreciated.
 
Franxis said:
I have just returned from the last part of my holidays. Awesome work Slaanesh!!!. :D
Good to see you post again Franxis. Hope you had a nice time. Will you still be optimising and improving your fantastic mame for GP2X?
 
Last edited by a moderator:
I remember when this happened to the main MAME project on the PC, and games like asteroids suddenly went through the roof for system requirements.

If I might make a request, it would be that there is an option to disable discrete sound emulation in favour of samples. I really don't like the idea of having to run my '2x at 250mhz continuously - imagine what that will do to battery life. Even for Pandora, I think I'd rather have more games available under emulation than having to sacrifice which games can be played simply because sound samples are given a higher priority than playability - but that depends on how many games need discrete sounds, and whether or not any modern hardware uses it...

I never found discrete sound to be any better than a good sample set anyway - but of course, others may be better able to tell the difference.
 
I wouldn't add discrete sound for any games that doesn't make it playable afterwards.
Asteroids on the GP2X will remain with samples, no worries there.

Discrete sound does sound better than samples to my ears - and it's also the knowledge that the sounds are 100% faithful to the original which gives me satisfaction.

There are also many older games which only had discrete sound and no sample support, so it's the only way that you are going to get any sound of the system at all.

Nice to see you are back Franxis, and thanks for you comments Dunny.
 
Back
Top