exoscoriae / eXoDOS

eXoDOS
65 stars 3 forks source link

Soltys (1995) #5213

Open parricc opened 4 weeks ago

parricc commented 4 weeks ago

The SoundBlaster option does not work correctly. When choosing Port: 220, IRQ: 7, DMA: 1, there is no sound. When choosing Auto, the game freezes after you press a key.

This bug happens in both Windows and Linux. Tested with ECE r4230 in Windows. Testing with ECE r4301, r4358, and r4482 in Linux.

interloper98 commented 4 weeks ago

Tried w/ DOSBox Staging 0.81.1 with:

[cpu]
cycles = 15000

[sblaster]
sbtype = sb16

[gus]
gus = false

At least music & sfx work, and doesn't lock up:

https://github.com/exoscoriae/eXoDOS/assets/165201780/2a3c116e-7466-4d6b-8e34-ca447e784e9a

SmilingSpectre commented 4 weeks ago

Partially confirmed.

  1. If SB=SB1 or SB2 music works as expected, but not FX. But for SBPRO1,2 or SB16 there is no sound at all for 240,7,1 (I forced it in config - no luck).
  2. For any SB, if you select "Sound Blaster" in menu, then select "AUTO" for each of three choices, sound works. And music too.
  3. If you don't select "Sound Blaster", but select "Automatic Configuration", you get sound - but game stuck on the first screen, playing melody forever.

Tried to change the settings. On 210,7,1 all SB woks as SB1: music is here, but sound isn't. Again: everything works on "AUTO".

But Staging really works with 'Automatic Configuration"! And still don't give FX in manual selection (but gives music with any SB, and FX still works with AUTO).

I recommend to send the issue to Staging guys. :) I am very curious why it's different.

Python-Exoproject commented 3 weeks ago

Whats happening is that with all the sound devices turned on as we do in current eXoDOS conf the game doesnt know what to do when you select "Automatic Configuration" and crashes. Turn all but the sound device being used off in the conf and auto detect works.

As for the FX not working unless Auto is selected, this is related to the DMA selection as you can specify the IRQ and Port using Auto only for DMA and it works. I lean towards a game issue as all forks perform the same, its detecting DMA properly by itself with auto but not working when we specify the DMA.

I think the best solution is to edit run.bat to tell the user to select "Auto" for each option, then everything is fine. I also noticed that when GUS was selected we had the fluidsynth turn on for some reason so ive fixed that as well. Here is a run.bat with the suggested changes: run.zip

I also found on my PC when sound canvas is selected while using ECE there is noise in the channel but on Staging its clean. I would like to change to Staging for the main launch due to this however one problem that does seem Staging specific seems to be that it wont give sound for GUS choice. Can you confirm @SmilingSpectre?

interloper98 commented 2 weeks ago

one problem that does seem Staging specific seems to be that it wont give sound for GUS choice.

Ran some tests on the releases, and looks like 0.75.2 was OK but on 0.76+ Soltys GUS stops working.

Looking at the logs, normally Staging prints the number of GUS voices, but in 0.76, it wasn't being shown after I clicked the 'auto-detect' button. Compared those areas of code between the versions, and and with some trial and error on my RetroPie box, this was enough to get it playing again:

diff --git a/src/hardware/gus.cpp b/src/hardware/gus.cpp
index a46ff6ff1..7af628469 100644
--- a/src/hardware/gus.cpp
+++ b/src/hardware/gus.cpp
@@ -684,6 +684,7 @@ void Gus::ActivateVoices(uint8_t requested_voices)
                ms_per_render = MillisInSecond / sample_rate_hz;

                audio_channel->SetSampleRate(sample_rate_hz);
+               BeginPlayback();
        }
 }

@@ -769,8 +770,6 @@ void Gus::AudioCallback(const uint16_t num_requested_frames)

 void Gus::BeginPlayback()
 {
-       dac_enabled = ((register_data & 0x200) != 0);
-       irq_enabled = ((register_data & 0x400) != 0);

        audio_channel->Enable(true);

@@ -1570,8 +1569,9 @@ void Gus::WriteToRegister()
                        StopPlayback();
                } else if (state == 1) {
                        PrepareForPlayback();
-               } else if (active_voices) {
-                       BeginPlayback();
+               } else {
+                       dac_enabled = ((register_data & 0x200) != 0);
+                       irq_enabled = ((register_data & 0x400) != 0);
                }
        }
                return;

GUS Automatic setup:

https://github.com/exoscoriae/eXoDOS/assets/165201780/a5944b2f-1759-49f5-bc72-1ca55aa18237

GUS + MIDI, manual setup:

https://github.com/exoscoriae/eXoDOS/assets/165201780/8642c3b4-6cb5-491a-88e7-efecc56ebd69


It seems to work well enough. My usual GUS games like OMF, Star Control 2, Blood, Descent, Duke 3D, Hocus Pocus, Rise of the Triad, Pinball games, and Jazz Jackrabbit are still fine. Same with demos like 1st Infection, Second Reality, Unreal by Future Crew.

I'll pass it onto the Staging devs to see if they can do something with it.

johnnovak commented 2 weeks ago

Thanks @interloper98. That active voice check was questionable to begin with; hardware usually is "dumb" and works all the time. Sound cards certainly don't try to "micro optimise" their "work"; those logic circuits do 100% work 100% of the time 😏

exoscoriae commented 2 weeks ago

@Python-Exoproject I added your run.bat file to the zip.

I am leaving this open though to see how staging\GUS support goes.

exoscoriae commented 1 week ago

moving to low priority as we are now waiting on staging

Python-Exoproject commented 6 days ago

This is fixed in Staging and will be in the 82 release