VOGONS


First post, by canadacow

User metadata
Rank Member
Rank
Member

Hello all. I've posted an beta of an alpha version of the DosBox MT-32 emulator on my site. This isn't a sound test, rather, I want feedback regarding performance. How does it run on slower systems? On my Celeron 1333Mhz laptop, I only see about 10-20% CPU usage where I once saw 80-90% usage. Is this everyone else's experience? This won't be my last update of the weekend. I've taken the time to implement freeverb in the emulator (and it sounds really, really close to the MT-32's reverb!) and I'm working to tweak the settings now. When I get those fixed and everyone agrees the optimizations are good, I'll make a new post.

Reply 1 of 52, by damien

User metadata
Rank Newbie
Rank
Newbie

Seems pretty fast to me -- I'm on a celeron p4 2 ghz (I think 😀 )and I used to get big spikes to 100% of CPU with your previous versions, but on this version I didn't see the cpu jump past 25% after playing around with it for a bit.

Keep up the fantastic work! 😀

Reply 4 of 52, by HunterZ

User metadata
Rank l33t++
Rank
l33t++

Hmm... Just downloaded and tried it with the following games:
Indy: Fate of Atlantis
Monkey Island 1 (the old EGA version I think)
Populous

Each game caused DosBox to close itself when I tried running it in MT-32 mode. I tried running Populous in Adlib mode and it ran but with no sound (seems it doesn't know what to do with signals on ports 0x388 and 389 - the Adlib ports), so it must be a problem with the MT-32 part of things?

Here is an example log:
0: MOUSE:Unhandled videomode FF on reset
0: Partial reserve: 1=3 2=10 3=6 4=4 5=3 6=0 7=0 8=0 9=6
0: MIDI:Opened device:mt32
0: Reading from undefined port 0378
0: Using joystick Microsoft PC-joystick driver with 2 axes and 10 buttons
459420: MISC:Execute mount.COM 0
996131: MISC:Execute atlantis.EXE 0
1201692: MISC:Execute C:\ATLANTIS\roland.ims 3
5223337: Partial reserve: 1=4 2=4 3=4 4=4 5=4 6=4 7=4 8=4 9=0

The dosbox.exe I'm using has a last modified stamp of 9/28/2003 1:56AM.

Reply 6 of 52, by ih8registrations

User metadata
Rank Oldbie
Rank
Oldbie

So what was the cause of the slowdown in your code?
I notice the dropped samples you had referred to before.
Canadacow didn't include the mt32_pcm.rom this time hunterz.

Canadacow, I know you said why you didn't want to release your code, but you need to reconsider what license you're going to put this under if you keep releasing binary only and having pulled the old source. Of course, that means you can't release a binary only dosbox version since it's under the GPL. Some people might not like me suggesting you take away their candy as it were, but I'd prefer you not violate the GPL.

Reply 7 of 52, by canadacow

User metadata
Rank Member
Rank
Member

Its not GPL'ed (well, the DosBox code is, mine isn't). My code is strictly under a Public Domain license. Since I have a wife and full time job, I don't have too much time to work on this project. If I had more time I'd be more thorough in posting both binaries and source. Moreover, this latest post was strictly made to get feedback regarding my optimizations. You're right though, I shouldn't violate the GPL, and I'll continue to try to post both the source code and binary when I get time.

As for the dropped partials, they aren't nearly as bad as they were when I wrote the original post. The problem is still in trying to figure out exactly how the MT-32 deals with partials when it runs out of them.

As for the slowdown... it was the order in how I was doing things. Here's some pseudo-code to demonstrate:

Old version:
CallbackRoutine {
for each sample requested
call getsample routine (this routine would then return a single stereo sample from all the notes currently playing)
next
}

New version:
CallbackRoutine {
for each partial playing
call getsample of partial class and generate the samples needed from that particular partial
next
}

Because I'm not calling the same getsample routine 32 times over and then reloading the pointers to all the notes and partials a gazillion times, I was able to save a ton in CPU speed. I'll be posting the source very soon.

Last edited by canadacow on 2003-09-28, 21:12. Edited 1 time in total.

Reply 8 of 52, by Kaminari

User metadata
Rank Oldbie
Rank
Oldbie

I tested a few Sierra games, including Codename Iceman and Space Quest 3 on my P3 667 MHz. DOSBox eats nearly 100% of the CPU time and the MT-32 emulation sounds a bit choppy, but the games seem to behave and react correctly without being slowed down 😀

At least I can now clearly recognize the music, which I just couldn't with the stand-alone driver because it was way too choppy. The music sometimes even play without any hitch when there's not too much activity on the screen. In many cases, the emulated MT-32 sounds much better than the AdLib tunes. This is impressive. Now I can feel a huge potential here!

Great work CC.

Reply 9 of 52, by ih8registrations

User metadata
Rank Oldbie
Rank
Oldbie

Well that's a news flash. You'll want to remove the GPL copyright notice as the headers of your code. Ignoring the GPL headers for the moment, as far as all the dosbox implementations go, you've inadvertantly GPL'd them. Binary only(and in general seperate license) code is allowed through dynamic linking. By being seperate modules until runtime, the code isn't considered derivative of each other, thereby retaining whatever license that they started with. By being an include file statically linked as a part of dosbox, the dosbox mt32 code aquired the GPL license. Your lawyer friend could disect this for practice:) As for being a duel license of GPL and PD, I'd imagine the only implication would be is when there's contributions made to a GPL version; if those contributions are used and built upon, whatever results have to be released back to the GPL code base(and can't be used in the PD code unless the author releases to PD as well).

ps. I ran accross the description of how the mt-32 handles dropping partials serveral times when I was manual hunting, I'll have to find it again.

Last edited by ih8registrations on 2003-09-29, 00:03. Edited 1 time in total.

Reply 10 of 52, by HunterZ

User metadata
Rank l33t++
Rank
l33t++
canadacow wrote:

The rom is not included with the install. If you have the MT32_PCM.ROM file, copy it to the directory where you unziped the new dosbox.

Doh, I should have noticed. I was testing you - yeah, that's the ticket 😮

Anyways, got it working now, but between DosBox and the MT-32 code it brings my lowly PIII-550 to its knees (no surprise). After adjusting the frameskip and cycles settings quite a bit, I was able to get 90% skip-free MT-32 music in Populus and Space Quest 4. Unfortunately the games were too slow to be playable, but again this was to be expected so no big deal. The instruments sounded like they were out of tune with each other (something I also noticed in the Windows driver version when I was playing with it a couple instruments at a time in Cakewalk Sonar 2). Also, while trying to test it with Protostar, something went wrong and killed all non-DirectSound Windows sound until I ran Winamp using WaveOut mode. When I did that, the song came out slow and scratchy until I stopped and started it a couple of times. For reference my sound card is an Audigy 2 and I am using the latest Creative drivers.

Good work on the optimizations though! Even with all the resources DosBox needs, the music itself only stuttered every couple of seconds. I'm looking forward to a new Windows driver incorporating the changes and optimizations you're working on if/when you decide to do that. I don't use DosBox much because it has always and still runs too slow to be useful on my system, but I'm interested in trying an MT-32 emulator in conjunction with other programs like SCUMMVM and VDMSound, which let me run old games without as much demand on my CPU.

Reply 11 of 52, by Nicht Sehr Gut

User metadata
Rank l33t
Rank
l33t

Originally posted by ih8registrations By being seperate modules until runtime, the code isn't considered derivative of each other, thereby retaining whatever license that they started with. By being an include file statically linked as a part of dosbox, the dosbox mt32 code aquired the GPL license. Your lawyer friend could disect this for practice:) As for being a duel license of GPL and PD, I'd imagine the only implication would be is when there's contributions made to a GPL version; if those contributions are used and built upon, whatever results have to be released back to the GPL code base(and can't be used in the PD code unless the author releases to PD as well).

You know...

I sometimes wonder why programmers give up on their projects that hold much promise...then I read this...and all becomes clear.

Reply 12 of 52, by runderwo

User metadata
Rank Newbie
Rank
Newbie

You know...

I sometimes wonder why programmers give up on their projects that hold much promise...then I read this...and all becomes clear.

Why? Because they ignored the licenses of other software and found themselves in a quandary later on? I think it is perfectly reasonable to bring up such issues, esp. when canadacow may have been busy with other things and not made such considerations.

Reply 13 of 52, by Nicht Sehr Gut

User metadata
Rank l33t
Rank
l33t

Originally posted by runderwo Why? Because they ignored the licenses of other software and found themselves in a quandary later on?

No. You missed the point. It's because they almost have to hire a lawyer just to code a program without worrying that someone is going to crucify them because they forgot to follow sub-clause C of section B of some distribution agreement.

Reply 14 of 52, by Alkarion

User metadata
Rank Member
Rank
Member

I'm a bit confused concerning the way the MT-32 emulation in Dosbox works. Do I still have to use the Windows MT-32 driver or is my standard MIDI-driver ok? I thought with the MT-32 emulation being implemented in Dosbox I don't have to alter the MIDI-device. But without the MT-32 Windows-driver it sounds awful. Am I doing something wrong here?

Reply 15 of 52, by runderwo

User metadata
Rank Newbie
Rank
Newbie

No. You missed the point.

What was the point? Should copyright law go away? Should the Dosbox authors have chosen a license that protects their work less? How would you suggest one go about creating a derivative work of a GPL-licensed program, besides by complying with the terms of the GPL? I stand by my assertion that it is a valid complaint that the terms of the original license are not adhered to. It is canadacow's choice whether to comply with those terms or not. It is the Dosbox team's choice whether to pursue action against people who violate the terms. Hopefully nothing will ever come to that, but there is a lot to be said for covering one's ass.
As for the terms of the GPL, I don't know what the previous poster was saying (didn't make any sense to me) but the requirement of the license is quite clear; if you distribute a binary of a modified GPL work, you are also required to make the source *with your modifications included* available upon request. The source need not be distributed with the binary, but instructions on how to obtain it must be clearly enumerated.

Reply 16 of 52, by canadacow

User metadata
Rank Member
Rank
Member
runderwo wrote:

if you distribute a binary of a modified GPL work, you are also required to make the source *with your modifications included* available upon request. The source need not be distributed with the binary, but instructions on how to obtain it must be clearly enumerated.

And the source will be distributed, when I get time. Its a heck of a lot easier to distribute a binary than source code. With a binary, I just hit "compile", post the file, and then test it independantly on another machine. With the source however, I have to make sure it will compile under other configurations, and I have to provide instructions as to how to integrate it the larger program. That takes time I don't have. I'm not sure if everyone has caught on this yet, but I'm the only developer/QA/legal person on the project at the moment. I certainly have my plate full just making a DosBox distribution, never mind a driver, never mind making the effort to get the MT-32 samples garenteed in the Public Domain. Don't forget I'm doing this only during what free I do have. In short, I am complying with the GPL, just have patience.

Reply 17 of 52, by canadacow

User metadata
Rank Member
Rank
Member
Alkarion wrote:

I'm a bit confused concerning the way the MT-32 emulation in Dosbox works. Do I still have to use the Windows MT-32 driver or is my standard MIDI-driver ok? I thought with the MT-32 emulation being implemented in Dosbox I don't have to alter the MIDI-device. But without the MT-32 Windows-driver it sounds awful. Am I doing something wrong here?

No driver is needed with the DosBox distribution. The MT-32 emulation code is built into the binary.

Reply 18 of 52, by HunterZ

User metadata
Rank l33t++
Rank
l33t++

From what I understand of the GPL (which may be incorrect, as IANAL), you only have to make the source available if someone requests it. In other words, you can be lazy unless someone starts threatening legal action if you don't cough up the source.

Reply 19 of 52, by runderwo

User metadata
Rank Newbie
Rank
Newbie

From what I understand of the GPL (which may be incorrect, as IANAL), you only have to make the source available if someone requests it. In other words, you can be lazy unless someone starts threatening legal action if you don't cough up the source.

That is precisely correct, but your binary distribution must be accompanied with an advertisement for the source code as well if not accompanied by the actual source. (See 3b)

canadacow, nobody is trying to jump down your throat here, just trying to make you aware of stuff that you may not have had time to consider. I don't foresee the Dosbox people having a problem with it anytime soon, but when possible it is always a good idea to cover all the bases.