Using the Host Application#

The XVF3800 contains a control interface that enables users to configure the operation of the device and to set and read parameter data.

In 1.0 a sample host application, xvf_host is provided which can be used to connect to the control interface on the XVF3800 from a Raspberry Pi host. Contact XMOS for information on using these tools on other host platforms.

Installing the Host Application#

The sample xvf_host application can be found in the evaluation binaries release package in the subfolder host_v<version>/rpi This whole folder needs to be transferred to the Raspberry Pi. It can be placed in any convenient location. This directory should contain the following files:

.
├── libcommand_map.so
├── libdevice_i2c.so
├── libdevice_spi.so
└── xvf_host

To verify the xvf_host application is installed, change to the directory and run the application as per the example below, setting the appropriate permissions first.

chmod +x xvf_host

xvf_host --help

Users may find it convenient to store the host tools in a directory such as ~/bin and add this to the $PATH environment variable so that the tools can be invoked from any directory, for example with the shell command:

PATH=~/bin:$PATH

Connecting to the XVF3800 Device#

To use the host application, login to the Raspberry Pi, either directly, via a VNC connection or ssh and to open a terminal command line.

Change to the directory containing xvf_host. If the host tools have been added to the path as above this step is not needed.

The xvf_host device control application is run from the command line.

To check connection to the XVF3800, any command can be given; for example, the command:

$ xvf_host -u <protocol> VERSION

where <protocol> can be i2c or spi depending on the interface used in the specific firmware. The default control protocol is I2C.

This command should give an expected return value of:

VERSION 1 0 0

xfv_host Command Syntax#

The general syntax of the `xfv_host command is:

xvf_host [ command | option ]
         [ -u <protocol>] [ command | option ]

More documentation on the available options in the use of the host application are found with:

.. code-block:: bash

xvf_host –help

A full list of control commands may be found using:

xvf_host --list-commands

These commands are also listed in an Appendix of this User Guide.

It is possible to read all the control parameter settings from the XVF3800 using the following option:

xvf_host --dump-params

To support scripted set up of the XVF3800 it is possible to save the list of commands in a text file (.txt) which can be executed using: .. code-block:: bash

xvf_host –execute-command-list <command_file>.txt

Further options for saving and loading parameter sets can found by using the --help option or in the section of the User Guide on tuning the device where their usage is described.

Example Uses#

The xvf_host tool allows the configuration of the XK-VOICE-SQ66 evaluation kit to be changed during operations. The following examples illustrate some common operations.

Output Selection#

By default, the left (first) channel of the device’s output is the processed output from the XVF3800’s AEC and beamforming stage, while the right (second) channel is the raw input from one of the microphones after amplification. This is intended to provide a good comparison between the raw and processed audio. The selected outputs may be changed by using the AUDIO_MGR_OP_L and AUDIO_MGR_OP_R commands. These commands each take two integers defining the mux routing settings, described as a pair of (category, source) values.

The available categories and sources are as detailed in Table 22.

Table 22 Audio manager mux options#

Category

Sources

0: Silence

0: Silence

1: Raw microphone data - before amplification

0,1,2,3: Specific microphones accessed by index

2: Unpacked microphone data

0,1,2,3: Unpacked microphone signals. If using packed input, the packed microphone data is accessed though here. This will be undefined when not using packed input

3: Microphone data - after amplification and delay

0,1,2,3: specific microphones accessed by index after amplification. This is the microphone signal passed to the SHF task for processing. Source 2 is the default setting for the right channel output

4: Far end

0: Far end (reference) data received over I2S, post sample rate conversion to 16 kHz if required

5: Far end with system delay

0: Far end (reference) data received over I2S, post sample rate conversion to 16 kHz if required, and with system delay applied

6: Processed data

0,1: Slow-moving post-processed beamformed outputs, 2: Fast-moving post-processed beamformed output, 3: The “auto-select” beam; chooses the best of the previous three beams as an output. This is the recommended option for selecting the beamformed outputs

7: AEC residuals

0,1,2,3: AEC residuals for the specified beam

8: User chosen channels

0,1: These currently copy the auto-select beam (category 6, source 3) and are the default setting for the left channel output.

9: Post SHF DSP channels

0,1,2,3: All output channels from user post SHF DSP

10: Far end at native rate

0,1,2,3,4,5: Output from I2S task which is the far end reference signal with the custom pre-processing DSP applied. Always at native I2S rate.

11: Amplified microphone data after delay

0,1,2,3: Raw microphones after applying the delay. This is the reference signal which is passed to the SHF task for processing

12: Far end with amplification and delay

0: Far end signal with configurable fixed gain applied. This is the signal which is passed to the SHF task for processing. Note that this is after system delay has been applied.

For example, to set the left output to the 4th raw microphone signal (without gain applied), issue the command:

xvf_host AUDIO_MGR_OP_L 1 3

This will set the left channel to output the 4th (0-indexed) microphone signal of the 4 present. To reset this channel back to its default value, issue:

xvf_host AUDIO_MGR_OP_L 8 0

to set the channel to the postprocessed auto-selected output beam.

Similarly, the right channel may be set to any desired category/source; to reset to its default value, issue:

xvf_host AUDIO_MGR_OP_R 3 2

Setting an Output Pin#

The xvf_host can be used to configure the General Purpose Outputs on the XVF3800.

To turn on the LED on the XK-VOICE-SQ66 evaluation kit issue the following commands:

vf_host gpo_port_pin_index 0 6
xvf_host gpo_pin_pwm_duty 100

and to turn it off use:

xvf_host gpo_pin_pwm_duty 0

Note

The gpo_port_pin_index selects a port and subsequent gpo_pin_xxx commands only act on that pin.