Forums

Sega Master System / Mark III / Game Gear
SG-1000 / SC-3000 / SF-7000 / OMV
Home - Forums - Games - Scans - Maps - Cheats - Credits
Music - Videos - Development - Hacks - Translations - Homebrew

View topic - New VGM plugin SLOW on my p133.

Reply to topic
Author Message
Martin Skog
  • Guest
Reply with quote
New VGM plugin SLOW on my p133.
Post Posted: Mon Nov 05, 2001 11:16 am
The latest VGM plugin is much slower on my p133. The last one works fine, but with the new one the songs stops and then continues after a second all the time. Why?
 
  • Joined: 12 Jul 1999
  • Posts: 891
Reply with quote
Post Posted: Mon Nov 05, 2001 11:27 am
Quote
> The latest VGM plugin is much slower on my p133. The last one works fine, but with the new one the songs stops and then continues after a second all the time. Why?

Try turning off the EQ.. it reduces CPU usage, but it's still a fair whack more intensive than the last one...

~unfnknblvbl (has a P133 as well)
  View user's profile Send private message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14740
  • Location: London
Reply with quote
What it could be...
Post Posted: Mon Nov 05, 2001 12:41 pm
Quote
> The latest VGM plugin is much slower on my p133. The last one works fine, but with the new one the songs stops and then continues after a second all the time. Why?

If the VGM was ripped using Dega then, even if it has no FM music in it, the FM emulation will be run. Meka seems to disable FM (by setting its speed to 0) if it's not used which is better. Here's a bit of the updated readme I forgot to include:

Benchmark
=========

If either the FM or PSG clock rate is non-zero, that chip will be emulated, even if it is not used.

Files used: WB3 mouse-man music for FM, Green Hill for PSG. Unknown CPU speed :) some kind of PIII.

File type Typical CPU usage

FM only 9.6-10.8%
FM with silent PSG 13.1-14.2%
PSG only 2.8- 3.5%
PSG with silent FM 11.4-12.5%

So obviously it's better not to emulate an unused chip... it's OK to have data in the file for an unused chip, it'll be ignored if the chip speed is zero.

-------------------------------------------------------

As an update to that, the CPU is actually a mobile PIII 500 and should have been running at the full 500MHz at the time. The old plugin used about 9% CPU on my K6-2 400 @ 450MHz, so I think this one is faster.

You can manually tweak a VGM file to not run the FM engine by setting bytes 0x10 to 0x13 to zero - there should be something like 94 9E 36 00 94 9E 36 00 in the file, change the second one to zero. VGMTool will do this when I am able to update it but that might not be as soon as I thought.

Maxim
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14740
  • Location: London
Reply with quote
EQ
Post Posted: Mon Nov 05, 2001 1:13 pm
Quote
> Try turning off the EQ.. it reduces CPU usage, but it's still a fair whack more intensive than the last one...

I officially advise you not to use the EQ with my plugin. Apart from eating up a lot of CPU, presumably because Winamp increases the FFT precision to reduce the distortion of the square waves (although it seems to be less of a problem than it was, I don't know if it's Winamp or the plugin because both are updated), *takes a breath* it also distorts the sound quite badly, again because square waves do not go through Fourier transforms at all well. Try this:

- Turn on the EQ, and click where it says "0 dB" on the default skin to flatten the EQ. Winamp is intelligent enough to not do any processing when it's like that. Listen to a VGM for a few seconds.
- Now move one of the sliders a tiny bit and listen again (remember, if you have a 2s buffer it takes 2s for the change to be heard). The sound is all muffled... if you look at a WAV dump you can see the waveshape is changed a lot.

Maxim
  View user's profile Send private message Visit poster's website
  • Joined: 09 Sep 2001
  • Posts: 236
  • Location: Umeå, Sweden
Reply with quote
Post Posted: Mon Nov 05, 2001 6:21 pm
Hmmm, does a PSG only VGM player need to be so CPU intensive? I was thinking about having my Amiga 600 playing VGM's, and it has a 68000@7.14mhz :P it can play .sid files with some old player which probably isn't 100% accurate but still, and my old 68020@28Mhz could emulate the master system decently, with sound
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14740
  • Location: London
Reply with quote
Player speed
Post Posted: Tue Nov 06, 2001 2:38 pm
Quote
> Hmmm, does a PSG only VGM player need to be so CPU intensive?

I consider a few percent to be quite fast, considering it's running a fair-sized chunk of code 44100 times a second plus reading, decompressing and interpreting a file. Can any other emu authors give an estimation of how much CPU their sound emulators take, for comparison?

Quote
> I was thinking about having my Amiga 600 playing VGM's, and it has a 68000@7.14mhz :P it can play .sid files with some old player which probably isn't 100% accurate but still

The Amiga has certain features which would make it easier... basically I think you can give its sound chip a sample waveform and it will play it at whatever speed you like, so the hardware would do most of the work. Not that I'm offering to make a VGM player for it...

Quote
> and my old 68020@28Mhz could emulate the master system decently, with sound

Comparing MHz isn't really valid. The PC with its 8086 legacy is quite wasteful of MHz - other CPUs can be as fast at lower clocks. Even within the 80x86 architecture this is true - lower-clocked Athlons outperform higher-clocked Pentiums. My 486 at 80MHz (I think it was) could only play Massage with a frameskip of 3 or 4, for comparison. Sound is much less intensive than graphics emulation so of course the sound was 100% there (if crappy quality with cheesy noise).

Also, I'm not an expert programmer. This new plugin is my first project in C, so there's bound to be stuff in there I'll look at again in a year's time and think "OMG this is badly written", as is always the way. If there's anyone out there who can make a better plugin I urge them to do so, I'd love to listen to it.

Maxim
  View user's profile Send private message Visit poster's website
  • Joined: 09 Sep 2001
  • Posts: 236
  • Location: Umeå, Sweden
Reply with quote
Re: Player speed
Post Posted: Tue Nov 06, 2001 11:25 pm
Quote
> > Hmmm, does a PSG only VGM player need to be so CPU intensive?

> I consider a few percent to be quite fast, considering it's running a fair-sized chunk of code 44100 times a second plus reading, decompressing and interpreting a file. Can any other emu authors give an estimation of how much CPU their sound emulators take, for comparison?

> > I was thinking about having my Amiga 600 playing VGM's, and it has a 68000@7.14mhz :P it can play .sid files with some old player which probably isn't 100% accurate but still

> The Amiga has certain features which would make it easier... basically I think you can give its sound chip a sample waveform and it will play it at whatever speed you like, so the hardware would do most of the work.

that sounds good, I'm actually gonna look into it, but since I have never programmed C/C++ in my entire life, only loads and loads of basic =) I don't think I'll suceed.

Quote
> > and my old 68020@28Mhz could emulate the master system decently, with sound

> Comparing MHz isn't really valid. The PC with its 8086 legacy is quite wasteful of MHz - other CPUs can be as fast at lower clocks. Even within the 80x86 architecture this is true - lower-clocked Athlons outperform higher-clocked Pentiums. My 486 at 80MHz (I think it was) could only play Massage with a frameskip of 3 or 4, for comparison. Sound is much less intensive than graphics emulation so of course the sound was 100% there (if crappy quality with cheesy noise).

Yes, I know comparing MHz between stupid (x86) and excellent (m68k) processors :) isn't valid. But people do it all the time anyway :/

Quote
> Also, I'm not an expert programmer. This new plugin is my first project in C, so there's bound to be stuff in there I'll look at again in a year's time and think "OMG this is badly written", as is always the way. If there's anyone out there who can make a better plugin I urge them to do so, I'd love to listen to it.

I never said your plugin was bad written, I really do love your work :)) and for a PC program I think fast :) I haven't seen any winamp plugin using less CPU. I actually think it's winamp / windows that is bad written :) (I know for sure about windows
and winamp doesn't have the fastest MP3 decoder.)

/David Eriksson
  View user's profile Send private message Visit poster's website
Reply to topic



Back to the top of this page

Back to SMS Power!