google / ExoPlayer

This project is deprecated and stale. The latest ExoPlayer code is available in https://github.com/androidx/media
https://developer.android.com/media/media3/exoplayer
Apache License 2.0
21.74k stars 6.03k forks source link

Issue when switching two surfaceview in sony bravia TV #8715

Open donchummar opened 3 years ago

donchummar commented 3 years ago

In my sample app i have feature to swap one full screen player and small PIP player above full screen player , when clicking on swap button i need to swap content each other. Each player is sitting in different fragment. When switching i am changing the constraint with animation TransitionManager.beginDelayedTransition(layout) . i am changing the elevation of fragment container to bring small player above big player on each swap operation. This is working fine when i set surface as textureview but i found that when i set surface as surfaceview , the small player which is shown above getting transparent on surface part. By setting setZOrderMediaOverlay true to small player it is fixed in other devices like Nvdea and MIBox but sony tv failed to pass with that fix.

i have changed the video renderer from OMX.MTK.VIDEO.DECODER.AVC to OMX.google.h264.decoder then its works but i cannot rely on software codec

any idea whats going on here ?

here is the sample code :

ExoPlayerTest.zip

android version : 9 exo-player version - 2.12.1

swap-surface

AquilesCanta commented 3 years ago

Thanks for the thorough description, and the repro steps.

any idea whats going on here ?

Everything seems to point at this being an issue with the sony device you are testing on.

The following steps I would suggest are:

AquilesCanta commented 3 years ago

Assigning @ojw28 for input on device-specific issues.

fgl27 commented 3 years ago

This is a related issue of https://github.com/google/ExoPlayer/issues/7999

Setting setZOrderMediaOverlay to false for the big view is recommended.

I didn't tested on that device, but I don't have any reports that it malfunctions on this app https://play.google.com/store/apps/details?id=com.fgl27.twitch and there is a lot of sony bravia devices using it.

Test it and let us know, the app uses latest version of ExoPlayer.

donchummar commented 3 years ago
  • As a workaround for sony tv devices, is it acceptable for you to use Texture view?

we are moving all the contents to drm protected asset with multiview so we eventually have to move to surfaceview

  • Report to the device manufacturer. I think we can help with this if you provide us with two videos captured on the device using adb shell screenrecord, which clearly show the expected and observed behavior.

attached video of how it behaves

this video is recored with adb but for some reason this video not showing the issue as actually visible in tv
https://user-images.githubusercontent.com/6000288/111228043-ad13a080-8637-11eb-9849-7971e5f57022.mp4

so i have recorded video with my mobile to see actual behaviour. attaching the same here

https://user-images.githubusercontent.com/6000288/111231123-d1be4700-863c-11eb-8807-848469a2eb10.mp4

one more thing to mention when we switch players with big and small , small player is able to move to big player but big player first rendered is failing to display in small player on further switch it behaves same.

  • Setting setZOrderMediaOverlay to false for the big view is recommended.

if you see the code i have provided i am doing that but does not help

the above app also has the same issue attaching the video here , you can see that video is loading and once starts its going behind the big player

https://user-images.githubusercontent.com/6000288/111231640-ba338e00-863d-11eb-810d-f41a949842a0.mp4

fgl27 commented 3 years ago

Sorry I didn't look at yours code, just the info from first post.

Very unfortunately and unexpected result, yes the HW codec seems to be the issue, didn't expect it on Android 9 maybe they are using very old codec libraries that they have ported from an old Android version, as I only see this type of issue on Android 7 and bellow that maybe the case.

Unfortunately no device seems to be properly test for a simple in app picture in picture feature, as I have encounter many singular devices issues when trying to use multiple player.

Unfortunately at least on my test even though textureview solves the issue of picture in picture, in most cases the image quality has a noticeable degradation, and some users have reported that isn't just a visual degradation but a performance one as is noticeable that some devices will drop frames playing content using textureview but when playing the same content on surfaceview they don't.

donchummar commented 3 years ago

Thanks for the update Another thing i found is which ever surface is rendered second is showing above other even if we set setZOrderMediaOverlay to false

Even i have seen noticeable frame-drops with textureview , so that can not be fix So how do i go about this to next level, do you report this to sony from your side or do i need to contact them. ?

fgl27 commented 3 years ago

I'm just a user of ExoPlayer trying to help as this is something that affect one of my projects, once the developers responsible for ExoPlayer have all the info and is determined that the manufacturer of the device need to take a look they will inform and reply back to you on what can be done.

Two sample of that here https://github.com/google/ExoPlayer/issues/8427 and https://github.com/google/ExoPlayer/issues/7998

fgl27 commented 3 years ago

Can this be checked when possible please.

Thank you