recloudstream / recloudstream/cloudstream

Video Stuttering Issue for Audio Codecs

Open
#2,921 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Kotlin
Stars
10.7k
Forks
1.1k
Avg merge
1d 23h
Merged PRs (30d)
15

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Android TV playback path described through Media3/ExoPlayer, especially AudioManager.getDirectProfilesForAttributes(), MediaCodecAudioRenderer, and DefaultAudioSink. Reproduce AC3/E-AC3 5.1 playback on Android 8 and compare the audio behavior with stereo or software decoding; done means stable audio without video regressions and a tested user-facing resolution.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.