FGCom (before 3.0): Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
(add description of Prereqs, Installation Linux + Windows)
(→‎Tips and Tricks: add PTT hints)
Line 189: Line 189:
ToBeDefined
ToBeDefined
====Tips and Tricks====
====Tips and Tricks====
'''PTT''' (Push To Talk)
*'''if the FGCom Command-window initiates, but does not respond to any COMM or PTT activity:'''
**Try to enforce (the usually predefined) port as option. i.e. add “-p16661” to the FGCom Start-Command
**check the FGrun extended Options → Input/output “generic=socket..”: The port there must be the same as for the FGCom, i.e. 16661 (if it was not intentionally changed by you)
**You may try to change the port to e.g. UPD 5004. In this case you have to change at 2 places:
***add the option “-p5004” to the FGCom start-command
***also change the value in the FGrun (“Wizard”) → Advanced Options → Input/output to 5004.
***and you may have to tell your Firewall to allow port UPD 5004<br><br>
*'''if in the FGCom Command-Window the Airport indication is ok''',
**but when hitting the PTT it does not appear:
***[LISTEN] mute mic, unmute speaker
***[SPEAK] unmute mic, mute speaker</nowiki> <br>
**Be sure the FGFS window is the active window. Move the Mouse-Pointer into the FlightGear-Window and click once, then try again (while the Mouse-Pointer remains in that window! Some systems do change the “active Window” according to where the mouse is!)
**Check the “''YourPlane''-set.xml” file in your FGFS/data/Aircraft/YourPlane directory: If you find a line “<key n="32">” then this plane is intentionally  using “key 32” (Space) for something other than the PTT. Known planes that do that as of Feb. 2009 are: an2, bluebird-base, ogel, OV10..,  seafireIIc, spitfireIIa, ufo.
--[[User:Jomo|Jomo]] 13:34, 11 March 2009 (EDT)
ToBeDefined
ToBeDefined



Revision as of 17:34, 11 March 2009

Cleanup.png This article may require cleanup to meet the quality standards of the wiki. Please improve this article if you can.

FGCom is an addon for FlightGear. With FGCom (and the infrastructure behind it), FlightGear now has a realtime voice communication system which enriches the FlightGear capabilities, especially for Multiplayer events, like:

  • flying in groups (see e.g. the Forum Multiplayer Events):
    • invite friends to a guided sightseeing tour in your most beloved area or do “Fly In's”
    • do military training like “Air-Air-Refuelling”, “Dog fights”, “Escort flights”, etc.
  • offering additional services at an airport like ATC, Snowplows, Pushbacks, etc. (Visit e.g. KSFO on a weekend – sorry enough: Most communication is still by keyboard - we are sure that will change!)
  • have a real time flightraing (e.g. pilot in Hongkong, teacher in Sydney) or just ask for online support during flight or just ask somebody flying a plane of interest about specifics
  • or e.g. just sit in a cockpit e.g. in Germany while sightseeing San Francisco in a C172, voice-chatting with a Texan in a plan I dreamed of as a boy (Super Constellation), and both getting informations from a New Zealand guy (it shall be a wonderful island – but do real people live there? He said: Yes!!).
  • etc.

In the future FGCom surely will extend further and surley will get a “Speech to Text” capability in order to also use the Text-based standard ATC-routines inside FlightGear (see also Development).

Status

  • March, 2009:
This wiki-Page is undergoing a Major Revision

Since the new version Nov.2008 the usage of FGCom is picking up rapidly – but so are also the confusions of many “Computer-Non-Professionals” trying to use it. We hope to help users by adding many more user-specific informations, like e.g. installation on different Operating Systems, testing, operating, informing, and “how to get the most out of it”. The existing more tech. Informations will remain but will be restructured. We decided to do it online in the “wiki-fashion” so that others can benefit as soon as possible. This major update will take about a month (or 2).

--Jomo 12:46, 3 March 2009 (EST)


  • 18 November, 2008:

Latest SVN (rev 163) has the compile problems fixed. Also we have a new server: fgcom.flightgear.org.uk. User accounts not required (ie. do not use -U or -P)

  • 31 October, 2008:

The latest SVN release at this time is the r149 which does not compile due to a constant that is not defined (STL_STRING). Such constant appears at line 57 in the file src/fgcom_init.cpp which is: #include STL_STRING

I guess that such constant must point to the STL library include file but I am not sure. I revert to the r148 SVN version which successfully compiles.

Command to get such version is: svn co -r148 svn://svn.dfn.de:/fgcom/trunk fgcom-r148

  • 19 June, 2008: Currently the server is down due to hardware problems. It is unknown when the service comes back because he currently has no time to fix the problems.
  • 22 November 2007: Due to heavy development at this time there may be some differences between the information on the web pages and the installation. Please follow the discussions on the FlightGear development list!

The Client installation

Installing FGCom

Hardware Requirements

If you are satisfied with the operation and responstimes of your current FGFS installation, then you should see no significant difference after adding the FGCom. If your FGFS installation runs already a little marginal, then you might experience some delays when many new airplane-models etc. must be loaded. This may happen when starting up at a busy airport. You can monitor/verify such a "shorttime overload" in the FGstart command-window.

For details see the FGFS common hardware and driver requirements on http://www.flightgear.org/hardwarereq.html

Prequisites/Companions

FGFS The basic Flight-Gear-Flight-Simulation installation. This must be installed prior to installing the FGCom (except if installing the Linux "CVS complete" version which can install FGCom and FGFS concurrently). ref.: http://www.flightgear.org/
FGrun This FlightGear Launch Control (also known as FG-Wizard), is a graphical front end to start the FGFS. This makes it very easy to startup the FGFS with all it's possible options. In some newer distributions this is already part of the basic FGFS installation package
Atlas Atlas displays the current position of your airplane on an landscape type of map together with navigational informations. It derives its data direct out of the installed FGFS databases.
MPMap MPMap is a pure browser application based on Google Maps, so it does not need any installation, except a Web-Browser. With MPMap you can watch all Multiuser-planes worldwide on a road-map, satellite picture or a composite of both. It includes most of the airports, navigational aids, and current weather informations. So it can be used for preflight planning, without having the FGFS started or even installed.
Multiplayer Howto: Multiplayer=Multiplayer is not an installable program but an integrated function of the FGFS. As the name says, it enables communication of several players via a chat-function (keyboard) - or with this vocal interface ==> FGCom.
Festival Festival is a TTS (Text To Speech) system that can convert all in the FGFS displayed written text (ATC, Chat, etc.) into speech and put it on your loudspeakers. ref.: http://www.flightgear.org/Docs/getstart/getstartch5.html#x10-790005.6

--Jomo 12:06, 11 March 2009 (EDT)

Install on Linux

For Linux-Systems there are 3 ways to install:

1) Downloading from the “Distributor” (Debian, Ubuntu, Red Hat, Suse, etc.).

  • Advantage: This is the easiest way and ensures that maintenance and services for this package and all concurrencies to it are provided automatically for a reasonable time-frame.
  • Disadvantage: The availability of those packages is usually very late and most Distributors do not cover all FGFS-features. To our knowledge none of the Distributors has an FGCom package available as of March 2009.
  • Installation: Follow the usual procedures of your distributer on how to install additional packages.

2) Installing a “CVS complete”

  • Advantage: It is the very easiest form of installation and installs in one step all prerequisite/companion modules (FGFS, FGrun, FGcom, PLIB, OSG, Simgear, AT). Also it can be added and removed from the system without disturbing the rest of the system (Libraries, Menus, Structures, etc.). It was tested on several Ubuntu and Debian systems.
  • Disadvantage: No automated maintenance available. The handling is a little different from the standard Menu-driven practice.
  • Installation: http://wiki.flightgear.org/index.php/Scripted_Compilation_on_Linux_Debian/Ubuntu

3) Compiling it locally

  • Advantage: After a successful installation it is integrated into the system like a package from the distributor.
  • Disadvantage: No automated maintenance available. Also the user should have some basic knowledge of his system and it's devices.
  • Installation:


Fetch FGCom (a copy of a working iaxclient is inside)

svn checkout svn://svn.dfn.de:/fgcom/trunk fgcom

Optional: edit iaxclient/lib/Makefile

To use OpenAl (Recommended and the default for now. Note however, that it requires OpenAl with capture support.)

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

To use oss emulation

USE_PA_OSS=1
USE_PA_ALSA=0
USE_PA_JACK=0
AUDIO_ALSA=0
AUDIO_OPENAL=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
AUDIO_OPENAL=0

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
AUDIO_OPENAL=0

Edit fgcom/src/Makefile and check the pathes for PLIB_PREFIX and OPENAL_PREFIX.

Compile iaxclient and fgcom. To do so, do the following:

cd fgcom/src && make

Install

make install

and you should be ready for a quick test...

Install on Windows

There is no download available directly from the FlightGear home-pages, so you need to search for one in the Internet. We found and tested that one: http://files.ww.com/files/50789.html

  • Download the binary file “fgcom-win32.zip” (or similar) and define as target your FGFS-directory.
  • Unzip the downloaded file – now you should have added “fgcom.exe” and “positions.txt” to your FGFS-directory
  • open a command window and type in:
c:\FGFS\fgcom.exe
      c:	stands for the drive/partion where your FGFS is installed
      FGFS	stands for the Directory where the FGFS is installed
  • if your system requests access via the firewall allow that


--Jomo 12:06, 11 March 2009 (EDT)

Install on Mac

ToBeDefined

Testing

Test the basic function

(The often so called "-f910 test")

Prior to executing the following command change into the directory, into which the FGCom was installed. This path will then shown up before the "$" sign. In case of a "cvs" installation you have to replace "fgcom" with "sh ./run_fgcom.sh". Then type:

   $ fgcom -Sfgcom.flightgear.org.uk -f910      


That will give the following output:

   fgcom - a communication radio based on VoIP with IAX/Asterisk
   (c)2007 by H. Wirtz <wirtz@dfn.de>
   Version 1.2.2 build 163M
   Using iaxclient library Version SVN 163M
   
   Successfully parsed commandline options.
   Reading list of airports...done.
   Initializing IAX client as guest:xxxxxxxxxxx@fgcom.flightgear.org.uk
   Call 0 accepted
   Call 0 answered

speak into the mic and your words will be echoed back with a short delay.
Then type ctrl-C to exit this Quick-Test


In case of trouble check the following:

  • "parsed commandline options" not successful: Check for wrong commands and/or missing “-” signs in front of them. See FGcom Options.
  • "Reading list of airports .." not succesfull: Check your file “positions.txt” which should be in the same directory in which you installed the FGCom. This is a normal text-file in which you can add missing informations. (Replacing a complete "Windows" position.txt with a "Linux" one can lead to erros, allthough lines of both files may be exchanged/added).
  • "Initializing IAX client" not successful: Check if you defined the right server, it must be "-Sfgcom.flightgear.org.uk”. Watch it: The “S” must be capital in Linux, but small for Windows (“-sfgcom.flightgear.org.uk”)!
  • No response "Call 0 accepted": Check your network.
  • If you did not hear the "delayed response" echoed back, check the Chapter Solving Audio-Problems.

--Jomo 01:01, 7 March 2009 (EST)

Solving Audio-Problems

Before you start, make sure that your headset is (or speakers and microphone are) working and tested to sensible volumes. Headsets are strongly recommended in order to avoid feedback resonances, which could affect not only you but all fellow listeners with awful or even painful noises. You may test your Audio-Devices using the basically installed Utilities of your operating system. e.g.: type into a command line for:

  1. Linux: "gnome-sound-recorder", (you may also check on: Linux software audio mixing with FlightGear)
  2. Windows: "audiorecorder"
  3. Mac: ???

more Tests / TestSetups etc. ToBeDefined

Final Tests

ToBeDefined

Using FGCom

ToBeDefined

Tips and Tricks

PTT (Push To Talk)

  • if the FGCom Command-window initiates, but does not respond to any COMM or PTT activity:
    • Try to enforce (the usually predefined) port as option. i.e. add “-p16661” to the FGCom Start-Command
    • check the FGrun extended Options → Input/output “generic=socket..”: The port there must be the same as for the FGCom, i.e. 16661 (if it was not intentionally changed by you)
    • You may try to change the port to e.g. UPD 5004. In this case you have to change at 2 places:
      • add the option “-p5004” to the FGCom start-command
      • also change the value in the FGrun (“Wizard”) → Advanced Options → Input/output to 5004.
      • and you may have to tell your Firewall to allow port UPD 5004

  • if in the FGCom Command-Window the Airport indication is ok,
    • but when hitting the PTT it does not appear:
      • [LISTEN] mute mic, unmute speaker
      • [SPEAK] unmute mic, mute speaker</nowiki>
    • Be sure the FGFS window is the active window. Move the Mouse-Pointer into the FlightGear-Window and click once, then try again (while the Mouse-Pointer remains in that window! Some systems do change the “active Window” according to where the mouse is!)
    • Check the “YourPlane-set.xml” file in your FGFS/data/Aircraft/YourPlane directory: If you find a line “<key n="32">” then this plane is intentionally using “key 32” (Space) for something other than the PTT. Known planes that do that as of Feb. 2009 are: an2, bluebird-base, ogel, OV10.., seafireIIc, spitfireIIa, ufo.

--Jomo 13:34, 11 March 2009 (EDT)


ToBeDefined

Supplemantery Informations

Commandline Parameters

Or if it didn't work perfectly first time

   fgcom --help

returns the following useful info

   fgcom - a communication radio based on VoIP with IAX/Asterisk
   (c)2007 by H. Wirtz <wirtz@dfn.de>
   Version 1.2.2 build 163M
   Using iaxclient library Version SVN 163M
 OPTION                                        DESCRIPTION
 -d, -debug, --debug=                          show debugging information
 -S, -voipserver, --voipserver=                voip server to connect to (default: 'fgcom1.parasitstudio.de')
 -s, -fgserver, --fgserver=                    fg to connect to  (default: 'localhost')
 -p, -port, --port=                            where we should listen to FG (default: '16661')
 -a, -airport, --airport=                      airport-id (ICAO) for ATC-mode
 -f, -frequency, --frequency=                  frequency for ATC-mode
 -U, -user, --user=                            username for VoIP account (default: 'guest')
 -P, -password, --password=                    password for VoIP account (default: 'guest')
 -i, -mic, --mic=                              mic input level (0.0 - 1.0)
 -o, -speaker, --speaker=                      speaker output level (0.0 - 1.0)
 -b, -mic-boost, --mic-boost=                  enable mic boost
 -l, -list-audio, --list-audio=                list audio devices
 -r, -set-audio-in, --set-audio-in=            use <devicename> as audio input
 -k, -set-audio-out, --set-audio-out=          use <devicename> as audio output
 -c, -codec, --codec=                          use codec <codec> as transfer codec (default: 'u')
 Available codecs:
       u - ulaw (default and best codec because the mixing is based onto ulaw)
       a - alaw
       g - gsm
       s - speex
       7 - G.723
 Mode 1: client for COM1 of flightgear:
       $ fgcom
 - connects fgcom to fgfs at localhost:16661
       $ fgcom -sother.host.tld -p23456
 - connects fgcom to fgfs at other.host.tld:23456
 Mode 2: client for an ATC at <airport> on <frequency>:
       $ fgcom -aKSFO -f120.500
 - sets up fgcom for an ATC radio at KSFO 120.500 MHz
   Note that /home/hcs/src/fgcom/trunk/src/fgcom starts with a guest account unless you use -U and -P!

Also note that the current server (fgcom.flightgear.co.uk) works with guest account, so do not use -U or -P

Server installation

For running a FGCOM server you need Asterisk and depending on the amount of users much bandwith and CPU power. Because of putting pilots and ATCs in a VoIP conference the server-admin has to assure that there is enough network and cpu power to avoid drop-outs of the voice stream.

Prerequirements

Install Asterisk on top of your favorite distribution. Please refer to installation manuals (e.g. [[1]]) you can find on the net. You do not need H.323 or SIP because the fgcom client uses IAX2 as VoIP signaling protocol. Only if you think about connecting external VoIP applications to FGCOM you should consider to activate H.323 or SIP (but this is not the scope of this small howto).

Notice: You need to install the zaptel driver modules - even if you won't use any hardware for telecom interfacing. You need the ztdummy kernel module for the asterisk conference application MeetMe() because it simulates a hardware clock needed by this application. Further development of FGCOM might use app_conference which don't needs any timing device.

For now we want to use /etc/asterisk as the base configuration directory.

Setting up the radio frequencies

The radio frequencies are "simple" Conferences and realized due to the Asterisk application MeetMe().

Part 1: General configuration

First you have to set up the general configuration of the system. Put the following at the top of your "extensions.conf" file:

 [general]
 static=yes
 writeprotect=yes
 ;
 [globals]
 ;
 [macro-com]
 exten => s,1,Answer()
 exten => s,n,MeetMe(${MACRO_EXTEN},qd)
 exten => s,n,Hangup()
 ;
 [macro-echo]
 exten => s,1,Answer()
 exten => s,n,Echo()
 exten => s,n,Hangup()
 ;
 [guest]
 ; ATC-Help
 exten => 01-ZZZZ-911.000,1,Macro(com)
 exten => 012525252591100,1,Dial(Local/01-ZZZZ-911.000)
 exten => 01-ZZZZ-910.000,1,Macro(echo)
 exten => 012525252591000,1,Dial(Local/01-ZZZZ-910.000)
 ;
 [default]
 include => guest
 ;
 ; Code:
 ; 01 - FlightGear
 ; 02 - Microsoft Flight-Simulator
 ; 03 - ...
 ;
 ; Air2Air
 exten => 01-ZZZZ-123.450,1,Macro(com)
 exten => 012525252512345,1,Dial(Local/01-ZZZZ-123.450)
 exten => 01-ZZZZ-122.750,1,Macro(com)
 exten => 012525252512275,1,Dial(Local/01-ZZZZ-122.750)

Part 2: Adding your favorite (all?) frequencies

For this you have simply to create an extension for every touple of airport/frequency in extensions.conf. The following is an example for Berlin-Tempelhof (EDDI). The information comes from the file "apt.dat.gz" of your FlightGear installation.

 ; EDDI ATIS 126.020 - Berlin Tempelhof
 exten => 01-EDDI-126.020,1,Macro(com)
 exten => 010403030812602,1,Dial(Local/01-EDDI-126.020)
 ;
 ; EDDI BERLIN DEP 120.620 - Berlin Tempelhof
 exten => 01-EDDI-120.620,1,Macro(com)
 exten => 010403030812062,1,Dial(Local/01-EDDI-120.620)
 ;
 ; EDDI BERLIN DIRECTOR 121.120 - Berlin Tempelhof
 exten => 01-EDDI-121.120,1,Macro(com)
 exten => 010403030812112,1,Dial(Local/01-EDDI-121.120)
 ;
 ; EDDI BERLIN ARR 126.420 - Berlin Tempelhof
 exten => 01-EDDI-126.420,1,Macro(com)
 exten => 010403030812642,1,Dial(Local/01-EDDI-126.420)
 ;
 ; EDDI GND 121.950 - Berlin Tempelhof
 exten => 01-EDDI-121.950,1,Macro(com)
 exten => 010403030812195,1,Dial(Local/01-EDDI-121.950)
 ;
 ; EDDI TWR 119.570 - Berlin Tempelhof
 exten => 01-EDDI-119.570,1,Macro(com)
 exten => 010403030811957,1,Dial(Local/01-EDDI-119.570)
 ;
 ; EDDI BERLIN DIRECTOR 136.100 - Berlin Tempelhof
 exten => 01-EDDI-136.100,1,Macro(com)
 exten => 010403030813610,1,Dial(Local/01-EDDI-136.100)
 ;
 ; EDDI TWR 118.100 - Berlin Tempelhof
 exten => 01-EDDI-118.100,1,Macro(com)
 exten => 010403030811810,1,Dial(Local/01-EDDI-118.100)
 ;
 ; EDDI BERLIN DEP 119.500 - Berlin Tempelhof
 exten => 01-EDDI-119.500,1,Macro(com)
 exten => 010403030811950,1,Dial(Local/01-EDDI-119.500)
 ;
 ; EDDI BERLIN ARR 119.620 - Berlin Tempelhof
 exten => 01-EDDI-119.620,1,Macro(com)
 exten => 010403030811962,1,Dial(Local/01-EDDI-119.620)

What does the above mean? There are two lines (three with the comment) for each frequency: The first one sets up an extension named "01-EDDI-119.500". Yes, for VoIP you can use textual extensions but be careful if you want to setup your Asterisk-Server with POTS (=Plain old telephone service). Therefor you need the second line which is the same as above but without dashes and the letters in the decimal representation of the ASCII Code. The second line does only a "rewrite" of the numerical representation to the textual one.

For setting up all airports you can write your own simple script. But this maybe also not needed in further versions of FGCOM.

After editing the extensions.conf file you have to reload the extensions file (e.g. "asterisk -rx extensions reload").

You can add further nice goodies to your extensions.conf: MorseCode() for morsing the code of the VOR (MorseCode() will only work in Asterisk >= 1.4), Recording of metar data and playing this recording back when using the frequency of the metar information, ...

Setting up user accounts

The user accounts are located in the file iax.conf (and perhaps also in sip.conf, but this is not necessary). The top of the file should look like this:

 [general]
 bandwith=low
 disallow=lpc10
 jitterbuffer=yes
 forcejitterbuffer=no
 tos=lowdelay
 autokill=yes
 disallow=all
 allow=alaw
 allow=gsm
 allow=ilbc
 allow=g726
 allow=ulaw
 language=en
 maxauthreq=10
 context=guest
 ;
 [guest]
 type=user
 username=guest
 context=guest
 qualify=yes
 callerid=Guest IAX User
 host=dynamic
 ;

You may want to disallow more codecs or want to allow additional codecs (such as speex). But have in mind that the internal mixing of the conferences are done in "ulaw". But "ulaw" needs about 80 kBit/s because it does no compression. So you have to think about what's better for you: less bandwidth (per user) and more CPU usage or more bandwidth (per user) and less CPU usage... you should also consider the "sound" of some codecs may not have the 'real radio sound'.

For each user you have to add a bunch of lines to your iax.conf file:

 [<USERNAME>]
 type=user
 username=<USERNAME>
 secret=<PASSWORD>
 context=default
 host=dynamic
 nat=yes
 notransfer=yes

You just have to fill in the <USERNAME> and <PASSWORD>. After each change you have to reload the configuration (e.g. "asterisk -rx reload chan_iax2.so"). Perhaps you want to write scripts for automatic configuration and so on. But be warned: Further versions of fgcom may use the multiplayer servers for getting usernames and position data and you have to change your scripts.

Problems?

If you have problems you can contact me via email at "dcoredump AT gmail.com".

External links

Development

TODO

See also