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

Dolby(EC3) not playing on androidTV when connected to bluetooth speaker #7788

Closed
PratimMallick opened this issue Aug 20, 2020 · 4 comments
Closed
Assignees
Labels

Comments

@PratimMallick
Copy link

PratimMallick commented Aug 20, 2020

Issue description

Trying to play ec3 content on Android TV os 9.0 via exoplayer demo app while connected to Bluetooth speaker/headphone. Getting Playback failed error

From the logs:
AudioTrack-JNI: Error -38 initializing AudioTrack
android.media.AudioTrack: Error code -20 when initializing AudioTrack

Reproduction steps

100% reproducible
Add the following to media.exolist.json to exoplayer demo app
Connect the device(I have tested it only dolby enabled TV) to bluetooth speaker or headphone and play this content

Link to test content

{
"name": "DASH DD+ 5.1 clip",
"uri": "https://nsesh-s3.s3.ap-south-1.amazonaws.com/VOD/5ch_DASH/ChID_voices_51_256_ddp.mpd"
}

A full bug report captured from the device

bugreport

Version of ExoPlayer being used

2.11.0

Device(s) and version(s) of Android being used

TCL android TV, OS - 9.0

@andrewlewis
Copy link
Collaborator

From the bug report:

APM_AudioPolicyManager: getOutputForDevice() could not find output for stream 3, sampling rate 48000, format 0xa000000, channels 0x3f, flags 0x1

... means that the AudioTrack is failing to initialize for encoded audio output (ENCODING_E_AC3).

I suspect that the device is still reporting to the app that DD+ is supported via passthrough even though the actual output path is now via headphones. Can you detect the headphone connection event and restart the player with a new AudioCapabilities instance that doesn't include encoded formats?

@PratimMallick
Copy link
Author

@andrewlewis Yes the audio output settings are set to passthrough. So there is no other way apart from detecting a bluetooth headset connection?

Also is it possible to decode ec3 in the device(if it supports) and pass the decoded stream to the speakers via BT?

@PratimMallick
Copy link
Author

@andrewlewis After detecting headphone connection and sending new capabilities that do not include Encoded format plays fine

@andrewlewis
Copy link
Collaborator

So there is no other way apart from detecting a bluetooth headset connection?

I'm not aware of another way to do this, I'm afraid.

Also is it possible to decode ec3 in the device(if it supports) and pass the decoded stream to the speakers via BT?

If audio capabilities don't include the format but the device has a decoder that supports the format, ExoPlayer will use that decoder automatically (and play the decoder's output PCM over headphones).

After detecting headphone connection and sending new capabilities that do not include Encoded format plays fine

It sounds like you've got a solution that works for now. I think we need to respect the audio capabilities that are passed in by the app at the moment so there isn't anything else to do here at the moment.

When we get round to #1993 it's possible that as part of that we will refine the behavior to check capabilities for specific output devices, at which point the default behavior may improve, but we need to wait and see how that API works.

@google google locked and limited conversation to collaborators Oct 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants