NXP Semiconductors AN14276 Application Note

NXP Semiconductors AN14276 Application Note

Voice seeker and voicespot for i.mx

Advertisement

Quick Links

AN14276
Voice Seeker and VoiceSpot for i.MX
Rev. 1.0 — 24 June 2024
Document information
Information
Keywords
Abstract
Content
AN14276, Voice Processing, VoiceSeeker, VoiceSpot
NXP created the Voice Processing environment, which is continuously improved. This
environment enables customers to use it for their application with low latency, low false-positives,
low energy consumption, and with minimum effort.
Application note

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the AN14276 and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Summary of Contents for NXP Semiconductors AN14276

  • Page 1 Document information Information Content Keywords AN14276, Voice Processing, VoiceSeeker, VoiceSpot Abstract NXP created the Voice Processing environment, which is continuously improved. This environment enables customers to use it for their application with low latency, low false-positives, low energy consumption, and with minimum effort.
  • Page 2: Introduction

    AN14276 NXP Semiconductors Voice Seeker and VoiceSpot for i.MX 1 Introduction NXP created the Voice Processing environment, which is continuously improved. This environment enables customers to use it for their application with low latency, low false-positives, low energy consumption, and with minimum effort.
  • Page 3: Materials

    AN14276 NXP Semiconductors Voice Seeker and VoiceSpot for i.MX with the help of VoiceSpot and if VoiceSpot finds the wake word command, it has the ability to trigger a third- party application so the third party starts listening to the capture stream. VoiceSpot also sends the buffer to VIT so it can look for the voice commands.
  • Page 4: Architecture

    AN14276 NXP Semiconductors Voice Seeker and VoiceSpot for i.MX useful when developing voice applications. If you are interested in testing the full version, send an email to voice@nxp.com to receive further information about this. 5.1.1 Architecture VoiceSeeker and VoiceSpot were designed to work independently from each other. However, it is recommended to use them together to achieve the best behavior of each library.
  • Page 5: External References Signal

    AN14276 NXP Semiconductors Voice Seeker and VoiceSpot for i.MX Another independent application, which must use the default ALSA device, is responsible for starting the playback stream so that AFE can manage the incoming and outgoing data. It is assumed that the asound.conf file has a configuration compatible with AFE.
  • Page 6: Asound.conf

    AN14276 NXP Semiconductors Voice Seeker and VoiceSpot for i.MX AFE only controls the streams. It does not even fix the delay between the streams (acoustic delay). Keep this in mind, because you might require a mechanism to solve such a delay (the solution and explanation of the acoustic delay are described further on in this document).
  • Page 7: Voiceseeker

    AN14276 NXP Semiconductors Voice Seeker and VoiceSpot for i.MX Table 1. Device properties Device name Owner Access Type Pipeline pwloop Application Write Loopback Playback prloop Read Loopback Playback Write Hardware Playback Read Hardware Capture cwloop Write Loopback Capture crloop Application Read...
  • Page 8 AN14276 NXP Semiconductors Voice Seeker and VoiceSpot for i.MX • Four channels for microphone input. • Two channels for speaker output. • 16000-kHz sample rate on all devices. • S32_LE format on all devices. When all the devices are opened and configured, AFE initializes the respective ALSA devices and starts streaming.
  • Page 9: Config.ini

    AN14276 NXP Semiconductors Voice Seeker and VoiceSpot for i.MX mic_xyz_mm is a matrix with the size of the number of channels times three dimensions (width, depth, and height). The distance between an origin and the microphones is measured in millimeters. The origin can be anywhere, not necessarily in one of the microphones.
  • Page 10: Voicespot

    AN14276 NXP Semiconductors Voice Seeker and VoiceSpot for i.MX 5.1.4 VoiceSpot As well as VoiceSeeker, VoiceSpot is a library that is wrapped in a class (called SignalProcessor_VoiceSpot) for easy use of the voice engine. VoiceSpot is an independent program that can communicate to VoiceSeeker to retrieve the feedback of where and when a voice signal is detected.
  • Page 11: Setup View

    AN14276 NXP Semiconductors Voice Seeker and VoiceSpot for i.MX Table 4. Items to evaluate VoiceSeeker and VoiceSpot Quantity Name Description i.MX 8M Plus EVK board NXP evaluation board for the i.MX 8M Plus. Power supply USB-Type C 45-W power delivery supply, 5 V/3 A; 9 V/3 A; 15 V/3 A;...
  • Page 12: Software Installation

    AN14276 NXP Semiconductors Voice Seeker and VoiceSpot for i.MX Figure 4. Common setup 1. For the 8MIC-RPI-IMX8 board: a. Mount the board onto the EXP_CN of the EVK. Make sure that its pin numbering matches that on the EVK. b. Unmute the board by pulling down its mute switch. The switch indicates the muting when the board is powered on if this is not set.
  • Page 13: Software Checklist

    AN14276 NXP Semiconductors Voice Seeker and VoiceSpot for i.MX 6.3.1 Software checklist The recommended BSP version is MM_04.09.00_2405_lf6.6.23 or higher. The latest image can be installed from https://www.nxp.com/design/design-center/software/embedded-software/i-mx-software/embedded-linux- for-i-mx-applications-processors:IMXLINUX. When the image is fully downloaded, you can install it by following the steps in the i.MX Linux User's Guide (document IMXLUG).
  • Page 14: Installing Missing Drivers

    AN14276 NXP Semiconductors Voice Seeker and VoiceSpot for i.MX 7.2 Installing missing drivers By default, the image does not load the drivers that allow ALSA to do a loopback stream. Therefore, it is required to manually install it using the following command: $ modprobe snd-aloop 7.3 Editing the ALSA asound configuration for VoiceSeeker...
  • Page 15 AN14276 NXP Semiconductors Voice Seeker and VoiceSpot for i.MX Set the following values for the DebugEnable and RefSignalDelay properties. The DebugEnable variable can be turned off when the calibration is done, but it is kept until the end for the sake of this document.
  • Page 16 AN14276 NXP Semiconductors Voice Seeker and VoiceSpot for i.MX By default, the library records a pair of minutes (0-1, 2-3, 4-5, and so on). To change the default behavior, change the MINUTE_INTERVAL_WAV_FILE configuration macro (located in <root_dir>/voiceseeker/ src/SignalProcessor_VoiceSeekerLight.h). For example, to record all the minutes on independent files, set up the macro with a value of 1.
  • Page 17: Beamforming

    AN14276 NXP Semiconductors Voice Seeker and VoiceSpot for i.MX Figure 7. Microphone channel The delay can be measured either in time or in sample units. VoiceSeeker works with the delay in samples. The audio editors usually allow time-frame measurements in sample units. To do so in Audacity, go to the bottom-left corner and change the option bar to “Start and Length of Selection”.
  • Page 18: External References

    AN14276 NXP Semiconductors Voice Seeker and VoiceSpot for i.MX The clearest way of seeing this feature is by playing a pure tone, trigger the wake word, and say a voice command from VIT. Be sure to work with latest WAV files by removing the temporary files first.
  • Page 19: Asound.conf

    AN14276 NXP Semiconductors Voice Seeker and VoiceSpot for i.MX Application Voice Engine Speech Detection / App external prloop cwloop default external Loopback ALSA pwloop micfilaudio cwloop crloop Drivers Figure 10. Virtual device 8.3.1 asound.conf To test the feature, add the following devices to the /etc/asound.conf file. The idea is to duplicate the playback stream at the ALSA level, which is in charge of writing to the speakers and feeding AFE with the streamed data.
  • Page 20: Running The Pipeline

    AN14276 NXP Semiconductors Voice Seeker and VoiceSpot for i.MX The difference between using these devices and using the default one is that ALSA manages the playback thread. When running the following command, it causes the speakers to start playing even before AFE gets executed.
  • Page 21: Installing The Library

    AN14276 NXP Semiconductors Voice Seeker and VoiceSpot for i.MX 8.4.2 Installing the library Clone the repository from GitHub: $ git clone https://github.com/nxp-imx/imx-voiceui.git Move to the latest branch: $ cd imx-voiceui $ git switch MM_04.09.00_2405_L6.6.y Replace the voiceseeker/platforms/iMX8M_CortexA53 folder with the new folder, which contains the full version of VoiceSeeker: $ cp -r ../iMX8M_CortexA53/* ./voiceseeker/platforms/iMX8M_CortexA53...
  • Page 22: Appendix

    AN14276 NXP Semiconductors Voice Seeker and VoiceSpot for i.MX 9 Appendix 9.1 Using NXP SWPDM with AFE This section explains how to integrate the NXP SWPDM ALSA Plugin to the voice pipeline. 9.1.1 NXP SWPDM NXP SWPDM is a solution for the i.MX 8MM and i.MX 8MN processors, which do not have a 32-bit width resolution required for voice-processing tasks.
  • Page 23 AN14276 NXP Semiconductors Voice Seeker and VoiceSpot for i.MX Figure 11. Microphones The relative microphone positions are also needed to enhance the AEC. These positions are shown in Figure 12. In this case, the distances are measured from the center of the microphones in millimeters.
  • Page 24: Microphone Position Configuration

    AN14276 NXP Semiconductors Voice Seeker and VoiceSpot for i.MX ttable.1.1 1 ttable.2.2 1 ttable.3.3 1 ttable.4.4 1 ttable.5.5 1 ttable.6.6 1 ttable.7.7 1 } The ttable property can reroute a physical microphone to any audio stream channel as follows: The legend for the above snippet is ttable.A.B 1, where: •...
  • Page 25: Microphone Arrangement Example

    AN14276 NXP Semiconductors Voice Seeker and VoiceSpot for i.MX 9.2.3 Microphone arrangement example This example shows the configuration to use a custom set of microphones (the ones circled in purple). The intention of this example is to route microphones 6, 5, 3, and 1 to channels, 0, 1, 2, and 3, respectively.
  • Page 26: Document

    AN14276 NXP Semiconductors Voice Seeker and VoiceSpot for i.MX Figure 14. Four chosen microphones and their relative coordinates 10 Note about the source code in the document The example code shown in this document has the following copyright and BSD-3-Clause license:...
  • Page 27 Voice Seeker and VoiceSpot for i.MX Table 8. Revision history Document ID Release date Description AN14276 v.1.0 24 June 2024 Initial public release AN14276 All information provided in this document is subject to legal disclaimers. © 2024 NXP B.V. All rights reserved.
  • Page 28: Legal Information

    NXP Semiconductors. In the event that customer uses the product for design-in and use in In no event shall NXP Semiconductors be liable for any indirect, incidental, automotive applications to automotive specifications and standards, punitive, special or consequential damages (including - without limitation - customer (a) shall use the product without NXP Semiconductors’...
  • Page 29: Table Of Contents

    Please be aware that important notices concerning this document and the product(s) described herein, have been included in section 'Legal information'. © 2024 NXP B.V. All rights reserved. For more information, please visit: https://www.nxp.com Document feedback Date of release: 24 June 2024 Document identifier: AN14276...

Table of Contents