exoplayer-amazon-port: Older FireTV devices do not advertise AC3 playback support

On some FireTV devices like AFTT and AFTS, the ACTION_HDMI_AUDIO_PLUG intent’s EXTRA_ENCODINGS only advertises ENCODING_PCM_16BIT. On newer devices like AFTN, it advertises ENCODING_AC3 as expected.

For example, here is the output from exoplayer with a logging patch to show AudioCapabilities. The devices are plugged into the same TV, and even swapping the HDMI ports does not change the behavior.

I/AUDIOCAPA: AudioCapabilities[maxChannelCount=8, supportedEncodings=[2, 4, 5, 6]]
I/AudioTrack: Amazon legacy corrections: Latency:off; Dolby:off. On Sdk: 25
I/ExoPlayerImpl: Init 47dcca5 [ExoPlayerLib/2.7.1] [needle, AFTN, Amazon, 25]
I/AUDIOCAPA: AudioCapabilities[maxChannelCount=2, supportedEncodings=[2]]
I/AudioTrack: Amazon legacy corrections: Latency:off; Dolby:off. On Sdk: 22
I/ExoPlayerImpl: Init 804feb2 [ExoPlayerLib/2.7.1] [tank, AFTT, Amazon, 22]
I/AUDIOCAPA: AudioCapabilities[maxChannelCount=2, supportedEncodings=[2]]
I/AudioTrack: Amazon legacy corrections: Latency:off; Dolby:off. On Sdk: 22
I/ExoPlayerImpl: Init d07d259 [ExoPlayerLib/2.7.1] [sloane, AFTS, Amazon, 22]
I/AUDIOCAPA: AudioCapabilities[maxChannelCount=8, supportedEncodings=[2, 5, 6]]
I/AudioTrack: Amazon legacy corrections: Latency:off; Dolby:on. On Sdk: 22
I/ExoPlayerImpl: Init 3191edc1 [ExoPlayerLib/2.7.1] [bueller, AFTB, Amazon, 22]

diff --git a/library/core/src/main/java/com/google/android/exoplayer2/audio/AudioCapabilities.java b/library/core/src/main/java/com/google/android/exoplayer2/audio/AudioCapabilities.java
index 91365dde2..b307e855a 100644
--- a/library/core/src/main/java/com/google/android/exoplayer2/audio/AudioCapabilities.java
+++ b/library/core/src/main/java/com/google/android/exoplayer2/audio/AudioCapabilities.java
@@ -24,6 +24,7 @@ import android.content.IntentFilter;
 import android.media.AudioFormat;
 import android.media.AudioManager;
 import android.provider.Settings;
+import android.util.Log;

 import com.google.android.exoplayer2.util.Util;

@@ -60,8 +61,10 @@ public final class AudioCapabilities {
    */
   @SuppressWarnings("InlinedApi")
   public static AudioCapabilities getCapabilities(Context context) {
-    return getCapabilities(context, // AMZN_CHANGE_ONELINE
+    AudioCapabilities capa = getCapabilities(context, // AMZN_CHANGE_ONELINE
         context.registerReceiver(null, new IntentFilter(AudioManager.ACTION_HDMI_AUDIO_PLUG)));
+    Log.i("AUDIOCAPA", "" + capa);
+    return capa;
   }

   @SuppressLint("InlinedApi")

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 18 (6 by maintainers)

Most upvoted comments

Yes, ignore those warnings. There won’t be audio glitch due to this. I believe we have relaxed the 4096 buffer size hardcoding in the next release, and the app can configure the size.

That’s why please use non-blocking API only in AFTS. Exo uses it for API Level 21 and above.