Requirements: alsa headers plus standard development tools (gcc, make,
etc) Nothing fancy :)

1.) fetch a known good revision of iaxclient:
svn co https://iaxclient.svn.sourceforge.net/svnroot/iaxclient/branches/1.0
-r '{2007-07-21}' iaxclient

2.) fetch fgcom into the same directory
svn checkout svn://svn.dfn.de:/fgcom

3.) edit iaxclient/lib/Makefile

To use oss emulation (recommended for now)

USE_PA_OSS=1
USE_PA_ALSA=0
USE_PA_JACK=0
AUDIO_ALSA=0

To use native alsa (WARNING: PTT won't work)

USE_PA_OSS=0
USE_PA_ALSA=0
USE_PA_JACK=0
AUDIO_ALSA=1

To use portaudio alsa (WARNING: only if your card natively supports
8000Hz sample rate)

USE_PA_OSS=0
USE_PA_ALSA=1
USE_PA_JACK=0
AUDIO_ALSA=0

4.) make iaxclient (run make from the lib dir, no need to install)

5.) patch fgcom with attached diff

6.) make fgcom

7.) install fgcom

Now you should have a shiny new fgcom. Consult the manual for usage.


Note to Holger:
The diff includes:
i) remove blocking sleep from alarm signal handler (found by Anders)
ii) allow radio selection even if not connected
iii) autodetect iaxclient version (untested)
iv) remove last trails of xmlrpc from Makefile
v) don't use -s during linking, leave it to install (makes debugging easier)
vi) changed default iaxclient location

Please review and apply.

-- 
Good luck,
Csaba/Jester
Index: src/fgcom.h
===================================================================
--- src/fgcom.h (revision 38)
+++ src/fgcom.h (working copy)
@@ -16,7 +16,9 @@
 #include <unistd.h>
 #endif
 
+#ifndef AUDIO_INTERNAL
 #define HAVE_IAX12             /* Only for newer iaxclient libraries */
+#endif
 
 #define DEFAULT_USER "guest"
 #define DEFAULT_PASSWORD "guest"
Index: src/fgcom.c
===================================================================
--- src/fgcom.c (revision 38)
+++ src/fgcom.c (working copy)
@@ -407,24 +407,20 @@
            }
 
          /* Check for pressed PTT key */
-         if (connected == 1)
+         if (previous_ptt != data.PTT)
            {
-             if (previous_ptt != data.PTT)
+             if (data.PTT == 2)
                {
-                 if (data.PTT == 2)
-                   {
-                     /* select the next com equipment */
-                     com_select = (com_select + 1) % 4;
-                     printf ("Radio-Select: %s\n", radio_map[com_select]);
-                   }
-                 else
-                   {
-                     ptt (data.PTT);
-                   }
-                 previous_ptt = data.PTT;
+                 /* select the next com equipment */
+                 com_select = (com_select + 1) % 4;
+                 printf ("Radio-Select: %s\n", radio_map[com_select]);
                }
+             else if (connected == 1)
+               {
+                 ptt (data.PTT);
+               }
+             previous_ptt = data.PTT;
            }
-
        }
     }
 
@@ -480,6 +476,7 @@
 alarm_handler (int signal)
 {
   /* Check every DEFAULT_ALARM_TIMER seconds if position related things should 
happen */
+  int next_alarm = DEFAULT_ALARM_TIMER;
 
   if (mode == 1)
     {
@@ -509,14 +506,13 @@
          iaxc_select_call (0);
 
          connected = 1;
-
+          next_alarm += 50;
        }
-      iaxc_millisleep (50 * 1000);
     }
 
 
 /* restart timer */
-  alarm (DEFAULT_ALARM_TIMER);
+  alarm (next_alarm);
 
 }
 
Index: src/Makefile
===================================================================
--- src/Makefile        (revision 38)
+++ src/Makefile        (working copy)
@@ -1,8 +1,8 @@
 CC:=gcc
 SVNDEF:=-D'SVN_REV="$(shell svnversion -n .)"'
 #CFLAGS:=-O2 -DDEBUG $(SVNDEF)
-CFLAGS:=-O2 $(SVNDEF)
-STATIC_LIBS:=/usr/local/lib/libiaxclient.a /usr/lib/libtheora.a 
/usr/lib/libogg.a /usr/local/lib/libspeex.a /usr/lib/libgsm.a -lportaudio 
-lasound -ljack -lpthread -lrt -lm -ldl
+CFLAGS:=-O2 $(SVNDEF) -I ../../iaxclient/lib
+STATIC_LIBS:=../../iaxclient/lib/libiaxclient.a -lasound  -lpthread -lm
 SHARED_LIBS:=-lm -L/usr/local/lib -liaxclient -lportaudio -lspeex -lgsm
 INDENT:=/usr/bin/indent
 IFLAGS:=
@@ -12,10 +12,10 @@
 all: iaxstatic
 
 shared: fgcom.o usage.o position.o
-       $(CC) -s fgcom.o usage.o position.o $(SHARED_LIBS) -o fgcom
+       $(CC) fgcom.o usage.o position.o $(SHARED_LIBS) -o fgcom
 
 iaxstatic: fgcom.o usage.o position.o
-       $(CC) -s fgcom.o usage.o position.o $(STATIC_LIBS) -o fgcom
+       $(CC) fgcom.o usage.o position.o $(STATIC_LIBS) -o fgcom
 
 indent: fgcom.c fgcom.h
        $(INDENT) $(IFLAGS) fgcom.c
@@ -36,11 +36,11 @@
        $(CC) $(CFLAGS) -c fgcom.c
 
 usage.o: Makefile usage.c
-       $(CC) $(CFLAGS) $(XMLRPC_CFLAGS) -c usage.c
+       $(CC) $(CFLAGS) -c usage.c
 
 position.o: Makefile position.c
-       $(CC) $(CFLAGS) $(XMLRPC_CFLAGS) -c position.c
+       $(CC) $(CFLAGS) -c position.c
 
 libwwwapp-hack.o: Makefile libwwwapp-hack.c
-       $(CC) $(CFLAGS) $(XMLRPC_CFLAGS) -c libwwwapp-hack.c
+       $(CC) $(CFLAGS) -c libwwwapp-hack.c
 
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to