-
Notifications
You must be signed in to change notification settings - Fork 29
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
Destroying MediaPlayer Gameobject stuck the main thread for over 20 seconds / Dolby not supported in ExoPlayer #1302
Comments
What version of AVPro Video are you using? What API Path are you using? Which device(s) have you seen this on? Can you send over a full logcat please? |
@zyfeng413 On Android, the MediaPlayer API opens/closes videos on a thread, and so should not hit the main thread much/at-all. This is unfortunately something we cannot do in the ExoPlayer API path currently. So, if you are not already using the MediPlayer API path, and can, it might be worth trying that. |
@Ste-RH AVPro Video - Ultra Edition v2.6.2 |
I would also try using ExoPlayer to see if it is different |
I see this log from main.txt |
Can you provide a link to the device? I am struggling to find it. When does the pause happen? During the GO destroy? Could you try to wind it back a little more sensibly? (wait for the open to fail, then call Dispose() on the media player before the GO destroy) It does feel like a driver or OS level issue with that device though - as you, us, other developers, are not seeing this issue on other devices. The IO logging you point at is not called directly by us in AVPro Video c# or plugin code - that is not to say we are not calling API level functions that do not call them. The MediaPlayer API path implementation in AVPro Video is threaded and so should not hit the main thread at all. |
I'm sorry that I can't provide the device link at present, because our company's car is still in the unmarketed stage. "UnityMain" prio=5 tid=24 Blocked
"Binder:20618_8" prio=5 tid=162 Native
|
It looks like something has called 'seek' (not evident as to what this is as the callstack does not show enough information, and that seek is locking the main thread? Because the 'close' calls the MediaPlayer 'reset()' on a Runnable/Thread model. I guess we are a bit stuck as the device you are having issue with is not available to us in any form! Even with the device in hand we could not promise to be able to address the issue. Though, it does appear to be limited to that device specifically? Is there anything 'special' about the version of Android on the device? Or the hardware used in the device? |
Is there any further information that you could provide? Is there anything 'special' about the version of Android on the device? Or the hardware used in the device? |
Any timeout is beyond the scope of AVPro Video as (both) the network calls are happening deep inside the Android SDK |
This bothered me so much that I tried switching the API Path to ExoPlayer, which won't stuck the main thread, but unfortunately doesn't support playing our Dolby videos. But I can play it using the official exoplayer demo. |
We will take a look to see if we can add support for the format you are using |
The ExoPlayer demo app reports back that 'audio tracks are present but not supported by this device'. Track info logged out is: EventLogger: tracks [eventTime=0.36, mediaPos=0.00, window=0, period=0 I am using a Xiaomi Mi 10T There is no reason I can see that, if the device supports eac3 then both ExoPlayer demo and AVPro Video would not play it back. I will try some more devices I have in hand to see if any of them support eac3 |
The only other device I have to hand the might play it is an Oculus Quest 2, and it does not - either in the ExoPlayer demo app or AVPro Video. Again, it says the audio track is unsupported. Maybe you could send over a full logcat of yo running the ExoPlayer demo app? You can email it over to unitysupport@renderheads.com if you wish to keep it private. |
I have consulted our colleagues in the system department, our system is Android10, and there are two modifications to the ExoPlayer demo to support audio. Here are the full logcat and code changes that play normally. |
Whilst we could, we have a policy to not change the core ExoPlayer code - so we cannot implement your custom changes. You will need to take them to ExoPlayer themselves to get support added. That aside, I was curious and so tried a version of ExoPlayer with your changes in. They do not work for me. Maybe because your code is looking for 12 channels, and the video you sent states it is 6.
|
This mimeType information is not entirely correct because it is Dolby ATMOS, the mime information is only referable, and the actual output channel in our system is 12 |
We did a couple of comparison tests:
Is there a way to fix this? |
As @Ste-RH mentioned, we could look into supporting Dolby video. |
Thank you so much for your support. Look forward to good news on further support. |
As previously stated. We have a policy of not adding to the core ExoPlayer code that we distribute with AVPro Video. It appears you need your custom code added to the ExoPlayer codebase in order for it to work. If your changes are generic, then you would be best advised to raise it on the ExoPlayer issues board, or create a pull request and add them into the codebase for review yourself. If your changes are custom, then I would think ExoPlayer will not entertain its inclusion, just as we will not at RenderHeads. There is a solutions though. You could build your own set of ExoPlayer libraries up with your changes and use those. The only change we make to the core codebase is changing the package name to 'com.google.android.exoplr2avp'. To find out what version of ExoPlayer your version of AVProVideo is using, you can filter your logcat to 'ExoPlayerLib'. |
Bit of housekeeping on this issue. Link to ExoPlayer issue: google/ExoPlayer#10701 |
The ExoPlayer dev team have made some changes to the library. This will naturally follow into AVPro Video when they next release a version of ExoPlayer and we integrate it into AVPro Video. Once @zyfeng413 confirms the changes fix the issue we will send over a new set of ExoPlayer libs for testing within AVPro Video to verify. |
Looks like there has been some code added to ExoPlayer v2.18.2 for this. We will update AVPro Video to use the latest release for ExoPlayer in our next release. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
AVPro v2.7.0 was updated to use ExoPlayer v2.18.2. Do let us know if this addresses your issue @zyfeng413 |
Any update @zyfeng413 ? |
I'm going to close this for now, as neither thread has had any contact from the OP for a while now. Please reopen if you still require assistance. |
When the network video is opened without network or the network is interrupted in the middle of playing the network video,
the main thread will be stuck for a long time when quitting the playing, The m_Video.Call("CloseVideo") interface was found to be stuck.How can I solve this problem? Thank you!
environment:
Unity 2020.3.30
Platform:
Android
The text was updated successfully, but these errors were encountered: