Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DefaultAudioSink resets audioCapabilities on error even when context is null. #2168

Open
1 task
sruditsky opened this issue Feb 20, 2025 · 2 comments
Open
1 task
Assignees
Labels

Comments

@sruditsky
Copy link

Version

Media3 1.3.1

More version details

In ExoPlayer 2.18.7 DefaultAudioSink allowed to use setAudioCapabilities to set the audio capabilities.
In Media3 DefaultAudioSink has a mechanism to set audio capabilities dynamically, but keeps (while deprecated) setAudioCapabilities for the case when the context is not provided.

Unfortunately, using setAudioCapabilities does not work anymore because the audioCapabilities can be overwritten by error recovery code even in the case the context is not provided.

Devices that reproduce the issue

N/A

Devices that do not reproduce the issue

No response

Reproducible in the demo app?

Not tested

Reproduction steps

N/A

Expected result

When the audioCapabilities are set by setAudioCapabilities and context = null the capabilities can only be changed by another setAudioCapabilities.

Actual result

Error recovery causes audioCapabilities to be reset to the default ones.

Media

N/A

Bug Report

  • You will email the zip file produced by adb bugreport to [email protected] after filing this issue.
@tonihei
Copy link
Collaborator

tonihei commented Feb 21, 2025

Thanks for reporting! We can ensure the audio capabilities are not reset internally for the error recovery case in case the context was not provided.

One thing I'd be interested in though is why you need to set the audio capabilities manually instead of relying on the automatic detection? The method is deprecated because we don't think it's needed anymore.

@tonihei tonihei self-assigned this Feb 21, 2025
@sruditsky
Copy link
Author

sruditsky commented Feb 21, 2025

Thanks @tonihei

Yes, in the ideal world this would be true.

We have a proprietary android device which requires an audio passthrough (because the AC-3 decoder on the device has some problem working in the tunneling mode which we use) and this worked well with 2.18.7 using DefaultAudioSink.setAudioCapabilities() with AC-3 capability being hardcoded.

When we moved to Media3 and started to use the context the device started to randomly (we do not really now why yet) use the AC3 decoder instead of the c2.android.raw.decoder and as a result we decided to go back to the deprecated one but it apparently does not work.

What we really need is some way to force the audio passthrough but I do not believe ExoPlayer provides any nice way to do this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants