Skip to content

Video Stuttering Issue for Audio Codecs #2921

@Wizdier

Description

@Wizdier

Steps to reproduce

  1. Open Cloudstream on an Android TV device.
  2. Select any media link containing an AC3 or E-AC3 5.1 audio track.
  3. Observe that video runs completely smoothly, but audio constantly drops frames and stutters.
  4. Attempting to change to an external player or toggling standard passthrough settings on the TV does not fix the stuttering.

Expected behavior

The internal player engine should recognize hardware limitations or provide a mechanism to decode/downmix the AC3/E-AC3 audio stream entirely via software into stereo PCM, ensuring stable playback on hardware-constrained smart TVs.

Actual behavior

When playing streams that contain multi-channel AC3 or E-AC3 (Dolby 5.1) audio tracks on an Android TV device, the audio suffers from severe, rhythmic stuttering and skipping. The video stream itself plays completely smoothly with zero frame drops, indicating that this is exclusively an audio-sink processing bottleneck.

Attempting to route the stream to external players (like Just Player, VLC, MPV, or MX Player) fails to resolve the issue, as the underlying audio pipeline/extraction remains constrained by the initial internal player configuration. The exact same links play flawlessly on Android mobile devices, pointing to a severe optimization issue on low-power Android TV SoCs.

Cloudstream version and commit hash

4.7.0-PRE 2c03a3d

Android version

Android 8

Logcat

Other details

This is a device-specific capability mismatch involving the Android Media3 / ExoPlayer framework:

  1. The TV's firmware incorrectly reports native hardware decoding support for high-bitrate AC3/E-AC3 when queried via AudioManager.getDirectProfilesForAttributes().
  2. ExoPlayer relies on this report and initializes a hardware audio track (MediaCodecAudioRenderer).
  3. The budget TV processor hits a severe decoding/licensing bottleneck, leading to constant buffer underruns in the audio track sink, which manifests as rhythmic stuttering

Suggested Solutions / Feature Requests
To fix this compatibility roadblock for TV users, please consider exposing one of the following settings in the Player menu:

  1. Expose a Preference for Extension Decoders
    Allow users to toggle EXTENSION_RENDERER_MODE_PREFER over platform decoders. Utilizing software-based extension decoders (like the ExoPlayer FFmpeg extension) to decode multi-channel audio to flat PCM stereo before it hits the TV's audio track sink would completely bypass buggy native hardware decoders.
  2. Manual Audio Capabilities Override
    Implement an option to manually override or spoof AudioCapabilities inside the player configuration (similar to Plex or Kodi). Forcing a stereo-only profile to the DefaultAudioSink will stop ExoPlayer from trying to force broken hardware passthrough routes.
  3. Audio-Only Hardware Acceleration Toggle
    Provide an internal player flag to force-disable hardware acceleration strictly for the audio track, delegating audio parsing entirely to software execution.

Acknowledgements

  • I am sure my issue is related to the app and NOT some extension.
  • I have searched the existing issues and this is a new ticket, NOT a duplicate or related to another open issue.
  • I have written a short but informative title.
  • I have updated the app to pre-release version Latest.
  • I will fill out all of the requested information in this form.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions