Projects that use their own Bluetooth service need to use the io-acoustic API to manage acoustic echo cancellation and noise reduction.
If you use the io-acoustic API, you will have to perform the tasks described below.
To enable acoustic echo cancellation on your system, you need to perform a few setup tasks when you start your system:
If you want to use an acoustic tuning file for the AAP library other than the one specified in the io-acoustic configuration file, you need to:
If you want to change the device routing from that specified in the io-acoustic configuration file:
When you have completed your initial setup, you need to:
To start acoustic processing:
To stop acoustic processing, call ioap_hf_stop().
If you need to get information about your system and how it is configured for acoustic processing you can:
Volume control is enabled if volumecontrol is set to "true" in the configuration file. Otherwise, the volume level is fixed and specified by the tuning file.
This design supports systems that want the AAP library to control the volume, and systems that want the codec to control the volume. The acoustic echo cancellation performance will be better if the AAP library controls the volume, but this option is more difficult to implement. It requires that your system intercept the volume control change request and pass it into your handsfree application rather than just letting the audio subsystem handle it.
If you configure your system to have the AAP library control the volume, you can use the acoustic processing API to get and set the volume level. The volume level you set with the API remains in force until the next time io-acoustic is started:
If you do not know your system's latency, you can use ioap_start_latency_test() to run a latency test, and ioap_hf_get_latency_estimate() to retrieve the results of this test.