Hi Curt,
Curtis Olson schrieb am 07.11.2008 23:12:
On Fri, Nov 7, 2008 at 2:55 PM, Curtis Olson wrote:

    Question: has anyone noticed anything odd with the stall horn
    sound in the default c172p in the current cvs (although it's
    likely been an issue since we migrated to openal?)

    When the stall horn goes off, it used to be a clean/constant tone,
however in openal it's warbly disjointed crackly sort of sound. It's enough to be very aurally annoying.

    I almost wonder if this issue affects all our sounds, but because
    the stall horn audio is such a clean sine wave with no extra noise
    or "character", any little imperfection in the audio system really
    jumps out when the sound is played.  This really seems like it
    could be related to inconsistent positioning of the listener
    versus the sound source?

    The audio imperfections seem to be correlated with frame rate changes.

    Anyone have any ideas on this?


Replying to my own message here ...

In src/Main/main.cxx the sound positions and velocities are updated. I observe that the velocity is computed as (current position - last position) / dt. However, this approach leads to inconsistent velocities because of some very subtle issues related to the flight dynamics update loop.

If I force the velocities to be zero, the sound quality *greatly* improves, and not just with the stall horn. The overall sound is much more "rich" and vibrant (at least to my ears.)
Unfortunately I do not have a running flightgear now. I assume, that you are in the cockpit. Can you check what happens, if you change line 642 from
globals->get_soundmgr()->set_source_vel_all( model_vel );
to
globals->get_soundmgr()->set_source_vel_all( listener_vel );
This forces the velocities of all sounds to be the same as the listener velocity. In theory these two values should be exactly the same when you are in cockpit view. If the sound is "ok" after this, there is an issue with the order of view position calculation, model position calculation and sound calculation. If the sound is not ok, it could be either a bug in the Doppler calculation (which kind you are using: USE_OPEN_AL_DOPPLER, USE_OPEN_AL_DOPPLER_WITH_FIXED_LISTENER or USE_SOFTWARE_DOPPLER?) or (again) a bug in the view position calculation or in the model position calculation. If you are not using USE_OPEN_AL_DOPPLER I am rather sure, that the viewer and the model position are not aligned, probably due to the order of updating these values.

I'm not sure the best solution here since I'm sure we need correct velocities to get correct doppler effects.

I am trying to understand the code a bit more and I see that both the listener and the sound velocities are rotated into a new coordinate space. Is this necessary? It seems like the important thing is the relative velocity of the sounds, not what coordinate system they are transformed into?
No, not only the relative velocity is from interest. If you are in front of a mach 2 flying jet you will hear nothing from the jet, even with a relative speed of zero. But you can use any coordinate system as long as it is not moving compared to the air. If I remember correctly, we are using a coordinate system with its orient at the listener position in the same orientation as the aircraft.. Therefore we need only an offset to transform the sound source coordinates to this coordinate system and don't need to transform the sound source orientation.

Is it worth giving up on doppler effect to get reasonable cockpit sounds, or is doppler a big enough win to put up with really crappy cockpit sound with lots of artifacts?
I think its worth to dig down this bug.

It wouldn't be hard to add an --enable/disable-doppler configuration option?
sure, but better fix the problem instead of adding a switch to choose between two problems. From my point of view the Doppler effect adds much realism to flightgear. As a workaround we could switch off the Doppler effect in all internal views. But there are other bug reports about the Doppler sound, maybe your observations lead us to the right track to fix some of them.

Thought/comments?

Regards,

Curt.
--
Curtis Olson: http://baron.flightgear.org/~curt/ <http://baron.flightgear.org/%7Ecurt/>
Regards,
Maik
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to