www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/12/03/08:16:51

From: Luca Bisti <s150405 AT studenti DOT ing DOT unipi DOT it>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Sound stream corruption with Allegro?
Date: Fri, 3 Dec 1999 00:19:27 +0000
Organization: Universita' di Pisa
Lines: 21
Message-ID: <Pine.BSF.4.10.9912030018150.66504-100000@studenti.ing.unipi.it>
References: <Pine DOT BSF DOT 4 DOT 10 DOT 9912020027390 DOT 39597-100000 AT studenti DOT ing DOT unipi DOT it> <Lyn14.1555$US6 DOT 45968 AT dfiatx1-snr1 DOT gtei DOT net>
NNTP-Posting-Host: studenti.ing.unipi.it
Mime-Version: 1.0
In-Reply-To: <Lyn14.1555$US6.45968@dfiatx1-snr1.gtei.net>
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> Happens to me under NESticle, loopyNES, any DOS
> Allegro program, or for that matter any Sound Blaster
> program that plays waves. Windows tends to fsck up
> DMA because its timer's resolution is too low. What
> happens when you run from M$-DOS mode?

The problem occurs also under plain MSDOS. As I said, I don't think it's anything related to the DMA or interrupt processing, it sounds more like a sample aliasing problem (similar to when you convert a sample to a very very low amplitude and then re-amplify it back, but it's just an example).

I'm pretty sure is that it's due to a software alteration like additional filtering, resampling or things like that performed by Allegro. Look: when I play the WAV file through WinAMP, CoolEdit, Windows player and anything else you like, the music sounds clean; if I play the same WAV with "EXSAMPLE.EXE" (a WAV/VOC player example which comes with Allegro), the music sounds corrupted, so it must clearly be Allegro's fault! I can send a very small fragment of the WAV to anybody who wants to try it him(her)self and help me.

I have taken a look at the Allegro source code ("MIXER.C") and I have even tried to bypass the vol[] indexing in the various mix_mono_8x1() functions, but with no result. This is not the only operation done by the Allegro mixer, but unfortunately I have no time to study MIXER.C deeply to check where the problem is. All I ask for is a way (if it exists) to be sure to bypass any kind of processing introduced by Allegro, so that my sample buffer is passed to the soundcard *untouched*. Let me insist on the fact that the music sounds much clearer with any non-Allegro soundplayer, so it might be a good idea to revisit Allegro's mixing code to improve overall quality. Note that in my case Allegro does not need to do any mixing/resampling, since I have only one voice open and playing at the same rate of the soundcard.

I'm feeling comfortable with Allegro, so I'd like to try all the possible ways before giving up and port the code to another sound library like SEAL, MIDAS, or even write a new one myself (btw, any other good library to suggest me?). I only need audio buffer playback (I mix channels myself).

Thanks again,

Luca.

PS: It happens with any version of Allegro; I'm currently using WIP 3.9.28


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019