[Openal] Re: Help! Inconsistent behaviors with Listener velocity

Garin Hiebert garinh at cheesetoast.net
Thu Apr 21 18:57:42 PDT 2005


Weird -- I got this message, but the list did not.  The list doesn't 
really do any sophisticated rejection -- it just puts a hold on items 
which don't appear to be from a list member, and deletes messages which 
go to both lists (a very useful anti-spam measure).  I don't remember 
offhand what the policy is with attachments, but certainly they _are_ 
allowed up to some limit.

Maybe try again without the attachment, referencing somewhere else on 
the net for the file...  I can host the file for you temporarily if you 
want.

Garin



On Apr 21, 2005, at 3:20 AM, E. Wing wrote:

> I am having really bad problems with the Listener velocity. I am
> getting totally inconsistent behavior among the distributions and they
> all behave in a way that contradicts my expectations. It seems that
> when I set a velocity on the listener, the wrong thing happens (a
> different wrong thing depending on the distribution).
>
> Also, the listener orientation coordinate system seems to be different
> between the distributions as well.
>
> I stumbled on this problem while testing the new Mac/CoreData OpenAL
> backend after Apple fixed the Doppler problem I had posted several
> months ago. After the fix, the Doppler shifts were not behaving the
> way I expected and sounded very different (and wrong) from my Windows
> and Linux versions. To isolate the problem I wrote a small test
> program (enclosed).
>
> The test program deals with a listener and a single source. The
> program does as follows:
>
> 1) Starts playing a looping sound with a stationary source and
> stationary listener. The listener is at <0,0,0>. and the source is at
> <10,0,0> (sound is on the right side). This test works on all
> platforms correctly and is just done so the user knows what the base
> sound is like.
>
> 2) Next I set the listener velocity to <100, 0, 0> so it is moving
> towards the stationary source. I think the pitch should be higher.
>
> 3) Then I set the listener velocity to <-100, 0, 0> so it is moving
> away from the stationary source. I think the pitch should be lower.
>
> 4) To show that the problem isn't just with the x-axis, I test the
> y-axis by setting the Listener position to <0,0,0> and the stationary
> source position to <0,10,0> and setting the listener velocity to
> <0,100,0> which should be moving towards the source. I think the pitch
> should be higher.
>
> 5) Next, I tested the z-axis by setting the listener position to
> <0,0,0> and the stationary source position to <0,0,10> and set the
> listener velocity to <0,0,100> to once again move towards the source.
> I think the pitch should be higher.
>
> 6) To verify that only the listener seems broken, I then test a
> stationary listener against a moving source. I set the source position
> at <0,0,0,> and the listener position to <10,0,0> (the sound is on the
> left side this time). I set the source velocity to <100,0,0> so it
> should be moving towards the listener. I think the pitch should be
> higher. (This test seems to work correctly on all platforms.)
>
> 7) Finally, I see what happens if I set the listener and source to
> move towards each other. The source is still at <0,0,0> and the
> listener is still at <10,0,0>. The source velocity is <100,0,0> and
> the listener velocity is <-100,0,0>. I think the pitch should be
> twice(?) as high as before.
>
> But what I think should happen is not what actually happened. On the
> new Mac implementation, everything was the opposite of what I expected
> (except where I denoted it worked everywhere).
>
> To verify the results, I originally used a very old CVS version of
> OpenAL I had installed on Debian Woody (Linux), maybe 2 years old.
> Maybe I'm losing my mind, but when I did this test (about 2 weeks
> ago), I am fairly sure that this version behaved within my
> expectations, which is what led me to believe the Mac version was
> incorrect. (I think I remember being satisfied when #7 met my
> expectations.)
>
> But I extended my test to the Nvidia (Windows) implementation, and
> suddenly I got a whole different behaviors. With the Nvidia
> implementation, I seem to be getting no Doppler effect from Listener
> contributions at all.
>
> So confused, I dropped in some device enumeration code and tried the
> DirectSound3D and DirectSound implementations. The D3D behaved exactly
> like Nvidia, and DirectSound gave no Doppler effects for anything (not
> even for the sources).
>
> Unfortunately, my Woody box suffered a series of calamities in the
> past 2 weeks and I can no longer test on that system to reverify my
> results. I had a different Debian Sarge box that I ran the test on,
> but this one behaved exactly like the Mac version. So I'm wondering if
> I'm losing my mind because this is the exact opposite of what I
> thought my Woody results were. But it could be that something has
> changed in the Doppler backend for Linux in the past two years. The
> OpenAL distribution for Sarge was under package management and not
> CVS. Maybe it's also possible that the "fixed" Mac backend was based
> on the Linux distributions which would explain why they are the same.
> But I don't really know.
>
> Unfortunately, I don't have any Creative cards to test on. But I seem
> to have enough inconsistent behavior that I have no clue what's going
> on. (Though I would like to know what the other implementations do.)
>
> But here are my results summarized:
>
> 1) Pitch is normal. Everybody does this correctly.
>
> 2) I think the pitch should be higher.
> Apple: Pitch is lower
> Nvidia: No change in pitch
>
> 3) I think the pitch should be lower.
> Apple: Pitch is higher
> Nvidia: No change in pitch
>
> 4) I think the pitch should be higher
> Apple: Pitch is lower
> Nvidia: Pitch is higher (But why not in #2?)
>
> 5) I think the pitch should be higher
> Apple: Pitch is lower
> Nividia: Pitch is higher (But why not in #2?)
>
> 6) Pitch is higher (works on all)
>
> 7) I think the pitch should be twice(?) as high (at least higher than 
> #6)
> Apple: No pitch shift (as if they were moving together instead of 
> closing in)
> Nvidia: Pitch is only as high as #6, not higher
>
> DirectSound3D gave me the same results as Nvidia for all the tests.
> DirectSound and MMSystem gave no Doppler shifts of any kind.
> Sarge gave the same results as Apple.
> I believe Woody gave me the results I was expecting.
>
> But regardless of my expectations, because the distributions are
> giving totally different results, I presuming that either I'm missing
> some kind of initialization state which leads to undefined behaviors
> in my test program, or that at least one (if not more) of the
> implementations are incorrect. (Or I just did something incredibly
> stupid which would be entirely possible.)
>
> Also, I seem to be having problems with the listener orientation. The
> Sarge distribution seems to have a reversed Z-coordinate compared to
> Windows and Mac.
> For Windows and Mac, I must set the listener orientation to:
> ALfloat front[]  = { 0.0f, 0.0f,  -1.0f, 0.0f, 1.0f, 0.0f };
> But in Sarge, I had to set it to:
> ALfloat front[]  = { 0.0f, 0.0f,  1.0f, 0.0f, 1.0f, 0.0f };
> Otherwise, the sound came out the wrong side. I checked my speaker
> connections and they don't appear to be flipped.
> I didn't notice if Woody was flipped because I wasn't paying attention
> to that at the time.
>
> So, first, I would like to verify if my expectations are correct. Is
> my interpretation of what the OpenAL listener attributes should do
> seem reasonable?
>
> If so, then I would like to know if my sample program is correct. Can
> anybody determine if my program is flawed? And are people getting
> other results than mine?
>
> And finally, what should really be happening?
>
> Attached is a zip file containing my test program source code, a few
> sample wave files, and a Windows exe. You'll need to rename a.ex to
> a.exe because Gmail won't let me send exe files. Or you can just
> compile the source yourself. (Linux and Mac will have to compile
> yourselves anyway.)
>
> Thanks,
> Eric
> <AL_LISTENER_VELOCITY_ISSUES.zip>




More information about the Openal mailing list