dosbox-staging icon indicating copy to clipboard operation
dosbox-staging copied to clipboard

Dual Module Player is silent when using Sound Blaster 16 mode

Open madbrain76 opened this issue 1 year ago • 14 comments

Are you using the latest Dosbox-Staging Version?

  • [X] I have checked releases and am using the latest release.

Different version than latest?

No response

What Operating System are you using?

Windows 10

If Other OS, please describe

No response

Relevant hardware info

AMD 5950X, 64GB RAM, GTX 3060Ti GPU, triple monitors ( 2 x 4K, 1x HD)

Have you checked that no other similar issue already exists?

  • [X] I have searched and not found similar issues.

A clear and concise description of what the bug is.

Dual Module Player produces no sound when configured for Sound Blaster 16 mode.

Steps to reproduce the behaviour.

Explain how to reproduce

  1. Download DMP 4.0 from http://www.tucows.apollo.lv/ftp/mirror/x2ftp/msdos/programming/mxutil/dmp400.zip 2.Download patches from http://www.tucows.apollo.lv/ftp/mirror/x2ftp/msdos/programming/mxutil/dmpdr401.zip 3.Run DSETUP .
  2. Select SB16 as the soundcard. Other options don't really matter, result is always the same.
  3. Play a MOD file with DMP.EXE <file.mod>
  4. Observe the silence
  5. Repeat step 3with Sound Blaster Pro or original Sound Blaster
  6. Observe that there is sound in both cases 9

Download URL of affected game or software

No response

Your configuration

Default except for LCTRL+LALT+SHIFT set to MIDI recording.

Provide a Log

Not sure how/where to get the log file other than the console.

Code of Conduct & Contributing Guidelines

  • [X] Yes, I agree.

madbrain76 avatar Jun 04 '24 07:06 madbrain76

Huh, I could swear I got this to work. But maybe I confused it with another one; I tried all DOS MOD players in existence at some point 😅

EDIT: Ah, okay, so it works with the SB Pro. Maybe I used that.

johnnovak avatar Jun 04 '24 08:06 johnnovak

Yeah, it sounds like some SB16 emulation problem, not quite sure what's going on there. The reason I wanted to try DMP was to get the output of a MOD file to a WAV, to get better audio for the demo I posted at https://www.youtube.com/watch?v=ZetuVi2a26Q (I had nothing to do with that one except getting it out of my archives and posting it). Seems like the built-in MOD player for that demo may be using 8-bit audio, or perhaps 22 kHz sampling rate.

Turns out the DOS version of DMP doesn't support output to file. I added that in the OS/2 version. But that can't run in DOSbox.

madbrain76 avatar Jun 04 '24 09:06 madbrain76

If you want a better quality rendering of a MOD file, I recommend CapaMod. It's one of the more accurate DOS MOD players and it sounds a lot better than any software mixing on Sound Blasters. Just set gus = on in the config.

https://demozoo.org/productions/124175/

The other really high-quality software mixing based player I found is Multi Module Player. It requires 150,000 cycles or more for full oversampling and lowpass filter emulation, but with these options it sounds really good:

https://archive.org/details/mmp5325_zip

So yeah, to get GUS-quality software mixing results, you needed a Pentium MMX 😄

johnnovak avatar Jun 04 '24 11:06 johnnovak

@johnnovak actually, I was looking for a module player that would render directly to a PCM file, such as a WAV file,. It doesn't need to be DOS-based - it can be any platform. This would bypass any issues of CPU cycles, since it doesn't need to be real-time. It also bypasses the sound card and its emulation. I implemented this as a "file output" sound driver in DMP OS/2. I was misremembering about this feature also existing in the DOS version of DMP - it did not. I can't imagine it was such a novel idea that nobody else implemented that feature.

Edit: looks like XMPlay supports this, as well as Schism Tracker. ChatGPT incorrectly lists Audacity as supporting MOD files. Maybe with a plug-in.

madbrain76 avatar Jun 04 '24 22:06 madbrain76

@johnnovak actually, I was looking for a module player that would render directly to a PCM file, such as a WAV file,. It doesn't need to be DOS-based - it can be any platform. This would bypass any issues of CPU cycles, since it doesn't need to be real-time. It also bypasses the sound card and its emulation. I implemented this as a "file output" sound driver in DMP OS/2. I was misremembering about this feature also existing in the DOS version of DMP - it did not. I can't imagine it was such a novel idea that nobody else implemented that feature.

Edit: looks like XMPlay supports this, as well as Schism Tracker. ChatGPT incorrectly lists Audacity as supporting MOD files. Maybe with a plug-in.

Depends on what your goals are. You can use the WAV writer of DOSBox to write WAV files. CPU cycles is not an issue with the GUS.

But, if you're after the most accurate playback, you only really have these options:

  • XM files — Only use Fast Tracker II. XMPlay might be close, or even perfect, but I wouldn't bother. FT II is the real deal. There is a modern conversion of FT II that runs on Windows, the original authors shared the code with the author, so it's 100% authentic and accurate. You can get it from here: https://16-bits.org/pt2.php

  • MOD files — Well, CapaMod and Multi Module Player are the most accurate for 4-chanel Amiga MOD files, but they are not perfect. If you want perfection, there's only one player in town (pun intended): ProTracker on the Amiga, or its authentic recreation from asm sources by the same guy who created the FT II remake. Get it from here: https://16-bits.org/pt2.php

  • S3M files – Only use Scream Tracker under DOS. Everything else is inaccurate to varying degrees.

I'm very serious about DOS mod players being more or less wrong when playing back Amiga MOD tunes. I spent about a month testing all of them, and I'm very familiar with hundreds of Amiga MODs. They are simply all wrong to some degree. Best way to play Amiga MODs is to use ProTracker, that's the only way.

It's also important to note that while XMPlay is quite accurate for XM files, the MOD playback of Amiga MOD files is only so-so (but it's undoubtedly one of the better attempts). Same goes for VLC and all other modern attempts; 99% of them are inaccurate (including my own). If the author doesn't say the playroutine is from the ProTracker remake, just skip it 😎

johnnovak avatar Jun 04 '24 22:06 johnnovak

Update: the ProTracker clone also has a WAV writer, and I think the FastTracker II clone as well.

Check out the guy's repo, he seems to have a bunch of separate projects for the PT and FT2 playroutines in C: https://github.com/8bitbubsy

johnnovak avatar Jun 04 '24 23:06 johnnovak

@johnnovak I just tried Protracker and generated a WAV file from it. Very interestingly, PowerDirector was unable to automatically "sync by audio" with the video I made from DOSBox staging recording. I looked at it very closely, and aligned the start of the waveforms by hand. But I found out things were getting out of sync very rapidly. The wave form from the demo recording actually runs a little faster than the one from Protracker. That just won't do since there are 4 graphical bars showing the volume, and they would get out of sync with the music. I'll try one of the other options and see if any of them can be synced.

madbrain76 avatar Jun 04 '24 23:06 madbrain76

@johnnovak I just tried Protracker and generated a WAV file from it. Very interestingly, PowerDirector was unable to automatically "sync by audio" with the video I made from DOSBox staging recording. I looked at it very closely, and aligned the start of the waveforms by hand. But I found out things were getting out of sync very rapidly. The wave form from the demo recording actually runs a little faster than the one from Protracker. That just won't do since there are 4 graphical bars showing the volume, and they would get out of sync with the music. I'll try one of the other options and see if any of them can be synced.

This is not surprising as the timing of various MOD players can be off compared to the "gold standard" ProTracker replay routine. If anything, this is expected.

johnnovak avatar Jun 04 '24 23:06 johnnovak

@johnnovak Yes. But for the pupose of this demo, I need to find one that matches the tempo. Not quite sure if changing the sampling rate affects the result slightly. Just tried XMPlayer and it has the opposite problem - runs faster. Also, very strangely, it does a repeat, and that repeat runs crazy fast, maybe twice as fast. I hear the same thing when I play the file on modarchive at https://modarchive.org/index.php?request=view_by_moduleid&query=42677 using the built-in web player (which, BTW, doesn't work in Firefox for mobile, sadly).

madbrain76 avatar Jun 04 '24 23:06 madbrain76

Tried the fast tracker 2 clone - also doesn't match the waveform of the demo exactly. I guess I have to leave it alone as the DOSBox recording. Otherwise I would have to stretch/compress either the video or the audio, and the result would probably be worse. I don't think I can easily do that in PowerDirector 16 either. I stopped upgrading it when they made the perpetual licenses way too expensive, in order to push for subscription.

madbrain76 avatar Jun 05 '24 00:06 madbrain76

Yeah, they just use different timers in different replayers.

johnnovak avatar Jun 05 '24 00:06 johnnovak

I thought about it a bit more, and there are two ways to achieve authenticity:

  • Record the DOS demo as is, with whatever playroutine the coders used. That's how people experienced the demo back in the day.
  • Record the MOD tune in an accurate player, such as ProTracker.

Of course, my accuracy points only apply to 4-channel MOD files composed on the Amiga. If we know for certain that the author composed a 4-channel tune in Fast Tracker II, then the FTII play routine might be preferable.

And for MOD tunes that use more than 4 channels, the answer is almost always Fast Tracker II.

If you're serious about this, it's best to research whether the composer was an Amiga or a PC musician. Coders usually don't have a good earn to discern the finer details of correct MOD playback, so even an Amiga MOD file as it's heard in an Amiga demo can be slightly off compared to ProTracker which is how the musician heard it when composing. The musician might not have been present when the demo was made, maybe just sent the MOD file to the coder by mail, so this is understandable. Often, there was no "quality check" done by the composer himself.

The differences can be small, but sometimes surprisingly big and they break the music (e.g., missing notes, wrong notes, out of tune notes, etc.)

johnnovak avatar Jun 05 '24 01:06 johnnovak

It's a 4 channel MOD. The main thing that's wrong about it is the noise floor. It sounds like 8 bit. The SB16 probably wasn't released at that time. Just checked - indeed, the game it came with was released in 1991, before the SB16. It should still sound better even on SB pro. I think I'll just leave this one alone. It'll have the historical feel.

madbrain76 avatar Jun 05 '24 01:06 madbrain76

I think I'll just leave this one alone. It'll have the historical feel.

I agree, it's for the best.

johnnovak avatar Jun 05 '24 02:06 johnnovak