[Openal] Doppler effect&other trouble
Ed Phillips
ed at udel.edu
Thu Sep 21 13:54:45 PDT 2006
Hi,
On Thu, 21 Sep 2006, Garin Hiebert wrote:
>> I'm guessing you're using the sample implementation. First of all, you
>> should definitely try the latest source from the Subversion repository
>> (look at http://www.openal.org/downloads.html for instructions), and see if
>> that does any better for you. I suspect that a lot of the issues you're
>> pointing out will go away with the latest code.
>
> Follow Jason's advice and make sure you're using the latest code out of
> Subversion. Then, read up on how Doppler works in the 1.1 specification (see
> the docs on the OpenAL site -- section 3.5.2 of the 1.1 spec, and/or the
> doppler section of the Programmer's Guide), and use the implementation in
> that way.
>
> Doppler was an area of confusion and inconsistency with OpenAL 1.0 -- hence
> the changes for 1.1. Specifically, alDopplerVelocity is not a preferred
> entry point any more -- use the "speed of sound" and "doppler factor"
> parameters to control Doppler.
>
> I'm not intimately familiar with the Linux implementation, so I don't know
> the current status of the Subversion code on 1.1 support -- there may be bugs
> and the workaround(s) may encompass using 1.0 functionality
> (alDopplerVelocity), but hopefully the 1.1 method can be made to work, as
> that's how things are _supposed_ to work at this point...
For what it's worth, I already noted this problem about a year ago - but
it was never fixed (and my quick-n-dirty fix wasn't used to at least make
it work in the interim until the real "1.1 Way" is implemented in what is
now called "OpenAL-Sample")...
Ed
---------- Forwarded message ----------
From: Ed Phillips <ed at UDel.Edu>
To: openal-devel at opensource.creative.com
Date: Tue, 27 Sep 2005 17:29:42 -0400 (EDT)
X-Junkmail-Status: score=10/50, host=md1.nss.udel.edu
X-Junkmail-Whitelist: YES (by ed at ms1.nss.udel.edu)
Subject: [Openal-devel] Doppler problem on Linux
Hi,
I found the culprit with the doppler problem on Linux - the equations in
compute_doppler_pitch have been converted to follow to follow the 1.1 method
from the spec, but using they are using "doppler_velocity" without including
the speed of sound factor. Here's a quick-n-dirty fix against HEAD:
Index: linux/src/al_filter.c
===================================================================
RCS file: /usr/local/cvs-repository/openal/linux/src/al_filter.c,v
retrieving revision 1.33
diff -r1.33 al_filter.c
1262a1263,1268
> /*
> * speed is actually the "doppler_velocity" parameter - for the new
> * doppler equations, we need speed of sound...
> */
> speed *= 343.0;
>
I think this is mainly due to the fact that the 1.1 conversion to
alSpeedOfSound() hasn't been completed on Linux yet, but this should make the
calculations work correctly in the meantime at least.
Cheers,
Ed
Ed Phillips <ed at udel.edu> University of Delaware (302) 831-6082
Systems Programmer III, Network and Systems Services
More information about the Openal
mailing list