google / google/ExoPlayer

Improve speed/responsiveness of adaptive switches for audio only playback

Open
#3,342 10 comments 0 reactions 1 assignee Claimed by @tonihei View on GitHub
enhancement
Dominant language
Java
Stars
21.9k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

### Issue description
Hello. When playing DASH M4a AAC Audio, I have having two issues;

1. The bandwidth meter takes on average 1:30 to generate its initial estimate.
I have set (DEFAULT_MAX_INITIAL_BITRATE = 64_000) so that users get a quick start regardless of their current bandwidth. This selects the low bandwidth stream of ~40Kbps as expected. However it is not until 1-2 Minutes of play that bandwidth_meter estimates appear and the player starts downloading a higher bit rate stream.

2. When throttling the available bandwidth (via a firewall) mid playback, the bandwidth meter does not appear to react to bandwidth changes until the buffer is drained empty, even with a large (20 Second) buffer. When I change a 512Kbps throttle to a 64Kbps throttle, the buffer starts draining and the player continues to perform GET requests on 320Kbps chunks which are far too large for the 64Kbps of bandwidth. The audio stops, the state changes to _buffering_ and the player attempts to buffer a few more 320Kbps chunks before the bandwidth meter estimate drops to 64Kbps then the player starts performing GET requests on the lower 40Kbps stream. I have tested the audio/DASH media on the web based DASH reference player and it switches to the lower quality within a few seconds of the throttle being applied.

Thank you for your time , in advance.

Please Note: All audio tracks are the same sample rate and same codec for testing purposes.
I have tried many variations of the below settings, plus the defaults to no avail....

DEFAULT_MAX_INITIAL_BITRATE = 64_000;
DEFAULT_MIN_DURATION_FOR_QUALITY_INCREASE_MS = 16_000;
DEFAULT_MAX_DURATION_FOR_QUALITY_DECREASE_MS = 8_000;
DEFAULT_MIN_DURATION_TO_RETAIN_AFTER_DISCARD_MS = 0_000;
DEFAULT_BANDWIDTH_FRACTION = 0.75f;

DEFAULT_MIN_BUFFER_MS = 10_000;
DEFAULT_MAX_BUFFER_MS = 20_000;
DEFAULT_BUFFER_FOR_PLAYBACK_MS = 2_000;
DEFAULT_BUFFER_FOR_PLAYBACK_AFTER_REBUFFER_MS = 4_000;

### Reproduction steps
Not required yet as it may be due to my code / settings.

### Link to test content
Not required yet as it may be due to my code / settings.

### Version of ExoPlayer being used
2.5.3

### Device(s) and version(s) of Android being used
Same issue on all below
Sony XA (F3111) Nougat 7.1
Samsung S4 (GT-I9505) Lollipop 5.0.1
LG G3 (D-855) Lollipop 5.0.0

### A full bug report captured from the device
Not required yet as it may be due to my code / settings.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.