crazii / SBEMU

legacy sound blaster emulation for DOS
GNU General Public License v2.0
621 stars 33 forks source link

Sound stops working in games after running any program that uses DOS32A or D3X dos extrender. #130

Open CandyMan30 opened 2 months ago

CandyMan30 commented 2 months ago

After loading SBEMU, everything works as it should. However, when I run any program using DOS32A or D3X dos extender, the sound stops working in 32-bit mode. This may be due to some incompatibility of these dos extenders or a change in some settings. Please check what is causing this.

Here are testing programs: d3x-dos32a.zip

Thanks.

volkertb commented 2 months ago

There is indeed a known issue with the DOS/32A DOS extender, which was noticed by the developer of FastDoom.

Can you try the following:

Please let me know if either (or both) of these workarounds have any effect on this problem.

Thanks!

volkertb commented 2 months ago

@CandyMan30 Today I've been troubleshooting an integration test in the CI/CD pipeline for SBEMU. A test kept failing with a protected mode sound (WAV) player that I had set up to use DOS/32A. The sound player didn't crash or anything, but it complained about not detecting a Sound Blaster card.

After trying a few other things (including the workarounds I shared in my previous reply, neither of which helped) I tried using the original DOS/4GW DOS extender (version 1.97) instead, and presto, the test passed. :partying_face: This was less than half an hour ago.

So there may be more compatibility issues going on between DOS/32A and SBEMU.

As for the D3X DOS extender, I was not yet familiar with that DOS extender. (Thanks for introducing me to it, by the way!)

However, from what I read here, it's a "ring 0" DOS extender. If that means that it's running the application code in ring 0, that probably explains why SBEMU isn't working, since the application or game needs to run at a lower privilege level (typically ring 3) in order for SBEMU to trap and emulate I/O access to the sound card. At least, that's how it works as far as I understand.

I guess in the meantime, the advice is to just keep the original DOS/4GW DOS extender that comes with the games that you want to use with SBEMU. Although if you're emulating a Sound Blaster 16, you might want to upgrade to DOS/4GW version 1.97, since that version of the DOS extender includes a high DMA fix for 16-bit sound cards.

I hope this helps with your use case(s).

CandyMan30 commented 2 months ago

Problem solved. The DOS extenders in question were run in VCPI mode instead of DPMI. I ran JEMM* with the NOVCPI parameter and now everything works. Thanks a lot.

P.S: I use D3X dos extender in Necromancer's Dos Navigator (NDN for DOS32/64).

Here my working configuration:

SET BLASTER=A220 I7 D1 JEMM386.EXE LOAD MAX=32768 NOEMS X=C000-FFFF VCPI HDPMI32I.EXE -r -x JLOAD.EXE QPIEMU.DLL IF ERRORLEVEL 1 GOTO ERR SBEMU.EXE /I7 JEMM386.EXE NOVCPI :ERR CD C:\GAMES\DOOM DOOM.EXE JEMM386.EXE VCPI

volkertb commented 2 months ago

Cool! Thanks for sharing your working configuration. Does this work with the D3X DOS extender as well as DOS/32A?