Skip to content

Playback fails at runtime on some Android TV decoders (AAC channelCount=0), should fall back to transcode #5398

@nalet

Description

@nalet

Describe the bug

On some Android TV devices, playback can fail at runtime due to device-specific decoder/init issues even when the server playback plan considers the stream compatible for direct play/direct stream.

On my Sony BRAVIA 4K VH2 (Android 12), some AAC tracks cause Media3/ExoPlayer to try to initialize the platform AAC decoder with a Format that effectively reports channelCount=0 (see ...[0, 48000] in the Format dump). The decoder (c2.android.aac.decoder) then fails, and Jellyfin Android TV shows the toast: Player error encountered. Will re-try....

Environment

Device properties:

  • ro.product.manufacturer: Sony
  • ro.product.brand: Sony
  • ro.product.model: BRAVIA 4K VH2
  • ro.product.device: BRAVIA_VH2
  • ro.product.name: BRAVIA_VH2_EU
  • ro.build.version.release: 12
  • ro.build.version.sdk: 31
  • ro.build.version.security_patch: 2025-09-01
  • ro.build.fingerprint: Sony/BRAVIA_VH2_EU/BRAVIA_VH2:12/STT2.230505.001.S88/681561:user/release-keys

Jellyfin Android TV:

  • Built from upstream master (local build from source; versionName fallback: 0.0.0-dev.1)

Steps to reproduce

  1. Use a media item that the server marks compatible for direct play/direct stream and contains AAC-LC audio (mime audio/mp4a-latm, codec mp4a.40.2).
  2. Play it on the device above.
  3. Observe the toast and a playback error.

Logs

Minimal excerpt (logcat):

CCodec: allocate(c2.android.aac.decoder)
MediaCodecAudioRenderer: Audio codec error
ExoPlaybackException: MediaCodecAudioRenderer error ... audio/mp4a-latm ... [0, 48000]
MediaCodecDecoderException: Decoder failed: c2.android.aac.decoder

Expected behavior

If playback fails at runtime (decoder/init errors that the server cannot predict), the client should automatically re-request a more conservative server playback plan (e.g. force audio transcoding, then full transcode if needed), rather than giving up or requiring users to toggle settings.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions