Repository navigation
Description
1. The user experience
Omi Glass is designed to stream microphone audio over Bluetooth Low Energy. Currently, the firmware is hardcoded to a maximum MTU size of 517 bytes.
If a connecting client (like an older Android phone or Windows PC) fails to negotiate this MTU size and drops it to the default 185 bytes, the firmware will attempt to notify the characteristic with raw buffers exceeding the limit, causing packet drops or firmware crashes. We need to support dynamic MTU negotiation and split audio packets when they exceed the limit, ensuring stable connections on all host devices.
2. Technical architecture
The firmware must dynamically adjust the transmitted packet size to match the negotiated MTU of the active Bluetooth connection.
graph TD
A[I2S Mic Audio] -->|Raw PCM| B[Opus Compressor]
B -->|Compressed Opus Frame| C[MTU Check]
C -->|Frame <= Max Payload| D[Send Single Packet]
C -->|Frame > Max Payload| E[Fragment Frame]
E -->|Loop Chunk| F[Send Packet with Sub-Index]
Affected files
- Modify:
omiGlass/firmware/src/app.cpp - Modify:
omiGlass/firmware/src/config.h
3. Implementation steps
Step 1: Set up the BLE Server MTU callback
Register a server callback on the BLE Server to track the negotiated connection MTU dynamically whenever the link updates. Store this value in a global configuration variable.
Step 2: Implement dynamic packet fragmentation
In the audio broadcast function, subtract GATT overheads and custom headers from the negotiated MTU to find the safe payload limit. If the Opus frame size is within the limit, transmit it directly. If it exceeds the limit, split the frame and send the chunks sequentially, prefixing each with a sub-index header byte so the client-side app can stitch them back together.
4. Verification benchmarks
- BLE server logs successful MTU updates over Serial.
- Firmware successfully fragment-transmits audio packets on connections with smaller MTUs.
Activity
gianluca-disanto commentedon Sep 11, 2026
Hi @thesohamdatta, @beastoin, @kodjima33,
I would like to request to lock this issue for a fair $50 bounty as an active contributor (my first PR #13389 is
merged, and I recently contributed the BLE MTU notification bounds for CV1 on #13342 and DevKit on #13388).
Proposed Implementation Plan:
app.cpp,config.h):onMTUChange(uint16_t MTU, ble_gap_conn_desc* desc)insideServerHandler(
NimBLEServerCallbacks) to track the negotiated ATT MTU dynamically.connection drops.
broadcastAudioPacket):safe_payload = current_mtu - ATT_OVERHEAD (3 bytes) - AUDIO_PACKET_HEADER_SIZE (3 bytes).safe_payload, notify as a single packet withsub_index = 0.safe_payload, chunk the Opus payload across sequential notifications sharing the sameaudioPacketIndexand incrementingsub_index(0, 1, 2...) so client receivers can assemble them without droppingdata.
byte, and 517-byte links).
Looking forward to your approval so I can proceed with the PR. Thank you!
fix(firmware): advance packet sequence number monotonically per notif…
chore(failure-classes): define FC-ble-att-notification-exceeds-negoti…
style(omiglass): format config.h according to clang-format (BasedHard…