libxmp / xmp-cli

Command-line mod player using libxmp
GNU General Public License v2.0
75 stars 22 forks source link

add SoundBlaster output driver for DOS based on libMikMod #42

Closed sezero closed 1 year ago

sezero commented 2 years ago

P.S.: This is for DJGPP. If this is accepted, it'd be nice if someone can port to Watcom too.

AliceLR commented 2 years ago

Tested with DJGPP and DOSBox-X and it seems to work fine. Lower bound for correct 4 channel MOD playback with nearest interpolation seems to be 6000 cycles/ms. I kind of expected higher for whatever reason.

Is there anything in particular I should review here? I'm not very familiar with the SB16 but I can give it a look (or at the very least compare it to the SB16 drivers in MZX's DJGPP port or BWSB).

sezero commented 2 years ago

Tested with DJGPP and DOSBox-X and it seems to work fine. Lower bound for correct 4 channel MOD playback with nearest interpolation seems to be 6000 cycles/ms. I kind of expected higher for whatever reason.

Is there anything in particular I should review here?

Nothing in particular

I'm not very familiar with the SB16 but I can give it a look (or at the very least compare it to the SB16 drivers in MZX's DJGPP port or BWSB).

Whatever you can do, I'd welcome it :)

ccawley2011 commented 2 years ago

I'm not an expert, but is it necessary to have the audio driver be IRQ-based when xmp uses a push mechanism? In uhexen2, for example, SoundBlaster audio output seems to be handled without using IRQs, and the IRQ seems to be the most difficult part of this PR to get working with OpenWatcom. The IRQ code itself also seems to be much more complicated than in other projects.

sezero commented 2 years ago

I put together this one without much thinking.. Patches for improvement are most welcome.

sezero commented 2 years ago

I'm not an expert, but is it necessary to have the audio driver be IRQ-based when xmp uses a push mechanism? In uhexen2, for example, SoundBlaster audio output seems to be handled without using IRQs, and the IRQ seems to be the most difficult part of this PR to get working with OpenWatcom. The IRQ code itself also seems to be much more complicated than in other projects.

I put together this one without much thinking.. Patches for improvement are most welcome.

I also am not sure how to handle SB-1 there which doesn't do auto-dma. Haven't re-read the code, will try later. If you have patches though, they are welcome.

ccawley2011 commented 2 years ago

I managed to get this working with OpenWatcom: https://github.com/ccawley2011/xmp-cli/tree/dos-watcom

I'm not 100% confident with the DPMI changes, but it works in DOSBox-X, and it still compiles with DJGPP.

sezero commented 2 years ago

OK, will look as soon as I can.

sezero commented 2 years ago

OK, will look as soon as I can.

Built it, ran fine under dosbox-0.74 - I have yet to try under real dos and real hardware.

I'd like to see a few changes to it: IMO, we shouldn't wrap djgpp's dpmi and enable/disable procedures whenever we can but use macros, instead of them. Maybe a few more -- I'll look and detail further later.

sezero commented 1 year ago

Closing this in favor of https://github.com/libxmp/xmp-cli/pull/49