Bluetooth Protocol & Device Synchronization
Relevant source files
The following files were used as context for generating this wiki page:
The Bluetooth Protocol and Device Synchronization system in Omi facilitates low-latency audio streaming, device management, and secure firmware updates between the Omi wearable hardware and client applications (Mobile/Desktop). Utilizing Bluetooth Low Energy (BLE) 5.0, the protocol is optimized for continuous capture, real-time transcription, and efficient data transfer of stored audio when a connection is re-established.
The system spans the Application Core and Network Core of the nRF5340 SoC, employing the Zephyr RTOS and nRF Connect SDK. It supports standard GATT services for battery monitoring and device info, alongside custom services for high-throughput audio data encoded with the OPUS codec.
Sources: omi/firmware/BUILD_AND_OTA_FLASH.md, omi/firmware/omi/README.md
BLE Stack & Architecture
Omi uses a dual-core architecture on the nRF5340. The Network Core handles the Bluetooth stack and radio management (using ipc_radio), while the Application Core manages the high-level logic, audio processing, and GATT service definitions.
Connection Management
The device operates in a BLE peripheral role, supporting extended advertising and 2M PHY for increased data rates. Connection intervals are tuned to balance latency and battery life; for instance, Android devices may use a 7ms connection interval, while iOS devices typically use approximately 15ms.
The diagram above shows the high-level handshake and core transition from advertising to data streaming.
Sources: omi/firmware/BUILD_AND_OTA_FLASH.md, omi/firmware/omi/README.md, app/e2e/flows/device-connect.yaml
Audio Streaming & Data Synchronization
Audio is captured via PDM microphones, encoded using the OPUS codec, and transmitted over BLE.
Real-time Streaming
When connected, the device streams audio bytes continuously. The protocol is designed to handle approximately 100 requests per second with 50-byte packets to maintain low latency for real-time transcription.
Offline Synchronization
Omi features an automatic storage synchronization mechanism. If the BLE connection is lost, the device creates a new file in local storage (SD Card/Flash) and writes encoded OPUS data.
- Disconnection: Device starts filling a new storage file.
- Re-connection: The device automatically begins streaming the contents of the storage to the app.
- Completion: Once the file transfer is finished, the device attempts to delete the local file.
Sources: omi/firmware/omi/README.md, omi/firmware/readme.md
GATT Services & Configuration
The device implements several GATT services to provide status and control to the application.
| Service/Feature | Description | Relevant Config |
|---|---|---|
| Audio Service | High-throughput streaming of OPUS encoded audio. | CONFIG_OMI_CODEC_OPUS=y |
| Battery Service | Reports battery percentage and charging status. | CONFIG_BT_DEVICE_APPEARANCE=22 |
| Device Info | Provides hardware/firmware versions and serial numbers. | CONFIG_BT_DEVICE_NAME |
| MCUmgr (DFU) | Handles Over-the-Air (OTA) firmware updates. | CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU=y |
Sources: omi/firmware/BUILD_AND_OTA_FLASH.md, omi/firmware/test/BLE_THROUGHPUT_TEST.md, omi/firmware/omi/README.md
High-Throughput Protocol Settings
For performance testing and high-speed data transfer (such as syncing large offline audio files), the firmware utilizes specific L2CAP and MTU configurations.
// Configuration for high-speed BLE throughput
#define CONFIG_BT_L2CAP_TX_MTU 498
#define CONFIG_BT_CTLR_DATA_LENGTH_MAX 251
#define CONFIG_BT_CTLR_PHY_2M y
#define CONFIG_BT_BUF_ACL_TX_SIZE 2048
Note: These settings enable the use of 2M PHY and large packet sizes to maximize bandwidth.
Sources: omi/firmware/test/BLE_THROUGHPUT_TEST.md
Device State Synchronization Flow
The following flowchart illustrates how the device transitions between different operational modes based on Bluetooth connectivity.
The state machine ensures no data is lost during intermittent connectivity by switching between BLE streaming and local flash storage.
Sources: omi/firmware/readme.md, omi/firmware/omi/README.md
Security and OTA Updates
Device synchronization also includes the secure update of firmware components via the MCUmgr protocol over BLE.
- Security: Firmware images are cryptographically signed using RSA-2048.
- Verification: The MCUboot bootloader verifies signatures before swapping images.
- OTA Process: Updates are uploaded to a secondary partition, verified, and then automatically swapped by the bootloader upon restart.
Sources: omi/firmware/BUILD_AND_OTA_FLASH.md
Summary
The Omi Bluetooth Protocol is a specialized implementation of BLE 5.0 tailored for continuous, low-latency audio capture. By leveraging the dual-core nRF5340 and the Zephyr RTOS, Omi achieves a robust synchronization flow that seamlessly transitions between real-time streaming and offline storage. This architecture, supported by high-throughput configurations and secure MCUmgr-based updates, ensures a reliable "second brain" experience across mobile and desktop platforms.