|
ailia_speech
1.6.1.0
|
| Component | Environment |
|---|---|
| Board / SoC | Advantech AOM-2721 / Qualcomm QCS6490 |
| Yocto | Based on 4.0.22 (Kirkstone) |
| OS | QCOM Robotics Reference Distro with ROS 1.3-ver.1.1 |
| OS ID | qcom-robotics-ros2-humble |
| Linux kernel | 6.6.52-yl01301-ga97804e47e26 |
| CPU architecture | aarch64 |
| glibc | 2.35 |
| Python | 3.10.15 |
| QNN runtime | QAIRT 2.47.0.260601 / Hexagon v68 |
The Linux ARM64 binaries require at most glibc 2.35 and GLIBCXX_3.4.29. They can use the system C++ runtime in the environment listed below.
Use the prebuilt Linux ARM64 sample in the distribution package. No compiler installation or sample build is required on the board. The BSP must provide CDSP firmware, FastRPC libcdsprpc.so, and access to the CDSP device.
Extract the ailia Speech SDK distribution package and download:
Choose either Turbo or Medium. The following example uses Turbo. Extract QAIRT and set SPEECH_PACKAGE and QNN_SDK_PATH to the extracted directories.
The package's cpp/prebuilt/linux/arm64-v8a/ directory includes the following files. No separate ailia SDK, ailia Audio or ailia Tokenizer native-library download is needed.
| File | Purpose |
|---|---|
| ailia_speech_sample | Prebuilt C++ sample |
| libailia_speech.so | Speech recognition library |
| libailia_speech_qnn.so | QNN plug-in |
| libailia.so | ailia SDK |
| libailia_audio.so | Audio preprocessing |
| libailia_tokenizer.so | Tokenizer |
Copy these files into the deployment directory.
Copy QAIRT's aarch64-oe-linux-gcc11.2 libraries and the Hexagon v68 skel. Do not use Android or Windows binaries. Use the board's BSP FastRPC library and CDSP firmware.
Adjust the SSH address and user. If an evaluation license is required, place a valid license at ~/.shalo/ailia.lic on the board (setup).
Run the following commands on the board. No LD_LIBRARY_PATH setting is needed: the sample loads the ailia libraries from its own directory, and the QNN plug-in loads the QNN libraries and v68 skel from the same directory. Pass the model path as the second argument. cpu selects the ailia environment for auxiliary processing. QNN speech recognition runs on HTP / NPU. VAD, diarization and postprocessing are disabled.
Use Python 3 and pip3. If the BSP does not include pip3, install it first:
To install from the SDK package, also extract the SDK on the board. Run bootstrap.py to copy the bundled libraries into the Python package, then install:
Alternatively, install the public package:
The Location shown by pip3 show is the site-packages directory. The plug-in is installed in ailia_speech/linux/arm64-v8a/ beneath it. Copy the QNN libraries and v68 skel beside libailia_speech_qnn.so:
Start Python after copying the libraries. The system C++ runtime must support GLIBCXX_3.4.29 or later; no additional LD_LIBRARY_PATH setting is needed.
open() opens the specified local files instead of initialize_model(), which downloads models automatically. Save the following code as /home/root/qnn-yocto/transcribe_qnn.py on the board. It reads audio as float32 with soundfile, loads the model and prints the recognition results. Install soundfile for this example:
Transpose the audio to the (channels, samples) shape accepted by ailia Speech. Call get_qnn_model_name() on the instance to obtain the device model name. Enable set_qnn_graph_switching(True) before open() to reduce HTP memory usage; inference may take longer. Pass one file for QNN. The Python Turbo constant is used by default.
Run after copying the QNN libraries in step 6. Language is detected automatically; add –language ja to select Japanese explicitly.
For ONNX, pass two files with open(encoder_path, decoder_path, model_type=...).
For VAD, pass a local ONNX file such as vad_path="silero_vad_v6_2.onnx". For diarization, supply both segmentation_path="segmentation.onnx" and embedding_path="speaker-embedding.onnx". These ONNX models can be used with QNN recognition. Each optional path defaults to None, which skips loading that model. The default vad_type is Silero and diarization_type is Pyannote. Supplying VAD applies the same silent thresholds as initialize_model(). Select FP16 and VAD version through the supplied files. Place external ONNX weights at the locations referenced by the ONNX file. None does not unload a previously loaded model.
Download and transfer the Medium model instead of Turbo in step 2.
Run on the board in /home/root/qnn-yocto. For Python, copy the libraries as in step 6:
| Error | Action |
|---|---|
| GLIBCXX_x.x.xx not found | GLIBCXX_3.4.29 or later (a Yocto 4.0 or later BSP) is required. Check the BSP version. |
| GLIBC_2.xx not found | Check binary requirements against the BSP's glibc. Use a compatible BSP; do not overwrite individual libc.so.6 or loader files. |
| QnnSystem interface version mismatch | Check that the QAIRT 2.47 Yocto libraries are selected. |
| Missing libcdsprpc.so / DSP initialization failure | Check BSP FastRPC, CDSP firmware, device permissions and the v68 skel. |