Csaba, On Thu, Jan 31, 2008 at 04:34:46PM +0100, Csaba Hal?sz wrote: > On Jan 29, 2008 8:48 AM, Holger Wirtz <[EMAIL PROTECTED]> wrote: > > > > There is a nearly stable iaxc version 2 available which has some > > advantages (for VoIP, not necessarily for the usage with FG). The build > > system is now based on autotools which makes it complexer for me (I have > > no idea about autotools). > > > > But for further features it maybe not bad to use iaxc version 2 as a > > base for fgcom. However the current patches must be ported. > > I have messed a little with iaxc2. As speex and portaudio are no > longer bundled I have hacked it to build without them as well.
Speex is a really good open source codec but when using LoFi filters you get problems with every "crunching" codec. So using fgcom without spees might not be a problem. Perhaps GSM may also only used without LoFi (when the LoFi code is ready). > I have used "./configure --disable-shared --enable-local-gsm > --without-video" and apparently got a working fgcom. Note: iaxclient2 > does not compile with speex svn, as it uses some internal structure it > is not supposed to.. As I said... speex will become problems the next month :-) > Looks like iaxclient developers are dropping all audio drivers and > relying on portaudio exclusively so probably they wouldn't be > interested in an openal driver that in its current form isn't even > usable for general VOIP. Getting it into portaudio would mean extra > work. I'd rather add support to iaxclient for user-supplied external > audio drivers (all the pieces are there really). > This would be a useful general feature, so could be included in > iaxclient upstream (same holds for the configure changes). That's great. I currently haven't took a look at it and I really hadn't in mind to rush you to port openal to iaxc2... > It would also open some further possibilities, such as text-to-speech > or pre-recorded messages. > Drawback is, we would lose the portaudio driver. I don't know if Tat > used that or openal on Mac, and no idea if any windows users managed > to get fgcom running at all. I had in mind that the iaxc developers said they will be comptable to Linux, OSX and Win. So I hope this will be the same for iaxc2. I will set up a new branch for iaxc2 and will as Tat if he can check this. > And now something else: Holger, can you look at the "alarm_handler" > function? The new call initiated for the "Send our coords to the > server" block seems to cause segfault with both iaxc v1 and iaxc v2, > for other users as well. Argh! Fixed it with an #ifdef around... I need this some time for sending the postition of the client via IAX2. The future conference app should use this for distance calculation... Thanks a lot for your work! I will write some lines if the new branch is available. Regards, Holger > > -- > Csaba/Jester > Index: configure.ac > =================================================================== > --- configure.ac (revision 1336) > +++ configure.ac (working copy) > @@ -143,6 +143,21 @@ > [Theora support])],, > with_theora="auto") > > +AC_ARG_WITH(openal, > + [AS_HELP_STRING([--without-openal], > + [OpenAl support])],, > + with_openal="auto") > + > +AC_ARG_WITH(portaudio, > + [AS_HELP_STRING([--without-portaudio], > + [PortAudio support])],, > + with_portaudio="auto") > + > +AC_ARG_WITH(speex, > + [AS_HELP_STRING([--without-speex], > + [Speex support])],, > + with_speex="auto") > + > AC_ARG_WITH(vidcap, > [AS_HELP_STRING([--without-vidcap], > [libvidcap support])],, > @@ -194,11 +209,21 @@ > > AC_SUBST(OSTYPE) > > -PKG_CHECK_MODULES(PORTAUDIO, [portaudio-2.0 >= 19],,AC_MSG_ERROR([ > - portaudio is required to build this package! > - please see http://www.portaudio.com/ for how to > - obtain a copy. > -])) > +has_portaudio=no > +if test ! x$with_portaudio = xno; then > +PKG_CHECK_MODULES(PORTAUDIO, [portaudio-2.0 >= > 19],has_portaudio=yes,has_portaudio=no) > +if test x$has_portaudio = xyes; then > + AC_DEFINE(AUDIO_PORTAUDIO, 1, [PORTAUDIO]) > + PKG_REQUIRES="$PKG_REQUIRES portaudio" > +elif test ! x$with_portaudio = xauto ; then > + AC_MSG_ERROR([ > + portaudio is required to build this package! > + please see http://www.portaudio.com/ for how to > + obtain a copy. > + ]) > +fi > +fi > +AM_CONDITIONAL(PORTAUDIO, test x$has_portaudio = xyes) > > has_gsm=no > if test x$enable_local_gsm = xyes; then > @@ -215,7 +240,7 @@ > > has_ogg=no > if test ! x$with_ogg = xno; then > -PKG_CHECK_MODULES(OGG, [ogg >= 1.1.3],has_ogg=yes) > +PKG_CHECK_MODULES(OGG, [ogg >= 1.1.3],has_ogg=yes,has_ogg=no) > if test x$has_ogg = xyes; then > AC_DEFINE(USE_OGG, 1, [OGG]) > PKG_REQUIRES="$PKG_REQUIRES ogg" > @@ -228,16 +253,26 @@ > fi > fi > AM_CONDITIONAL(OGG, test x$has_ogg = xyes) > - > -PKG_CHECK_MODULES(SPEEX, [speex >= 1.2],,AC_MSG_ERROR([ > - speex is required to build this package! > - please see http://www.xiph.org/ for how to > - obtain a copy. > -])) > > +has_speex=no > +if test ! x$with_speex = xno; then > +PKG_CHECK_MODULES(SPEEX, [speex >= 1.2],has_speex=yes,has_speex=no) > +if test x$has_speex = xyes; then > + AC_DEFINE(USE_SPEEX, 1, [SPEEX]) > + PKG_REQUIRES="$PKG_REQUIRES speex" > +elif test ! x$with_speex = xauto ; then > + AC_MSG_ERROR([ > + speex is required to build this package! > + please see http://www.xiph.org/ for how to > + obtain a copy. > +]) > +fi > +fi > +AM_CONDITIONAL(SPEEX, test x$has_speex = xyes) > + > has_theora=no > if test ! x$with_theora = xno; then > -PKG_CHECK_MODULES(THEORA, [theora >= 1.0alpha7],has_theora=yes) > +PKG_CHECK_MODULES(THEORA, [theora >= 1.0alpha7],has_theora=yes,has_theora=no) > if test x$has_theora = xyes; then > AC_DEFINE(USE_THEORA, 1, [THEORA]) > PKG_REQUIRES="$PKG_REQUIRES theora" > @@ -251,9 +286,23 @@ > fi > AM_CONDITIONAL(THEORA, test x$has_theora = xyes) > > +has_openal=no > +if test ! x$with_openal = xno; then > +PKG_CHECK_MODULES(OPENAL, [openal >= 0.0.8],has_openal=yes,has_openal=no) > +if test x$has_openal = xyes; then > + AC_DEFINE(AUDIO_OPENAL, 1, [OPENAL]) > + PKG_REQUIRES="$PKG_REQUIRES openal" > +elif test ! x$with_openal = xauto ; then > + AC_MSG_ERROR([ > + libopenal is required to build this package! > + ]) > +fi > +fi > +AM_CONDITIONAL(OPENAL, test x$has_openal = xyes) > + > has_vidcap=no > if test ! x$with_vidcap = xno; then > - PKG_CHECK_MODULES(VIDCAP, [vidcap >= 0.1],has_vidcap=yes) > + PKG_CHECK_MODULES(VIDCAP, [vidcap >= 0.1],has_vidcap=yes,has_vidcap=no) > if test x$has_vidcap = xyes; then > AC_DEFINE(USE_VIDCAP, 1, [VIDCAP]) > PKG_REQUIRES="$PKG_REQUIRES vidcap" > @@ -269,7 +318,7 @@ > > has_ffmpeg=no > if test ! x$with_ffmpeg = xno; then > -PKG_CHECK_MODULES(FFMPEG, [libavcodec >= 51.40.3],has_ffmpeg=yes) > +PKG_CHECK_MODULES(FFMPEG, [libavcodec >= > 51.40.3],has_ffmpeg=yes,has_ffmpeg=no) > if test x$has_ffmpeg = xyes; then > AC_DEFINE(USE_FFMPEG, 1, [FFMPEG]) > PKG_REQUIRES="$PKG_REQUIRES ffmpeg" > Index: lib/iaxclient_lib.c > =================================================================== > --- lib/iaxclient_lib.c (revision 1336) > +++ lib/iaxclient_lib.c (working copy) > @@ -49,6 +49,10 @@ > # endif > #endif > > +#ifdef AUDIO_OPENAL > +#include "audio_openal.h" > +#endif > + > #ifdef AUDIO_ALSA > #include "audio_alsa.h" > #endif > @@ -626,13 +630,18 @@ > > if ( !test_mode ) > { > -#ifndef AUDIO_ALSA > - if ( pa_initialize(&audio_driver, 8000) ) > +#ifdef AUDIO_OPENAL > + if ( !openal_initialize(&audio_driver, 8000) ) > + goto got_audio; > +#endif > +#ifdef AUDIO_PORTAUDIO > + if ( !pa_initialize(&audio_driver, 8000) ) > { > iaxci_usermsg(IAXC_ERROR, "failed pa_initialize"); > - return -1; > + goto got_audio; > } > -#else > +#endif > +#ifdef AUDIO_ALSA > /* TODO: It is unknown whether this stuff for direct access to > * alsa should be left in iaxclient. We're leaving it in here for > * the time being, but unless it becomes clear that someone cares > @@ -640,10 +649,13 @@ > * is capable of using alsa. This is another reason why this > * direct alsa access may be unneeded. > */ > - if ( alsa_initialize(&audio_driver, 8000) ) > - return -1; > + if ( !alsa_initialize(&audio_driver, 8000) ) > + goto got_audio; > #endif > + return -1; > } > +got_audio: > + > #ifdef USE_VIDEO > if ( video_initialize() ) > iaxci_usermsg(IAXC_ERROR, > Index: lib/audio_encode.c > =================================================================== > --- lib/audio_encode.c (revision 1336) > +++ lib/audio_encode.c (working copy) > @@ -22,8 +22,11 @@ > #endif > #include "codec_ulaw.h" > #include "codec_alaw.h" > + > +#ifdef USE_SPEEX > #include "codec_speex.h" > #include <speex/speex_preprocess.h> > +#endif > > #ifdef CODEC_ILBC > #include "codec_ilbc.h" > @@ -34,15 +37,11 @@ > static float input_level = 0.0f; > static float output_level = 0.0f; > > +#ifdef USE_SPEEX > static SpeexPreprocessState *st = NULL; > static int speex_state_size = 0; > static int speex_state_rate = 0; > -int iaxci_filters = > IAXC_FILTER_AGC|IAXC_FILTER_DENOISE|IAXC_FILTER_AAGC|IAXC_FILTER_CN; > > -/* use to measure time since last audio was processed */ > -static struct timeval timeLastInput ; > -static struct timeval timeLastOutput ; > - > static struct iaxc_speex_settings speex_settings = > { > 1, /* decode_enhance */ > @@ -52,8 +51,15 @@ > 0, /* abr */ > 3 /* complexity */ > }; > +#endif > > +int iaxci_filters = > IAXC_FILTER_AGC|IAXC_FILTER_DENOISE|IAXC_FILTER_AAGC|IAXC_FILTER_CN; > > +/* use to measure time since last audio was processed */ > +static struct timeval timeLastInput ; > +static struct timeval timeLastOutput ; > + > + > static float vol_to_db(float vol) > { > /* avoid calling log10() on zero which yields inf or > @@ -91,6 +97,21 @@ > return 0; > } > > +static void calculate_level(short *audio, int len, float *level) > +{ > + int big_sample = 0; > + int i; > + > + for ( i = 0; i < len; i++ ) > + { > + const int sample = abs(audio[i]); > + big_sample = sample > big_sample ? > + sample : big_sample; > + } > + *level += ((float)big_sample / 32767.0f - *level) / 5.0f; > +} > + > +#ifdef USE_SPEEX > static void set_speex_filters() > { > int i; > @@ -111,28 +132,17 @@ > i = 7; > speex_preprocess_ctl(st, SPEEX_PREPROCESS_SET_PROB_CONTINUE, &i); > } > +#endif > > -static void calculate_level(short *audio, int len, float *level) > -{ > - int big_sample = 0; > - int i; > - > - for ( i = 0; i < len; i++ ) > - { > - const int sample = abs(audio[i]); > - big_sample = sample > big_sample ? > - sample : big_sample; > - } > - > - *level += ((float)big_sample / 32767.0f - *level) / 5.0f; > -} > - > static int input_postprocess(void *audio, int len, int rate) > { > static float lowest_volume = 1.0f; > float volume; > int silent = 0; > > + calculate_level((short *)audio, len, &input_level); > + > +#ifdef USE_SPEEX > if ( !st || speex_state_size != len || speex_state_rate != rate ) > { > if (st) > @@ -143,8 +153,6 @@ > set_speex_filters(); > } > > - calculate_level((short *)audio, len, &input_level); > - > /* only preprocess if we're interested in VAD, AGC, or DENOISE */ > if ( (iaxci_filters & (IAXC_FILTER_DENOISE | IAXC_FILTER_AGC)) || > iaxci_silence_threshold > 0.0f ) > @@ -193,6 +201,7 @@ > * we were silent. Just set it to 0 in that case */ > if ( iaxci_silence_threshold > 0.0f && silent ) > input_level = 0.0f; > +#endif > > do_level_callback(); > > @@ -228,8 +237,10 @@ > return codec_audio_ulaw_new(); > case IAXC_FORMAT_ALAW: > return codec_audio_alaw_new(); > +#ifdef USE_SPEEX > case IAXC_FORMAT_SPEEX: > return codec_audio_speex_new(&speex_settings); > +#endif > #ifdef CODEC_ILBC > case IAXC_FORMAT_ILBC: > return codec_audio_ilbc_new(); > @@ -244,12 +255,14 @@ > EXPORT void iaxc_set_speex_settings(int decode_enhance, float quality, > int bitrate, int vbr, int abr, int complexity) > { > +#ifdef USE_SPEEX > speex_settings.decode_enhance = decode_enhance; > speex_settings.quality = quality; > speex_settings.bitrate = bitrate; > speex_settings.vbr = vbr; > speex_settings.abr = abr; > speex_settings.complexity = complexity; > +#endif > } > > int audio_send_encoded_audio(struct iaxc_call *call, int callNo, void *data, > @@ -392,12 +405,16 @@ > EXPORT void iaxc_set_filters(int filters) > { > iaxci_filters = filters; > +#ifdef USE_SPEEX > set_speex_filters(); > +#endif > } > > EXPORT void iaxc_set_silence_threshold(float thr) > { > iaxci_silence_threshold = thr; > +#ifdef USE_SPEEX > set_speex_filters(); > +#endif > } > > Index: lib/Makefile.am > =================================================================== > --- lib/Makefile.am (revision 1336) > +++ lib/Makefile.am (working copy) > @@ -11,9 +11,7 @@ > > AM_CFLAGS = \ > $(PTHREAD_CFLAGS) \ > - $(SPEEX_CFLAGS) \ > - $(IAX2_CFLAGS) \ > - $(PORTAUDIO_CFLAGS) > + $(IAX2_CFLAGS) > > AM_CFLAGS += -Wall > AM_CFLAGS += -Wextra > @@ -23,9 +21,7 @@ > > libiaxclient_la_LIBADD = \ > $(PTHREAD_LIBS) \ > - $(IAX2_LIBS) \ > - $(PORTAUDIO_LIBS) \ > - $(SPEEX_LIBS) > + $(IAX2_LIBS) > > AM_LDFLAGS = \ > -no-undefined \ > @@ -98,6 +94,24 @@ > AM_CFLAGS += $(FFMPEG_CFLAGS) > endif > > +if OPENAL > +SRCS += audio_openal.c audio_openal.h > +libiaxclient_la_LIBADD += $(OPENAL_LIBS) > +AM_CFLAGS += $(OPENAL_CFLAGS) > +endif > + > +if PORTAUDIO > +SRCS += audio_portaudio.c audio_portaudio.h > +libiaxclient_la_LIBADD += $(PORTAUDIO_LIBS) > +AM_CFLAGS += $(PORTAUDIO_CFLAGS) > +endif > + > +if SPEEX > +SRCS += codec_speex.c codec_speex.h > +libiaxclient_la_LIBADD += $(SPEEX_LIBS) > +AM_CFLAGS += $(SPEEX_CFLAGS) > +endif > + > SRCS_LIBGSM= \ > gsm/src/add.c \ > gsm/src/code.c \ > @@ -126,13 +140,9 @@ > SRCS += \ > audio_encode.c \ > audio_encode.h \ > - audio_portaudio.c \ > - audio_portaudio.h \ > codec_alaw.c \ > codec_alaw.h \ > codec_ilbc.h \ > - codec_speex.c \ > - codec_speex.h \ > codec_ulaw.c \ > codec_ulaw.h \ > iaxclient_lib.c \ > @@ -201,6 +211,8 @@ > EXTRA_DIST = \ > audio_alsa.c \ > audio_alsa.h \ > + audio_openal.c \ > + audio_openal.h \ > codec_ffmpeg.c \ > codec_ffmpeg.h \ > sound2c.pl \ > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Flightgear-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/flightgear-devel -- ##### #### ## ## Holger Wirtz Phone : (+49 30) 884299-40 ## ## ## ### ## DFN-Verein Fax : (+49 30) 884299-70 ## ## #### ###### Stresemannstr. 78 E-Mail: [EMAIL PROTECTED] ## ## ## ## ### 10963 Berlin ##### ## ## ## GERMANY WWW : http://www.dfn.de GPG-Fingerprint: ABFA 1F51 DD8D 503C 85DC 0C51 E961 79E2 6685 9BCF ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Flightgear-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/flightgear-devel

