Comments (14)
Everything seems to work fine for most devices, but we've received 2 reports from users of Samsung Galaxy S21+ devices who are unable to play any of the media.
It will be difficult to support what's happening on the Samsung devices without any further information. As you may have seen when you opened this issue, we request bugreports to inspect what may have gone wrong. A copy of the logs and/or stack trace would at least be more helpful than nothing.
Another thing: enableAudioOffload causes things not to work properly on Pixel 6 Pro and perhaps more devices
Can you please explain in more detail what's happening? Also consider attaching a bureport when issues occur.
@krocard can you offer some assistance on the audio off-load issues?
from media.
@christosts I can appreciate and understand that. Unfortunately I don't have access to the particular device and haven't been able to get the users to create a bugreport. Perhaps I can bake something into the app that will allow me to generate that remotely, but I am not super experienced with Android so I'll have to investigate.
from media.
Another thing: enableAudioOffload causes things not to work properly on Pixel 6 Pro and perhaps more devices
I'll test on Pixel 6 Pro, but can I am wondering why you choose to enable this option. It is designed for power savings during long audio only playback with the screen off. Additionally only AAC and MP3 are supported and there are severe limitations on offload scheduling (you can't interact with the Player).
Offload playback is useless if you don't also enable offload scheduling with all its limitations. I could not find any usage of offload scheduling in your app.
Note that offload scheduling is still experimental.
from media.
I'll test on Pixel 6 Pro, but can I am wondering why you choose to enable this option. It is designed for power savings during long audio only playback with the screen off. Additionally only AAC and MP3 are supported and there are severe limitations on offload scheduling (you can't interact with the Player).
Because it says in the docs that this feature should be used to minimize battery consumption, in cases where audio should play with the screen off for longer durations. I linked to my app (both source and play store) in the original issue description and it is a radio/podcast app. I cannot think of a better match for the feature described. Additionally the streams, that I also linked in the original issue description, are pure AAC streams.
Offload playback is useless if you don't also enable offload scheduling with all its limitations. I could not find any usage of offload scheduling in your app.
Okay, I wasn't aware. The documentation on the matter is scarce at best. I wasn't able to find a sample, though the fact that audio playback behaved slightly differently with offloading enabled, led me to believe it was in fact working (playback was a few seconds delayed when being started for example).
Note that offload scheduling is still experimental.
I don't mind that :) love to be on the edge
from media.
Because it says in the docs that this feature should be used to minimize battery consumption, in cases where audio should play with the screen off for longer durations.
To clarify, it says: "Audio offload disables ExoPlayer audio processing, but significantly reduces the energy consumption of the playback when offload scheduling is enabled" [emphasis added]. Please refer to the linked offload scheduling doc that lists many restriction on how the player can be controlled when offload scheduling is enabled:
media/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/ExoPlayer.java
Lines 1564 to 1601 in 341bb57
One of the main current limitation of offload scheduling is that it is not compatible with the demo or the media-3/ExoPlayer current UI module as it accesses the player state without leaving offload scheduling.
Unfortunately, one can't simply enabling offload playback to gain battery power (though it is a state where we would like to be on the long term). The main issue is that because ExoPlayer internal thread doesn't run very often (to save battery), the shared state visible by the UI thread is only updated every ~1min. In theory it could be avoided by updating the state in the UI thread, but we are waiting to get more data on the power savings across the ecosystem before considering such architectural change.
from media.
Right, but from the user guide:
For long playbacks with the screen off, ExoPlayer’s audio offload mode needs to be used or ExoPlayer may consume significantly more power than MediaPlayer. Audio offload allows audio processing to be offloaded from the CPU to a dedicated signal processor.
Anyways I understand and I've also turned it off now as it seemed to break on Pixel 6 Pro. I don't use the ExoPlayer provided UI elements. Instead I've built player layout using compose and interact with the player through media3.
All of this is however not super important as users do not seem to be concerned about battery usage without offloading. It is however quite a big issue for us that it doesn't seem to work at all on Samsung Galaxy S21+. Unfortunately I don't have a device at hand. There is no chance the media3 team has one?
from media.
Hey @rhummelmose. We need more information to resolve this issue but there hasn't been an update in 14 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically.
If you have more information that will help us get to the bottom of this, just add a comment!
from media.
@google-oss-bot Thanks but I did provide information. I cannot provide more information without a device.
from media.
We are going to improve support for audio offload, but for now it is still experimental. We have known issues currently with offload, especially on track transition.
from media.
@krocard Totally understand. Main issue is that it doesn't work at all on S21+ (I am not using offload).
from media.
I checked with the app you mentioned on S21+ (Exynos). I can confirm that audio does not play reliably on S21+ (it is able to play rarely).
However, both the "demo" and "demo-session" apps are able to play both streams reliably on S21+.
I observed that your app goes to IDLE state instead of receiving timeline change event with correct duration, and remains stuck in this state. Your app works as expected on Pixel 3.
Since reference demo applications work reliably with your content on S21+, the issue appears to be in how your application has implemented its custom listener and state manager in Player.kt. This issue is not at all reproducible in reference demo app. I would recommend you to review the demo-session reference app again to try and identify the root-cause in your app.
@Krovad may recommend things to try, however following the reference as closely as possible would be the way to proceed to resolve this.
Thanks.
from media.
@umangsaini Okay, thanks. However quite hard for me to understand how it can be implemented incorrectly. It's super simple.
from media.
Thanks @umangsaini for carring the test!
@rhummelmose Given that the the demo app has no issue, it is highly likely that the problem comes from your app. Unfortunatly, we do not have the time to help you debug your app. Nevertheless, would you have any ExoPlayer specific question, feel free to open a new issue.
from media.
To anybody who might be coming here facing the same issue:
The problem was that I used flags 0 when I created the pending intent for the MediaLibrarySession.Builder. For reasons I cannot comprehend this causes a subset of newer Samsung devices to crash. Changing to PendingIntent.FLAG_IMMUTABLE instead of 0 fixed the issue.
See these changes for ref: https://github.com/denuafhaengige/duah-android/commit/535b67ec1d01b9dbf9bce48a9defd136e9402fc6#diff-646df2a2921af05d16df70df494cd94a6deb6af5cef4ee040dc8914c93aed41eR120-R125
from media.
Related Issues (20)
- App crash inside androidx.media3.common.Format$Builder.build method in Android/Amazon device OS version 5.1 HOT 3
- targetOffsetUs and DefaultLoadControl HOT 4
- PlayerView not appropriately sizing content to size of container HOT 6
- ordering of action buttons seems strange
- Does exoplayer support AFR(Auto frame rate) function HOT 3
- Does Exoplayer support Tag/Label for subtitles names inside of DASH .mpd manifest? HOT 3
- Notification is not showing with MediaStyle when trying to play videos in background HOT 2
- "No periods found. Downloading entire stream" for mp4 media HOT 1
- Support error & loading progress feedback to browser clients via MediaLibraryService HOT 1
- Feedback for Media3 Demo App - Improved Internet Handling HOT 1
- Play pause problem HOT 1
- Compile error with `The following Android dependencies are set to compileOnly which is not supported com.google.j2objc:j2objc-annotations:2.8` HOT 1
- Sometime I am getting error from exoplayer "Invalidate date format" HOT 1
- Offline download fails after started with HttpDataSourceException HOT 2
- "Usage not a subset." error log spammed 20 times per second. Only happens on certain device. HOT 3
- DashManifest playback results in IndexOutOfBoundsException
- How to calculate buffer ratio/ time for analytics purposes HOT 3
- Quality of PNG images is lost in a video created with Media3 Transformer and colors are darker HOT 7
- Issues with BT and FFMpeg extension HOT 5
- NullPointerException when setting mediaItem HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from media.