In a mono-directional audio streaming asymmetric system, the device with voice data is the one with a
microphone and is therefore considered the server. The client device sends requests to the server and accepts
server-initiated updates containing audio data.
Audio data transmission is based on periodic server-to-client notifications which do not require a request or
response from the receiving device. Server-initiated updates are sent as asynchronous notification packets which
include the handle of a characteristic along with its current value.
According to the Bluetooth specification, the peripheral enters advertising mode at start-up and sends
advertisement packets at relatively long intervals. The central unit enters discovery mode and sends a connection
request on reception of an advertisement packet from a slave device. After connection, notifications carrying
audio data are periodically sent from the server to the client.
1.2.5.2
BlueMic1 service
The Attribute Protocol (ATT) is used by GATT as a transport protocol for exchanging data between devices. The
smallest entities defined by ATT (named attributes) are addressable pieces of information that may contain user
data or meta-information on the attribute architecture, stored in the server and exchanged between client and
server.
GATT server attributes are organized as a sequence of services, each one starting with a service declaration
attribute marking its beginning. Each service groups one or more characteristics and each characteristic can
include zero or more descriptors.
Since audio streaming is not part of the predefined set of profiles, the
STSW-BLUEMIC-1
application defines a
vendor-specific service named
BlueMic1 Service
based on an
Audio
characteristic to expose actual compressed
audio data and a
Sync
characteristic to expose collateral information to implement a synchronization mechanism
and an inertial characteristic to expose 3-axis accelerometer and gyroscope raw data.
Table 2.
BlueMic1 UUID summary table
UUID name
UUID
bluemic1_service_uuid
00000000-0001-11e1-9ab4-0002a5d5c51b
audio_adpcm_char_uuid
08000000-0001-11e1-ac36-0002a5d5c51b
audio_adpcm_sync_char_uuid
40000000-0001-11e1-ac36-0002a5d5c51b
acc_gyr_char_uuid
00E00000-0001-11e1-ac36-0002a5d5c51b
Given the service hierarchical architecture, further characteristics may be added to the BlueMic1 service, such as
configuration of parameters like volume, enabling/disabling of processing algorithms, etc.
1.2.6
Audio processing
The audio processing component of the
STSW-BLUEMIC-1
application is designed to achieve an audio sampling
frequency of 8 or 16 kHz at the receiver side, with a trade-off between audio quality and bandwidth occupation for
voice signals. The audio signal transmitted is compressed via ADPCM (adaptive differential pulse code
modulation) to fit in the available data rate while minimizing radio transmission time and power consumption.
The figure below shows the speech processing chain in a complete communication system with Tx and Rx.
On the Tx side, the library receives an audio signal which is typically acquired by a digital MEMS microphone as a
1-bit PDM signal and converted by a PDM to PCM conversion filter, integrated in the ADC peripheral of the
BlueNRG-1 SoC, into 16-bit PCM samples at 8 or 16 kHz.
The library can be provided with 1, 2, 5 or 10 ms of audio data. When the compressed output buffer is ready, a
flag is set and audio data is streamed via Bluetooth Low Energy together with collateral ADPCM information. The
resulting communication bandwidth is 32 kbps (with 8 kHz audio sampling frequency) or 64 kbps (with 16 kHz
audio sampling frequency) of audio data plus 300 bps of collateral information.
UM2257
Software description
UM2257
-
Rev 2
page 9/35