RenderHeads / UnityPlugin-AVProVideo

AVPro Video is a multi-platform Unity plugin for advanced video playback
https://www.renderheads.com/products/avpro-video/
238 stars 29 forks source link

[Android] Crash [libAVProVideo2Native.so] VulkanPlayer::update() #2079

Open IgorKubyshkin opened 5 days ago

IgorKubyshkin commented 5 days ago

Unity version

2022.3.32f1

Unity editor platform

Windows

AVPro Video edition

Core

AVPro Video version

3.1.2

Device hardware

realme 8i

Which Android OS version are you using?

13

Unity Graphics API

Vulkan

Video API

media3/ExoPlayer

Texture format

BGRA

Audio output

Unity

Any other Media Player component configuration required to reproduce the issue.

No response

Which output component(s) are you using?

No response

Any other component configuration required to reproduce the issue.

No response

The issue

At first, I noticed that my app crashes with this error from users in the google play console. Now I tried to test avpro on my device and also got this crash. I just run my test app and got it while video was playing. I can confirm that this error also happens in older versions of the plugin. It is not always reproduced. But it happens quite often, according to Google statistics

Media information

No response

Logcat output

2024.11.25 13:55:53.211 6186 6442 Error CRASH backtrace:
2024.11.25 13:55:53.211 6186 6442 Error CRASH       #00 pc 000000000005b428  /data/app/~~10fY_fg5OkGrLHK_erWn_Q==/com.testapp-w82kp-4JsZY5dV0XwFRMuw==/lib/arm64/libAVProVideo2Native.so (VulkanPlayer::update()+60) (BuildId: a3920f0d1dcf0efc9eefbed1ce8f656ae527368b)
2024.11.25 13:55:53.211 6186 6442 Error CRASH       #01 pc 000000000005a90c  /data/app/~~10fY_fg5OkGrLHK_erWn_Q==/com.testapp-w82kp-4JsZY5dV0XwFRMuw==/lib/arm64/libAVProVideo2Native.so (VulkanPlayerRenderer::updatePlayer(unsigned int)+60) (BuildId: a3920f0d1dcf0efc9eefbed1ce8f656ae527368b)
2024.11.25 13:55:53.211 6186 6442 Error CRASH       #02 pc 00000000008ff0a0  /data/app/~~10fY_fg5OkGrLHK_erWn_Q==/com.testapp-w82kp-4JsZY5dV0XwFRMuw==/lib/arm64/libunity.so (BuildId: bf3729b2db3d73b8)
2024.11.25 13:55:53.211 6186 6442 Error CRASH       #03 pc 00000000009ca090  /data/app/~~10fY_fg5OkGrLHK_erWn_Q==/com.testapp-w82kp-4JsZY5dV0XwFRMuw==/lib/arm64/libunity.so (BuildId: bf3729b2db3d73b8)
2024.11.25 13:55:53.212 6186 6442 Error CRASH       #04 pc 00000000009c2148  /data/app/~~10fY_fg5OkGrLHK_erWn_Q==/com.testapp-w82kp-4JsZY5dV0XwFRMuw==/lib/arm64/libunity.so (BuildId: bf3729b2db3d73b8)
2024.11.25 13:55:53.212 6186 6442 Error CRASH       #05 pc 00000000009c1e90  /data/app/~~10fY_fg5OkGrLHK_erWn_Q==/com.testapp-w82kp-4JsZY5dV0XwFRMuw==/lib/arm64/libunity.so (BuildId: bf3729b2db3d73b8)
2024.11.25 13:55:53.212 6186 6442 Error CRASH       #06 pc 00000000004c377c  /data/app/~~10fY_fg5OkGrLHK_erWn_Q==/com.testapp-w82kp-4JsZY5dV0XwFRMuw==/lib/arm64/libunity.so (BuildId: bf3729b2db3d73b8)
2024.11.25 13:55:53.212 6186 6442 Error CRASH       #07 pc 00000000000eb910  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+208) (BuildId: f74e738c3fdb73d042a4e80cb5479864)
2024.11.25 13:55:53.212 6186 6442 Error CRASH       #08 pc 000000000007e4c0  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: f74e738c3fdb73d042a4e80cb5479864)
Chris-RH commented 5 days ago

Is it reproducible in a new project running only AVPro Video demo scenes? Does it also occur when you change to OpenGLES? What is happening in the run up to the crash?

IgorKubyshkin commented 5 days ago

I have reproduced it only once in my test project. It is essentially empty, it contains only avpro. I didn't try to reproduce it in the demo scenes. I also don't see a similar OpenGLES error in the Google play console, vulkan only. The only thing I tried to do before the crash is happened to pause and unpause the app.

Chris-RH commented 5 days ago

So it doesn't happen every time you pause and unpause your app? Are there some devices on which this crash occurs more frequently?

IgorKubyshkin commented 5 days ago

Not every time. I pause/resume my test app several times. That's all I did after launching. I'm not sure if this is the cause of the error, because the crash occurred about 18 seconds later. In this interval, I did nothing.

IgorKubyshkin commented 5 days ago

I'm not sure what frequency will depend on the device. Because there are a lot of them in Google Crash Details 1

Ste-RH commented 5 days ago

What are the devices under 'others' ? Is it just the 'realme 8i', or are there more suffering this crash? We are looking for a way to link devices suffering the issue (likely by chipset/GPU).

IgorKubyshkin commented 5 days ago

I've sent the list of devices on unitysupport@renderheads.com

MorrisRH commented 4 days ago

What kind of video are you playing? (local mp4, remote mp4, HLS)

IgorKubyshkin commented 4 days ago

Mostly hls. In my test app it was https://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8

MorrisRH commented 4 days ago

I've been unable to reproduce this, however I think it's caused when a switch in variants in the HLS manifest occurs whilst the render thread update is running. I've added some checks for this which will make it into the next release.

IgorKubyshkin commented 4 days ago

Okay, waiting for release. Thanks

NieYanzhe commented 2 days ago

I have same crash @MorrisRH The crash is Occasional. Due to confidentiality reasons, I cannot provide the video file and engineering files.

Video format: H264 mp4

Crash Stack: ··· libAVProVideo2Native.so pc 000000000005b428 update (/Users/morris/RenderHeads/Dev/AVProVideo-v3/NativePlugins/Android/AVProVideo2/avp_library/src/main/cpp/VulkanPlayer.cpp:74 [Inline: hasUpdatedTexture]) (Other infos:operator bool /Users/morris/RenderHeads/Dev/AVProVideo-v3/NativePlugins/Android/AVProVideo2/avp_library/src/main/cpp/VulkanPlayer.h:197load /Users/morris/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/c++/v1/atomic/atomic_base.h:63__cxx_atomic_load /Users/morris/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/c++/v1/atomic/atomic_base.h:60__cxx_atomic_load /Users/morris/Library/Android/sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/c++/v1/__atomic/cxx_atomic_impl.h:349) [arm64-v8a] libAVProVideo2Native.so pc 000000000005a90c updatePlayer (/Users/morris/RenderHeads/Dev/AVProVideo-v3/NativePlugins/Android/AVProVideo2/avp_library/src/main/cpp/VulkanPlayerRenderer.cpp:139) [arm64-v8a] libunity.so pc 000000000091c620 GfxDeviceVK::InsertCustomMarkerCallbackAndDataWithFlags(void ()(int, void), int, CustomMarkerCallbackFlags, void, unsigned long) [arm64-v8a] libunity.so pc 0000000000a6c860 GfxDeviceWorker::RunCommand(ThreadedStreamBuffer&) [arm64-v8a] libunity.so pc 0000000000a648fc GfxDeviceWorker::RunExt(ThreadedStreamBuffer&) [arm64-v8a] libunity.so pc 0000000000a64644 GfxDeviceWorker::RunGfxDeviceWorker(void) [arm64-v8a] libunity.so pc 00000000003007ac Thread::RunThreadWrapper(void*) [arm64-v8a] /apex/com.android.runtime/lib64/bionic/libc.so pc 0000000000029fd4 [arm64-v8a] /apex/com.android.runtime/lib64/bionic/libc.so pc 000000000001c0f0 [arm64-v8a] ···

Crash Device List: vivo X Fold2 (V2266A) Android 14 Honor Magic V3 (FCP-AN10) Android 14 Honor Magic V (MGI-AN00) Android 14 Xiaomi 15 (24129PN74C) Android 15 iQOO 12 (V2307A) Android 14 Samsung Galaxy S21 (SM-G9910) Android 13

Unity Version: 2022.3.50f1 AVPro Version: 3.1.2 Ultra