Audio Application for Qualcomm® Robotics RB3 Platform

Skill LevelArea of FocusOperating SystemPlatform/Hardware
BeginnerBluetooth, Robotics, Embedded, SensorsLinuxQualcomm Robotics RB3
This project is intended to help you get familiar with the Qualcomm Robotics RB3 development kit, which is based on the Qualcomm® SDA845 processor. We would also verify the initial setup and working of the audio functionality and build a simple audio application.
The objective of this application is to verify the functionality of audio on the Qualcomm Robotics RB3 development kit. You will download an application from Sample-app-codes section on the Thundercomm website and push the application onto the Qualcomm Robotics RB3 device using ADB. The commands to enable and listen to the audio from the board are shown in the application.
  • Qualcomm Robotics RB3 Development Kit
  • Power Adapter - 12 V with 2500 mA required by the 96Boards specification
  • USB to Micro USB cable - For serial console interface and ADB, Fast boot commands
  • USB to USB Type C cable - For connecting the USB3.0 Type C port and flashing images
  • Host PC OS for RB3 SDK build process

aplay_test.tar

(found on the Thundercomm Qualcomm Robotics RB3 Development Kit web page, under the Technical Documents tab in the “Sample-apps-codes” section)

Prerequisites:

Complete the build instructions in the Hello RB3 project, and make sure that the following steps are done before proceeding with running the application on device.

1. Setup the development environment

  • 1.1) Install Android SDK tools (ADB, Fastboot)
  • 1.2) Install and configure the USB driver on host machine
  • 1.3) Flash the firmware image on the board
  • 1.4) Setup serial port for debugging purpose
  • 1.5) Install the App Toolchain SDK

2. Audio Application

  • 2.1 From the Thundercomm Qualcomm Robotics RB3 Development Kit web page, under the Technical Documents tab in the “Sample-apps-codes” section, download source code for the Audio application : "aplay_test.tar"

    Audio app sample-code location
  • 2.2 After decompressing the .tar file, the directory is as follows:

    $ cd “Path to downloaded source code”
    $ tree alsa-utils-build -L 1
    Directory structure of audio app

    Look for alsa-utils-build.sh file in the downloaded folder

3. Build and transfer the application

  • 3.1 Verify the configuration by executing the configuration script and run the same to compile and build the application using makefile.

    $ cat alsa-utils-build.sh Command to view contents of script file
  • 3.2 Build the application:

    Load the environment setup for arm7 using ‘source’ command

    $ source /usr/local/oecore-x86_64/environment-setup-aarch64-oe-linux
    $ ./alsa-utils-build.sh
  • 3.3 Connect the board to the host PC via Type C cable and transfer the application using adb:

    $adb push alsa-utils-build/build/aplay/aplay /usr/bin Navigate to aplay directory Push aplay binary to RB3

4. Verifying Audio Decoding

To verify the audio decoding functionality, download the Audio test files from the Thundercomm Qualcomm Robotics RB3 Development Kit web page, under the Technical Documents tab in the “testResource” section:

Audio app testResource location

Extract the contents to find.wav and .mp3 files

Contents of Audio app testResource folder

5. Use the following commands to playback the WAV file using amixer + aplay

  • 5.1 Push audio:

    $ adb push Audio_Decode_WAV_Stereo_48KHz_16Bit.wav /data/ Push Audio app binary to RB3
  • 5.2 Enable speaker:

    $ adb shell
    /# spk-ctl enable
    Enable Speaker
  • 5.3 Play:

    To see the list of audio devices, type the following command:

    /# aplay -L Command to list audio devices

    Select the required device from the list to play the audio using following command and it will play the audio the device:

    aplay -D front:CARD=C320M,DEV=0 /data/Audio_Decode_WAV_Stereo_48KHz_16Bit.wav
    Command to play the audio

To disable speaker

Enter the command:

# spk-ctl disablesoutput of spk-ctl disables command
NameTitle/Company
Rakesh SankarSr, System Architect
Global Edge Software Ltd
Akshay KulkarniTechnical Lead
Global Edge Software Ltd
Vihari SreeramSenior Software Engineer
Global Edge Software Ltd
Vengamamba PatchaSoftware Engineer
Global Edge Software Ltd