Skip to content

🐛 Audio desync/lag after pausing recording, switching cameras, and resuming in v4.x #3658

@ZakirBangash

Description

@ZakirBangash

What's happening?

When pausing a video recording, switching the camera (e.g., from back to front via the device prop), and then resuming the recording, there is noticeable audio lag/desync in the final video output. The video resumes smoothly, but the audio appears delayed by 1-3 seconds (depending on device), causing misalignment between sound and visuals. This occurs consistently on physical devices and disrupts user experience for apps requiring seamless multi-camera recordings (e.g., video calls or tutorials).
This seems related to the camera session reinitialization during the switch, which may interrupt or flush audio buffers/timestamps even in a paused state. No errors are thrown in logs, but the output video plays with offset audio.

Reproduceable Code

<Camera
            ref={camRef}
            device={frontMode ? front : back}
            isActive={isFocused}
            torch={isTorchOn === true ? 'on' : 'off'}
            video={true}
            audio={true}
            focusable={true}
            format={format}
            enableZoomGesture={true}
            style={StyleSheet.absoluteFill}
          />

Relevant log output

We have Visual bug, just lags in sound

Camera Device

{
  "videoStabilizationModes": [
    "off",
    "cinematic",
    "cinematic-extended"
  ],
  "autoFocusSystem": "contrast-detection",
  "photoWidth": 3264,
  "supportsPhotoHdr": false,
  "supportsDepthCapture": false,
  "maxISO": 3918,
  "minISO": 41,
  "minFps": 15,
  "videoWidth": 1280,
  "supportsVideoHdr": true,
  "videoHeight": 720,
  "fieldOfView": 86.45470190505881,
  "maxFps": 30,
  "ph

Device

Android Pixel 7 Pro, but can be on any device

VisionCamera Version

4.7.2

Can you reproduce this issue in the VisionCamera Example app?

I didn't try (⚠️ your issue might get ignored & closed if you don't try this)

Additional information

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐛 bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions