joncampbell123 / dosbox-x

DOSBox-X fork of the DOSBox project
GNU General Public License v2.0
2.6k stars 376 forks source link

High pitched sound in Windows 98 SE games [problem with MMX instructions] #470

Open vinceho opened 6 years ago

vinceho commented 6 years ago

On a stock installation of Windows 98 SE, all the sounds are high pitched screeches when in game. However, the sounds outside of the game is ok (e.g. boot chime and bells).

2 games are tested: CyberStorm and Deer Hunter. Both builds 0.82.1 and 0.82.2 exhibit the issue.

I can also reproduce this by going into dxdiag and run the sound test. Weird that 16bit samples are ok. Only the 8bit samples are high pitched.

Attached is my conf file. dosbox.zip

joncampbell123 commented 6 years ago

I will test that image. Quick question: What sound card are you using with Windows 98 SE? Did you use sbtype=sb16?

I just ran dxdiag on a Windows 98 SE image on my side, and I didn't hear any issues.

joncampbell123 commented 6 years ago

I see sbtype=sb16 in yours, verses sbtype=sb16vibra in mine.

I'm reconfiguring my VM to talk to the card around sbtype=sb16 (non-PnP)

joncampbell123 commented 6 years ago

The other funny thing about audio, is that Windows 98 and later use the kernel streaming driver architecture. Usually that means that everything a program plays to the sound card goes through an audio mixer in the Windows kernel (with format conversion) before going to the sound card.

It's possible there's something wrong with your Windows setup that fails to convert 8-bit to 16-bit PCM.

joncampbell123 commented 6 years ago

So in my setup, DMA=1 and HDMA=5, IRQ=5. I'm going to try IRQ=7 like your setup.

No problems so far.

guest os_000

joncampbell123 commented 6 years ago

Still no problems.

vinceho commented 6 years ago

Thank you for testing! I'll try again tomorrow with a fresh Win 98 installation and report back.

vinceho commented 6 years ago

If it's ok with you, would you share your conf file? Thanks

joncampbell123 commented 6 years ago

Here you go

win98se-dosbox-x-test-1.zip

vinceho commented 6 years ago

I tracked down the setting that causes the sound corruption. When cputype=pentium_mmx, then I'll get the problem.

I'll change my settings back to pentium to enjoy my old games (don't need MMX anyways). Thank you!

wbcbz7 commented 6 years ago

hm, souns like there are some issues with....stop, where is dynamic core? :) With recent DOSBox-X 0.82.3 and cputype=pentium_mmx Win98SE + dxdiag produces garbled sound in 8bit playback (16bit works fine), cannot test with 0.801 (either Windows doesn't recognise soundcard or if core=dynamic DOSBox exits with "E_Exit: IRET from pmode to v86 with CPL!=0" before switching to graphics mode).

So, it seems to be related to bugs in old MMX implementation

joncampbell123 commented 6 years ago

I had to remove the dynamic core. It has bitrotted over the last few years and is incompatible with the page fault handling needed to run Windows 95 properly.