Skip to content

Bug: Audio silently dropped when internet fails but Bluetooth stays connected #5159

Closed

Description

@omi-discord-vector

Bug: Audio lost when internet drops while Bluetooth stays connected

Platform: Android (tested by community member)

Problem

When the Omi CV1 is connected to the phone via Bluetooth but internet connectivity is lost (e.g. entering an elevator, dead zone), the audio streamed during the outage is permanently lost. The transcription for that period never appears — even after internet is restored.

What Happens

  1. Omi is connected via BT, recording and transcribing normally
  2. Internet drops (phone loses Wi-Fi/cellular) but Bluetooth stays connected
  3. Audio continues streaming from pendant to phone over BT
  4. The app shows "Waiting for network" — the WebSocket to the transcription service is down
  5. The app does not buffer the incoming audio — it receives bytes from BT but only sends them to the socket if socket.state == connected. If the socket is disconnected, the audio bytes are silently dropped.
  6. Internet returns — transcription resumes, but everything said during the outage is gone

Root Cause (from code review)

In capture_provider.dart, the phone mic recording handler:

onByteReceived: (bytes) {
  if (_socket?.state == SocketServiceState.connected) {
    _socket?.send(bytes);
  }
}

If the socket isn't connected, audio bytes are simply not sent and not saved anywhere. There is no local buffer, no queue, no disk cache for audio received over BT when the internet is down.

The firmware correctly streams audio to the phone over BT regardless of internet status. But the app discards it silently.

Expected Behavior

Audio received from the pendant should be buffered locally on the phone when the transcription socket is unavailable, then sent for processing once connectivity is restored — or at minimum saved as a local recording that can be synced later.

Impact

High — users lose portions of conversations during any brief internet interruption (elevators, tunnels, dead zones, Wi-Fi handoffs). This is especially problematic because:

  • The device LED stays blue (connected), giving the impression everything is being captured
  • There is zero indication that audio is being lost
  • The pendant's SD card doesn't activate because BT is still connected

Suggested Fix

Buffer incoming BT audio bytes to a local file when the transcription socket is disconnected. On reconnect, either:

  1. Send the buffered audio to the transcription service, or
  2. Treat it like an offline recording and process it through the normal sync pipeline

Tested and reported by community member on Discord (Android).

Activity

  1. added
    bug
    on Feb 26, 2026
  2. added
    capture
    maintainer
    p1
    on Feb 27, 2026
  3. beastoin commented on Feb 27, 2026

    @beastoin
    Collaborator

    Related data loss cluster: #4816 (long recordings disappear on disconnect), #4805 (web unreliable — 40 min meeting lost), #4669 (offline sync data loss), #4867 (offline sync fails to process). This issue adds a new variant: audio streamed over BT is silently dropped when internet fails because the app doesn't buffer incoming bytes during WebSocket disconnection.

  4. beastoin commented on Mar 17, 2026

    @beastoin
    Collaborator

    This issue is now tracked under the main umbrella issue #5733 (Audio capture data loss). Please report any new findings or updates there so we can keep investigation centralized. This issue stays open as a child reference for its specific scenario.


    by AI for @beastoin

  5. beastoin commented on Mar 17, 2026

    @beastoin
    Collaborator

    This report describes the behavior but has no specific incident data we can trace. To investigate:

    1. Has anyone reproduced this recently? If so, we need: date/time, redacted user UUID (Settings → Profile → bottom, redact middle), app version, firmware, phone model.
    2. What was the network condition — Wi-Fi drop, cellular drop, or handoff between networks?

    Without a specific incident (date + UUID), we cannot verify whether audio was actually lost server-side or if it was a client-side drop.

    @aaravgarg @mdmohsin7 — can we check if any Discord reporters who experienced this can provide trace data?

    Tracked under #5733.


    by AI for @beastoin

  6. beastoin commented on Mar 30, 2026

    @beastoin
    Collaborator

    S3 Repro Results — Works by Design

    Reproduced on: Pixel 7a (33041JEHN18287), Omi dev app (com.friend.ios.dev), phone mic recording (same code path as BLE — identical if (socket.connected) gate in capture_provider.dart)

    Setup

    • Phone mic recording with WebSocket connected to a mock transcription server via ADB USB tunnel chain (Phone → Mac Mini → VPS → mock WS server on port 10120)
    • Omi BLE pendant was offline, so used phone mic — exercises the same vulnerable code at capture_provider.dart:912-925

    Repro Timeline (UTC)

    Time Event
    04:15:50 Phone mic recording started, WebSocket connected
    04:17:00 Baseline: 2.19 MB audio bytes sent via WS
    04:17:03 Internet killed (mock server terminated)
    04:17:18 App detects WS close (code 1006), UI → "Recording, reconnecting"
    04:17:18–04:18:43 ~92 seconds outage — mic keeps recording, zero bytes sent via WS
    04:18:43 Internet restored (mock server restarted)
    04:18:50 App reconnects (7s). Byte counter starts from zero — no catch-up burst

    Evidence

    Mock server logs (pre-outage → outage → post-restore):

    [04:17:00] Audio bytes received: 2195200 total      ← last bytes before kill
    [04:17:18] Client disconnected: code=1006            ← outage begins
    [04:17:18] Total bytes received this session: 918400
    ---
    [04:18:50] Client connected: /v4/listen?...          ← reconnect
    [04:18:55] Audio bytes received: 131520 total        ← fresh counter, NO replay
    [04:19:00] Audio bytes received: 297920 total        ← only new audio
    

    Flutter logs (WS disconnect):

    11:17:18 | Socket closed with code: 1006 (abnormal_closure)
    11:17:18 | [Socket] Connect error: Connection closed before full header was received
    11:17:18 | Can not connect to websocket
    

    WAL logs (frames captured but NOT synced during outage):

    11:18:03 | _chunk wals 255
    11:18:03 | SyncProvider: Loaded 255 WALs (255 missing)  ← all unsent
    11:18:18 | _flush file audio_phonemic_pcm16_16000_1_fs160_1774844195.bin
    11:19:18 | SyncProvider: Loaded 256 WALs (256 missing)  ← still all unsent
    

    Verdict: Works by Design

    The audio bytes are not permanently lost. WAL captures all frames during the outage via onFrameCaptured(), marks them as "miss" (not WebSocket-synced), and stores them on disk. These WAL chunks can be recovered later through manual sync.

    The code behaves as designed:

    1. capture_provider.dart gates WS send on _socket?.state == SocketServiceState.connected
    2. When socket is disconnected, frames are captured to WAL but not sent
    3. WAL chunker creates files with WalStatus.miss for later sync
    4. On reconnect, only new audio flows — no replay of missed frames

    UX Concern (separate issue)

    While the data isn't lost, the user experience during internet outage is poor:

    • No visible warning that audio isn't being transcribed in real-time
    • The "Recording, reconnecting" status is subtle and doesn't convey data impact
    • Recovery requires manual WAL sync — user may not know this
    • Live transcript has a gap with no indication of what was missed

    Filing a separate UX improvement issue for this concern.


    Repro by @kelvin-agent, 2026-03-30

  7. beastoin commented on Mar 30, 2026

    @beastoin
    Collaborator

    Closing as works by design. Repro confirmed that audio bytes ARE saved locally via WAL during internet outage — they are not permanently lost. WAL captures all frames and marks them as "miss" for later manual sync.

    The remaining UX concern (no warning to user, no automatic recovery, invisible transcript gap) has been filed as #6171.

    See repro evidence in the comment above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcapturemaintainerp1

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions