NOTICE: The Processors Wiki will End-of-Life on January 15, 2021. It is recommended to download any files or other content you may need that are hosted on processors.wiki.ti.com. The site is now set to read only.

WL18xx TI Bluetooth Stack VOLE Demo App

From Texas Instruments Wiki
Jump to: navigation, search

Return to WL18xx AM335x TI Bluetooth Stack

Demo Overview[edit]

The Voice over BLE (VOLE) demo application is designed for use with the CC2650RC remote control device in order to stream voice data using notifications over the Bluetopia GATM profile. This voice data is then saved as a wav file where it may be analyzed for specific voice commands. The VOLE profile, defined by the VOLETyp.h header file, is a custom application that demonstrates using the Bluetooth Low Energy protocol to send compressed audio data over GATT. It is not a Bluetooth Low Energy profile, and will only be useful if both the local and remote devices are using the custom protocol.


NoteNote: Only the Client side of the profile is supported on the Sitara platforms.


This application allows the user to use Bluetooth Low Energy (BLE) to establish connection between two BLE devices (The CC2650RC remote and the Wilink8/CC2564x) and send raw data between the server and client.


The companion application, which runs on the CC2650RC remote control is the hid_adv_remote_cc2650rc_app and can be found as a part of the extra examples for the TI BLE-Stack 2.2.x SDK release found with other BLE Examples. The hid_adv_remote_cc2650rc_app application is responsible for using its PDM driver to take audio samples at 16 kHz, compress the audio using 4:1 ADPCM compression and send the audio samples over GATT. For details on this process, visit the CC2650RC Developers guide.


Hardware Requirements[edit]

  • CC2650RC Remote
  • AM335x or AM437x Sitara Platform
  • CC256x or Wilink8
  • Headphones or speakers to hear audio over the Evm’s 3.5mm jack


Software Requirements[edit]

As this application is designed to show a full use case, there are extra software requirements for the ADPCM decoding and voice recognition.

  • Python > 2.7 (Comes pre-installed with the Processor SDK)
    • Python modules: Installed via the command line using the Python ‘pip’ installer
  • Wave File Generation:
    • pip install wave
  • (Optional)Open source local speech recognition:
    • pip install pocketsphinx
    • pip install SpeechRecognition /* Python Port for pocket sphinx */

NoteNote: In order to install the python modules, the pip executable must be present on the device, this can be downloaded by downloading and running the ‘get-pip.py’ python script with the EVM connected to the internet. The script can be downloaded from the following Python page.



Software Overview[edit]

LinuxVOLE builds upon the existing LinuxHOGM application in order to allow for the acceptance of HID (Human Interface Device) key press indication reports. More information on the HID Over GATT profile can be found on the following demo page HOGM Demo

borderless


Software components[edit]

LinuxVOLE C Application[edit]

A C application that includes code to connect to the CC2650RC remote, receive the voice data in the form of notifications and receive incoming HID reports. The LinuxVOLE application is designed to run without the use of a terminal and as such will perform the necessary setup, such as powering on the device and scanning for the remote, automatically. See the below flowchart for details on how the LinuxVOLE thread runs.

borderless

The VOLE_initialize() function powers on the device and handles registering the necessary callbacks for authentication, HID and GATT events.


Audio_frame_linux Python Application[edit]

A python script which is responsible for decoding the incoming ADPCM data, saving the input to a wav file and running the file through speech recognition to generate arbitrary commands. This script also spawns sub processes to run the Bluetooth Daemon and LinuxVOLE application. As such, all IO is piped through the python script.

borderless

NoteNote: : These instructions can be used to run this demo on the AM335x or AM437x Sitara Platforms.

Running the Bluetooth Code[edit]

NoteNote: When using a CC256x controller you will need to change the init script in order to enable BLE. You can use the following command in the AM335x device terminal

cp -f /lib/firmware/TIInit_6.12.26_ble_on.bts /lib/firmware/TIInit_6.12.26.bts



Enter to the Sample Application folder, for this example cd BluetopiaPM/bin

 root@am335x-evm:~# cd BluetopiaPM/bin/
 root@am335x-evm:~/BluetopiaPM/bin#

Start the python script by running the following command:

 root@am335x-evm:~# python audio_frame_linux.py

The following will be printed to the console.

root@am335x-evm:~/BluetopiaPM/bin_4_2_cc256x# python audio_frame_linux.py

Starting Voice Over LE Demo!
Please press the power button to start pairing.
echo 16 > /sys/class/gpio/export
sh: line 0: echo: write error: Device or resource busy
echo out > /sys/class/gpio/gpio16/value
echo 0 > /sys/class/gpio/gpio16/value
echo 1 > /sys/class/gpio/gpio16/value
echo 0 > /sys/class/gpio/gpio16/value
echo 1 > /sys/class/gpio/gpio16/value
BT COMM PORT (/dev/ttyS3): 1
Changing HCI baud rate to 3000000
Status: Executing BTS Script /lib/firmware/TIInit_6.12.26.bts
Status: BTS Script successfully executed.


If no error messages are printed to the console, the CC2650RC remote is ready to be paired. Click the power Button on the remote device to start the pairing procedure. A passkey will appear on the terminal, press the corresponding keys on the remote control in order to pair with the device.


Please enter the following authentication passkey on the Remote: 738653
Ready to receive audio data!

NoteNote: Pressing the ‘pair’ button twice sequentially will remove all previous bonding data.

When the “Ready to receive audio data” message appears, this means that the remote’s services have been discovered and connection parameters have been updated and is ready to transmit audio data.

Press and hold the Mic button on the remote to start streaming a voice command, releasing when complete. For example say Pause Music and a wav file will automatically be generated.


Saving new Audio file...
...DONE...


If the correct speech recognition python modules have been installed, then the Sphinx speech recognition software will parse the wav file and print the command to the console as seen below. If not, the command that was spoken will simply be played back to the user through the audio port on the Sitara EVM.


Processing Wav file...
Sphinx thinks you said:
PAUSE MUSIC


The supported speech recognition commands are as follows and can be changed by updating the analyzePhrase() function within the python script:

<Pause, Play, Stop, Load> Music
Set volume to <0..10>






Limitations:

Memory/CPU usage:

Integration Notes:

HCILL tradeoff related to page-scan interval

References:

Licensing Information[edit]

Pocketsphynx - BSD License

Speech recognition library - BSD License

E2e.jpg {{
  1. switchcategory:MultiCore=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article WL18xx TI Bluetooth Stack VOLE Demo App here.

Keystone=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article WL18xx TI Bluetooth Stack VOLE Demo App here.

C2000=For technical support on the C2000 please post your questions on The C2000 Forum. Please post only comments about the article WL18xx TI Bluetooth Stack VOLE Demo App here. DaVinci=For technical support on DaVincoplease post your questions on The DaVinci Forum. Please post only comments about the article WL18xx TI Bluetooth Stack VOLE Demo App here. MSP430=For technical support on MSP430 please post your questions on The MSP430 Forum. Please post only comments about the article WL18xx TI Bluetooth Stack VOLE Demo App here. OMAP35x=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article WL18xx TI Bluetooth Stack VOLE Demo App here. OMAPL1=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article WL18xx TI Bluetooth Stack VOLE Demo App here. MAVRK=For technical support on MAVRK please post your questions on The MAVRK Toolbox Forum. Please post only comments about the article WL18xx TI Bluetooth Stack VOLE Demo App here. For technical support please post your questions at http://e2e.ti.com. Please post only comments about the article WL18xx TI Bluetooth Stack VOLE Demo App here.

}}

Hyperlink blue.png Links

Amplifiers & Linear
Audio
Broadband RF/IF & Digital Radio
Clocks & Timers
Data Converters

DLP & MEMS
High-Reliability
Interface
Logic
Power Management

Processors

Switches & Multiplexers
Temperature Sensors & Control ICs
Wireless Connectivity