Example configurations

Examples of io-acoustic configuration files are useful when learning to tune acoustic echo cancellation.

You can refer to the examples below to help you better understand how to edit your io-acoustic configuration file.

Single device input and output

The following simple configuration file configures only the io-acoustic handsfree module.

     
# Single device input and output
            
logfd 2
verbose 6
<hf apm-aap-hf.so>
    inputs 1
    ichannels1 2
    iroute1_1 IOAP_MIC_IN_1
    iroute1_2 IOAP_PHONE_IN_1
    outputs 1
    ochannels1 2
    oroute1_1 IOAP_PHONE_OUT_1
    oroute1_2 IOAP_SPKR_OUT_1
    qcf /etc/acoustic/mono.qcf
    msprime 30
</hf>
            

This example assumes that the mono.qcf acoustic processing configuration file specifies mono operation. It instructs io-acoustic to open one stereo input device and one stereo output device. For more information , see "Acoustic processing tuning files (.qcf)".

The two input device channels are mapped to microphone 1 and phone input 1 of the acoustic processing library, and the two output device channels are mapped to speaker output 1 and phone output 1. Because no path to a device is specified in the routings, the preferred input and output devices are used.

In addition, this file configures logging, specifies the location of an acoustic processing configuration file, and configures the speaker output zero-priming.

The table below provides a line-by-line description of the configuration file:
Key Effect of setting
logfd 2 Direct logging to standard error.
verbose 6 Increase verbosity to level 6.
hf apm-aap-hf.so Start marker for hands-free configuration.
inputs 1 Open one input device.
ichannels1 2 Open 2 channels for input device 1.
iroute1_1 IOAP_MIC_IN_1 Route channel 1 of input device 1 to acoustic processing input IOAP_MIC_IN_1.
iroute1_2 IOAP_PHONE_IN_1 Route channel 2 of input device 1 to acoustic processing input IOAP_PHONE_IN_1.
outputs 1 Open one output device.
ochannels1 2 Open 2 channels for output device 1.
oroute1_1 IOAP_PHONE_OUT_1 Route acoustic processing output IOAP_PHONE_OUT_1 to channel 1 of output device 1.
oroute1_2 IOAP_SPKR_OUT_1 Route acoustic processing output IOAP_SPKR_OUT_1 to channel 2 of output device 1.
qcf /etc/acoustic/mono.qcf Use /etc/acoustic/mono.qcf as the acoustic processing tuning file.
msprime 30 Prime speaker output with 30 milliseconds of zeroes on "go" to compensate for system latency.
/hf End marker for handsfree configuration.

Two input devices, two output devices

This configuration file uses two separate input devices and two separate output devices.

# Mono input, mono output

<hf apm-aap-hf.so>
   inputs 2
      ichannels1 1
      iroute1_1 IOAP_MIC_IN_1
      ipath2 /dev/snd/pcmC1D0c
      ichannels2 1
      iroute2_1 IOAP_PHONE_IN_1
   outputs 2
      ochannels1 1
      oroute1_1 IOAP_SPKR_OUT_1
      opath2 /dev/snd/pcmC1D0p
      odevice2 0
      ochannels2 1
      oroute2_1 IOAP_PHONE_OUT_1
   qcf /etc/acoustic/mono.qcf
   msprime 30
</hf>

Two microphone inputs, a reference input, separate phone and output devices

This configuration file use two microphone inputs, a reference input, and separate phone input and output devices. The mixer.qcf tuning file should configure the acoustic processing to mix the two microphone inputs as part of its processing.

# Dual mic input, mono output

<hf aap-apm-hf.so>
   inputs 3
      ichannels1 2
      iroute1_1 IOAP_MIC_IN_1
      iroute1_2 IOAP_MIC_IN_2
      ipath2 /dev/snd/pcmC1D0c
      ichannels2 1
      iroute2_1 IOAP_REF_IN_1
      ipath3 /dev/snd/pcmC2D0c
      ichannels3 1
      iroute3_1 IOAP_PHONE_IN_1
   outputs 2
      ochannels1 1
      oroute1_1 IOAP_SPKR_OUT_1
      opath2 /dev/snd/pcmC1D0p
      ochannels2 1
      oroute2_1 IOAP_PHONE_OUT_1
   qcf /etc/acoustic/mixer.qcf
   msprime 30
   </hf>