Skip to content

Audio playback pauses when starting/stopping screen capture on Android #888

@marcynumix

Description

@marcynumix

Description:
While testing on Meta Quest, I noticed that the app’s environmental audio stops whenever starting or stopping a stream while a VR application is running.

This issue does not occur when triggering the stream from the lobby — only when the app is already active.

More specifically:

  • Ambient/environmental sounds from the app are cut off
  • But subsequent sounds continue to play normally

At first, I suspected a bug in LiveKit. However, this appears to be expected Android behavior:

  • When starting a screen capture, Android reroutes audio to a different audio bus for privacy reasons
  • This process interrupts currently playing audio streams

Problem:
Android seems to pause or stop looping audio sources when this happens, which breaks continuous ambient sound playback in the app.

Expected behavior:
Ideally, audio loops should either:

  • Resume automatically after the capture starts/stops, or
  • Not be interrupted if possible

Questions / Discussion points:

  • Is there a recommended way in the LiveKit Android SDK to handle audio focus changes during screen capture?
  • Are there best practices to keep or restore looping audio after this interruption?
  • Should the SDK expose hooks/events to better manage this scenario?

Environment:

  • Device: Meta Quest (Android-based)
  • Context: In-app streaming (screen capture)
  • SDK: LiveKit Android Client SDK (2.23.5)

Additional notes:
This seems tied to Android’s privacy protections around screen/audio capture, but it has a noticeable UX impact on immersive applications relying on continuous ambient audio.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions