FGCOM Testing

From FlightGear wiki
Jump to navigation Jump to search
This article or section contains obsolete information.

Please refer to FGCom_3.0 instead.

This article is obsolete but is kept for historical reference.

The new version of FGCom is much more simple to use, a clean documentation is available at FGCom_3.0
See also the discussion page.

This "FGCOM_Testing" is intended to support FGCOM-users in debugging their FGCOM-System directly after installation, but also for those who want to verify the basic functionality or want to readjust the audio-system. It covers the following 4 areas in more detail:

  1. Testing of the standalone FGCOM Installation
  2. Testing the FGCOM together with the FlightGear Simulator
  3. Adjusting the Microphone and Speaker volumes
  • In the Appendix you will find supporting information
  • Of course the prerequisite for the following is that you have already installed the FGCOM (see the FGCOM-main-page) !

    The Initial test of the standalone FGCOM Installation --> the so called "-f910 Test"

    Prior to executing the following command open a command-window and change into the directory, into which the FGCom was installed. This path will then be shown shown in the command window, followed by a "$"-sign. Enter the following "fgcom"-command with the required/wanted options:

    fgcom -Sfgcom.flightgear.org -f910
    For MAC you may use:
    /Applications/FlightGear.app/Contents/MacOS/fgcom -Sfgcom01.flightgear.org -f910
    the command (in case you installed by using the download_and_compile.sh script for LINUX-Systems you have to replace the command "fgcom" with: "sh ./run_fgcom.sh". Then the complete command would be: "sh ./run_fgcom.sh -f910")
    one of two FGCOM-servers! Since Oct.2012 there are 2 FGCOM-servers available:
    1. The original: fgcom.flightgear.org
    2. A new one: fgcom01.flightgear.org
    Due to technicalities it is not possible to speak from 1 server to the other - so try one and change if you notice that your friends are using the other.
    So insert the server-address after a "-S" (watch: The "S" must be a capital!):
    the only available frequency for echo-tests
    In case your audiosystem is rather weak, you may try the options:
    -i and/or -o: i=input(microphone) o=output(Speaker), both values between 0.0 and 1.0 (e.g.: -i0.9)

    You do not need any Login-Passwords and/or User-Names !!!

    For a detailed description of all available options see Commandline Parameters - in the following we will only show the minimal required options:

    That should give you the following return:
     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
     Call 0 accepted
     Call 0 answered

    Speak into your microphone and your words should be echoed back with a short delay. e.g. say "one" - and you should notice that the "one" is returned after you finished speaking it.
    If that was OK

    In case of trouble check the following most probable errors:

    Error: FGCOM does not start because of OpenAL-version:

    If you see a message from the Operating-System similar to the following Windows message:

    "The procedure entry point alcCaptureSamples could not be located in the dynamic link libary Open AL32.dll."

    Then download and install the latest OpenAL software from: http://connect.creativelabs.com/openal/Downloads/Forms/AllItems.aspx

    for windows: alinst.zip
    for Linux: openal-soft-1.10.622
    for OSX: OpenALInstaller

    Be aware that the versions and also the names of the modules may change -- so please always check also the description of the module at the right side on that http-page!

    Error: Incorrect Home-Directory specified for FGCOM:

    typical for Windows-Systems:

       C:\Users\localuser>cd \Programme\Fxx
        The System cannot find the given path.
        C:\Users\emmerich>fgcom.exe -Sfgcom.flightgear.org -f910
        The command "fgcom.exe" is either mistyped or could not be found.

    typical for Linux-Systems:

     /home/emmerich/Desktop/Link to fgcom: line 1: cd: /home/emmerich/fgf: No such file or directory
     sh: Can't open run_fgcom.sh
    • The system is right: I gave it (for testing) a wrong directory!
    • You better correct yours prior to retrying!

    Error: "TYPO" (mistyped command or option) or Network-problem:

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

    after some time there may appear:

    ''' Call 0 timed out.'''
    '''Timeout for a non-existent session.  Dropping'''


    '''Call 0 accepted'''
    '''Call 0 answered'''
    '''The service is unavailable. Please wait until fgcom Version 3 is online. Thank you.'''

    most likely you may have

    • defined a wrong Frequency to use or you may have forgotten to define one. You must define the option -f910
    • forgotten a "-"sign in front of an option
    • typed a small "-sfgcom..." instead the capital "-Sfgcom..."
    • mistyped the Server-Name or defined a wrong FGCOM-Server
    • or you may have created your own unique "typo" (lol).
    • or it may indicate a Network-Problem:
      • Check your network by using some other application (e.g. your file browser to look up an usually not used http-address - if you use a recently used address the answer might be out of your locally saved copies - even so the network is not connected! (e.g. use "http://mainz.de/" to test)
    • If you use a firewall (what you should - out of general safety reasons!) make sure the ports below are enabled for your PC.
     2005	UDP	Vcp-Stream
     4569	UDP	FGCom  VoIP, (Inter-Asterisk eXchange)
     5000	UDP	in/out Multiplayer    (VPN Sftw.)
     16661	UDP	FGCom listening to FGFS, usually on localhost only

    Error: "Phone-book" and/or "positions" cannot be found and/or are corrupted:

    ./fgcom - a communication radio based on VoIP with IAX/Asterisk
    (c)2007 by H. Wirtz <wirtz@dfn.de>
    Version 1.2.2 build 223M
    Using iaxclient library Version SVN 223M
    Successfully parsed commandline options.
    '''Reading list of airports...Cannot open /home/emmerich/fgfs/install/fgcom/fgcom/positions.txt'''
    '''fopen: No such file or directory'''
    '''Stopping service.'''
    • check the directory in which the FGCOM is installed for the files "phonebook.txt" and "positions.txt". These are normal text-files in which you can add missing information with a standard editor, for Windows you should use the "WordPad" (not the "Editor"). Replacing a complete "Windows" position.txt with a "Linux" one can lead to errors, although lines of both files may be exchanged/added.

    Error: The Sound-Card is not fully compatible:

    ./fgcom - a communication radio based on VoIP with IAX/Asterisk
    (c)2007 by H. Wirtz <wirtz@dfn.de>
    Version 1.2.2 build 223M
    Using iaxclient library Version SVN 223M
    '''AL lib: alsa.c:564: set access failed: Invalid argument'''
    Successfully parsed commandline options.
    Reading list of airports...done.
    Initializing IAX client as guest:xxxxxxxxxxx@fgcom.flightgear.org
    Call 0 accepted
    Call 0 answered
    • Continue checking/adjusting:
      • If everything else works out OK forget this problem (but be aware: The Audio might not function perfectly!)
      • otherwise check the Internet for new drivers for your sound-card or other fixes.

    Test the FGCOM together with the FlightGear Simulator

    In the forgoing chapter you checked the FGCOM as a standalone application. Now we will test whether the FGFS (FlightGear Flight-Simulator) itself and the FGCOM work together, inclusive the PTT-button (PushToTalk, usually the space-bar) and the internal connections via the assigned ports.
    For this test

    1. start the FGFS with any plane at any airport you like
    2. start the FGCOM (usually it does not matter which one starts first - but in case of trouble you should try to start in this sequence!)
    3. click in the FGFS menu-bar onto "Equipment" --> "Radio Settings"
      • into the field "COM1" enter the frequency "910.00" then click "Apply" (and "OK" if you want to close the Pop-up.)
      • Ensure the FGFS is the active window: if something does not work out as expected click with the mouse somewhere into the Main-FGFS-window (that will activate the window) and then retry the last action(s)!!!
    4. if the FGCom Command-window initiates, but does not respond to any COMM-Frequency setting:
      This indicates a pure Port/Interface problem between the FGCOM and the FGFS.
      Try to enforce (the usually predefined) port as option. i.e. add the option “-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 interface-port to e.g. UPD 5004. In this case you have to watch 3 places:
      add the option “-p5004” to the FGCom start-command
      also change the value in the FGrun (“Wizard”) → Advanced Options → Input/output to 5004 or add the option "--generic=socket,out,10,localhost,5004,udp,fgcom" to your FGFS start-command.
      and you may have to tell your Firewall to allow port UDP 5004
      anyhow make sure all these 3 places contain the same Port-number !!!

    5. Push the PTT (normally the Space-Bar (if you reassigned the PTT to another key - use that one!)) and speak into your microphone: "your words should be echoed back with a short delay. e.g. say "one" - and you should notice that the "one" is returned after you finished speaking it.
      if you heard that echo:
      keeping the PTT pressed for about 3 sec and watch for a possible start of "funny noises".
      if those occur continue with chapter Adjust the Microphone and Speaker volumes
      otherwise switch your COM1 back to the frequency wanted --> continue with the next numbered item.
      if you did not hear the echoed return
      Test your PTT: Watch the FGCOM messages in the FGCOM-Window:
      When pushing the PTT they should switch between [SPEAK] unmute mic followed by [LISTEN] mute mic
      If they did not switch you probably use an airplane model that has reassigned the Space-bar to another function:
      Otherwise 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. There could be others.

      Adjust the Microphone and Speaker volumes

      Finally we will adjust the Microphone and Loudspeaker volumes to an optimum, as well for yourself as also for your fellow players.
      (You could perform this test also with the "f910-test" in chapter 1, but with the test-setup in chapter 2 it becomes more realistic!)

      1. Start your FGFS and FGCOM as described in the forgoing chapter(s), the COM1 must be switched to 910.00 and be the active one.
      2. Talk into your Microphone and verify the delayed feedback. If this does not function as described before, repeat the forgoing chapters.
      3. While talking into the microphone adjust your loudspeaker so that your echoed voice is understandable, but not any louder than required.
      4. Now adjust your microphone volume from 0 to full. Somewhere in between you will find a spot at which the returned echo-volume will not increase according to the microphone-volume changes. Leave the volume just a little below that point.
      5. After the microphone is set, adjust the loudspeaker volume to a level you prefer.
      6. Finally verify both settings by keeping the PTT pressed for about 10 seconds without talking and/or feeding any other sounds into the microphone.
        • listen for "funny noises" building up over time (hard to describe: some "unverified whoosh" and maybe additional even some sound like "air in a water-pipe" - actually: Whenever you hear anything --> it is no good!!!.
        • Mostly these "build up sounds with time" are due to an active microphone booster. Try to keep that booster to an absolute minimum (even better try to switch it off completely if not really needed!) while instead increasing the microphone volume
        • but also a rather high adjusted speaker-volume may cause such "funny noises" - try reducing the loudspeaker volume if you cannot solve the problem by adjusting the microphone and/or booster.
        • then you might readjust as described in the forgoing items.
      7. Now you are ready to talk to others, e.g. set your COM1 to the desired frequency and let your co-players praise you for that "absolute brilliant voice you have"!

      By the way: You do not have to wait for the next MP-event to check this real life: When flying next time, look into your pilots-list (FGFS-menu-bar --> Network --> Pilot List) and try to contact one of those pilots (or pilotesses) listed there via MPchat (FGFS-menu-bar --> network --> Chat) - via this chat you then can define what frequency to use - to be sure you tune to the same. In general all of those having FGCOM operational will gladly help you testing! You may have to look in MPmap first to find where there are some people - because you need a distance less than 100 nm to get into contact via MPchat.

      PLEASE: While "on Air" in MP keep the PTT pressed only while actually talking - and never longer than about 20 sec. After some time you will be timed out anyhow - but even before that drastic cutoff you might give your co-players a chance to reply/say something!


      Tips and Tricks

      Typical Problems

      1. Microphone not plugged or Mute-Key activated: It sounds stupid – but most technical problems are due to such “cannot bee”s – please: Always spend the 2 sec. to check this first! Also some Microphones do have an own "Mute-Key", which sometimes is not obviously to see - check your handbook if your Mic has such a switch.

      2. Plug/Jack connections are often the cause for trouble: Try to re-seat your plugs and (if possible) try to use another jack (after cleaning the plug!).

      3. Multiple Microphones and/or Loudspeakers plugged to your PC: Be aware that most PC's do have Jack-mechanisms that prevent more than one input and/or output per PC. Try using only one (at best the major one - mostly at the back of the PC)

      4. If you changed your Mic/Loudspeaker setup or did plug them into anther jack, it is advisable to restart your PC – just to make sure the system knows what you did! (For Windows-Systems this is usually not necessary - but: It cannot hurt to reassure!)
        • If you use USB-headsets you might first try to get FGCOM running with standard Input/output devices – and go back to USB after that. If nothing else it helps to narrow down into the trouble-area!

      5. Check that none of your Sound-system Inputs/Outputs are set to “Mute”:
        • For basic systems you might use a right mouse-click onto the loudspeaker-symbol in the upper or lower position of you screen.
          • For WIndows-Systems: If that symbol is not there:
            • for Vista: Left mouse-click onto “Start”, type “SndVol.exe” into the line just above the Start-button
            • for XP: Left mouse-click onto “Start” then on “Run”, type “SndVol32.exe” into the appearing input-field.
        • For some “highly sophisticated (and expensive)” sound-cards you might need to use their unique descriptions.
        • FGCOM does not require a “better” sound-card like e.g. for Music or so – it is all Telephone/TCP-IP talking only – (except some people I know like to play country-music while pushing the PTT – that sounds nice - but still is not really high fidelity!)

      6. Always make sure that you can record and playback something you talk into the microphone with your basic system tools, completely independent of the FlightGear and/or the “OpenAL”. (See your handbooks for testing your unique system and/or the chapter Where to find the volume controls)

      7. If the connection is noisy or poor quality:
        • First retest your sound-setup as described above
        • try routing your Mic/Speaker cables away from electro-smog (Fans, AC/DC modules, motors, lamps, etc.)
        • even placing your sound-card into another plug-position may help
        • a (digital) USB-headset may help avoiding noise and feedback problems
        • if stereomix is enabled on your sound-card - try to disable it

      8. Most PC's are set up that you need to keep your PTT (PushToTalk) button pushed as long as you talk. But there are also sound-cards which open for talk with the first push/release and close it with the second push/release. Test your system how it works (may be while trying to record something or while testing according to the above).

      9. If the FGFS sound-volume does not match your FGCOM-volume:
        • After starting the FGFS click onto “File” in the FGFS menu-bar, then onto “Sound Configuration”: Adjust the upper slide-control to a proper volume. Be aware that this setting will get lost when you exit via “X” - always exit via “File” → “Exit/Quit”.
        • To the opposite you may adjust the volume of your FGCOM by changing the “-o” and/or “-i” options to values between 0 and 1 (see the FGOM command at the beginning of this wiki-page).

      10. If you believe you did everything right - but still you cannot establish a connection: Use MPchat to ask which FGCOM-server the other('s) are using! Since Oct.2012 there are 2 FGCOM-servers available:
        1. The original: fgcom.flightgear.org
        2. A new one: fgcom01.flightgear.org
        Due to technicalities it is not possible to speak from 1 server to the other - so try one and change if you notice that your friends are using the other.

      Try to keep in mind: FGCOM is proven to work! So if there are problems look also for surrounding PC-features like unique hardware, software, etc.

      High Quality Sound-Cards

      Especially “high quality” sound-cards may get you into trouble, because e.g.:

      • they may monitor how long the microphone was not used and switch it off after some timespan (without you noticing it)
      • during reboot or restart they may initiate with values out of a special profile instead of reusing the “last used” values
      • or they may set some slide controls to “0” (especially microphone sliders)
      • some do switch the microphone only after pushing and releasing the space-bar – while we want to change the microphone-status only while the space-bar is pushed down! (This may not affect a PTT asigned to a joystick)

      So know your standard settings and check if they have changed (without your written permission!)

      Linux ALSA Sound

      (Reference Linux software audio mixing with FlightGear)

      Check your Home-directory (“~/” or $HOME) for a file ".alsoftrc" (Remember that the “show hidden files” must be enabled!)

      If using Creative Labs' OpenAL library (or older OpenAL version)

      Check if you are using the old Creative Labs OpenAL library (or old version) which uses the ".openalrc" configuration file. If so, you can put something like this within ".openalrc":


      (define devices '(alsa))
      (define alsa-out-device "plug:dmix")
      (device alsa-in-device "plug:dsnoop")
      If using OpenAL Soft (or newer OpenAL version)

      It is more likely users of more recent Linux distributions are using this newer OpenAL Soft package, instead of the previously mentioned older Create Labs' OpenAL. (Hence, the likely rational for renaming the default configuration file to something other than the more common previous naming format.)

      Copy either the be /etc/openal/alsoft.conf, /usr/share/doc/openal-1.15.1-r2/alsoftrc.sample.bz2, or create a new $HOME/.alsoftrc file and insert the following:

      format = AL_FORMAT_STEREO16
      cf_level = 1
      drivers = alsa
      device = plug:dmix
      capture = plug:dsnoop

      [NOTE: format is now "sample-type = uint16", and cf_level would appear not needed for typical users, or only desired for headphone users.]

      The system wide OpenAL-soft configuration file may be /etc/openal/alsoft.conf or similar. It usually contains comments describing all possible configuration options.

      Linux ALSA Audiophiles avoiding Dmix

      For audiophiles using Linux ALSA and with their custom $HOME/.asoundrc file preventing DMix usage, make sure you have both specified "device = plug:dmix" as well as "capture = plug:dsnoop". Per ALSA's page, "dsnoop is the equivalent of the dmix plugin, but for recording sound." Without specifying using dsnoop for the capture device alongside your $HOME/.asoundrc file preventing DMix usage, you will likely only get silence played back when usage FGCom. FGCom is not working at this point, as the sound device is likely still locked by your $HOME/.asoundrc file and only recording silence or playing back silence during the echo test!

      Using ALSA Custom "plug:" Filters

      The OpenAL Soft (or the newer version of OpenAL) $HOME/.alsoftrc file also accepts using other $HOME/.asoundrc "plug:" incanatations, such as sections containing Dmix - alsa.opensrc.org's "pcm.dmixs51" customization for using DMix with 5.1 Surround Sound, and called as:

      $ aplay -D "plug:dmixs51" Some_PCM_WAV_File.wav 


      "device = plug:dmixs51"

      Just remember to also uncomment layout_surround51, and note the likely fact FlightGear is still only using Stereo sound (or two channel audio) and is only set here for an example!

      USB-Headsets-Problems with Linux (Ubuntu)

      The following is based/verified on Ubuntu, but should be similar on other distributions:

      • If Recording is ok and the f910-Test looks alright in the window, but there is no delayed response:
        • type "cat /proc/asound/modules" into the command window, e.g.:
      $ cat /proc/asound/modules
       0 snd_usb_audio
       1 snd_hda_intel
        • If that displays multiple devices (as shown in the above list, which is the result after doing the following!), then the USB-Headset should be in the "0" position. If this is not the case, notice the name of your USB-device and edit it. e.g.:
      "sudo gedit /etc/modprobe.d/alsa-base.conf"
        • add as last line into that file, e.g.:
      options snd_usb_audio index=0


      • If you use Festival (the Text/Speech AddOn)
        • and
          • it works OK when running alone
          • but runs int error "can't open /dev/dsp" when running with FGFS (and/or other applications)
        • then add a TextFile ".festivalrc" into your home-directory, containing:
      (Parameter.set 'Audio_Command "aplay -q -c 1 -t raw -f s16 -r $SR $FILE")
      (Parameter.set 'Audio_Method 'Audio_Command)

    Where to find the volume controls

    Please be aware that FGCOM is used on many very different PC's, Notebooks, etc. under very different Operating-Systems and with very different Sound-Cards. So the following basic concepts may not fit your actual system 100%. In addition you may have to check your actual System and/or unique Sound-Card manuals!

    1. Define the audio-devices to use:
      for Linux: for Windows: for MAC:
      Enter command: gnome-sound-properties
      test devices

      For each task you can open a selection-menu (on the right the downward arrow) in order to select the wanted device. I suggest to first try setting all to "Autodetect". Then click onto the green "Test"-button. If you need to make changes, reboot the PC after each change!

      Click right onto the audio-icon → Preferences → Audio-tab:
      set devices

      See the two Tabs (in the picture) Audio and Stimme (voice), you need to change in both!

      Open with Menu --> System-preferences:
      set devices

      Switch between "Output" and "Input" and select the wanted device('s) in the field "Chose a device...".

      If you did change these device-settings, it is a good idea to reboot the PC and retest the settings prior to continue.

    2. Adjust volumes and switch boosters (for the first loudspeaker-adjustments you should switch off the Mic.!)
      Click right on Audio-Icon → Open Vol. Ctrl:
      Volume Control

      The amount of the slider-controls vary depending on the capabilities of the sound-card or the usage of USB-headsets.

      The “booster” is available under “Switches” (you may have to activate it first under "Preferences").

      Click right on the Audio-Icon → Volume-Ctrl. (or type command: sndvol32)
      set devices

      In this example the card overrides the std. Microsoft “Mic.” with “Rear Pink In”. Be aware of such changes caused by usually “high expense” devices! The “booster” is available under options.

      Use the above shown window to adjust.

    3. Verify the basic Mic/Loudspeaker functionality:
      Use the volume-control-panels to enable the microphone for this test. Then:
      Open the recorder with the command: gnome-sound-recorder
      • Record
      • Stop
      • Play
      Open the Recorder with command: sndrec32
      • Start recording (click red point)
      • talk some words into the mic
      • stop (rectangel)
      • spool back ( < < )
      • listen (>)
      There is no basic recording program available with OSX.