![]() |
|
Alleg422/DJGPP/DOS/SBPro/Bad Sound |
Peter Wang
Member #23
April 2000
|
No, you really want diff. Even better is to learn to use Subversion. Then you can use a bisecting algorithm to figure out exactly which change caused something to break. Start by finding a revision that works and one that doesn't. Then pick a revision in the middle and check if that works, and so on. You should find the offending change within one or two cups. You might have trouble compiling old code but as I remember, when you switch between revisions Subversion will try to keep any modifications to files you have made so you don't have to keep reapplying the same changes. If you're willing to do try this out, I or someone else can provide the details.
|
JeffTX
Member #9,836
May 2008
![]() |
Peter Wang said: No, you really want diff. Okay; I just looked over the online documentation on Delorie, and a few other sites, to understand what the output of DIFF looks like and how it could help me. I downloaded dif287b, dif287d, and documentation in the form of an ascii text file. Peter Wang said: Even better is to learn to use Subversion. Then you can use a bisecting algorithm to figure out exactly which change caused something to break. Start by finding a revision that works and one that doesn't. Then pick a revision in the middle and check if that works, and so on. You should find the offending change within one or two cups. I've already done this (using the old fashioned brute force method); Allegro 4.1.14 : WAV playback and MIDI playback in a DOS environment through a SoundBlaster Pro (CT-1600) sound just fine, work flawlessly. Allegro 4.1.15 : MIDI sounds fine, but the volume is severly depressed, and in SETUP -> (alter the volume for MIDI) it has little if any effect. Peter Wang said: You might have trouble compiling old code but as I remember, when you switch between revisions Subversion will try to keep any modifications to files you have made so you don't have to keep reapplying the same changes. Yes, I would like to get Allegro 4.22 fixed so that I can use the latest GCC / GPP to build and use it. I don't want to settle for 4.1.14 'just because it works, yet I have to use an older version of GCC to build it'. Peter Wang said: If you're willing to do try this out, I or someone else can provide the details. I think the problem is very technical. I've looked at the differences between MIXER.C for Allegro versions 4.1.14 and 4.1.15 several times this evening. I just get a headache each time. There is nothing OBVIOUS that leaps out at me, like a flag in 4.1.15 that was improperly set, or a define that was left out. I don't understand enough of WHY instead of WHAT, otherwise I might be able to fix it. I don't think DIFF is going to help. I can open two Notepad Windows on my (Vista) computer, compare MIXER.C from 4.1.14 and 4.1.15 side-by-side, and scroll through the two files quite easily. I need to know what was done to 4.1.15 that would probably cause Allegro to do this to a SBPro in a DOS environment. |
Edgar Reynaldo
Major Reynaldo
May 2007
![]() |
Doesn't diff tell you exactly which lines changed? I've done the transparent side by side log viewing before and knowing which lines are different would be nicer in my opinion. Perhaps it's not the mixer changes that broke it at all but the sound driver that changed. I wouldn't really know , but it sounds possible anyway. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
Peter Wang
Member #23
April 2000
|
Quote: I've already done this (using the old fashioned brute force method); Not quite. You know it's between the released versions 4.1.14 and 4.1.15. With Subversion you can narrow that down to the exact revision. In other words, the date and time that the offending change was checked in. But it's up to you.
|
Audric
Member #907
January 2001
|
If you have a windows machine, I really recommend winmerge. |
JeffTX
Member #9,836
May 2008
![]() |
Edgar Reynaldo said: Doesn't diff tell you exactly which lines changed? I've done the transparent side by side log viewing before and knowing which lines are different would be nicer in my opinion. Perhaps it's not the mixer changes that broke it at all but the sound driver that changed. I wouldn't really know , but it sounds possible anyway. First, I looked at the 4.1.14 sources to find files that I should check (because they might effect WAV playback). I made a list of 10 files in \SRC and \SRC\DOS. Actually I opened EVERY source file just to make certain. If it had anything to do with WAV, MIDI or sound, I listed it. This DID include the appropriate driver (SB.C). I made a note of the file sizes from 4.1.14. Then I compared those 10 files from 4.1.14 and 4.1.15. Only two had changed; DIGMID.C and MIXER.C. Peter Wang said: Not quite. You know it's between the released versions 4.1.14 and 4.1.15. With Subversion you can narrow that down to the exact revision. In other words, the date and time that the offending change was checked in. Okay - I guess I just don't understand. I downloaded and archived to CD every version of Allegro from 3.1 through 4.22, and I also ended up archiving most of DJGPP, including several versions of GCC. So - you're saying that for 4.1.15, there is some kind of a timeline for every change? So that maybe I could try altering one change, rebuilding Allegro, and seeing if the alteration worked? You see - how do I know WHICH change is the OFFENDING change? |
Thomas Fjellstrom
Member #476
June 2000
![]() |
Quote: So - you're saying that for 4.1.15, there is some kind of a timeline for every change? Version Controll is very nice like that. Code is commited to the Version Controll system every so often, and you can narrow down the problem to a specific commit to the VCS, then somoene who knows more about it can go in and fix the problem much easier (I dont think any of us have DOS boxes to mess with). Quote: So that maybe I could try altering one change, rebuilding Allegro, and seeing if the alteration worked? Nope. While you can, it wasn't actually suggested for YOU to fix it, just to help find it. -- |
Peter Wang
Member #23
April 2000
|
Jeff, I think you're on the right track anyhow: the only relevant changes in that time period are to mixer.c and digmid.c. These are the only changes to those files (excluding one trivial one):
I have attached the diffs corresponding to those changes. Edit: yup, Chris is reading.
|
Kitty Cat
Member #2,815
October 2002
![]() |
Quote: Jeff, I think you're on the right track anyhow: the only relevant changes in that time period are to mixer.c and digmid.c. These are the only changes to those files (excluding one trivial one)
Unfortunately, the mixer change is a very large change, so it's difficult to tell what, if anything, in there may have broke it (I've since learned better than to make big changes like that all at once -- |
Elias
Member #358
May 2000
|
Peter Wang said: And if Elias is reading: that was an awful log message.
I'm getting the dev forum over mail into the same mail folder as the mailing list, so yes.. and to my defense, that commit was a long long time ago - my log messages have gotten much better since I don't remember much about the issue itself though, I guess it was discussed and tested on the mailing list before committing - but maybe not under DOS. And Chris is here anyway so hopefully it can be figured out. Hm, one thing to narrow this down a bit without looking at the code, can someone try with another sound card under pure DOS? I assume, it's not the DOS sound as a whole which is broken, but just this particular card - but I wouldn't be sure. Wouldn't surprise me a lot if there weren't many who tried this in pure DOS in the last 5 years. -- |
Ron Novy
Member #6,982
March 2006
![]() |
something that looks odd to me in sb.c is at line 816. Here is a snippet starting at line 802:
Don't know though... I can't test it myself as I don't have an sb card here at the moment... anyway I'll keep looking. ---- |
JeffTX
Member #9,836
May 2008
![]() |
Thanks all for assistance - I am just waking up, and I am on only my second cup of coffee. Cool thing about being 'retired', your time is all your own (and maybe you have a 'right' to be grouchy hehehe). For some reason I needed a lot of sleep after yesterday. Ron Novy; Elias; Peter Wang / Kitty Cat; I made it easier for myself by archiving all the DJGPP ZIPs (and I think 3 or 4 versions of BNU and GCC) and several Allegro ZIPs in an archive directory on that DOS machine, so its relatively easy (by now) to rebuild everything. I will try DIFF this afternoon. Again, thanks for the assistance - I realize that not many people still tinker around in DOS, though one person in this thread sent me a private about it (his concerns coincided with mine, he also wanted to 'fire up his P166' and try things). Those DIFFS were from 4 years ago(?), so I guess it isn't a suprise that no DOS testers came forward (too bad, because the 'bug' is persistant through 422, its reasonable to assume its still there. Though I don't see much benefit for a DOS user to progress past Allegro 422 / DJGPP-GCC and GPP 428). Okay - I think that the easiest thing (for me) is a brute force approach. I want to look at those DIFF files first; but maybe I can 'hack and slash' C sources from 422 to make them more like 4114 (IE undo the mixer / digmid changes) (or change C sources from 4114 to make it compatible with 422 / GCC 428). I'm tempted to just 'drop in' the .C from 4114 into a 422 before I build it - if the changes are all/mostly internal to all/most functions, I might get very few error messages during the build. I realize that this would be against Allegro design philosophy, but this would be along the lines of a 'personal patch', and I don't see that too many people are interested in DOS. A more elegant solution would be to test the environment and equipment, and IF DOS and IF SBPRO, than sidestep the Mixer and DigMid changes. I'm afraid that trying to determine 'why' the mixer changes are incompatible with this situation is beyond me. I know how to program, I know about the SBPro (probably more than a casual user but less than an engineer); but I can't absorb WHY the mixer changes are effecting the SBPro this way in DOS. UPDATE: UPDATE2: I'm falling back to Allegro 3.12; that was apparantly the last DOS-only version, its a smaller/simpler installation, and I'll probably still have fun with it (apparantly versions earlier than that were used for 'DosDoom'). One last general question on building and using/compatibility: Apparantly the most recent version of GCC that was compatible with Alleg 3.12 was version 2.95.3. I downloaded it. I assume thats the same for GPP? I downloaded GPP version 2.95.3 Also downloaded Objective-C; 2.95.3; In case I might want it for some reason. Ok so now I am concerned about the rest of DJGPP. Logically only the compiler versions matter. I know that the lastest MAK and RHide are okay, because on a DosDoom site that offered source for the game, an Allegro version prior to 3.12 was referenced; and the referenced versions of MAK and RHide corresponded with the latest versions from the Delorie FTP site (I guess MAK and Rhide haven't changed much). What about BNU? Will the most recent (BNU217) work? (I'm concerned because apparantly that package contains the assembler, among other things). I think I can assume that the most recent 'File Utilities (FIL41B, I think) is ok - they are basically just a bunch of EXEs to manipulate files and directories. What about the debugger, GDB? does that matter - with an older Allegro / GCC / GPP (BNU)? The latest TXI should work (I hope - on the older 3.12 info file?). Any other pitfalls I am not aware of yet with falling back to Alleg 3.12, and DJGPP? - Thanks |
Audric
Member #907
January 2001
|
I didn't dare plug my old P166 in the attic but I did check the CDs of my friend Paul Siramy, which contain the versions we used, back in 1998: DJDEV202.ZIP DJGPP 2.02 CSDPMI3B.ZIP CWSDPMI BNU281B.ZIP binutils : as, ar, ld, strip... GCC281B.ZIP gcc GDB416B.ZIP gdb debugger GPP2721B.ZIP gpp (c++) LGP271B.ZIP c++ libraries MAK3761B.ZIP make MLP105B.ZIP djp (executable compressor) RHIDE14B.ZIP Robert Höhne's IDE, a must have TXI390B.ZIP texinfo for documentation PAT25B.ZIP patch, to apply diff's BCD_102.ZIP (library to read audio from CD's) LIBJGMOD 0.23 (library for MOD music playing) ALLEG30.ZIP Allegro 3 No "major" (first digit) version difference from what you reported, so I think they stand a very serious chance to be compatible. |
JeffTX
Member #9,836
May 2008
![]() |
Thanks, Audric; I just noticed another complication though (too complicated to get into right now). Maybe I should take a break from this for a couple of days. |
Evert
Member #794
November 2000
![]() |
Any changes to digmid are unlikely to affect playback of sound samples (it's the digital MIDI driver), so you probably only need to look at the mixer. Just thought I'd point this out. |
Ron Novy
Member #6,982
March 2006
![]() |
Ok... I've been pretty bored today so I thought I'd look through some sound code... If the problem hasn't been discovered yet then here is my theory... The SB driver is using the function _mix_some_samples from mixer.c and the function looks ok to me... So I think the problem is that the SB driver isn't setting the 'issigned' flag correctly when calling the function... From what I remember the 8-bit sample format for the sound blaster is unsigned... In the SB driver 'issigned' is being set to 'TRUE' for 8 bit sound and 16 bit sound. So if this truly is the problem there are two ways to fix it... You can program the SB to send unsigned data in 16-bit mode and set all the 'issigned' flags to 'FALSE' in SB.c or set the flag appropriately according to the number of bits being used... I think either way should work ok... I'll be back later with some testable SB.c files... [EDIT] Attached a modified sb.c for testing if anyone is interested... ---- |
JeffTX
Member #9,836
May 2008
![]() |
Ron Novy; Which version of Allegro is that from? Thanks. I'll test it on a DOS machine once I know which version of Allegro (and thus which version of DJGPP) I need to re-install; which version(s) of Allegro I can 'drop that in to'. (I've about given up trying to fix Alleg 4.22 myself). |
Audric
Member #907
January 2001
|
I'm just thinking it should be possible to test with DOSbox. |
Ron Novy
Member #6,982
March 2006
![]() |
Oh sorry... It's Allegro V4.2.2 and just for comparison the creation date on the SB.C file is 12/28/2007. ---- |
JeffTX
Member #9,836
May 2008
![]() |
Ron; Thanks! I'll try that out sometime today. I have to re-install the latest DJGPP, and Allegro 422... I'll drop that modified .C file in, build it, and see what happens. I'll post the results. It may be a few hours... I've been up all night working on something else. I have to be careful with these 'experiments'. Its old, legacy hardware that I am using. That 2 Gig drive, being thrashed with I don't know how many attempts over the past couple of weeks - it couldn't have been good for it. I started to just 'settle' for Allegro 3.12 (and an older DJGPP), but most of the tutorials that I found (including 'Vivace') were just too incompatible without heavy modification. Thanks for trying this, I hope it works. If it doesn't, I am almost 're-energized' enough to try hacking 4.22 again. |
Ron Novy
Member #6,982
March 2006
![]() |
Quote: Thanks! I'll try that out sometime today. I have to re-install the latest DJGPP, and Allegro 422... I'll drop that modified .C file in, build it, and see what happens. I'll post the results. It may be a few hours... I've been up all night working on something else.
Hey no problem... I get bored sometimes and usually have a lot of free time so I like to solve problems/puzzles and play games... But I've been up all night myself working on different things. This year I seem to be extra busy... Anyway... I'm crossing my fingers that it works. ---- |
JeffTX
Member #9,836
May 2008
![]() |
RON; That modified SB.C source worked! (Allegro 4.22, DOS, Creative Labs SoundBlaster Pro). Thanks very much. In the Allegro SETUP program, the TEST DIGITAL function resulted in an UNdistorted 'gong sound'... the way its supposed to, instead of a screech. The PLAYSAMPLES example program plays UNdistorted WAVs now. ---- Also, its possible that a minor bug with MIDI files was fixed(?). I'm not COMPLETELY sure about this, because I was focusing on sample playback problems. But it seems to me, with a couple of Allegro 4.1.15 and 4.22 builds (several times), MIDI playback in the Allegro SETUP program via TEST MIDI had noticably low volume... I could turn up the speakers to hear MIDI, and of course digital sound playback was a lot louder (but not TOO much so). What I would call a 'minor annoyance'. Even more significant, though, was that it didn't matter what I set the volume to for OPL3; the default -1, or 255, or 10, or 128; MIDI was at a constantly somewhat-low volume. Now with this modified SB.C of yours, MIDI output still seems to be a little low, but Allegro SETUP \ OPL3 -> change the volume; now seems to be working. I can impose changes (back and forth) between volume settings of -1 (default), 10, 50, 128, 255, 75, etc, and it behaves as you would expect. THANKS much! (edit) As far as I'm concerned, Ron fixed the problem (at least for my setup). I don't see myself getting back into Windows programming any time TOO soon; I used to be very active with MSVC6 and the DirectX SDK; but with this new computer / Vista Home Premium, I see indications of bugs / problems / headaches with various compilers in several forums when the users are using Vista. Maybe 'later'. So now I can use the latest DJGPP, Allegro 4.22; in a DOS environment on a legacy DOS machine. Yes, its pre-historic, and some people snicker (admit it - you KNOW you do), but thats OK, I can still have fun with it. I have one more thing I want to do for Allegro 4.22; add a new joystick type. Allegro 4.22 'comes equipped' for a CH Flightstick Pro (I believe more than two buttons, plus a hat, and a throttle); I am using a CH Flightstick ('basic'?) for my DOS machine... just two buttons and a throttle. I've studied the joystick-related sources, this looks easy to do. |
Evert
Member #794
November 2000
![]() |
Quote: That modified SB.C source worked!
Good. The fix should probably be commited to 4.2 branch and probably 4.3 as well. Quote: I have one more thing I want to do for Allegro 4.22; add a new joystick type. Allegro 4.22 'comes equipped' for a CH Flightstick Pro (I believe more than two buttons, plus a hat, and a throttle); I am using a CH Flightstick ('basic'?) for my DOS machine... just two buttons and a throttle. Does the (more extended) Pro driver not work with your joystick as well (just identifying it incorrectly)? |
JeffTX
Member #9,836
May 2008
![]() |
EVERT; About the joystick; yes, the CH Flightstick Pro setting DOES work; that is, the buttons (just button 1 and 2, but I think if I remember correctly the 'Pro' has 4? ... and a hat switch), the throttle, X and Y axis all work. Its just that if I select Flightstick Pro, its seems kinda ... 'weird' ... because there are 'dead' controls when Allegro 'thinks' I am using a FS Pro. No big deal... one could select FS Pro and just not bother reading the hat or extra buttons (that is if I ever complete a game project - I have ideas). There were a few joystick models (pre-usb, DOS era, etc) that had this configuration - 3 axis (X, Y, and Z or X, Y, and throttle) and only 2 buttons... just being a perfectionist, I guess; I want to add this joystick type to the list. Examining the code it seems like it will be VERY easy to do - I'll get around to it within a couple of days; I have too many 'irons in the fire' right now. --- I might be mistaken, but I thought the 4.22 branch had been... 'closed'? Of course, the fix should probably be implemented for branches still in development; you never know when another DOS user / SBPro user will come along. Allegro is presented as being compatible for DOS, DJGPP, SBPro; so the code should be fixed. Possibly a 'Patch for DOS users' should be released on the main site for 4.22. I myself am satisfied... for the DOS machine that I have, I don't see any reason to progress past Allegro 4.22. I might be interested later in recent versions if I get back into Windows programming. |
Evert
Member #794
November 2000
![]() |
Quote: About the joystick; yes, the CH Flightstick Pro setting DOES work Ok, good. Quote: I want to add this joystick type to the list. Fine and yes, this shouldn't be very hard from what I remember. Quote: I might be mistaken, but I thought the 4.22 branch had been... 'closed'?
There is no 4.22 branch, just a 4.2 branch. Quote: Of course, the fix should probably be implemented for branches still in development; The only relevant one is probably the 4.3 branch. Quote: Allegro is presented as being compatible for DOS, DJGPP, SBPro; so the code should be fixed.
Exactly - which is why in my opinion a 4.2.3 is not out of the question. Quote: Possibly a 'Patch for DOS users' should be released on the main site for 4.22.
And we can make the patched version available for download and call it Allegro 4.2.3. |
|
|