Setting Up the Hardware#

Introduction#

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

Version v2.0.0 of the XVF3800 firmware supports audio I/O via I2S or USB UAC2. The instructions below describe how to set up an evaluation system in either configuration.

Note

The XK-VOICE-SQ66 development kit is intended for use as an evaluation board for the XVF3800 and after power on or reset the device will stop processing audio 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.

Hardware Setup - USB (UA) Configuration)#

The UA configuration is the simplest configuration as the XK-VOICE-SQ66 development kit can be connected directly to a computer using a USB port.

UA - Required Components#

  • An XK-VOICE-SQ66 development kit board.

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

  • A setup or development machine (Windows, Mac OS or Linux are supported). This machine must have at least two USB connections.

  • A micro USB cable to connect the setup machine to the XTAG4 and a second micro USB cable to connect the XK-VOICE-SQ66 development kit to the development machine.

Setting up the Evaluation System in UA Configuration#

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

  1. On the development computer, 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. Connect the USB port on the XK-VOICE-SQ66 development kit to the development computer using a USB cable. (This provides power to the device.)

  3. Connect an XTAG-4 debug adapter to the setup computer via USB, and connect it to the XK-VOICE-SQ66 development kit using the supplied ribbon cable. The cable should be plugged into XSYS2 connector on the XK-VOICE-SQ66 development kit. Fig. 11 below shows the UA configuration of the XK-VOICE-SQ66 development kit

    ../../_images/02_evk_usb_setup.jpg

    Fig. 11 XK-VOICE-SQ66 development kit in UA configuration#

  4. Open an XTC tools terminal window on the development 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 development 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.

Installing the UA firmware#

The XVF3800 firmware release package provided contains several precompiled binaries.

The provided binary images have names in the format:

application_xvf3800_ua[configuration-options].xe

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

Table 23 Build configuration settings#

Option

Values

Description

I2S 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). This setting is only used in INT configurations

USB sample rate

-io16 / -io48

to choose between a 16 kHz or 48 kHz rate for the USB rate. Input and output rates must be the same. This setting is only used in UA configurations

Microphone topology

-sqr / -lin

to choose between a “squarecular” or linear microphone array

Control protocol

-i2c / -spi

to choose between I2C and SPI control modes. This setting is only used in INT configurations, the UA configurations always use USB control mode

Audio MCLK

-extmclk

to choose between external or internal MCLK. This setting is only used in INT configurations

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

xflash application_xvf3800_ua[...].xe

The XTAG4 adapter can be disconnected from the XK-VOICE-SQ66 development kit after successfully installing the firmware image if desired.

After completing the initial setup, follow the instructions in the section Setting up the Audio below.

Hardware Setup - I2S (INTDEV) Configuration#

The following instructions explain how to set up a Raspberry Pi computer with the XK-VOICE-SQ66 development kit in order to evaluate the operation of the XVF3800 using an I2S audio interface in the intdev configuration.

INTDEV Required Components#

  • An XK-VOICE-SQ66 development kit board.

  • An XMOS XTAG4 with associated ribbon cables (Provided in the XK-VOICE-SQ66 development 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 development 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. 12 to mount the XK-VOICE-SQ66 development 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. 12 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).

Setting up the INTDEV configuration#

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.

  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 development 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 and SSH (if not already set using the imager) on the next screen.

  6. Shutdown the Pi, detach the power and mount the XK-VOICE-SQ66 development 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. 13.

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

Fig. 13 XVF3800 evaluation kit#

Installing the INTDEV Firmware#

The XVF3800 firmware release package provided contains several precompiled binaries.

The provided binary images have names in the format:

application_xvf3800_[device-configurations][configuration-options].xe

where the [device-configurations] can be intdev or ua where the [configuration-options] is constructed as detailed in Table 24 below.

Table 24 Build configuration settings#

Option

Values

Description

I2S 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). This setting is only used in INT configurations

USB sample rate

-io16 / -io48

to choose between a 16 kHz or 48 kHz rate for the USB rate. Input and output rates must be the same. This setting is only used in UA configurations

Microphone topology

-sqr / -lin

to choose between a “squarecular” or linear microphone array

Control protocol

-i2c / -spi

to choose between I2C and SPI control modes. This setting is only used in INT configurations, the UA configurations always use USB control mode

Audio MCLK

-extmclk

to choose between external or internal MCLK. This setting is only used in INT configurations

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.

The firmware is installed using the XMOS XTAG4 adapter supplied with the XK-VOICE-SQ66 development kit.

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

  2. 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 development 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.

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

    xflash application_xvf3800_intdev[...].xe
    

The XTAG4 adapter can be disconnected from the XK-VOICE-SQ66 development kit after successfully installing the firmware image if desired.

After completing the setup, follow the instructions below to set up the audio path.

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 development 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 development kit and

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

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

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

Fig. 14 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 stored on the computer used for playback (USB host or I2S host). If the Raspberry Pi is connected to the internet the files can be copied with the following:

curl --output <FILE>.zip https://standards.ieee.org/wp-content/uploads/import/download/269-2010_downloads.zip
unzip <FILE>.zip

The output volume must be changed directly on the loudspeaker or on a connected amplifier, not on the computer. 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#

I2S Audio Configuration#

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. 15:

../../_images/audacity_screenshot.png

Fig. 15 Audacity TM example#

UA Audio Configuration#

In the UA configuration, Audacity TM may be used to visually play and record signals from the device. The sample rate must be set to match the XVF3800 in the Project Rate (Hz) selection in the bottom left.

The device should appear as a USB sound card with the default name of XMOS |project| Voice Processor. On Audacity both playback and recording devices should be set to be the XVF3800.

With the standard evaluation firmware the USB parameters are:

Product_STR: XMOS XVF3800 Voice Processor
Manufacturer_STR:  XMOS
Vendor_ID (VID):  0x20b1
Product_ID (PID): 0x4f00
Serial Number: 00000000

These can be modified, along with other USB parameters - see the subsection about Changing Default Parameter Values, for details.

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 development kit board. Ensure that the XK-VOICE-SQ66 development 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 host 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 development 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.