Acoustic Test Application*
Note
- SDK path: http://gitlab.nationalchip.com/nationalchip/voice-wifi-solution/ovp_aiot
- App path: app/acoustic_test_app/ under the SDK path
- Applicable chip: 8006
1. Overview*
The Acoustic Test App is used to test audio paths such as speaker playback, AEC (Acoustic Echo Cancellation), and recording pass-through. Different test modes can be selected via configuration files, suitable for acoustic verification scenarios on production lines or in laboratories.
2. Features*
- THD Test (
speak_test.config): Plays white noise and single-tone audio for THD (Total Harmonic Distortion) testing - AEC Test (
aec_test.config): Plays human voice to verify echo cancellation performance - Dual-channel Recording (
bypass_record.config): Mic + ref dual-channel recording without playback - Optional integration of the VIVA voice engine (
CONFIG_ENABLE_VIVA)
3. Directory Structure*
app/acoustic_test_app/
├── acoustic_test_app.c # Main program
├── app.mk # Build configuration
├── app.name # Kconfig option
├── Kconfig # Sub-configuration (empty)
└── viva/ # VIVA engine submodule
├── viva.c
├── viva.h
└── viva.mk
| File | Description |
|---|---|
acoustic_test_app.c |
Main program, defines and registers the OVP_APP structure |
app.mk |
Builds the main program and the viva submodule (controlled by CONFIG_ENABLE_VIVA) |
app.name |
Defines the CONFIG_APP_ACOUSTIC_TEST option |
viva/ |
VIVA voice engine wrapper, responsible for TTS playback control |
4. Configuration Description*
This App has no additional Kconfig sub-configuration or macro definitions. Select "Acoustic Test" in menuconfig.
It depends on the external configuration option CONFIG_ENABLE_VIVA. The viva submodule is compiled and TTS playback is supported only when this option is enabled.
5. Working Principle*
5.1 Initialization Flow*
- Print wake-up source information
- If
CONFIG_ENABLE_VIVAis enabled: Initialize the VIVA engine - Send the
EVENT_POWER_ON_TTS_PLAYevent to trigger the initial TTS playback
5.2 Event Handling*
app_event_response() only responds to the Audio-in recording completion event:
| Event | Trigger Condition | Handling Logic |
|---|---|---|
EVENT_AUDIO_IN_RECORD_DONE |
Audio-in recording complete (trigger time determined by PCM frame length, configured as needed) | Check if the player is idle; if idle, re-trigger TTS playback |
When the player is idle, EVENT_POWER_ON_TTS_PLAY is sent to achieve looped playback.
5.3 Main Loop*
app_task_loop() calls viva_tick() to drive the periodic tasks of the VIVA engine.
6. Usage*
6.1 Build*
Configuration files are located in configs/acoustic_test_config/. Select based on test requirements:
| Configuration File | Description |
|---|---|
speak_test.config |
THD test (plays white noise, single-tone audio) |
aec_test.config |
AEC test (plays human voice) |
bypass_record.config |
Mic + ref dual-channel recording without playback |
cp configs/acoustic_test_config/speak_test.config .config
make defconfig
make clean; make
6.2 Flashing and Running*
cd tools/bootx/
./flash_nor.sh 0 -r 1000000
7. Expected Output*
Output varies depending on the selected configuration file:
- THD Test: Speaker plays white noise or single-tone audio
- AEC Test: Speaker plays human voice, microphone captures ambient sound (including sound from the speaker) for echo cancellation verification
- Dual-channel Recording: Mic + ref dual-channel continuous recording without playback output
THD and AEC tests require acoustic test scripts to determine pass/fail. Refer to: Acoustic Test User Guide
8. Notes*
- Dependency on VIVA Engine: This App depends on
CONFIG_ENABLE_VIVA; it will not function correctly if not enabled - Looped Playback: Playback loops indefinitely and is not suitable for long-duration operation; intended for test scenarios only
- Suspend/Resume Not Implemented: The current SDK does not support suspend functionality;
app_suspend()andapp_resume()can remain as empty implementations