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:
it does not occur with NVIDIA SHIELD TV Pro.
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
Use the ExoPlayer demo app in androidx/media repository. I tested using version 1.3.1.
Connect the Fire TV to an AV receiver that can show the sampling rate (we use YAMAHA RX-A1080) via HDMI.
Play the following audio files by adding them to media.exolist.json:
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:
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.
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.
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.
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.
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.