[Flightgear-devel] Doppler effect

2009-11-23 Thread Erik Hofman
Hi,

I've implemented a check for implementations that need a Doppler effect 
adjustment to be able to hear them but there might be implementations 
that sound exaggerated now. If so, please specify which ones and I'll 
update the check procedure.

Erik

--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] doppler volume

2009-01-22 Thread Vivian Meazza
James Sleeman wrote

 
 Hi Maik,
 
 Maik Justus wrote:
  the effect you are discussing is not the Doppler effect, but just the
 
 Yes, I know it's not a function of the Doppler itself, but I was
 thinking more along the lines of the volume drop off, if it were better,
 might help the convincingness of the Doppler, if you see what I mean.
 
  volume as a function of the distance. Every aircraft has its own sound
  definition including the distance, where the volume is halved
  (reference-dist) and the distance where the volume is cutted off
  (max-dist).
 Hmm, interesting.  It seems that a great many aircraft do not define
 these values at all.  Is there a default definition for these somewhere,
 is one calculated by openal maybe in the absence of these specific
 settings?
 
 At the end of this message is a quick grep showing the aircraft which do
 not define reference-dist.  Quite a list.
 
 Just to clarify on the reference-dist, is it that this value is a
 diminishing effect, that is for reference-dist of 1 after distance 1 the
 volume is half original, after distance 2 the volume is 1/4 original
 (half of a half), distance 3 it's an 1/8th (half of a quarter).  Or is
 it simply that at that specific distance, and for infinity beyond until
 max-dist the volume is always half the original?
 

snip ...

In simgear\source\simgear\sound\xmlsound.cxx I see that default values for
reference-dist and max-dist seem to be specifed. It seems possible that
these default values are no longer honoured. I think they worked at one
time. It is going to be extremely tedious and time consuming to explicitly
apply specific values to _every_ sound in fg. 

I would think that the attenuation of sound in air is amenable to
mathematical calculation. Surely we shouldn't be guessing at some arbitrary
reference distance?

Vivian

 



--
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] doppler volume

2009-01-22 Thread Maik Justus
Hello,
James Sleeman schrieb am 22.01.2009 01:14:
 Hi Maik,
 ...
 Just to clarify on the reference-dist, is it that this value is a 
 diminishing effect, that is for reference-dist of 1 after distance 1 the 
 volume is half original, after distance 2 the volume is 1/4 original 
 (half of a half), distance 3 it's an 1/8th (half of a quarter).  
yes, exactly.

Maik


--
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] doppler volume

2009-01-22 Thread Maik Justus
Hi,

Maik Justus schrieb am 22.01.2009 13:45:
 Hello,
 James Sleeman schrieb am 22.01.2009 01:14:
 Hi Maik,
 ...
 Just to clarify on the reference-dist, is it that this value is a 
 diminishing effect, that is for reference-dist of 1 after distance 1 
 the volume is half original, after distance 2 the volume is 1/4 
 original (half of a half), distance 3 it's an 1/8th (half of a 
 quarter).  
 yes, exactly.

not exactly, it's 1/8th at distance 4 (doubled distance result in half 
volume).
Maik


--
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] doppler volume

2009-01-22 Thread Maik Justus
Hi Vivian,
Vivian Meazza schrieb am 22.01.2009 11:17:
 I would think that the attenuation of sound in air is amenable to
 mathematical calculation. 
Yes it is. (at lest if your distance to the sound source is large 
compared to the size of the source).
 Surely we shouldn't be guessing at some arbitrary
 reference distance?

   
The problem is, we don't know, which distance the author was thinking 
about, as he defined/recorded the sound. For in-cockpit sounds the 
distance from the sound source to the cockpit may be a good guess, for 
out-of cockpit sounds the typical viewing distance of the aircraft could 
be a good guess, too. Therefore we will have two different guesses for 
e.g. the engine sound (as long as there are no different sounds defined 
for cockpit and external view)...
 Vivian

   
Maik


--
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] doppler volume

2009-01-22 Thread Melchior FRANZ
* Maik Justus -- Thursday 22 January 2009:
 Vivian Meazza schrieb am 22.01.2009 11:17:
  I would think that the attenuation of sound in air is
  amenable to mathematical calculation. 

 Yes it is.

But it depends on the frequency pattern, no? So we'd need to
analyze the spectrum ... time to use libfftw3.  :-)

I don't see why adding these values to the sound config
should be such a problem. Don't we specify animation
parameters to the smallest detail? Why should sound be
different?

OTOH, I would support global default values max-dist and
reference-dist in preferences.xml, which an aircraft
could override. And finally, every sound definition can
still define its own values like before.

JFTR: The bo105 sets these values since a while.  :-P

m.

--
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] doppler volume

2009-01-22 Thread Vivian Meazza
Melchior FRANZ

 Subject: Re: [Flightgear-devel] doppler volume
 
 * Maik Justus -- Thursday 22 January 2009:
  Vivian Meazza schrieb am 22.01.2009 11:17:
   I would think that the attenuation of sound in air is
   amenable to mathematical calculation.
 
  Yes it is.
 
 But it depends on the frequency pattern, no? So we'd need to
 analyze the spectrum ... time to use libfftw3.  :-)

Well even taking some arbitrary mid frequency would be better than a wild
guess.

 
 I don't see why adding these values to the sound config
 should be such a problem. Don't we specify animation
 parameters to the smallest detail? Why should sound be
 different?

And usually there are default values.

 OTOH, I would support global default values max-dist and
 reference-dist in preferences.xml, which an aircraft
 could override. And finally, every sound definition can
 still define its own values like before.


I don't see any particular merit is setting the value in preferences.xml,
but it would be nice if the default values worked as designed, no matter
where they are set.

 JFTR: The bo105 sets these values since a while.  :-P

Well done, but what do you base the values on?


Vivian




--
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] doppler volume

2009-01-22 Thread Melchior FRANZ
* Vivian Meazza -- Thursday 22 January 2009:
 Melchior FRANZ
 I don't see any particular merit is setting the value in preferences.xml,
 but it would be nice if the default values worked as designed, no matter
 where they are set.

It's always nice to have default values changeable, rather than
hard-coded. So a property is the right choice. And preferences.xml
is the place to initialize properties. And then, these values might
have to be changed at runtime: Sound propagation also depends on the
atmosphere, the terrain, etc. Probably nobody would ever bother,
but having the possibility doesn't hurt either.



  JFTR: The bo105 sets these values since a while.  :-P
 
 Well done, but what do you base the values on?

Real life experience and guessing. That's not much worse than an
unscientific calculation. If somebody doesn't like the values,
just complain and I might change them.

m.

--
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


[Flightgear-devel] doppler volume

2009-01-21 Thread James Sleeman
The doppler effect (which I currently have working through the 
USE_SOFTWARE_DOPPLER define) has never sounded very real to my ear.  
Recently I've wondered if it might be to do with the volume dropoff 
not being enough.

It's hard to subjectively quantify the dropoff in the flyby, but for 
example if we switch to tower view, it seems you can always hear the 
aircraft no matter how far away you get, for example, I was 100 miles 
from the tower and yet I had no trouble hearing the aircraft at all.

Is the dropoff (if there is one at all, perhaps my mind is filling in 
the blank and making one), configurable at all through some property, I 
couldn't find one?  It would be good to be able to play around with the 
numbers and see if it makes an improvement to the subjective 
convincingness of the doppler effect.

---
James Sleeman

--
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] doppler volume

2009-01-21 Thread Maik Justus
Hi James,

the effect you are discussing is not the Doppler effect, but just the 
volume as a function of the distance. Every aircraft has its own sound 
definition including the distance, where the volume is halved 
(reference-dist) and the distance where the volume is cutted off 
(max-dist). The volume as a function of the distance is calculated by 
Openal. Therefore we need to know the aircraft, with wich you have the 
wrong effect and the kind of sound (most probably the engine sound?). If 
the sound configuration for this specific sound has reasonable 
definition for reference-dist we need to know your operating system 
and openal version. With this information other users can check, if they 
have the same problem. Maybe we can drill it down to a openal problem or 
maybe the distance passed to openal is wrong... Unfortunately I actually 
do not have a running flightgear; therefore I can not perform tests.

Maik

James Sleeman schrieb am 21.01.2009 13:46:
 The doppler effect (which I currently have working through the 
 USE_SOFTWARE_DOPPLER define) has never sounded very real to my ear.  
 Recently I've wondered if it might be to do with the volume dropoff 
 not being enough.

 It's hard to subjectively quantify the dropoff in the flyby, but for 
 example if we switch to tower view, it seems you can always hear the 
 aircraft no matter how far away you get, for example, I was 100 miles 
 from the tower and yet I had no trouble hearing the aircraft at all.

 Is the dropoff (if there is one at all, perhaps my mind is filling in 
 the blank and making one), configurable at all through some property, I 
 couldn't find one?  It would be good to be able to play around with the 
 numbers and see if it makes an improvement to the subjective 
 convincingness of the doppler effect.

 ---
 James Sleeman

 --
 This SF.net email is sponsored by:
 SourcForge Community
 SourceForge wants to tell your story.
 http://p.sf.net/sfu/sf-spreadtheword
 ___
 Flightgear-devel mailing list
 Flightgear-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/flightgear-devel

   


--
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] doppler volume

2009-01-21 Thread James Sleeman
Hi Maik,

Maik Justus wrote:
 the effect you are discussing is not the Doppler effect, but just the 
   
Yes, I know it's not a function of the Doppler itself, but I was 
thinking more along the lines of the volume drop off, if it were better, 
might help the convincingness of the Doppler, if you see what I mean.

 volume as a function of the distance. Every aircraft has its own sound 
 definition including the distance, where the volume is halved 
 (reference-dist) and the distance where the volume is cutted off 
 (max-dist).
Hmm, interesting.  It seems that a great many aircraft do not define 
these values at all.  Is there a default definition for these somewhere, 
is one calculated by openal maybe in the absence of these specific settings?

At the end of this message is a quick grep showing the aircraft which do 
not define reference-dist.  Quite a list.

Just to clarify on the reference-dist, is it that this value is a 
diminishing effect, that is for reference-dist of 1 after distance 1 the 
volume is half original, after distance 2 the volume is 1/4 original 
(half of a half), distance 3 it's an 1/8th (half of a quarter).  Or is 
it simply that at that specific distance, and for infinity beyond until 
max-dist the volume is always half the original?

Here is the list, checking for max-dist yields basically the same result.

for file in *; do fgrep -r reference-dist $file /dev/null; if [ $? != 
0 ]; then echo $file - no reference-dist; fi; done

14bis - no reference-dist
707 - no reference-dist
737 - no reference-dist
737-300 - no reference-dist
747 - no reference-dist
747-200 - no reference-dist
787 - no reference-dist
a10 - no reference-dist
A-10 - no reference-dist
A300 - no reference-dist
A320 - no reference-dist
A320-family - no reference-dist
A380 - no reference-dist
a4 - no reference-dist
A-6E - no reference-dist
A6M2 - no reference-dist
airwaveXtreme150 - no reference-dist
Albatross - no reference-dist
Alphajet - no reference-dist
an225 - no reference-dist
AN-225 - no reference-dist
AR-234 - no reference-dist
as350 - no reference-dist
ASK21 - no reference-dist
asw20 - no reference-dist
ATC - no reference-dist
B-17 - no reference-dist
B-1B - no reference-dist
B-2 - no reference-dist
b29 - no reference-dist
b52 - no reference-dist
B-52F - no reference-dist
BAC-TSR2 - no reference-dist
beaufighter - no reference-dist
bell206 - no reference-dist
Bernard-HV220 - no reference-dist
bf109 - no reference-dist
bleriot-XI - no reference-dist
bocian - no reference-dist
Buccaneer - no reference-dist
Bugatti - no reference-dist
c172x - no reference-dist
c182 - no reference-dist
c182rg - no reference-dist
C-2A - no reference-dist
c310u3a - no reference-dist
C550B - no reference-dist
C684 - no reference-dist
CanberraBI8 - no reference-dist
Caravelle - no reference-dist
Carreidas - no reference-dist
Citation - no reference-dist
colditz - no reference-dist
couzinet70 - no reference-dist
dc3 - no reference-dist
DerKleineUhu - no reference-dist
DH-88 - no reference-dist
DH-89 - no reference-dist
DO-335 - no reference-dist
DO-X - no reference-dist
Dragonfly - no reference-dist
E3B - no reference-dist
ec130 - no reference-dist
eurofighter - no reference-dist
f104 - no reference-dist
F-106-dart - no reference-dist
f-14b - no reference-dist
f15 - no reference-dist
f15c - no reference-dist
f16 - no reference-dist
f18 - no reference-dist
F4U - no reference-dist
F80C - no reference-dist
F-86 - no reference-dist
F-8E - no reference-dist
F-8E-Crusader - no reference-dist
Farman-IV - no reference-dist
fkdr1 - no reference-dist
fokker100 - no reference-dist
fokker50 - no reference-dist
fw190 - no reference-dist
harrier - no reference-dist
He162 - no reference-dist
HondaJet - no reference-dist
Hornet - no reference-dist
Hunter - no reference-dist
Instruments - no reference-dist
Instruments-3d - no reference-dist
j22 - no reference-dist
j3cub - no reference-dist
j7w - no reference-dist
jeep - no reference-dist
ju52 - no reference-dist
KC135 - no reference-dist
Ki-84 - no reference-dist
Lightning - no reference-dist
Lockheed-SR71 - no reference-dist
Macchi-Castoldi-MC72 - no reference-dist
Malolo1 - no reference-dist
marchetti - no reference-dist
MD11 - no reference-dist
MIBS - no reference-dist
MiG-15 - no reference-dist
Mig-29 - no reference-dist
mirage2000 - no reference-dist
MPCarrier - no reference-dist
NTPS - no reference-dist
ogel - no reference-dist
OH-1 - no reference-dist
ornithopter - no reference-dist
OV10_USAFE - no reference-dist
P-38-Lightning - no reference-dist
p51d - no reference-dist
paraglider - no reference-dist
payen-pa100 - no reference-dist
PC-6 - no reference-dist
pc7 - no reference-dist
pushback - no reference-dist
Rascal - no reference-dist
SaabJ35Draken - no reference-dist
santa - no reference-dist
seahawk - no reference-dist
SeaVixen - no reference-dist
sgs126 - no reference-dist
sgs233 - no reference-dist
shuttle - no reference-dist
Skyvan - no reference-dist
snowplow - no reference-dist

Re: [Flightgear-devel] Doppler

2008-12-21 Thread Melchior FRANZ
* Maik Justus -- Saturday 20 December 2008:
 Is there any chance to get to know at compile time, that
 openal-soft is used?

I haven't found anything specific in the header files.
At runtime, alGetString(AL_VERSION) should contain  ALSOFT .

m.

--
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] Doppler

2008-12-20 Thread James Sleeman
Csaba Halász wrote:
 http://kcat.strangesoft.net/openal.html Some distributions (notably
 debian) have switched to this version from the original
 implementation.
   

Ahh I see, using Ubuntu here and yes it appears to be this soft version.


--
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] Doppler

2008-12-20 Thread Maik Justus

Hi James,

James Sleeman schrieb am 20.12.2008 13:21:

Csaba Halász wrote:
  

http://kcat.strangesoft.net/openal.html Some distributions (notably
debian) have switched to this version from the original
implementation.
  



Ahh I see, using Ubuntu here and yes it appears to be this soft version.

  


I think the Doppler effect even should work with openal-soft.

Can you check, what is defined after

   #ifndef HAVE_WINDOWS_H
#ifdef AL_VERSION_1_2
 #define USE_OPEN_AL_DOPPLER should work
#else
 #define USE_OPEN_AL_DOPPLER_WITH_FIXED_LISTENER better than nothing
#endif
   #else
// the Open_AL Doppler calculation seems to be buggy on windows
#define USE_SOFTWARE_DOPPLER seem to be necessary
   #endif

(file simgear/sound/sample_openal.hxx lines 65ff) and evaluate if 
Doppler works for you if you define one of the other two USE_ macros 
(and undefine the defined one).


Best regards,
Maik
--
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] Doppler

2008-12-20 Thread Melchior FRANZ
* Maik Justus -- Saturday 20 December 2008:
 #ifndef HAVE_WINDOWS_H
  #ifdef AL_VERSION_1_2
   #define USE_OPEN_AL_DOPPLER should work

My openal-soft (svn/head) defines AL_VERSION_1_1 (and _1_0),
but not _1_2. I just defined USE_OPEN_AL_DOPPLER after that
#if* group, but Doppler didn't work.

m.


--
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] Doppler

2008-12-20 Thread Melchior FRANZ
* Melchior FRANZ -- Saturday 20 December 2008:
 I just defined USE_OPEN_AL_DOPPLER after that #if* group, but
 Doppler didn't work.

PS: not just after the group, but instead of it, so the other
optional symbols weren't defined.

m.

--
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] Doppler

2008-12-20 Thread Maik Justus

Hi Melchior,
Melchior FRANZ schrieb am 20.12.2008 15:56:

* Melchior FRANZ -- Saturday 20 December 2008:
  

I just defined USE_OPEN_AL_DOPPLER after that #if* group, but
Doppler didn't work.



PS: not just after the group, but instead of it, so the other
optional symbols weren't defined.

m.

  

Did you try to

   #define USE_SOFTWARE_DOPPLER

instead?

Maik
--
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] Doppler

2008-12-20 Thread Melchior FRANZ
* Maik Justus -- Saturday 20 December 2008:
 Did you try to
 
 #define USE_SOFTWARE_DOPPLER
 
 instead?

No, AFAICS that enables your manual Doppler calculations, which
you added for openal implementations with broken Doppler (or with
correct Doppler that doesn't work with our broken setup ;-). I only
wanted to know if openal-soft's Doppler works with fgfs, and apparently
it doesn't. (Though, as you know, the openal-soft maintainer claims
that his version is correct and that some of the others are buggy.
So our code might be tuned for broken openals and, thus, not support
openal-soft.)

m.

--
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] Doppler

2008-12-20 Thread Maik Justus

Hi Melchior,
Melchior FRANZ schrieb am 20.12.2008 17:54:

* Maik Justus -- Saturday 20 December 2008:
  

Did you try to

#define USE_SOFTWARE_DOPPLER

instead?



No, AFAICS that enables your manual Doppler calculations, which
you added for openal implementations with broken Doppler (or with
correct Doppler that doesn't work with our broken setup ;-). 
Yes, that is the actual state under windows. And the manual calculation 
works quite fine. And if it works with openal-soft we should use it with 
openal-soft.

I only
wanted to know if openal-soft's Doppler works with fgfs, and apparently
it doesn't. (Though, as you know, the openal-soft maintainer claims
that his version is correct and that some of the others are buggy.
So our code might be tuned for broken openals and, thus, not support
openal-soft.)
  
Yes I know. Unfortunately I do not have a openal implementation with 
working Doppler here; therefore I can not investigate, what need to be 
changed, to get it working with openal-soft. I had a quick look over the 
code and couldn't find any suspicious line.

m.

  

Maik
--
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] Doppler

2008-12-20 Thread Melchior FRANZ
* Maik Justus -- Saturday 20 December 2008:
 And the manual calculation works quite fine. And if it works with
 openal-soft we should use it with openal-soft.

Ah, ok. I re-tried with USE_SOFTWARE_DOPPLER, and that only worked
for a very short time (less a minute), and then there was no sound
at all.

m.

--
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] Doppler

2008-12-20 Thread Maik Justus

Melchior FRANZ schrieb am 20.12.2008 18:29:

* Maik Justus -- Saturday 20 December 2008:
  

And the manual calculation works quite fine. And if it works with
openal-soft we should use it with openal-soft.



Ah, ok. I re-tried with USE_SOFTWARE_DOPPLER, and that only worked
for a very short time (less a minute), and then there was no sound
at all.

m.

  
Strange, in this mode I only modify the pitch value in the same range 
any sound.xml file can do even without Doppler.


Maik

--
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] Doppler

2008-12-20 Thread Melchior FRANZ
* Maik Justus -- Saturday 20 December 2008:
 Melchior FRANZ schrieb am 20.12.2008 18:29:
  I re-tried with USE_SOFTWARE_DOPPLER, and that only worked
  for a very short time (less a minute), and then there was
  no sound at all.

 Strange, in this mode I only modify the pitch value in the same range 
 any sound.xml file can do even without Doppler.

Good point. Turns out I had just used the wrong aircraft for
this test. Apparently the f-14b has another funny feature
that I hadn't encountered before.  :-}

Yes, USE_SOFTWARE_DOPPLER works with openal-soft. Unfortunately,
the sound isn't muted when pausing ...

m.

--
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] Doppler

2008-12-20 Thread Melchior FRANZ
* Melchior FRANZ -- Saturday 20 December 2008:
 Unfortunately, the sound isn't muted when pausing ...

Pfff ...

| /*
| alcSuspendContext
| 
| Not functional
| */
| ALCAPI ALCvoid ALCAPIENTRY alcSuspendContext(ALCcontext *pContext)
| {
| // Not a lot happens here !
| (void)pContext;
| }


No, not a lot, indeed.

m.

--
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] Doppler

2008-12-20 Thread Maik Justus
Hi,
Melchior FRANZ schrieb am 20.12.2008 20:01:
 Yes, USE_SOFTWARE_DOPPLER works with openal-soft. 
Is there any chance to get to know at compile time, that openal-soft is 
used?

If not: is there any chance to get to know at runtime, that openal-soft 
is used?
if yes: we need to change the concept of choosing the Doppler algorithm 
at compile time to do so at runtime.

Maik

--
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


[Flightgear-devel] Doppler

2008-12-19 Thread James Sleeman
Some time ago there was discussion on the list regarding the loss of 
doppler sound effect in the fly-by view, I was sure I read that it had 
been resolved?  I still have no doppler in the fly-by with a fresh build 
last night, am I the only one, or is it still broken?

---
James Sleeman

--
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] Doppler

2008-12-19 Thread Curtis Olson
On Fri, Dec 19, 2008 at 4:55 PM, James Sleeman flightg...@gogo.co.nzwrote:

 Some time ago there was discussion on the list regarding the loss of
 doppler sound effect in the fly-by view, I was sure I read that it had
 been resolved?  I still have no doppler in the fly-by with a fresh build
 last night, am I the only one, or is it still broken?


This should be resolved.  Can you tell me which aircraft doesn't have the
doppler sound effect?  What frame rates are you experiencing when you have
no doppler effect?

Curt.
-- 
Curtis Olson: http://baron.flightgear.org/~curt/
--
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] Doppler

2008-12-19 Thread James Sleeman
Curtis Olson wrote:

 This should be resolved.  Can you tell me which aircraft doesn't have 
 the doppler sound effect?  What frame rates are you experiencing when 
 you have no doppler effect?
I have no doppler on any aircraft and havn't for quite a while.  As I 
type this I have usually around 40fps in fly-by.  Is there perhaps an 
option or something I have inadvertantly switched off? 

--
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] Doppler

2008-12-19 Thread Melchior FRANZ
* James Sleeman -- Saturday 20 December 2008:
 I have no doppler on any aircraft and havn't for quite a while.  As I 
 type this I have usually around 40fps in fly-by.  Is there perhaps an 
 option or something I have inadvertantly switched off? 

AFAIK, Doppler doesn't work in fgfs if you are using openal-soft.

m. 

--
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] Doppler

2008-12-19 Thread Csaba Halász
On Sat, Dec 20, 2008 at 1:04 AM, James Sleeman flightg...@gogo.co.nz wrote:
 Melchior FRANZ wrote:
 AFAIK, Doppler doesn't work in fgfs if you are using openal-soft.

 Forgive my ignorance, but as opposed to using what?  Is there Open AL in
 hardware on some devices?

Melchior is referring to a particular implementation of openal. They
call themselves openal soft. See:
http://kcat.strangesoft.net/openal.html Some distributions (notably
debian) have switched to this version from the original
implementation.

-- 
Csaba/Jester

--
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] Doppler oddness

2007-07-06 Thread AJ MacLeod
On Friday 06 July 2007 18:03, John Denker wrote:
 1) Where I'm coming from:  Different people are interested in different
   parts of FlightGear.  I consider it a strength of the project that it
   can be put to disparate purposes.

I'm sure we all agree about that, anyway.

   1a) As for me personally, and for more than a few others, there is
interest in using it as a complex-aircraft procedures trainer, and
as an IFR procedures trainer.
I'm sure virtually all of us want FG to be suitable for that purpose.

 YMMV, but for my purposes the whole Doppler-shift thing is unhelpful.
But there's no reason whatsoever for it to be so, that I can imagine; it's in 
everyone's interest that it works properly.

 The cases where the existing Doppler model works are features I don't
 use, while features I do use are cases where the existing Doppler modle
 fails.  For example:
   -- It is comical that the ILS middle marker is strongly shifted.
   -- It is not so comical that the ATIS broadast is redshifted
into unintelligibility.

These bugs actually have been worked out already.  The necessary fixes have 
been made and with Maik's last patch (which was posted to the dev list, I'm 
pretty sure) I'm not aware of any significant problems.  Maybe you could try 
that?  I expect it will be committed soon, anyway.

Cheers,

AJ

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] Doppler oddness

2007-07-06 Thread John Denker
On 07/06/2007 01:08 PM, AJ MacLeod wrote:

 These bugs actually have been worked out already.  

Excellent!

 The necessary fixes have 
 been made and with Maik's last patch (which was posted to the dev list, I'm 
 pretty sure) I'm not aware of any significant problems.  Maybe you could try 
 that?  I expect it will be committed soon, anyway.

It's been ten days now with no CVS-commit nor even any
discussion of a CVS-commit AFAICT.

If you send me the appropriate patch [off list or otherwise]
I'll be happy to try it.


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] Doppler oddness

2007-07-06 Thread John Denker
1) Where I'm coming from:  Different people are interested in different
  parts of FlightGear.  I consider it a strength of the project that it
  can be put to disparate purposes.

  1a) As for me personally, and for more than a few others, there is
   interest in using it as a complex-aircraft procedures trainer, and
   as an IFR procedures trainer.

  1b) If you want to use it for other things, that's fine.

2) Back on 06/26/2007 03:06 PM, Jon Stockill wrote:
 With a cvs build checked out about half an hour ago I've just noticed 
 something very strange - with external views the doppler shift appears 
 to be related to the view angle rather than the approach speed. If you 
 select the chase view then you'll find that the sound is extremely slow 
 from behind the aircraft, and ridiculously fast from in front. This also 
 still seems to affect the radio chatter, resulting in some highly 
 comical, but not too realistic radio messages.

I did not participate in the previous discussion of this topic.
The thread died ten days ago in a pillar of flame.

The program bugs, however, have lived on.

YMMV, but for my purposes the whole Doppler-shift thing is unhelpful.
The cases where the existing Doppler model works are features I don't
use, while features I do use are cases where the existing Doppler modle
fails.  For example:
  -- It is comical that the ILS middle marker is strongly shifted.
  -- It is not so comical that the ATIS broadast is redshifted
   into unintelligibility.

Therefore I ask:  Is there a nice way for the pilot, if he chooses,
to disable Doppler effects, at least until the bugs are worked out?
Perhaps a property that can be set?  I grepped through the current
property tree and didn't notice such a thing.

3) See item 1.

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] Doppler oddness

2007-07-06 Thread Thomas Förster
Am Freitag 06 Juli 2007 19:27 schrieb John Denker:
 It's been ten days now with no CVS-commit nor even any
 discussion of a CVS-commit AFAICT.

That's definitely not true (generally spoken). Which branch are you using?

Thomas
-- 
PhD Student, Dept. Animal Physiology, HU Berlin
Tel +49 30 2093 6173, Fax +49 30 2093 6375

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] Doppler oddness

2007-07-06 Thread John Denker
On 07/06/2007 01:50 PM, Thomas Förster wrote:

 That's definitely not true (generally spoken). Which branch are you using?


CVS OSG, up to date as of late yesterday (the 5th).
Has something happened since then?

With this version I observe:
  -- Middle marker audio is strongly shifted.
  -- ATIS audio is strongly shifted.

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] Doppler oddness

2007-07-06 Thread Thomas Förster
Am Freitag 06 Juli 2007 20:33 schrieb John Denker:
 On 07/06/2007 01:50 PM, Thomas Förster wrote:
  That's definitely not true (generally spoken). Which branch are you
  using?

 CVS OSG, up to date as of late yesterday (the 5th).
 Has something happened since then?

Hmm, rereading your post this probably was a misunderstanding. You were 
referring to doppler effect related commits, weren't you?

Thomas
-- 
PhD Student, Dept. Animal Physiology, HU Berlin
Tel +49 30 2093 6173, Fax +49 30 2093 6375

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] Doppler oddness

2007-07-06 Thread AJ MacLeod
On Friday 06 July 2007 18:27, John Denker wrote:
 It's been ten days now with no CVS-commit nor even any
 discussion of a CVS-commit AFAICT.
That's probably about right.  I and a few others on IRC were testing various 
patches for Maik for a while... I thought that the results of that made it to 
the devel list, but to remove any doubt about, I'll attach (what I think is) 
the last one here.

 If you send me the appropriate patch [off list or otherwise]
 I'll be happy to try it.

If I'm not mistaken, attached is the patch I'm currently using and I haven't 
noticed any problems with other than the slightly odd (but expected, and no 
doubt correct) effect one gets if one moves the view really quickly when in 
external view.

Let us know if you find otherwise...

Cheers,

AJ
Index: sound/sample_openal.cxx
===
RCS file: /var/cvs/SimGear-0.3/source/simgear/sound/sample_openal.cxx,v
retrieving revision 1.27
diff -u -p -r1.27 sample_openal.cxx
--- sound/sample_openal.cxx	21 Jun 2007 21:46:21 -	1.27
+++ sound/sample_openal.cxx	28 Jun 2007 19:22:14 -
@@ -75,12 +75,17 @@ SGSoundSample::SGSoundSample() :
 reference_dist(500.0),
 max_dist(3000.),
 loop(AL_FALSE),
-playing(false)
+#ifdef USE_SOFTWARE_DOPPLER
+doppler_pitch_factor(1),
+doppler_volume_factor(1),
+#endif
+playing(false),
+no_Doppler_effect(true)
 {
 }
 
 // constructor
-SGSoundSample::SGSoundSample( const char *path, const char *file) :
+SGSoundSample::SGSoundSample( const char *path, const char *file , bool _no_Doppler_effect ) :
 buffer(0),
 source(0),
 pitch(1.0),
@@ -88,8 +93,13 @@ SGSoundSample::SGSoundSample( const char
 reference_dist(500.0),
 max_dist(3000.),
 loop(AL_FALSE),
-playing(false)
-{
+#ifdef USE_SOFTWARE_DOPPLER
+doppler_pitch_factor(1),
+doppler_volume_factor(1),
+#endif
+playing(false),
+no_Doppler_effect(_no_Doppler_effect)
+{
 SGPath samplepath( path );
 if ( strlen(file) ) {
 samplepath.append( file );
@@ -145,7 +155,7 @@ SGSoundSample::SGSoundSample( const char
 }
 
 // constructor
-SGSoundSample::SGSoundSample( unsigned char *_data, int len, int _freq ) :
+SGSoundSample::SGSoundSample( unsigned char *_data, int len, int _freq , bool _no_Doppler_effect ) :
 buffer(0),
 source(0),
 pitch(1.0),
@@ -153,7 +163,12 @@ SGSoundSample::SGSoundSample( unsigned c
 reference_dist(500.0),
 max_dist(3000.),
 loop(AL_FALSE),
-playing(false)
+#ifdef USE_SOFTWARE_DOPPLER
+doppler_pitch_factor(1),
+doppler_volume_factor(1),
+#endif
+playing(false),
+no_Doppler_effect(_no_Doppler_effect)
 {
 SG_LOG( SG_GENERAL, SG_DEBUG, In memory sounds sample );
 
@@ -247,14 +262,23 @@ SGSoundSample::bind_source() {
 }
 
 alSourcei( source, AL_BUFFER, buffer );
+#ifndef USE_SOFTWARE_DOPPLER
 alSourcef( source, AL_PITCH, pitch );
 alSourcef( source, AL_GAIN, volume );
+#else
+print_openal_error(bind_sources return);
+alSourcef( source, AL_PITCH, pitch *doppler_pitch_factor );
+alGetError(); //ignore if the pitch is clamped by the driver
+alSourcef( source, AL_GAIN, volume *doppler_volume_factor );
+#endif
 alSourcefv( source, AL_POSITION, source_pos );
 alSourcefv( source, AL_DIRECTION, direction );
 alSourcef( source, AL_CONE_INNER_ANGLE, inner );
 alSourcef( source, AL_CONE_OUTER_ANGLE, outer );
 alSourcef( source, AL_CONE_OUTER_GAIN, outergain);
+#ifdef USE_OPEN_AL_DOPPLER
 alSourcefv( source, AL_VELOCITY, source_vel );
+#endif
 alSourcei( source, AL_LOOPING, loop );
 
 alSourcei( source, AL_SOURCE_RELATIVE, AL_TRUE );
@@ -273,8 +297,13 @@ SGSoundSample::set_pitch( double p ) {
 if ( p  2.0 ) { p = 2.0; }
 pitch = p;
 if (playing) {
+#ifndef USE_SOFTWARE_DOPPLER
 alSourcef( source, AL_PITCH, pitch );
 print_openal_error(set_pitch);
+#else
+alSourcef( source, AL_PITCH, pitch * doppler_pitch_factor );
+alGetError(); //ignore if the pitch is clamped by the driver
+#endif
 }
 }
 
@@ -282,7 +311,11 @@ void
 SGSoundSample::set_volume( double v ) {
 volume = v;
 if (playing) {
+#ifndef USE_SOFTWARE_DOPPLER
 alSourcef( source, AL_GAIN, volume );
+#else
+alSourcef( source, AL_GAIN, volume * doppler_volume_factor );
+#endif
 print_openal_error(set_volume);
 }
 }
@@ -313,6 +346,7 @@ SGSoundSample::set_source_pos( ALfloat *
 sgAddVec3( final_pos, source_pos, offset_pos );
 
 alSourcefv( source, AL_POSITION, final_pos );
+print_openal_error(set_source_pos);
 }
 }
 
@@ -327,6 +361,7 @@ SGSoundSample::set_offset_pos( ALfloat *
 sgAddVec3( final_pos, source_pos, offset_pos );
 
 alSourcefv( source, AL_POSITION, final_pos );
+print_openal_error(set_offset_pos);
 }
 }
 
@@ -350,13 +385,88 @@ SGSoundSample::set_orientation( ALfloat 
 }
 
 void

Re: [Flightgear-devel] Doppler oddness

2007-07-06 Thread John Denker
On 07/06/2007 02:56 PM, Thomas Förster wrote:

 Hmm, rereading your post this probably was a misunderstanding. You were 
 referring to doppler effect related commits, weren't you?

Yes.  Perhaps I clipped too much context;  I thought
the Subject: line would be sufficient contex.  Sorry.



To repeat:

I am using CVS OSG, up to date as of late yesterday (the 5th).

With this version I observe:
   -- Middle marker audio is strongly shifted.
   -- ATIS audio is strongly shifted.

Please tell me where to find whatever patches are needed to
deal with these bugs.

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] Doppler oddness

2007-07-06 Thread Maik Justus
Hi John,

I posted the patch which should fix your problem on June 1st, 22:16 
(German time).
(If you do not have archived this EMail: just drop me a note, I will 
email it to you).

I think the patch will be commited soon. But I am modifying files, which 
are not mine, therefore it is ok, to give the file-owner some time. On 
IRC we discussed to commit it tomorrow if nobody complains up to then.

Maik

P.S.: for plib-branch-users: June 3rd, 23:21



 John Denker schrieb am 06.07.2007 21:04:
 On 07/06/2007 02:56 PM, Thomas Förster wrote:

   
 Hmm, rereading your post this probably was a misunderstanding. You were 
 referring to doppler effect related commits, weren't you?
 

 Yes.  Perhaps I clipped too much context;  I thought
 the Subject: line would be sufficient contex.  Sorry.



 To repeat:

 I am using CVS OSG, up to date as of late yesterday (the 5th).

 With this version I observe:
-- Middle marker audio is strongly shifted.
-- ATIS audio is strongly shifted.

 Please tell me where to find whatever patches are needed to
 deal with these bugs.

 -
 This SF.net email is sponsored by DB2 Express
 Download DB2 Express C - the FREE version of DB2 express and take
 control of your XML. No limits. Just data. Click to get it now.
 http://sourceforge.net/powerbar/db2/
 ___
 Flightgear-devel mailing list
 Flightgear-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/flightgear-devel
   


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] Doppler oddness

2007-07-06 Thread Maik Justus
Hi,

ups. Is it really July? Please replace June by July in my last post. 
Thanks to John.

Maik

Maik Justus schrieb am 06.07.2007 21:23:
 Hi John,

 I posted the patch which should fix your problem on June 1st, 22:16 
 (German time).
 (If you do not have archived this EMail: just drop me a note, I will 
 email it to you).

 I think the patch will be commited soon. But I am modifying files, which 
 are not mine, therefore it is ok, to give the file-owner some time. On 
 IRC we discussed to commit it tomorrow if nobody complains up to then.

 Maik

 P.S.: for plib-branch-users: June 3rd, 23:21
   


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] Doppler oddness

2007-07-06 Thread John Denker
I got the .diff from Maik Justus.

I merged it into the _Sport Model_.

It works fine;  ATIS and marker beacons are no longer Doppler
shifted.

In addition to the two files patched by the .diff, I had
to make some trivial and obvious edits in two other files,
to bring them into compliance with the new interface.
If anybody wants to see the details they can pull the
_Sport Model_ and do a git-diff.

For details on that, see
   
http://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg11530.html


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] Doppler oddness

2007-06-27 Thread Maik Justus
Hello Martin,

just didn't got the point of my posting.

Maik

Martin Spott schrieb am 27.06.2007 01:14:
 Maik Justus wrote:

   
 [...] But I only will start to work 
 on that patch if there is a chance to get it into cvs. Therefore I will 
 wait, if the windows patch will be accepted.
 

 The original author of the OpenAL publicly objects implementing things
 in FlightGear that OpenAL usually should take care of and apparently
 the issue with OpenAL is still open.
 How do you _dare_ to expect people to commit your windows patch !?
 Such behaviour is highly disrespectful. Please comply with the same
 measures of fairness that you expect from other people (on this list)
 and refrain from such attempts unless the OpenAL issue is closed.

   Martin.
   


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


[Flightgear-devel] Doppler oddness

2007-06-26 Thread Jon Stockill
With a cvs build checked out about half an hour ago I've just noticed 
something very strange - with external views the doppler shift appears 
to be related to the view angle rather than the approach speed. If you 
select the chase view then you'll find that the sound is extremely slow 
from behind the aircraft, and ridiculously fast from in front. This also 
still seems to affect the radio chatter, resulting in some highly 
comical, but not too realistic radio messages.

Jon

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] Doppler oddness

2007-06-26 Thread Maik Justus

Hi Jon,

thanks for pointing that out. And thanks to you and AJ for the debugging 
on IRC.
Here is a patch (the same you already got via EMail (ok, one debug 
message is different)), which could fix it. If the bug is still present, 
please comment out line 56 (#define USE_OPEN_AL_DOPPLER should work) in 
file simgear\sound\sample_openal.hxx to use the own calculations.

This patch has some debug code and is not intended to go into cvs.
Due to pitch-limits on older OpenAL versions I am thinking of a patch 
for these versions. The pitch limitation on old OpenAL versions limit 
the Doppler effect depending on the pitch value without Doppler effect, 
which could sound odd on some aircrafts. But I only will start to work 
on that patch if there is a chance to get it into cvs. Therefore I will 
wait, if the windows patch will be accepted.
(It could be, that you get warnings about pitch values  2. Even some 
OpenAL1.1 versions seem to be limited in pitch while the OpenAL1.1 
specification says they aren't)


Maik


Jon Stockill schrieb am 26.06.2007 21:06:
With a cvs build checked out about half an hour ago I've just noticed 
something very strange - with external views the doppler shift appears 
to be related to the view angle rather than the approach speed. If you 
select the chase view then you'll find that the sound is extremely slow 
from behind the aircraft, and ridiculously fast from in front. This also 
still seems to affect the radio chatter, resulting in some highly 
comical, but not too realistic radio messages.


Jon

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

  


Index: sound/sample_openal.cxx
===
RCS file: /var/cvs/SimGear-0.3/source/simgear/sound/sample_openal.cxx,v
retrieving revision 1.27
diff -u -p -r1.27 sample_openal.cxx
--- sound/sample_openal.cxx 21 Jun 2007 21:46:21 -  1.27
+++ sound/sample_openal.cxx 26 Jun 2007 21:57:20 -
@@ -75,12 +75,17 @@ SGSoundSample::SGSoundSample() :
 reference_dist(500.0),
 max_dist(3000.),
 loop(AL_FALSE),
-playing(false)
+#ifndef USE_OPEN_AL_DOPPLER
+doppler_pitch_factor(1),
+doppler_volume_factor(1),
+#endif
+playing(false),
+no_Doppler_effect(true)
 {
 }
 
 // constructor
-SGSoundSample::SGSoundSample( const char *path, const char *file) :
+SGSoundSample::SGSoundSample( const char *path, const char *file , bool 
_no_Doppler_effect ) :
 buffer(0),
 source(0),
 pitch(1.0),
@@ -88,7 +93,12 @@ SGSoundSample::SGSoundSample( const char
 reference_dist(500.0),
 max_dist(3000.),
 loop(AL_FALSE),
-playing(false)
+#ifndef USE_OPEN_AL_DOPPLER
+doppler_pitch_factor(1),
+doppler_volume_factor(1),
+#endif
+playing(false),
+no_Doppler_effect(_no_Doppler_effect)
 {
 SGPath samplepath( path );
 if ( strlen(file) ) {
@@ -145,7 +155,7 @@ SGSoundSample::SGSoundSample( const char
 }
 
 // constructor
-SGSoundSample::SGSoundSample( unsigned char *_data, int len, int _freq ) :
+SGSoundSample::SGSoundSample( unsigned char *_data, int len, int _freq , bool 
_no_Doppler_effect ) :
 buffer(0),
 source(0),
 pitch(1.0),
@@ -153,7 +163,12 @@ SGSoundSample::SGSoundSample( unsigned c
 reference_dist(500.0),
 max_dist(3000.),
 loop(AL_FALSE),
-playing(false)
+#ifndef USE_OPEN_AL_DOPPLER
+doppler_pitch_factor(1),
+doppler_volume_factor(1),
+#endif
+playing(false),
+no_Doppler_effect(_no_Doppler_effect)
 {
 SG_LOG( SG_GENERAL, SG_DEBUG, In memory sounds sample );
 
@@ -254,7 +269,9 @@ SGSoundSample::bind_source() {
 alSourcef( source, AL_CONE_INNER_ANGLE, inner );
 alSourcef( source, AL_CONE_OUTER_ANGLE, outer );
 alSourcef( source, AL_CONE_OUTER_GAIN, outergain);
+#ifdef USE_OPEN_AL_DOPPLER
 alSourcefv( source, AL_VELOCITY, source_vel );
+#endif
 alSourcei( source, AL_LOOPING, loop );
 
 alSourcei( source, AL_SOURCE_RELATIVE, AL_TRUE );
@@ -273,8 +290,22 @@ SGSoundSample::set_pitch( double p ) {
 if ( p  2.0 ) { p = 2.0; }
 pitch = p;
 if (playing) {
+#ifdef USE_OPEN_AL_DOPPLER
 alSourcef( source, AL_PITCH, pitch );
-print_openal_error(set_pitch);
+#else
+ #ifdef AL_VERSION_1_1
+alSourcef( source, AL_PITCH, pitch * doppler_pitch_factor );
+ #else
+p*=doppler_pitch_factor;
+if ( p  0.01 ) { p = 0.01; }
+if ( p  2.0 ) { p = 2.0; }
+alSourcef( source, AL_PITCH, p );
+ #endif
+#endif
+//print_openal_error(set_pitch);
+char t[256];
+sprintf(t,set_pitch: 

Re: [Flightgear-devel] Doppler oddness

2007-06-26 Thread Martin Spott
Maik Justus wrote:

 [...] But I only will start to work 
 on that patch if there is a chance to get it into cvs. Therefore I will 
 wait, if the windows patch will be accepted.

The original author of the OpenAL publicly objects implementing things
in FlightGear that OpenAL usually should take care of and apparently
the issue with OpenAL is still open.
How do you _dare_ to expect people to commit your windows patch !?
Such behaviour is highly disrespectful. Please comply with the same
measures of fairness that you expect from other people (on this list)
and refrain from such attempts unless the OpenAL issue is closed.

Martin.
-- 
 Unix _IS_ user friendly - it's just selective about who its friends are !
--

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] Doppler oddness

2007-06-26 Thread SydSandy
On Tue, 26 Jun 2007 23:14:08 + (UTC)
Martin Spott [EMAIL PROTECTED] wrote:

 Maik Justus wrote:
 
  [...] But I only will start to work 
  on that patch if there is a chance to get it into cvs. Therefore I will 
  wait, if the windows patch will be accepted.
 
 The original author of the OpenAL publicly objects implementing things
 in FlightGear that OpenAL usually should take care of and apparently
 the issue with OpenAL is still open.

So  the problem is being dealt with then ???

 How do you _dare_ to expect people to commit your windows patch !?
 Such behaviour is highly disrespectful. Please comply with the same
 measures of fairness that you expect from other people (on this list)
 and refrain from such attempts unless the OpenAL issue is closed.

This kind of answer is highly disrespectful too , considering the amount of 
work Maik has done to improve Flightgear! 

-- 
SydSandy [EMAIL PROTECTED]

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel