Re: [AD] Amiga OS 4.3.10plus patch |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
On Thu, 2009-01-29 at 07:47 +0000, Colin Ward wrote:
>
> >> Once it's in, can someone give me Subversion access so that I can
> >> continue to update it?
> >
> > Sure. What's your SF username again?
>
> It's colin_ward.
Peter already gave you SVN access two years ago then :)
>
> >> I also have a couple of local edits of the Allegro src directory - in
> >> particular we have issues with signed -vs- unsigned sound samples, but
> >> that's a subject for another thread.
> >
> >>From what I remember, Allegro samples always have to be unsigned, but
> > the mixer code supports real-time conversion to signed if the sound
> > driver asks for it.
>
> Could you elaborate? I had a look through src/sound.c and src/mixer.c but
> couln't find anything like this.
http://www.liballeg.org/stabledocs/en//alleg001.html#SAMPLE
The data field of SAMPLE is a public, documented field, so games access
it directly and modify it. Therefore it always is unsigned. This can't
be changed.
>
> This is the "big" issue that I have to sort out before I can submit the OS4
> port. Currently I have a system that got rejected when I suggeseted it
> whereby I updated the routines that load audio samples from .dat files,
> from .voc files and from .wav files so that they can convert the loaded
> data to signed format if requested by the sound driver. This works well
> but when I suggested doing it like this on this list a while ago it got
> rejected. Are you saying that this can be done dynamically already?
The last parameter of _mix_some_samples tells the Allegro mixer whether
to output to signed or unsigned - so if the Amiga sound system expects
signed data, you should set it to TRUE (then send the data in the buffer
to the sound system). Maybe look at src/unix/alsa9.c or
src/win/wdsndmix.c or src/macosx/soundman.m.
> Also, even if my suggestion got accepted, we have a situation where some
> games are a bit "odd" in that they seem to use the "opposite" signedness of
> what they should. For example, in .dat files 8 bit samples are in unsigned
> format and 16 bit samples are in signed format. Normally the datafile
> loader will leave 8 bit samples as they are and will convert 16 bit samples
> to unsigned. So I put in some code to do the opposite and leave the 16 bit
> samples as they are and convert the 8 bit samples to signed. Fine. This
> works 99% of the time.
>
> But then I found some games where the occasional sample is *opposite* what
> it should be! So I end up feeding a sample of the wrong signedness into my
> sound card and get white noise. Yet this same game works fine on Windows
> but I can't see anywhere where Allegro checks the signedness of samples
> when loading them!
>
Is the source and data of this game available? As far as I understand,
that shouldn't be possible. But it's some time I looked at the sound
code, and maybe I never fully understood it either.
--
Elias Pschernig <elias@xxxxxxxxxx>