http://www.ti.com/lit/an/swra506/swra506.pdf

Application Report
SWRA506 – May 2016
Voice Over Remote Control
Torbjorn Sorby
ABSTRACT
This application report describes the voice over RF protocol used for Texas Instruments Bluetooth® low
energy (BLE) and RF4CE remote control solutions.
1
Contents
Introduction ................................................................................................................... 2
List of Figures
1
2
3
4
5
6
.......................................................................................................................
CC2541 .......................................................................................................................
CC2650 .......................................................................................................................
RF4CE ........................................................................................................................
BLE ............................................................................................................................
Sequence Diagram ..........................................................................................................
CC2533
3
3
3
4
4
7
List of Tables
..............................................................................................
1
Abbreviations and Acronyms
2
Start Frame ................................................................................................................... 4
2
3
IMA-ADPCM Data Frame ................................................................................................... 5
4
Stop Frame ................................................................................................................... 5
5
Raw PCM Data Frame ...................................................................................................... 5
6
Start Frame ................................................................................................................... 5
7
BLE ADPCM Data Frame Part #1/5 Frame .............................................................................. 5
8
BLE ADPCM Data Frame Part #2/5 Frame .............................................................................. 5
9
BLE ADPCM Data Frame Part #3/5 Frame .............................................................................. 6
10
BLE ADPCM Data Frame Part #4/5 Frame .............................................................................. 6
11
BLE ADPCM Data Frame Part #5/5 Frame .............................................................................. 6
12
Stop Frame ................................................................................................................... 6
Bluetooth is a registered trademark of Bluetooth SIG, Inc .
All other trademarks are the property of their respective owners.
SWRA506 – May 2016
Submit Documentation Feedback
Voice Over Remote Control
Copyright © 2016, Texas Instruments Incorporated
1
Introduction
1
www.ti.com
Introduction
Sending voice data over a low-power wireless protocol enables multiple use cases, such as, voice
recognition or baby monitoring. This application report presents the fundamental concepts of the voice
implementation used in Texas Instruments BLE and RF4CE remote control solutions.
1.1
Main Features
•
•
•
•
•
1.1.1
16 kHz sampling rate, 16 bits resolution
4:1 compression perform on-chip
Required throughput -- 64 kbps
RF4CE application throughput up to 90 kbps
BLE application throughput is higher than RF4CE and dependent on the system
Abbreviations and Acronyms
Table 1. Abbreviations and Acronyms
BLE
Bluetooth Low Energy
FA
Frequency Agility
I2C
Inter-IC
I2S
Inter-IC Sound
IC
Integrated Circuit
IMA-ADPCM
kbps
LL
Kilo bits per second
Link Layer
MAC
Medium Access Control
NWK
Network Layer
PDM
Pulse Density Modulation
RC
Remote Control
RF
Radio Frequency
RF4CE
SPI
2
Interactive Multimedia Association-Adaptive Differential Pulse Code Modulation
Radio Frequency for Consumer Electronics
Serial Peripheral Interface
Voice Over Remote Control
SWRA506 – May 2016
Submit Documentation Feedback
Copyright © 2016, Texas Instruments Incorporated
Introduction
www.ti.com
1.2
1.2.1
Solutions
Block Diagram
There are multiple devices available from Texas Instruments and Figure 1 through Figure 3 show the
components used in the various voice enabled Remote Controllers.
In case of the CC25xx generation, an external codec is connected to an analog microphone. It is
configured via inter-integrated circuit (I2C) and audio is retrieved via inter-IC sound (I2S). The master
clock is provided by CC25xx, which also acts as an I2S slave. The I2S slave is implemented using the
serial peripheral interface (SPI) module in slave operation, with a word clock connected to the chip select
pin.
In the CC26xx devices, no external codec is required as the bit stream from a digital microphone can be
read directly by the device, and the PDM stream can be processed in software.
IN
3xAAA
3xAAA
LDO
LDO
VDD
MOSI
DOUT
BCLK
SCLK
WCLK
CSN
IN
VDD
MOSI
DOUT
BCLK
SCLK
WCLK
CSN
Audio Codec:
TLV320ADC3101
Audio Codec:
TLV320ADC3101
CC2541
CC2533
GPIO/Timer
MCLK
GPIO/Timer
Reset
GPIO (reset)
Reset
GPIO (reset)
I2C-S
I2C-M
I2C-S
I2C-M
MCLK
GPIOs
GPIOs
User Interface:
(buttons/buzzer)
User Interface:
(buttons/buzzer)
32 kHz Xtal
32 MHz Xtal
32 MHz Xtal
I2C-S
I2C-S
MEMS (gyro, accel)
MEMS (gyro, accel)
Figure 1. CC2533
Figure 2. CC2541
2xAAA
VDD
ADI
BCLK
CC2650
I2C-S
MEMS (gyro, accel)
I2C-M
User Interface:
(buttons/buzzer)
GPIOs
32 kHz Xtal
24 MHz Xtal
Figure 3. CC2650
SWRA506 – May 2016
Submit Documentation Feedback
Voice Over Remote Control
Copyright © 2016, Texas Instruments Incorporated
3
Introduction
1.2.2
www.ti.com
Audio Flow Diagram
Figure 4 and Figure 5 show various audio flows from the microphone via RF to speaker.
Controller Node
Target Node
PDM
PDM
PCM
ADPCM
Encoding
RF4CE nwk +
MAC Tx
ADPCM
Decoding
RF4CE nwk +
MAC Rx
USB Audio
USB HID
Application
CC26xx
RF4CE
ADC
I2S Tx
I2S/SPI
SPI Rx
Audio Codec:
TLV320IDC3101
ADPCM
Encoding
Any device which
supports USB Audio,
e.g. PC or MAC
File
CC2531 ZRC Audio Dongle
Target Node
Controller Node
Digital
IN
Filtering
USB
RF4CE to HID
RF4CE nwk +
MAC Rx
RF4CE nwk +
MAC Tx
CC2533
RNP
UART/SPI/I2C
NPI
ADPCM
Decoding
File
Application running on Host, using
remoTI network interface
CC2533
Figure 4. RF4CE
Audio Central / HID Host
Audio Peripheral / HID Client
PDM
PCM
Vendor
HID
Voice over
HID over GATT
Voice over
HID over GATT
ADPCM
Encoding
USB
.
Alt
Voice over
HID over GATT
BLE
Audio Peripheral / HID Client
Digital
IN
Filtering
I2S Tx
SPI Rx
I2S/SPI
ADPCM
Encoding
Alt.
Voice over
GATT
Voice over
HID over GATT
Alt.
Audio Codec:
TLV320IDC3101
ADPCM
Decoding
HID
Keyboard/Mouse/
Consumer Control
File
Audio Central / HID Host
CC26xx
ADC
USB
CC2540
Voice over
GATT
ADPCM
Decoding
Any device which supports
USB Audio, e.g. PC or MAC
Also include HID Keyboard/
Mouse/Consumer Control
USB
File
CC2540
Voice over
GATT
Audio Central / HID Host / Mobile Device (iOS or Android)
CC2541
Voice over
HID over GATT
Andro
id
only
ADPCM
Decoding
USB
PDM
File
Voice over
GATT
HTML
SensorTag Application
Figure 5. BLE
1.2.3
Audio Protocol
In order to transmit audio data over BLE or RF4CE, it is necessary to have a protocol in place. A protocol
defines rules on how to interpret data. To save power, do not transmit audio continuously. As such, an
audio stream has a finite beginning and end. In addition to indicating the audio data, the beginning of
transmission can be identified as well as the end. This has the added benefit of allowing the recipient to
prepare for an audio stream.
1.2.3.1
RF4CE
To improve rate, re-transmission on different channels can be removed, which is necessary to re-acquire
channels in case they are changed mid-stream. Locking the RF channel removes this need.
For RF4CE, there is a very easy way to transmit your own vendor specific data, which is simply called
vendor specific data transmission. Since there is no official protocol to transmit audio data, vendor specific
data is used. Texas Instruments already defines several vendor specific data protocols, such as an Overthe-Air-Download protocol and a latency test protocol.
Table 2. Start Frame
Number of Bytes
Field
4
1
1
1
1
1
Protocol ID
CMD ID
Sample Frequency
Sample Width
Mode
0x50
0x00
8: 8kHz
16: 16kHz
8, 12 or 16 bits
0: RAW
1: IMA-ADPCM
Voice Over Remote Control
SWRA506 – May 2016
Submit Documentation Feedback
Copyright © 2016, Texas Instruments Incorporated
Introduction
www.ti.com
Table 3. IMA-ADPCM Data Frame
Number of Bytes
1
1
Protocol ID
Field
Seq No
ID
[7:3]
[2:0]
0-31
0x01
0x50
1
1
1
var
Header 1
Header 2
Header 3
Audio
Samples
Table 4. Stop Frame
Number of Bytes
Field
1
1
Prot/ocol ID
CMD ID
0x50
0x02
Table 5. Raw PCM Data Frame
Number of Bytes
Field
1.2.3.2
1
1
1
var
Protocol ID
CMD ID
Seq No
Audio Samples
0x50
0x03
0-255
16 bits LSB PCM
BLE
There is no standard way of transmitting audio via BLE. It is, however, quite simple to wrap the audio data
into a vendor defined profile service. One such option is vendor defined characteristics where audio is
transmitted over GATT. Another option is to wrap the audio data into vendor-specific HID profile service.
The latter is preferred by those who are familiar with writing vendor specific HID report handlers. The
performance is equal between the two options. The first byte in each of the following tables, Protocol ID, is
only valid for RF4CE.
Table 6. Start Frame
Number of Bytes
1
CMD ID
Field
0x04
Table 7. BLE ADPCM Data Frame Part #1/5 Frame
Number of Bytes
Field
1
Seq No
ID
[7:3]
[2:0]
0-31
0x01
1
1
1
16
Header 1
Header 2
Header 3
Audio Samples
Table 8. BLE ADPCM Data Frame Part #2/5 Frame
Number of Bytes
Field
20
Audio Sample
SWRA506 – May 2016
Submit Documentation Feedback
Voice Over Remote Control
Copyright © 2016, Texas Instruments Incorporated
5
Introduction
www.ti.com
Table 9. BLE ADPCM Data Frame Part #3/5 Frame
Number of Bytes
Field
20
Audio Sample
Table 10. BLE ADPCM Data Frame Part #4/5 Frame
Number of Bytes
Field
20
Audio Sample
Table 11. BLE ADPCM Data Frame Part #5/5 Frame
Number of Bytes
Field
20
Audio Sample
Table 12. Stop Frame
Number of Bytes
Field
6
1
CMD ID
0x00
Voice Over Remote Control
SWRA506 – May 2016
Submit Documentation Feedback
Copyright © 2016, Texas Instruments Incorporated
Introduction
www.ti.com
1.2.4
Sequence Diagram
Audio Protocol
Controller
Application
USER
BLE
RF4CE
Target
Stack
Application
Stack
³3XVK $XGLR .H\´
Reset, configure
and start audio
codec
Data Frame/
Connection Event
Send 1st Start Cmd
Data Cnf
Data Cnf
Data Indication/
Notification
Initialize Audio
Disable Frequency
Aglity
nd
Send 2 Start Cmd
(confirm channel)
Data Cnf
RF4CE only
Data Frame
Data Cnf
Data Indication
Start Buffering
Audio Frame
Frame ready to be
sent in audio queue
³5HOHDVH $XGLR .H\´
Send Data Request,
Audio Data Frame
Data Frame /
Connection Event
Notification
Notification
Data Indication
Notification
Notification
Decode frame, play
audio on speaker,
mic or file.
Stop Codec, empty
queue.
Send Data Request,
Audio Stop Frame Data Frame/
Connection Event
Data Indication/
Notification
Stop Audio
Enable Frequency
agility
RF4CE only
Figure 6. Sequence Diagram
SWRA506 – May 2016
Submit Documentation Feedback
Voice Over Remote Control
Copyright © 2016, Texas Instruments Incorporated
7
IMPORTANT NOTICE
Texas Instruments Incorporated and its subsidiaries (TI) reserve the right to make corrections, enhancements, improvements and other
changes to its semiconductor products and services per JESD46, latest issue, and to discontinue any product or service per JESD48, latest
issue. Buyers should obtain the latest relevant information before placing orders and should verify that such information is current and
complete. All semiconductor products (also referred to herein as “components”) are sold subject to TI’s terms and conditions of sale
supplied at the time of order acknowledgment.
TI warrants performance of its components to the specifications applicable at the time of sale, in accordance with the warranty in TI’s terms
and conditions of sale of semiconductor products. Testing and other quality control techniques are used to the extent TI deems necessary
to support this warranty. Except where mandated by applicable law, testing of all parameters of each component is not necessarily
performed.
TI assumes no liability for applications assistance or the design of Buyers’ products. Buyers are responsible for their products and
applications using TI components. To minimize the risks associated with Buyers’ products and applications, Buyers should provide
adequate design and operating safeguards.
TI does not warrant or represent that any license, either express or implied, is granted under any patent right, copyright, mask work right, or
other intellectual property right relating to any combination, machine, or process in which TI components or services are used. Information
published by TI regarding third-party products or services does not constitute a license to use such products or services or a warranty or
endorsement thereof. Use of such information may require a license from a third party under the patents or other intellectual property of the
third party, or a license from TI under the patents or other intellectual property of TI.
Reproduction of significant portions of TI information in TI data books or data sheets is permissible only if reproduction is without alteration
and is accompanied by all associated warranties, conditions, limitations, and notices. TI is not responsible or liable for such altered
documentation. Information of third parties may be subject to additional restrictions.
Resale of TI components or services with statements different from or beyond the parameters stated by TI for that component or service
voids all express and any implied warranties for the associated TI component or service and is an unfair and deceptive business practice.
TI is not responsible or liable for any such statements.
Buyer acknowledges and agrees that it is solely responsible for compliance with all legal, regulatory and safety-related requirements
concerning its products, and any use of TI components in its applications, notwithstanding any applications-related information or support
that may be provided by TI. Buyer represents and agrees that it has all the necessary expertise to create and implement safeguards which
anticipate dangerous consequences of failures, monitor failures and their consequences, lessen the likelihood of failures that might cause
harm and take appropriate remedial actions. Buyer will fully indemnify TI and its representatives against any damages arising out of the use
of any TI components in safety-critical applications.
In some cases, TI components may be promoted specifically to facilitate safety-related applications. With such components, TI’s goal is to
help enable customers to design and create their own end-product solutions that meet applicable functional safety standards and
requirements. Nonetheless, such components are subject to these terms.
No TI components are authorized for use in FDA Class III (or similar life-critical medical equipment) unless authorized officers of the parties
have executed a special agreement specifically governing such use.
Only those TI components which TI has specifically designated as military grade or “enhanced plastic” are designed and intended for use in
military/aerospace applications or environments. Buyer acknowledges and agrees that any military or aerospace use of TI components
which have not been so designated is solely at the Buyer's risk, and that Buyer is solely responsible for compliance with all legal and
regulatory requirements in connection with such use.
TI has specifically designated certain components as meeting ISO/TS16949 requirements, mainly for automotive use. In any case of use of
non-designated products, TI will not be responsible for any failure to meet ISO/TS16949.
Products
Applications
Audio
www.ti.com/audio
Automotive and Transportation
www.ti.com/automotive
Amplifiers
amplifier.ti.com
Communications and Telecom
www.ti.com/communications
Data Converters
dataconverter.ti.com
Computers and Peripherals
www.ti.com/computers
DLP® Products
www.dlp.com
Consumer Electronics
www.ti.com/consumer-apps
DSP
dsp.ti.com
Energy and Lighting
www.ti.com/energy
Clocks and Timers
www.ti.com/clocks
Industrial
www.ti.com/industrial
Interface
interface.ti.com
Medical
www.ti.com/medical
Logic
logic.ti.com
Security
www.ti.com/security
Power Mgmt
power.ti.com
Space, Avionics and Defense
www.ti.com/space-avionics-defense
Microcontrollers
microcontroller.ti.com
Video and Imaging
www.ti.com/video
RFID
www.ti-rfid.com
OMAP Applications Processors
www.ti.com/omap
TI E2E Community
e2e.ti.com
Wireless Connectivity
www.ti.com/wirelessconnectivity
Mailing Address: Texas Instruments, Post Office Box 655303, Dallas, Texas 75265
Copyright © 2016, Texas Instruments Incorporated