96kHz stereo audio downsampled to 48kHz when played on Fire TV

I am developing a video streaming app for Fire TV.
When playing FLAC 96kHz/24bit stereo audio, it is downsampled to 48kHz. I suspect that it is a bug of Fire TV, not the software player since:

  1. it does not occur with NVIDIA SHIELD TV Pro.
  2. I also checked the audio format using Android Studio’s debugger and confirmed that the sample rate of the audio was 96kHz in the code where audio samples were queued in the output buffer.

Devices that reproduce the issue

  • Fire TV Stick 4K - 2nd Generation (2023) - 8GB (Build Model: AFTKM)
  • Fire TV Stick 4K Max - 2nd Generation (2023) - 16GB (Build Model: AFTKRT)

Devices that do not reproduce the issue

NVIDIA SHIELD TV Pro

Reproduction steps

  1. Use the ExoPlayer demo app in androidx/media repository. I tested using version 1.3.1.
  2. Connect the Fire TV to an AV receiver that can show the sampling rate (we use YAMAHA RX-A1080) via HDMI.
  3. Play the following audio files by adding them to media.exolist.json:
  1. Observe the sampling rate displayed on the AV receiver.

Expected result

Both 96kHz/24bit stereo and 96kHz/24bit 5.1 channel audio should be played at 96kHz.

Actual result

  • The 96kHz/24bit stereo audio is downsampled to 48kHz.
  • The 96kHz/24bit 5.1 channel audio is played correctly at 96kHz.

Hi there,

Based on the information you have provided, where downsampling 96kHz/24-bit stereo audio to 48kHz, while the 96kHz/24-bit 5.1 channel audio is played correctly at 96kHz.

This appears to be a device-specific issue, as the NVIDIA SHIELD TV Pro is able to play the 96kHz/24-bit stereo audio correctly. It is likely a bug or a limitation in the audio processing capabilities of the Fire TV devices.

Here are a few suggestions on how you can address this issue:

  1. Provide 48kHz audio as a fallback: Since the Fire TV devices are downsampling the 96kHz/24-bit stereo audio, you can provide a 48kHz/24-bit stereo audio file as a fallback option. Your video streaming app can detect the device type and serve the appropriate audio file.

  2. Transcode the audio on the server-side: Another option is to transcode the 96kHz/24-bit stereo audio to 48kHz/24-bit on the server-side before sending it to the client app. This way, the client app can simply play the 48kHz audio without any issues.

  3. Implement a client-side audio re-sampler: If you want to avoid transcoding on the server-side, you can implement an audio re-sampler on the client-side (in your Fire TV app) to upsample the 48kHz audio back to 96kHz before playing it. This approach will require more processing power on the client device, but it can provide a better audio experience for users with compatible audio equipment.

  4. Provide user guidance: You can also provide guidance to your users on the audio format limitations of the Fire TV devices, and recommend them to use the NVIDIA SHIELD TV Pro or other devices that can handle 96kHz/24-bit audio playback.

By addressing this issue, you can ensure a consistent and high-quality audio experience for your users across different Fire TV and other Android TV devices.

Moreover, I have a doubt on the exoplayer version 1.3.1 that you have used where I am not able to find the version in mavenCentral or google or JCenter. They might have removed it.
ReF: https://mvnrepository.com/artifact/com.google.android.exoplayer/exoplayer

Thanks

Hi, thank you for your reply.

The URL for the repository I mentioned is in GitHub.

The steps to reproduce are:

  1. Clone the repository and open the main demo https://github.com/androidx/media/tree/1.3.1/demos/main.
  2. Change the playlist JSON file https://github.com/androidx/media/blob/1.3.1/demos/main/src/main/assets/media.exolist.json to include the sample files I mentioned in the earlier post
  3. Run the app with Fire TV

We are considering addressing this issue with a workaround that adds four dummy channels to simulate 5.1ch audio, which will not have the downsampling issue. Since our app features Hi-Res audio, keeping the 96kHz sample rate is important for us. However, we would appreciate your team investigating this issue and considering addressing it if it is confirmed to be a bug of Fire TV side.

Thanks