-
Notifications
You must be signed in to change notification settings - Fork 306
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
demo-session crashing when connected from "Media Controller Tester" #78
Comments
Thanks for reporting! I think this is because the see this commit also. |
Ok thanks. |
mmmh, still crashing the same way. I think the issue is because media/libraries/session/src/main/java/androidx/media3/session/MediaLibraryServiceLegacyStub.java Line 178 in 72a4fb0
|
Thanks for checking and the feedback. I think there are two issues. The first is the crash at connection time that you report and the second is that browsing the category tree isn't working. 1) Crash at connection to sessionWhen I test with API 27 with Android 13 (SP2A.220505.002) and T (TP1A.220519.003) I can succefully connect with the I see you reported the crash above for API 24 so I'm going to test with that API as well. Can you confirm this only happens on API 24? 2) Browsing not workingI noticed that with the When testing with UAMP that is using the legacy MediaSession still I get the same results (meaning I can not browse UAMP or Soundcloud but transport controls and metadata work). Can you browse your app with the |
Ok for the connection crash, it seems to only happens with API 24 and API 26 (probably lower API too) for the browsing issue, it seems to only works on API 28+ (even with onSubscribe implemented) I can browse my app, or the demo-session app with |
Can confirm that this issue is reproducible on all Samsungs with Samsung Experience ROM (pre-One UI, also SDK 24), and it directly happens if you try to connect a Is there any workaround of it at the moment? Production users are reporting about the issues on such devices, and there is Update: my bad, you actually can override both |
I can not repro the crash when using an emulator running Android 7/API 24. There is a bug in the media controller app that does not allow to browse the categories. Once this bug is fixed, I can connect to the session demo and navigate through the library. I can also start and pause playback of the current item and add a new item for playback when using the browser. I have file a pull request against the media controller app to fix this: googlesamples/android-media-controller#50 |
`MediaLibraryServiceLegacyStub` handles various edge cases by calling `result.sendError(null)` with the intention to send back an error to the legacy browser [1]. `MediaBrowserServiceCompat` of the legacy media1 Compat library has an inner base class `Result` that has a default implementation of `onErrorSent` that throws an `UnsupportedOperationException` [2]. However, most anonymous inner classes for `Result` created in `MediaBrowserServiceCompat` do not override `onErrorSent` [3]. Hence Media3 must not call `sendError` in these cases. Instead we call `sendResult(null)` according to what the default implementation of the callbacks in `MediaBrowserServiceCompat` do ([4] as an example). Issue: #78 Issue: #334 [1] https://github.com/androidx/media/blob/release/libraries/session/src/main/java/androidx/media3/session/MediaLibraryServiceLegacyStub.java#L200 [2] https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:media/media/src/main/java/androidx/media/MediaBrowserServiceCompat.java;l=872 [3] https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:media/media/src/main/java/androidx/media/MediaBrowserServiceCompat.java;l=578-604?q=MediaBrowserServiceCompat&ss=androidx [4] https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:media/media/src/main/java/androidx/media/MediaBrowserServiceCompat.java;l=1395 PiperOrigin-RevId: 551210137
`MediaLibraryServiceLegacyStub` handles various edge cases by calling `result.sendError(null)` with the intention to send back an error to the legacy browser [1]. `MediaBrowserServiceCompat` of the legacy media1 Compat library has an inner base class `Result` that has a default implementation of `onErrorSent` that throws an `UnsupportedOperationException` [2]. However, most anonymous inner classes for `Result` created in `MediaBrowserServiceCompat` do not override `onErrorSent` [3]. Hence Media3 must not call `sendError` in these cases. Instead we call `sendResult(null)` according to what the default implementation of the callbacks in `MediaBrowserServiceCompat` do ([4] as an example). Issue: #78 Issue: #334 [1] https://github.com/androidx/media/blob/release/libraries/session/src/main/java/androidx/media3/session/MediaLibraryServiceLegacyStub.java#L200 [2] https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:media/media/src/main/java/androidx/media/MediaBrowserServiceCompat.java;l=872 [3] https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:media/media/src/main/java/androidx/media/MediaBrowserServiceCompat.java;l=578-604?q=MediaBrowserServiceCompat&ss=androidx [4] https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:media/media/src/main/java/androidx/media/MediaBrowserServiceCompat.java;l=1395 PiperOrigin-RevId: 551210137 (cherry picked from commit 17ee527)
At the time of media3 1.0 release, the release announcement said that android-media-controller app would be updated within weeks for media3 support. Is that still on the radar? I really would like to poke at my controller pretty hard one of these days, including the media3-specific parts. |
@bubenheimer Thanks for the reminder! That's still on our radar and planned for the upcoming 1.4.0 release, sorry we didn't get around to publish the test app earlier. |
Issue: #78 PiperOrigin-RevId: 642277900
@bubenheimer The app is now published in f54991e |
Demo session sample app is crashing when conneced from https://github.com/googlesamples/android-media-controller
Tested against both release and main branches
Crash with Android API 24
On API 26 & 28 it doesn’t crash, but returns no results when browsing
Works with Android API 29 & 30
Step to reproduce
deploy both apps on device
launch media controller test app
click "control" on Media3 Session Demo in the list
The text was updated successfully, but these errors were encountered: