androidx / androidx/media

Add isOffloaded method to query AudioTrack offload state.

Open
#134 3 comments 0 reactions 1 assignee View on GitHub

@tonihei is already working on this.

Since Aug 2, 2022.

enhancement
Dominant language
Java
Stars
3k
Forks
955
Avg merge
12d 14h
Merged PRs (30d)
2

Description

Use case description

The current interface doesn't provide actual status of offload (whether is enabled on the AudioTrack, not whether it's sleeping). It doesn't allow apps making decisions to keep using offload support after a write error, which may be transient.

Requests:

  • call a new method AudioOffloadListener.isOffloadedPlayback with the value of AudioTrack.isOffloadedPlayback. This may be true, even when sleepingForOffload is false.
  • Allow AudioOffloadListener to be involved in the DefaultAudioSink maybeDisableOffload decision, such as trying additional times with offload enabled.
  • Expose the reason for offload being disabled, such as Audio Init errors, or write errors, or not supported for format.
Proposed solution

Add additional methods to AudioOffloadListener that affect the

Alternatives considered

Expose AudioTrack and additional logging.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.