google / ExoPlayer

This project is deprecated and stale. The latest ExoPlayer code is available in https://github.com/androidx/media
https://developer.android.com/media/media3/exoplayer
Apache License 2.0
21.7k stars 6.02k forks source link

Getting stereo output instead of 5.1 channel for AC-3 Dolby Digital audio #3422

Closed vipulpurohit closed 6 years ago

vipulpurohit commented 6 years ago

Issue description

Hello, I need to play video with AC-3 audio. My device does not have AC-3 decoder so I used FFMPEG extension with ExoPlayer to enable AC-3 audio. Device is connected with audio system via S/PDIF. Now the issue is I can hear the sound but instead of 5.1 channel it comes as stereo output. I tried other player such as Kodi, MXPlayer etc and they are able to play with 5.1 channel output. I've been gone through various other issues:

2700

2148

1741

722

2832

But no luck. Can you please help where is the issue and how can I enable 5.1 channel output.

Reproduction steps

Just play video provided below in exo player sample application with 5.1 channel speaker. Video will produce sound for specific channel with channel name and that speaker should only produce sound at that time.

Link to test content

Dolby Sound Test

Version of ExoPlayer being used

ExoPlayer r2.5.4

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

Device: HiMedia Q10 Pro Hi3798CV200

Android versions: 5.1 Lollipop API 22 7.0 Nougat API 24

A full bug report captured from the device

bugreport-HMD-2.0.4-2017-11-03-19-29-12.zip

ojw28 commented 6 years ago

I don't think the approach you describe will ever work, because S/PDIF can only carry two channels of uncompressed audio. To get AC-3 over S/PDIF I think you need it to still be compressed, in which case you don't need a decoder (and therefore you don't need FFmpeg) on the device.

It's unclear to me whether the device and/or Android supports compressed audio output over S/PDIF (it is supported via HDMI). You should probably try and answer this question more generally.

vipulpurohit commented 6 years ago

Thanks for this detailed response. Now I'm clear that we need to send compressed AC-3 over S/PDIF and need to remove ffmpeg extension. Inbuilt player and some other player like MX Player are able to play 5.1 channel on same device with same media, so does it mean the device support audio output over S/PDIF?

Is there any way I can find if my device support S/PDIF audio output using exoplayer or any other method?

ojw28 commented 6 years ago

@andrewlewis - Would we need to implement [Internal ref: 30828716] to support this type of output? And if so is there a corresponding GitHub issue?

andrewlewis commented 6 years ago

I think so. #1741 tracks the same thing, so I'll mark this as a duplicate.