Skip to content

Feature request: Support independent screen-share audio tracks on Android #1058

Open

Description

@farsunset-com

Please support publishing Android system playback audio as an independent audio track when screen sharing.

The Android SDK already exposes Track.Source.SCREEN_SHARE_AUDIO, but in the current release there does not appear to be a public API that captures Android system playback audio and publishes it as a separate LocalAudioTrack.

Current behavior

With LiveKit Android SDK 2.29.2, screen video sharing works correctly.

For system audio, the current workaround is to use ScreenAudioCapturer and attach it to the microphone track:

localAudioTrack.setAudioBufferCallback(screenAudioCapturer)

This mixes system playback audio into the microphone audio track.

As a result:

  • Screen-share audio and microphone audio cannot be controlled independently.
  • Muting the microphone may also affect the screen-share audio path.
  • Remote participants cannot distinguish microphone audio from system playback audio.
  • It is not possible to independently mute or subscribe to the two audio sources.
  • Audio processing, volume control, and source-specific UI become difficult to implement.

Expected behavior

On Android 10 and above, the SDK should provide a supported API to:

  1. Capture system playback audio through MediaProjection and AudioPlaybackCaptureConfiguration.
  2. Publish the captured audio as a separate audio track.
  3. Use Track.Source.SCREEN_SHARE_AUDIO as the track source.
  4. Keep the microphone track independent from the screen-share audio track.
  5. Allow the microphone and screen-share audio to be muted or enabled independently.
  6. Automatically clean up the screen-share audio track when screen sharing stops.
  7. Gracefully report that system audio capture is unsupported on Android versions below API 29.

The exact API design is open to discussion. For example, it could be integrated into the existing screen-sharing API or exposed through a dedicated screen-share audio capturer and publishing API.

Example of the desired API behavior

localParticipant.setScreenShareEnabled(
enabled = true,
screenCaptureParams = params
)

localParticipant.setScreenShareAudioEnabled(true)

Or, alternatively, an API that allows the application to create and publish a dedicated track:

val screenAudioTrack = createScreenShareAudioTrack(...)
localParticipant.publishAudioTrack(
screenAudioTrack,
AudioTrackPublishOptions(source = Track.Source.SCREEN_SHARE_AUDIO)
)

The API example is only illustrative; the implementation details can follow the SDK's existing architecture.

Environment

  • LiveKit Android SDK: 2.29.2
  • Android API level: 29+
  • Audio capture mechanism: MediaProjection + AudioPlaybackCaptureConfiguration
  • Language: Java/Kotlin

Additional context

The Track.Source.SCREEN_SHARE_AUDIO enum already exists, but it does not currently appear to provide a complete Android capture and publishing path for system playback audio.

Is independent screen-share audio track support planned for the Android SDK? If not, would the LiveKit team consider adding it?

Thank you.

Activity

  1. davidliu commented on Nov 20, 2026

    @davidliu
    Contributor

    Due to technical limitations of the underlying libraries, it's unlikely we'll be able to do it for a while. This isn't currently planned for development though is an issue we're aware of.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions