Page 2 of 2

Re: Panda BLAST!

Posted: Wed May 06, 2020 2:47 pm
by Erik
MikeHawk wrote:
Mon May 04, 2020 5:20 pm
But at least there's sound, so it's getting somewhere... I should probably stop the DMA transfer manually, or maybe attempt auto-init DMA transfer, which would also provide sample mixing... I'm just not sure how to do it yet... I'll look into it, thanks again for your help!
You're welcome. Glad to help where I can.

I found this page:

Which mentions the scenario I'm experiencing: wrote: When one of these old games (1991 or earlier) attempts to play digitized sound on a card that isn't at the factory defaults--port 220, IRQ 7, and DMA 1--the result can range from no sound, to digitized sound that "halts" after two seconds of play, to locking up completely.
My SB Setup:
It looks like I have the default set at 220/irq 7/dma 1

I don't have anything plugged in the LPT1 port (Also on IRQ 7) so I think set up wise on my computer it should be okay.

Also just for kicks I took out all my sound configs from my autoexec.bat and config.sys and wavetest behaved the exact same way. (even played the sound still).

Also tried loading it on my IBM XT which doesn't have a sound card installed (to see if it would crash) and it returned the following at start up:
audSBInit: Failed to reset DSP
Then returned to the command prompt, so I guess that's expected.

burger2227 wrote:
Tue May 05, 2020 4:12 pm
Check DMA on the hard drives in Device Manager. I had problems there.
PIO may be listed and unchangeable...newer stuff does not have the problem.
Thanks for the info, but this DMA issue is with the sound card and is running purely in DOS 5.0

Re: Panda BLAST!

Posted: Wed May 06, 2020 4:49 pm
by MikeHawk
Erik wrote:
Wed May 06, 2020 2:47 pm
Also just for kicks I took out all my sound configs from my autoexec.bat and config.sys and wavetest behaved the exact same way. (even played the sound still).
Yeah, that's on me: if there's no config string found, it defaults to "A220 I5 D1 H5" (base port 0x220, IRQ 5, low DMA 1, high DMA 5,) I don't know why I thought that was a good idea to be honest. It still worked because right now, the code doesn't take IRQ into account. That's why I need to write that ISR. I'm trying to figure out an organization that's not too heavy on assembly. I think I'll have to use the DMA auto-init and dump the audio data into a buffer that is fed on repeat to the SoundBlaster. The big downside is that it won't work with very early cards (pre SB 2.0)

I'm 99% positive the DMA issue is on my code and has nothing to do with your hardware.

Re: Panda BLAST!

Posted: Fri May 08, 2020 7:56 pm
by MikeHawk
I gave it another go, I hope this prevents the lock up. There's still no proper sound mixing and no ISR, but if it can at least play reliably one sound at a time, then I'm okay with it for now (that's enough to fix the previous games.)

Re: Panda BLAST!

Posted: Tue May 12, 2020 10:38 am
by Erik
Still locks up if I press the space bar too quickly while a previous sound is being played. :(

I tried added some debug print statements to the audlib.bas file and then rebuilding the library file with them but ended up getting "sub not defined" errors in wavetest using the new lib. (Must have broke something along the way). I might have some more time in the next few days to try getting the debug print statements to work.

Steps attempted:
  • Updated audlib.bas with print statements in audPlayWav sub every few lines so hopefully when it runs, I can see which line it hung at.
  • Run->Make Library. Named it AUDLIB.QLB
  • Attempted to re-run wavetest.bas with: qb /run wavetest.bas /L audlib.qbl
It works with the old one but not the new one. Not sure what I broke there yet. :)

EDIT: Got it working by dumping everything into one large bas file. haha

Here's a screenshot of a single key press and the sound working. (No lock up)

Here's a screen shot after a few plays and then hitting the spacebar quickly. It looks to lock up after sending the low byte and then attempting to send the high byte. If I force a wait during the "DMA not done, force" IF block, it keeps it from crashing but only because the sound file has time to complete before continuing.

I tried piping it to a text file to make it easier to view but the contents don't get saved due to the computer lock up.

Attached is the "WAVEFULL.bas" so you can see where the print lines are coming from in the audPlayWav sub.