Setting Up the Hardware#

Introduction#

This section explains the process of setting up and configuring the XVF3800 firmware on an XK-VOICE-SQ66 evaluation kit.

Note

Version v1.0.0 of the XVF3800 firmware supports audio I/O via I2S only. For evaluation a Raspberry Pi will be used to act as an I2S and I2C master.

Hardware Setup#

Required Components#

  • An XK-VOICE-SQ66 evaluation kit board.

  • An XMOS XTAG4 with associated ribbon cables (Provided in the XK-VOICE-SQ66 evaluation kit package).

  • A setup or development machine (Windows, Mac OS or Linux are supported). This must support USB connections and have the ability to write onto SD memory cards.

  • A USB cable to connect the setup machine to the XTAG4.

  • A Raspberry Pi microcomputer; either a Raspberry Pi 3 Model B or 4 Model B will work for this evaluation. See https://www.raspberrypi.com/ for more information.

  • A region-appropriate USB power supply is also required. The XK-VOICE-SQ66 evaluation kit obtains its power supply from the Raspberry Pi.

  • An SD memory card - minimum 8GB size

  • A stacking header block, such as pictured in Fig. 10 to mount the XK-VOICE-SQ66 evaluation kit board onto the Raspberry Pi using the standard 40 pin GPIO header. A suitable part is Toby REF-182668-01 .

../../_images/01_rpi_header.png

Fig. 10 Raspberry Pi HAT Connector - 10 mm Extended Tail Socket#

  • The XVF3800 evaluation firmware binary release package (available from https://xmos.ai or via an XMOS representative).

Note

The XK-VOICE-SQ66 evaluation kit is an evaluation kit and after loading the firmware the device will stop working after 8 hours of continuous use. The board must be restarted after 8 hours to resume operation. Licensed production XVF3800 devices do not have this restriction.

Setting up the Evaluation System#

The following steps are required to set up the XVF3800 evaluation hardware:

  1. On the setup machine, install the latest available XTC Tools, available from https://www.xmos.ai/software-tools/. Installation instructions for the supported platforms are available at https://www.xmos.ai/view/Tools-15-Documentation.

  2. On the setup machine, install and run the Raspberry Pi Imager, available from https://www.raspberrypi.com/software

  3. Using the Raspberry Pi imager, copy the latest available 32 bit version of the Raspberry Pi OS onto an SD card.

  4. Insert the programmed SD card into the Raspberry Pi. Attach any required peripherals (keyboard, mouse, monitor), connect the power supply and follow the setup prompts, but skip the option to update the operating system software.

    Warning

    The following step builds a kernel module for the I2S interface. In some cases the Raspberry Pi OS upgrade process does not correctly install the required packages so XMOS currently recommends that users do not upgrade the OS for this evaluation.

  5. Once the Pi has booted, open a terminal window and download the vocalfusion-rpi-setup utility from https://github.com/xmos/vocalfusion-rpi-setup which should be saved in a convenient directory on the Raspberry Pi. The following commands will setup the Raspberry Pi for use with the XK-VOICE-SQ66 evaluation kit:

    git clone https://github.com/xmos/vocalfusion-rpi-setup
    cd vocalfusion-rpi-setup
    ./setup.sh xvf3800-intdev
    

    To enable a remote GUI access on the Raspberry Pi, the VNC service should be enabled at this point with the following command.

    sudo raspi-config
    

    Select 3 Interfaces Options and enable VNC on the next screen.

  6. Shutdown the Pi, detach the power and mount the XK-VOICE-SQ66 evaluation kit board onto the Raspberry Pi header. After mounting the board, reattach power and verify the Raspberry Pi restarts.

    The evaluation hardware is now ready to use, and should resemble Fig. 11.

../../_images/evaluation-kit.png

Fig. 11 XVF3800 evaluation kit#

Installing the Firmware#

  1. Connect an XTAG-4 debug adapter to the setup computer via USB, and connect it to the XK-VOICE-SQ66 evaluation kit using the supplied ribbon cable. The cable should be plugged into XSYS2 connector on the XK-VOICE-SQ66 evaluation kit.

    Open an XTC tools terminal window on the computer. Verify that the XTAG4 has been correctly connected by running the following command in that window

    xflash -l
    

    The output from this should be of the following form:

    Available XMOS Devices
    ----------------------
    
      ID    Name            Adapter ID  Devices
      --        ----            ----------  -------
      0     XMOS XTAG-4     ABCDE123    P[0]
    

    Note

    If the XTAG-4 is not properly connected to the development machine, then xflash will report No Available Devices Found. If the XK-VOICE-SQ66 evaluation kit is not properly connected to the XTAG-4, then the Devices column will read None. For further guidance on the use of the XTC tools, see the https://www.xmos.ai/view/Tools-15-Documentation.

  2. Select the required binary firmware image from the release package, and transfer it to the XK-VOICE-SQ66 evaluation kit using the xflash tool.

xflash application_xvf3800_intdev[...].xe

The XVF3800 firmware release package provided contains several precompiled binaries.

The provided binary images have names in the format:

application_xvf3800_intdev[configuration-options].xe

where the [configuration-options] is constructed as detailed in Table 21 below.

Table 21 Build configuration settings#

Option

Values

Description

Sample rate

-lr16 / -lr48

to choose between a 16 kHz or 48 kHz I2S LR clock (and therefore reference input and processed output audio sample rate)

Microphone topology

-sqr / -lin

to choose between a “squarecular” or linear microphone array

Control protocol

-i2c / -spi

to choose between I2C or SPI control modes

Note

Some binaries are provided which have the suffix -extmclk. These are intended for use in systems where an external MCLK is provided, and they disable the XVF3800’s clock recovery system. These builds are not for use with a Raspberry Pi.

Setting up the Audio#

Loudspeaker#

To play reference audio into the room, a high quality loudspeaker operating in its linear region is required. Connect the loudspeaker to the LINE OUT port on the XK-VOICE-SQ66 evaluation kit, which accepts a 3.5 mm TRS jack plug connector. It is important for the ideal demonstration that the position, orientation, and volume of the loudspeaker are representative of a real-world system.

To achieve optimal performance:

  • Align the front of the loudspeaker with the microphone strip at the top of the XK-VOICE-SQ66 evaluation kit and

  • Place the loudspeaker 2-4 cm away from the device

An example layout can be seen pictured in Fig. 12.

../../_images/example-layout.png

Fig. 12 XVF3800 demo example layout#

To calibrate the volume of the loudspeaker for optimal performance, a test file such as the IEEE 269-2010 Male Mono 48 kHz signal can be used.

These test signals can be downloaded from:

https://standards.ieee.org/wp-content/uploads/import/download/269-2010_downloads.zip

and transferred to the Raspberry Pi for playback.

The output volume must be changed directly on the loudspeaker or on a connected amplifier, not on the Raspberry Pi. The volume of the track measured at a 1 metre distance from the loudspeaker should be 73 dBA±2 dBA on average.

Playback and Recording#

Playback and recording through the XVF3800’s I2S interface, once the Raspberry Pi has been set up correctly, can be achieved through standard use of the ALSA card snd_rpi_simple_card, device 0. For example, from the command line, a 2 channel 32-bit 48 kHz WAV file may be played as reference audio through aplay with the following command:

aplay -c 2 -f S32_LE -r 48000 -D hw:sndrpisimplecar,0 <filename>

Similarly, the returned processed audio from the XVF3800 may be recorded to a file with

arecord --mmap -c 2 -d <time> -f S32_LE -r 48000 -D hw:sndrpisimplecar,0 <filename>

Alternatively, in a desktop environment on the Raspberry Pi, Audacity TM may be used to visually play and record. The sample rate must be set to match the XVF3800 in the Project Rate (Hz) selection in the bottom left. The sound card settings must match the ones highlighted in Fig. 13:

../../_images/audacity_screenshot.png

Fig. 13 Audacity TM example#

Troubleshooting#

Audio Signals#

If audio is being played by the host but not heard from the loudspeaker, it is likely that there exists a connection issue between the host and the XK-VOICE-SQ66 evaluation kit board. Ensure that the XK-VOICE-SQ66 evaluation kit board is powered, and the loudspeaker connected and powered.

If audio is heard from the loudspeaker but no input audio is received by the host, ensure that the Raspberry Pi is configured to transmit and receive audio at the correct sample rate (either 16 kHz or 48 kHz, depending on the chosen firmware).

If there is still no input from the device, it is possible that the device firmware has stalled; disconnect and reconnect power to the XK-VOICE-SQ66 evaluation kit to reset the device, and then attempt input again.

AEC Convergence#

The AEC requires a reference signal be present in order to converge on a room transfer function estimate - this process will take a few seconds after reference audio has begun being provided. If the AEC has not been allowed to converge, the XVF3800 will tend to over-suppress near-end speech in its output to avoid undesirable artefacts being relayed to the far-end. This effect does subside within the first few seconds of use, so if the device is unexpectedly restarted then performance will be reduced momentarily but should restore over time.

If the device has consistently poor acoustic performance, it is likely that the AEC has not converged appropriately; restart the device and repeat the AEC convergence procedure described in the later sections to reset the AEC to a new set of coefficients.

If this does not resolve the issues, it is permissible to lower the loudspeaker volume. If loudspeaker volume is adjusted, or if there is any other change in environment, ensure that the AEC has reconverged before proceeding by playing several seconds of far-end audio again. The AEC will constantly reconverge, so a small change in environment such as a window opening or a change in loudspeaker volume should be automatically adjusted for by the AEC; however, actions that alter the direct delay path significantly, such as moving the loudspeaker, will require the device be reset and the AEC be allowed a few seconds to reconverge from startup.