Allegro.cc - Online Community

Allegro.cc Forums » Allegro Development » Alleg422/DJGPP/DOS/SBPro/Bad Sound

This thread is locked; no one can reply to it. rss feed Print
 1   2   3 
Alleg422/DJGPP/DOS/SBPro/Bad Sound
JeffTX
Member #9,836
May 2008
avatar

I maintain a legacy system built up from old hardware, mainly for playing old DOS games (easier and more headache-free than trying to use DosBox):
----- -----
Pentium 166

192Mb RAM (the max that the old motherboard will support). Note that due to 'MicroChannel Architecture' bugs, DOS XMS/EMS drivers only recognize 64Mb of this ram. Does not cause problems. Occasionally, I've used this old computer as a 'backup" and installed Win98SE on it, and the full 192Mb RAM is available; and used an external (serial port) dialup modem to get onto the internet.

NO modem is installed internally.

2Gb Hard Drive

SVGA chip S3 Trio 64V, 2Mb VRAM

Old Creative Labs SoundBlaster Pro (CT-1600).

DOS 6.22
----- -----
I Installed the most recent DJGPP suite under DOS 6.22, and Allegro 4.2.2. Allegro builds just fine. The example programs run, and I have no problems compiling and running the 'Vivace' tutorials, and a couple of other Allegro/DJGPP sources that I have found on the internet.

The problem is that playing .WAV files (or sound samples in packed files) sounds terrible. In the Allegro DEMO program ('asteroids'), the Allegro example program (EX_SAMPLE), and others, .WAVS sound very distorted.

It sounds like the samples are... 'boosted' (volume artificially boosted) and badly clipped. Imagine overdriving a set of speakers far past specs.

I am hoping that this is a KNOWN problem with a KNOWN solution, otherwise I am just going to have to forget about using Allegro (in this environment) or try to find the cause myself, and re-build it.

Someone of the SourceForge mailing list suggested that I try an earlier version of Allegro, but it wouldn't build under DJGPP; the build kept failing early in the process (Allegro 4.0.3; he suggested it MIGHT work better under DOS).
----- -----
- Thanks, Jeff

gnolam
Member #2,030
March 2002
avatar

Have you tried changing the sound settings in allegro.cfg?

--
Move to the Democratic People's Republic of Vivendi Universal (formerly known as Sweden) - officially democracy- and privacy-free since 2008-06-18!

JeffTX
Member #9,836
May 2008
avatar

(gnolam);

Yes - I should be more specific about what I have tried so far.

I've used the Allego 'SETUP' program, and I've tried every thing I can think of;

volume

number of channels for both digital sound and midi (I can't remember what this is specifically called - either '# channels' or '#voices') (Allegro docs indicate that this can go up to 64 - I've tried various values ranging from 1 to 64)

Other settings dealing with sound (BTW the 'Pan' setting works correctly - changes the L/R balance)

I've tried modifying the Allegro.cfg file manually.

I've tried various combinations.

I got a hold of the old legacy Creative Labs software package - DOS and Win31 - and tried modifying the SBPro mixer settings BEFORE invoking allegro applications.

The symptoms seem to indicate that in Allegro 4.22, for DOS/ SoundBlaster Pro (Creative Labs CT-1600 card); that the Allegro library (for some reason) ends up processing all sound files - boosting the volumes WAY UP, and then clipping them. For example in the Allegro Demo ('asteroids'), the voice that says "Welcome to Allegro!' and screams whenever the ship is blown up, is BADLY distorted. Imagine feeding a sound source to an amplifier, out thro a small 8 ohm speaker, turn the volume up enough to damage / blow the speaker. But the speaker still works (sort of), but the paper cone is ripped to shreads. OR - playing a voice through a speaker, turning the volume WAY up, but the speaker is enclosed in a metal coffee can.

I should say that the SBPro works FINE with other apps / games. ONLY apps compiled with DJGPP / Allegro 4.22 are distorted. I tried resampling some WAVS to different freqs (on my windows computer) - that didn't help. I have NOT tried yet to depress the volume stored in WAVS yet - (I'll get around to this tomorrow) - example re-working some waves to 0.50 and 0.25 volume. But from the symptoms, I don't think it will work - I've tried some 'quieter' wavs already.

One old game I have - JJFFE 2.8b for DOS (a re-work of Elite III : First Encounters, rebuilt by John Jordan) used an older DJGPP / Allegro (version 3. something I think) sounds just fine. But I can't get older versions of Allegro to compile under the recent DJGPP.

I would rather get 4.22 to work correctly - I am hoping someone has been through this before and knows what do to. If necessary, maybe I could 'fix' the applicable Allegro 4.22 source and rebuild it.

Matthew Leverton
Supreme Loser
January 1999
avatar

In the little I've used Allegro 4.2 with DOS, I've had no luck with SoundBlaster cards. It would actually crash and burn. I don't ever recall having the problem with Allegro 3 or Allegro 4.0.

So in short, it wouldn't surprise me if something is broken. It would probably be easier to try to get Allegro 4.0 up and running. Any compile error you have is probably easily remedied.

JeffTX
Member #9,836
May 2008
avatar

Matthew:

Thanks, thats actually a very valuable clue. It indicates that the problem occured somewhere in Allegro development; that something got broken along the way.

Trying to get earlier versions of Allegro to build under recent DJGPP: its complicated. The build for 4.03 halted at 'fli.c', I think. At present, this seems like the most complex of the options available (at least right now...). I'm just not sure - seems like it would take a long time to figure out why it can't build under recent DJGPP.

I think what I will do, based on what you've told me, is to download Allegro 4.0 and maybe some 3.xx versions. Study the code. Compare it to 4.22. Try to spot what was 'broken'. IF I can determine anything (definite), I can try 'fixing' the Allegro 4.22 code myself, and build a special version for my machine.

- Thanks, Jeff

Evert
Member #794
November 2000
avatar

It's actually not that easy to get Allegro 4.0 compiled with recent versions of GCC (don't ask me for the details, they changed something in how the compiler treats some constructs that used to be considered legal but aren't anymore).
Instead of randomly looking at the code, have a look at the changelogs that come with each release and try to pinpoint the problem there. Have you tried earlier 4.2 releases?

Matthew Leverton
Supreme Loser
January 1999
avatar

I should warn to take my recollections with a grain of salt. I know that sound code crashed the demo on pure DOS when I last tried, and I'm assuming it was the Allegro 4.2 branch since that has been out for a while.

It's possible it never worked on 4.0, but I think that would have been spotted back then since DJGPP was still widely being used, especially under Windows 98. But I know for sure I never had that problem with Allegro 3 under DOS.

Kitty Cat
Member #2,815
October 2002
avatar

Quote:

The problem is that playing .WAV files (or sound samples in packed files) sounds terrible. In the Allegro DEMO program ('asteroids'), the Allegro example program (EX_SAMPLE), and others, .WAVS sound very distorted.

It sounds like the samples are... 'boosted' (volume artificially boosted) and badly clipped. Imagine overdriving a set of speakers far past specs.

Allegro's mixer has plenty of clipping protection, unless something is multiplying the samples way way above the intended target. Something that could cause this, though, is if Allegro is giving the wrong information on the expected signedness of the samples. Also, I think the SBPro can only do 8-bit sound? I'm not sure how well that's tested, there could be some improper scaling for that..

--
"Do not meddle in the affairs of cats, for they are subtle and will pee on your computer." -- Bruce Graham

JeffTX
Member #9,836
May 2008
avatar

Thanks all for more answers and further information....

In short, it sounds like I have some hacking to do.

For that matter, in the long run all I need for DOS / DJGPP is some videocard code, soundcard code, joystick and input code, and game timing functions. SVGA code would be nice. By the time I get done studying various versions of Allegro, I could probably just create my own mini-library; sort of an 'Allegro Lite'. OR look for another game library (DJGPP compatible... or Open Watcom, I downloaded ALL of the Open Watcom for DOS files, but haven't gotten around to studying them yet).

Kitty Kat:

Yes; I tried various WAVs; 8 and 16 bit, and also the same WAV that had been resampled to different frequencies (originally it was 8 bit unsigned, 8Khz). Allegro 4.22 does this to ALL WAVs, at least for the SoundBlaster Pro under DOS.

Kitty Cat
Member #2,815
October 2002
avatar

Quote:

Yes; I tried various WAVs; 8 and 16 bit, and also the same WAV that had been resampled to different frequencies (originally it was 8 bit unsigned, 8Khz). Allegro 4.22 does this to ALL WAVs, at least for the SoundBlaster Pro under DOS.

Yes, because the mixer works in signed 24-bit integers internally (regardless of the source sound), and scales down to the appropriate bit depth and toggles the sign bit as needed afterward. If the mixer is toggling the sign incorrectly, scaling down incorrectly, or getting the info incorrectly from the card, it doesn't matter what the wave file is.

--
"Do not meddle in the affairs of cats, for they are subtle and will pee on your computer." -- Bruce Graham

Evert
Member #794
November 2000
avatar

Quote:

By the time I get done studying various versions of Allegro, I could probably just create my own mini-library;

You could, but you'd be reinventing the wheel.

Quote:

OR look for another game library (DJGPP compatible...

Good luck with that, but don't waste too much time on it.

I'll repeat what I said before, try to find the exact version number where things stopped working. Browse the changelogs, check 4.2.0 and/or the 4.1 WIP series (negelcted to mention those). That will be far more useful than looking through 4.0 or 3.x code to try and find the problem.

Audric
Member #907
January 2001

I can confirm, I experienced that early Allegro 4.0x, or one of the last 3.93x betas, made sound shriek in DOS.

You can try this link for a set of DJGPP/Allegro versions that can (for example) compile Dosdoom.
http://www.resurrected-entertainment.com/2007/07/15/getting-dirty-with-dos-doom/
The Allegro archive contains the compilable examples, so you can check that sound is ok on your machine.

At home I have some CDs with programming stuff from this time. I'll see if I can find more precisely what was the last version of Allegro I used in pure DOS.

In any case, I recommend the Allegro 3 series as it's really tailored for DOS programming, focused on VGA / VESA etc.

JeffTX
Member #9,836
May 2008
avatar

Audric:

THANKS for that link! It's probably exactly what I needed. I archived everything from that link and burned it to a CD; the Doom Source, pre-compiled Doom, AND those specific DJGPP packages / versions.

There is a good chance that it will work for me.

I've been up all night, so this evening (I need sleep!) I will install that version of DJGPP / Allegro on the hard drive. Hopefully the Allegro (3.11) examples will sound OK. Than I will make a pass at compiling that Doom source.

... MUCH appreciated.

UPDATE:

Okay... I've done several clean installs of DJGPP with fresh, clean builds of a few Allegro versions.

With Allegro 3.1, 3.11, 3.12, 4.00, and 4.03, the SoundBlaster Pro is working just fine in the Allegro Setup program, and the Play Samples example program.

NOTE: For some reason, in the 4.22 CHANGES log (and in some other later versions) 4.03 is left out for some reason? The CHANGES logs progress from 4.0.2 directly to 4.1.0

Allegro 4.1.0 is working okay.

Working backwards : The SBPro presents badly distorted sound in Allegro 4.22 and 4.20.

Allegro 4.1.18 : the SBPro does NOT work okay.

Therefore : the bug occurs somewhere between 4.1.0 and 4.1.18 (4.1.1 to 4.1.17)

Evert: I took your suggestion, and exhaustively searched the CHANGES log (from 4.2.2), between 4.1.0 and 4.1.18. There is NOTHING definitive, nothing that leaps out as to a possible culprit.

Between 4.1.0 and 4.1.18 there are 17 versions to check. That hard drive is really getting thrashed; between doing fresh installs of DJGPP and fresh builds of Allegro - and the CHANGES log presents no definitive clue.

I'm going to sent another message to the SourceForge mailing list - the first message I left (in alleg-main) didn't really result in useful responses (just 'did you try 4.03?'). I think I will send one today to alleg-developers. Hopefully they won't get too mad - I'll try to be polite. I think its justifiable in that the CHANGES log isn't helping to steer me in the right direction.

The only other alternative is to 'divide and conquer'; pick a revision close to the middle between 4.1.1 and 4.1.17 (inclusive), and if that one works, then move upwards (by 'half') and if it doesn't work move downwards. Too tired to do this today - I'll check later to see if anyone has input, and then proceed this afternoon or this evening. Maybe the developers have something.

Matthew Leverton
Supreme Loser
January 1999
avatar

Perhaps someone could tell you which source files are likely to be at fault. You could look at the differences between them, perhaps via the online SVN repository if it goes back that far.

Evert
Member #794
November 2000
avatar

Quote:

Evert: I took your suggestion, and exhaustively searched the CHANGES log (from 4.2.2), between 4.1.0 and 4.1.18. There is NOTHING definitive, nothing that leaps out as to a possible culprit.

Are you sure? My guess is you're looking for something that affected the clipping or arithmatic for Allegro's mixer, not something that is SBPro specific. Anything that is related to the sound code is suspect.

Quote:

Between 4.1.0 and 4.1.18 there are 17 versions to check. That hard drive is really getting thrashed; between doing fresh installs of DJGPP and fresh builds of Allegro - and the CHANGES log presents no definitive clue.

You can delete versions as you've cheked them, but I understand it's a chore.

Quote:

I'm going to sent another message to the SourceForge mailing list - the first message I left (in alleg-main) didn't really result in useful responses (just 'did you try 4.03?'). I think I will send one today to alleg-developers. Hopefully they won't get too mad - I'll try to be polite. I think its justifiable in that the CHANGES log isn't helping to steer me in the right direction.

Most (all?) of us read the Development forum here as well (actually, I get them as e-mail as well); do as you prefer, but I for one won't say anything else on the mailinglist than I do here. :)
The good thing about asking for support on the forums is that you can get response from people not directly involved with Allegro's development.

Quote:

The only other alternative is to 'divide and conquer'; pick a revision close to the middle between 4.1.1 and 4.1.17 (inclusive), and if that one works, then move upwards (by 'half') and if it doesn't work move downwards. Too tired to do this today - I'll check later to see if anyone has input, and then proceed this afternoon or this evening. Maybe the developers have something.

This is what I would suggest you do, actually.

Quote:

Perhaps someone could tell you which source files are likely to be at fault. You could look at the differences between them, perhaps via the online SVN repository if it goes back that far.

I suspect something related to the mixer, which might be called mixer.c (can't check at the moment). Anything in allegro/src/dos/ relating to soundblaster code is also suspect, but less likely to have been recently modified.

Kitty Cat
Member #2,815
October 2002
avatar

Quote:

Evert: I took your suggestion, and exhaustively searched the CHANGES log (from 4.2.2), between 4.1.0 and 4.1.18. There is NOTHING definitive, nothing that leaps out as to a possible culprit.

4.1.18 is around the time I redid the mixer, IIRC.

--
"Do not meddle in the affairs of cats, for they are subtle and will pee on your computer." -- Bruce Graham

JeffTX
Member #9,836
May 2008
avatar

Kitty Cat:
I'll take a look at the CHANGES log, and I might check 4.1.17 next then.

Evert:
I took steps to make it easier when I first started experimenting. On the C:\ drive of that 'DOS computer' I have a directory 'F_DJ'. Since GCC423 can't properly build all versions of Allegro (just Alleg 422, apparantly, I had to step back to GCC 2953 even for Alleg 420), I have a three or four GCC.x.ZIPs there, as well as the rest of the DJGPP package. Then I had F_3, F_41 and F_42; every Allegro .ZIP from 3.1 through 4.22. I've since deleted F_3 and F_42.

I might very well test 4.1.17 next, but otherwise if I use the approach I mentioned I COULD have it narrowed down in about the next four builds... just getting tired of it.

To be honest, when I read the changes log, I just 'scanned' through it visually. Then I did a search for 'sbpro' and 'soundblaster' (in the text editor). I also searched for 'sound' thinking that should catch anything. There were some items, but they weren't mixer related, they had to do with a couple of other drivers and also windows issues. After the coffee kicks in, I'll serach the changes log for 'mixer'.

Oh well, in any case, almost done. When I narrow it down to the exact point the problem starts, I'll compare code sections between two adjacent versions. Hopefully it's something that I can fix myself. I also want to add another joystick type (I haven't even looked at the joystick / setup sources yet), and hopefully correct Alleg 422. The 'latest stable release' produced noticably higher framerates in soem of the examples, and I also want to use the latest GCC / GPP.

- Thanks all

MAJOR UPDATE:

EVERT and KITTY CAT-

Thanks for your input; MUCH appreciated.

I searched the changelog (between 4.1.1 and 4.1.17) for 'mixer'.

Kitty Cat: If you are 'C.R.', then you made changes to the mixer code in 4.1.15, according to the changelog.

I built Allegro 4.1.14, the SoundBlaster Pro sounded good.
I built Allegro 4.1.15, the SoundBlaster Pro sounded like an angry banshee that was out to destroy the world. Problem located.

Now to compare the mixer code in 4.1.14 and 4.1.15. Hopefully(?) I can apply a 'correction' to 4.22.

And also add a new joystick type - 'Standard' 2 button joystick with throttle. Allegro setup offers 'CH Flightstick Pro' (which includes a hat, among other things) - I am using an old basic CH Flightstick (just 2 buttons and a throttle) for my DOS computer. If I select Flightstick Pro, Allegro DOES read the throttle OK though.

Kitty Cat: Just in case I run into problems - if it is convenient, and you can remember for back then (Alleg 4.1.15 / mixer), if you have any advice / input, it would be appreciated. I'm going to take a break now... I imagine I can correct the code for the mixer / DOS / SoundBlaster Pro myself, but you never know.

-----

Somewhat related : If I can modify 4.22 and get it running the way I want, then I imagine I will be satisfied with 4.22 as long as I am only programming in DOS / DJGPP (I also program in Borland C++ 3.0 and TASM on that DOS computer - but those don't offer protected mode features, which is why I got interested in DJGPP recently).

I used to do Windows programming (in the Win98 / Win98SE / WinME days) ; MSVC6 and the DirectX SDKs. But I've been away from it for awhile. I'm a little hesitant to try programming tools on my state-of-the-art Vista machine. I DON'T want to do experiments that might mean having to reinstall Vista!

So... while I am only interested in DOS programming (for now) is there any real reason to progress past Allegro 4.22 (major post-422 releases only), and the current DJGPP, anyone? Probably not, but I would appreciate relevant input.

THANKS, all.
- Jeff

Ron Novy
Member #6,982
March 2006
avatar

Quote:

I built Allegro 4.1.14, the SoundBlaster Pro sounded good.
I built Allegro 4.1.15, the SoundBlaster Pro sounded like an angry banshee that was out to destroy the world. Problem located.

From my own experience with allegro... it might be in the driver code... I'm not sure though... It's been a while since I compiled with DJGPP... I've been using MinGW since 4.1.18 because I was having the same trouble... Something I noticed though when using DJGPP is that when running in a DOS box the sound was usually fine, but under pure DOS there was trouble... It could just be me mistaking the different versions I compiled, but thought it might be worth mentioning...

If you find the bug then let us know ;)

----
Oh... Bieber! I thought everyone was chanting Beaver... Now it doesn't make any sense at all. :-/

Kitty Cat
Member #2,815
October 2002
avatar

Quote:

Kitty Cat: Just in case I run into problems - if it is convenient, and you can remember for back then (Alleg 4.1.15 / mixer), if you have any advice / input, it would be appreciated.

I'm pretty sure I tested mono, stereo, 8-bit, 16-bit, and the various quality output settings when I changed the mixer. Some quick looks through the code and I don't see anything out of place.

Do you know what output mode the card is outputting (8/16 bit, mono/stereo, quality 0/1/2, etc)?

--
"Do not meddle in the affairs of cats, for they are subtle and will pee on your computer." -- Bruce Graham

Ron Novy
Member #6,982
March 2006
avatar

You know what... Know that I think about it I think it was a problem with the wave files I was using... An old version of Cool Edit saved some files with an invalid header... Not sure if that helps though... :-/

----
Oh... Bieber! I thought everyone was chanting Beaver... Now it doesn't make any sense at all. :-/

JeffTX
Member #9,836
May 2008
avatar

Ron Novy;
I don't think that the individual WAV files are the problem.

In Allegro 4.1.14 and previous, the Allegro SETUP.EXE sounds just fine, IE when you invoke SETUP -> TEST -> TEST DIGITAL, you hear what you are supposed to hear, a 'bell or gong sound' (I presume from setup's own data file).

For my own test, I invoked the example programs 'Play Sample", and used a WAV from an old DOS game Daggerfall - it is a spoken voice, and it says "Rest well this night, for tomorrow you sail for the kingdom of Daggerfall!". That WAV is 8 bit, I think 11025 Hz, stereo (and pans slightly from one side to the other).

In Allegro 4.1.15 and later, even the Allegro SETUP.EXE is distorted. Instead of a 'gong', it sounds almost like a 'screech' or "shriek". All waves, regardless of resolution, frequency, or ... 'stereoige" (heheh - made up a new word) sound equally distorted. Almost as if you used a sound editor on a WAV (I use GoldWave, thats what I've used for years), and increased the amplitude (volume) in the wav by 500 percent or something, so much so that the waveforms themselves are distorted and the envelope is destroyed (ie there is no envelope - its all maxxed out).

Kitty Cat;
The SoundBlaster Pro is 8 bit, stereo, supports up to ~ 44 Khz (I have the specs). I don't think it has an inherant 'quality' setting (through hardware).

I have it set up (via jumpers, and my BLASTER variable) for address 220, interrupt 5, DMA 1 (some people say that the standard for Soundblaster 1's are INT 5 while SBPro should be INT 7; thats not QUITE true... just a 'tendancy'). DMA sharing is DISABLED.

I've double checked ALL the boards jumpers over the past few days, and double checked the BLASTER= environment variable in all of my AUTOEXEC.xxx's (I'll explain that shortly).

I've used a variety of WAVs in testing post-4115 Allegro, and regardless of the WAVs characteristics, they all sound distorted. In Allegro Setup, I tried all kinds of settings and combinations of settings - different volume, frequency, and I forget what its called, I thought it was # voices (number of channels?). I processed some WAVS, resampled them to different frequencies and so forth, nothing helped. I stuck with 8 bit WAVs though.

I just got up, and so far only 1 cup of coffee. After at least a second cup, I will start with examination of the mixer code for Alleg 4.1.14, 4.1.15, and 4.22. I'll do experiments. If I get 4.22 running for DOS/SBPro, I'll post the solution here (also the added joystick type). It may be a day or two before I post again...

Okay - exlanation about AUTOEXEC.XXX
I have a neat little program in my DOS directory - REBOOT.COM. As I recall, its only about 7 bytes long. It simply jumps through the computer's cold start vector, rebooting the machine. Its handy because it can be called through batch (.BAT) files. I got it from an OLD book; "DOS 5 Techniques and Utilities". To make the program, you invoke the DOS memory editor ('DEBUG'), load about 7 specific hex bytes into memory, and save memory as 'REBOOT.COM'.

In my DOS directory, I have 5 batch files (one of them very recent); XMS.BAT, EMS.BAT, BOR.BAT, RAW.BAT, and now I have DJG.BAT (for DJGPP).

I have fives sets of AUTOEXEC and CONFIG files... AUTOEXEC.XMS and CONFIG.XMS, through AUTOEXEC.DJG / CONFIG.DJG.

Entering the name of the batch file (since they are in C:\DOS, they are always in the path); XMS, EMS, RAW, BOR or DJG, runs the appropriate batch file.

The batch files simply copy 'thier' AUTOEXEC / CONFIG onto the hard drive's root AUTOEXEC.BAT and CONFIG.SYS, and then it invokes REBOOT.COM.

So, if I want to play a game that needs EMS memory (such as Elite II:Frontier or Wing Commander Privater) I just enter 'EMS' from any directory. The computer reboots, and I have 16Mb of EMS allocated, with no CDRom driver loaded (I have a 'NO CD hack' for Privateer). This lets me have as much conventional memory as possible. The path only points to DOS and a directory that contains a hex editor ('HIEW').

'XMS' invokes a more general configuration; no EMS, CDRom driver is loaded, FILES=64, etc. Its good for protected mode programs (Such as DJGPP/Allegro AFTER they have been built and tested). Its good for my DOS version of the RayTracer (POVRay 3.1g, though I rarely use that anymore). The path contains DOS, HIEW, and PICT (a very good DOS image viewer PictView).

'RAW' is just raw. Only DOS is in the path. NO xms or ems driver. I need that to run verious versions of DTA (basically a .FLI/.FLC file maker and image manipulator).

'BOR' is optimized for Borland Turbo C++ 3.0 and TASM.

And finally 'DJG" is optimized for DJGPP, with the DJGPP environment variable and the required SET command, and a couple of specific things in the CONFIG.SYS

This makes rebooting to different configurations very easy.

Kitty Cat
Member #2,815
October 2002
avatar

Quote:

The SoundBlaster Pro is 8 bit, stereo, supports up to ~ 44 Khz (I have the specs). I don't think it has an inherant 'quality' setting (through hardware).

Sorry for the confusion, I meant Allegro's output mode. Is it outputting stereo/mono, 8/16 bit, and what's the quality setting (should all be found in Allegro's setup.exe). IIRC, the SBPro is limitted to 22khz with stereo output, while you can get 44khz with mono.. or was that the SB2? I forget..

Either way, the only thing I can potentially see as a problem is using mono output with a a non-0 quality setting. Apparently _mixer_init fails to force the mixer quality to 0 for mono output (which it must), even though set_mixer_quality properly forces it. The default quality level is 2..

--
"Do not meddle in the affairs of cats, for they are subtle and will pee on your computer." -- Bruce Graham

JeffTX
Member #9,836
May 2008
avatar

Kitty Cat;

I haven't had the time to check things just yet - I got sidetracked on a couple of other sub-forums here. When I log off, I will UnZIP Allegro 4.1.14, 4.1.15, and 4.22 in a good place (renaming "\Allegro" to 4114, 4115, and 422 between unzippings) so that I can compare the code - for me, that would be the first step, to see what was specifically changed. Later, apply 'correction' to 4.22 if necessary.

Your second paragraph... argh, I don't remember if I specifically tinkered with a 'Quality' setting. I know that I tinkered both with SETUP and allegro.cfg (and modified autoexec.bat accordingly to point to it), and also modified allegro.cfg in SETUP's directory. I tinkered with everything else, volume, freq, stereo/mono etc. I'll write down what you said (more or less) and look again - if something leaps out at me, I might even rebuild Alleg 4.22 (unaltered) and try again.

Your first para; oops yes I seem to remember something like that. I'll look at the SBPro spec sheet again - I got all of this old hardware second hand, no manuals, and I had to download things from the web. One good thing, is that I actually found the ancient SBPro user software suite on the net, which includes SB-SET.EXE, and a mixer reset / programer thingy; can be invoked from AUTOEXEC.BAT. I have it set to clear / reset the mixer, and set the master / digital / midi volumes to 12 (out of I believe 15 or 16), and CD, mic, aux/line volumes to 0 (since I am not presently using them).

UPDATE:
Kitty Cat:
Based on your last post, I decided to try one more time with Allegro 4.22 (unaltered), and this time to be very thorough on experimenting with ALLEGRO.CFG. It didn't work, I got nowhere. Thats okay, its just being thorough. First, I ran SETUP, did an autodetect, and saved an ALLEGRO.CFG, and backed it up as A.BAK. Then I started changing things in the .CFG. I tried every possible combination for the Stereo setting, number of bits, quality, volume, number of voices, even the Pan setting, etc... no luck. When I do the digital test the SBPro just screeches. So I think it is safe to say that between 4.1.14 and 4.1.15 something was introduced that broke SBpro playback in DOS / DJGPP.

I created three directories now, \4114, \4115, and \422; just the unzipped allegro versions so I can compare sources. I just now looked at \4114 .. \SRC and SRC\DOS, came up with a list of files to examine and their files sizes (to help determine what was changed between versions). I haven't looked at file sizes for \4115 yet (or \422).

The files from SRC\DOS are ADLIB.C, DMA.C, DSNDDRV.C, SB.C
From \SRC are DIGMID.C, MIDI.C, MIXER.C, READSMP.C, SOUND.C, STREAM.C

The reason that I want to look at the MIDI code is that while digital sound is clearly messed up (post-4.1.14), MIDI is also "too quiet". I can't get much volume out of it (though it sounds OK). 4.1.14 and previous both digital and MIDI are fine.

I'm not sure if this will be easy. It depends. First I have to look at file sizes for those files in \4115, to see what was changed. And then I literally have to study the changed files, take my time and read them, jump between 4114 and 4115 until I understand what is happening, and hopefully see a solution. IF I find possible solution(s), then I will install a fresh DJGPP / Allegro 4.1.15, alter the source, rebuild it, and see what happens. If THIS works, then the goal will be to fix 4.22.

Also I want to look at SRC\DOS\JOYSTD.C and SRC\JOYSTICK.C, to add another joystick type that was left out of the default list (2 button 3 axis joystick, IE 2 button joystick with throttle). I looked over the code, and this one looks like it will be fairly easy.\

gnolam
Member #2,030
March 2002
avatar

Quote:

came up with a list of files to examine and their files sizes (to help determine what was changed between versions)

Use diff. It'll tell you exactly what has changed (if anything).

--
Move to the Democratic People's Republic of Vivendi Universal (formerly known as Sweden) - officially democracy- and privacy-free since 2008-06-18!

JeffTX
Member #9,836
May 2008
avatar

gnolam said:

Use diff. It'll tell you exactly what has changed (if anything).

I don't think thats going to help... I googled 'DIFF' to see what it was and how it worked. I DID consider downloading it, but I wanted to see what I was up against first.

Using file size comparisons between 4.1.14 and 4.1.15, it looks like I need to work with DIGMID.C (maybe - to check into a possible MIDI low-volume problem) and most probably MIXER.C

I made copies of the sources from 4.1.14, 4.1.15, and 4.22, renaming them (for example) to 14MIXER.TXT, 15MIXER.TXT, 22MIXER.TXT. Copied them over via floppy to my Vista computer...

Using Notepad, opening up 14MIXER.TXT and 15MIXER.TXT and 'lining the two windows up side-by-side' on my display monitor. This makes it very easy to compare the code, actually. There is just TOO MUCH change for 'DIFF' to be of any real help. Unfortunately fixing this is not going to be a matter of changing an errant flag or a faulty define. I don't understand enough about the code's FUNCTION (theory-of-operation, and HOW this affects DOS/SBPro) to even know where to start.

Its gonna be a... 15-cup-of-coffee problem, at least.
??? :P

 1   2   3 


Go to: