Skip to content
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

[Android] [libAVProVideo2Native.so] VulkanPlayerRenderBuffer::render(PushConstants const&) #2099

Open
IgorKubyshkin opened this issue Dec 7, 2024 · 12 comments
Assignees
Labels
Android Android platform

Comments

@IgorKubyshkin
Copy link

Unity version

2022.3.32f1

Unity editor platform

Windows

AVPro Video edition

Core

AVPro Video version

3.1.2

Device hardware

asus ASUS_X01BDA

Which Android OS version are you using?

9

Unity Graphics API

Vulkan

Video API

MediaPlayer

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

It happens on Samsung only:

backtrace:
  #00  pc 0x00000000013b45c8  /vendor/lib64/hw/vulkan.samsung.so
  #01  pc 0x00000000013b3a9c  /vendor/lib64/hw/vulkan.samsung.so
  #02  pc 0x000000000002463c  /system/lib64/libvulkan.so (vulkan::api::(anonymous namespace)::UpdateDescriptorSets(VkDevice_T*, unsigned int, VkWriteDescriptorSet const*, unsigned int, VkCopyDescriptorSet const*)+176)
  #03  pc 0x000000000005efac  /data/app/~~hNPrZbucsYNGSW16oreEzQ==/com.apicways.mim-DtnL0pWnNNlA7KgODny7Ew==/lib/arm64/libAVProVideo2Native.so (VulkanPlayerRenderBuffer::render(PushConstants const&)+636) (BuildId: 72453cfae60caf4f40d72ff7cd9c6ee80cfa59e8)
  #04  pc 0x000000000005cfa4  /data/app/~~hNPrZbucsYNGSW16oreEzQ==/com.apicways.mim-DtnL0pWnNNlA7KgODny7Ew==/lib/arm64/libAVProVideo2Native.so (VulkanPlayer::Surface::render(AHardwareBufferPlayerSurface::Image*)+200) (BuildId: 72453cfae60caf4f40d72ff7cd9c6ee80cfa59e8)
  #05  pc 0x000000000005b7f0  /data/app/~~hNPrZbucsYNGSW16oreEzQ==/com.apicways.mim-DtnL0pWnNNlA7KgODny7Ew==/lib/arm64/libAVProVideo2Native.so (VulkanPlayer::Surface::update()+576) (BuildId: 72453cfae60caf4f40d72ff7cd9c6ee80cfa59e8)
  #06  pc 0x000000000005b3fc  /data/app/~~hNPrZbucsYNGSW16oreEzQ==/com.apicways.mim-DtnL0pWnNNlA7KgODny7Ew==/lib/arm64/libAVProVideo2Native.so (VulkanPlayer::update()+44) (BuildId: 72453cfae60caf4f40d72ff7cd9c6ee80cfa59e8)
  #07  pc 0x000000000005a8f0  /data/app/~~hNPrZbucsYNGSW16oreEzQ==/com.apicways.mim-DtnL0pWnNNlA7KgODny7Ew==/lib/arm64/libAVProVideo2Native.so (VulkanPlayerRenderer::updatePlayer(unsigned int)+60) (BuildId: 72453cfae60caf4f40d72ff7cd9c6ee80cfa59e8)
  #08  pc 0x0000000000b13a9c  /data/app/~~hNPrZbucsYNGSW16oreEzQ==/com.apicways.mim-DtnL0pWnNNlA7KgODny7Ew==/lib/arm64/libunity.so (BuildId: 464866facdae79ca)
  #09  pc 0x0000000000c48ebc  /data/app/~~hNPrZbucsYNGSW16oreEzQ==/com.apicways.mim-DtnL0pWnNNlA7KgODny7Ew==/lib/arm64/libunity.so (BuildId: 464866facdae79ca)
  #10  pc 0x0000000000c40f74  /data/app/~~hNPrZbucsYNGSW16oreEzQ==/com.apicways.mim-DtnL0pWnNNlA7KgODny7Ew==/lib/arm64/libunity.so (BuildId: 464866facdae79ca)
  #11  pc 0x0000000000c40cbc  /data/app/~~hNPrZbucsYNGSW16oreEzQ==/com.apicways.mim-DtnL0pWnNNlA7KgODny7Ew==/lib/arm64/libunity.so (BuildId: 464866facdae79ca)
  #12  pc 0x00000000005b0404  /data/app/~~hNPrZbucsYNGSW16oreEzQ==/com.apicways.mim-DtnL0pWnNNlA7KgODny7Ew==/lib/arm64/libunity.so (BuildId: 464866facdae79ca)
  #13  pc 0x00000000000bea28  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+208)
  #14  pc 0x000000000005b3b0  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64)

Media information

No response

Logcat output

No response

@IgorKubyshkin IgorKubyshkin added the triage Needs triage label Dec 7, 2024
@Chris-RH
Copy link
Contributor

Chris-RH commented Dec 9, 2024

Can we get a full, unfiltered logcat as well as the video asset you are playing please?
How are you loading the video asset? (local file? from streaming assets? off a server?)
Which Samsung devices have you tested this on?
Does it occur using OpenGLES?
Does it occur using Exoplayer?

@Chris-RH Chris-RH added Android Android platform and removed triage Needs triage labels Dec 9, 2024
@IgorKubyshkin
Copy link
Author

IgorKubyshkin commented Dec 10, 2024

This crash from users. Unfortunately I havn't a full log. In this case these videos are played from the server via the link to the mp4 file. I don't know if it occurs on OpenGLES. The error inside VulkanPlayer script I think this error is related only to Vulkan. I use MediaPlayer now.
Снимок

@Ste-RH
Copy link

Ste-RH commented Dec 10, 2024

What is your 'Graphics APIs' set to for your project?

image

@IgorKubyshkin
Copy link
Author

Auto Graphics API is checked

@Ste-RH
Copy link

Ste-RH commented Dec 10, 2024

We are seeing that older devices do not do so well with Vulkan.

We have code in the plugin to detect when Vulkan is simply not supported, and as long as OpenGLES3 is in your list of Graphics APIs then it will fall back and use OpenGLES3. This, however, I do not think you are seeing here. I think it is likely the former comment re older devices and Vulkan. If there is no pressing requirement to use Vulkan, can you not set your app to use OpenGLES3? This will mean better backward device compatibility.

@IgorKubyshkin
Copy link
Author

There are quite new devices I presented on screenshot. At least they still on sale. For example,
samsung b0s (Galaxy S22 Ultra) looks quite modern. Just switch off Vulkan is not the best thing we can to do I think. I admit that this is better for compatibility of older devices. But I'm not sure if this is the case.

@Ste-RH
Copy link

Ste-RH commented Dec 10, 2024

Is there a specific reason you are using the MediaPlayer API path rather than ExoPlayer?

Can we get a copy of the video asset you are seeing crash?

Any/all information will help us reproduce and then, hopefully, offer a fix.

@IgorKubyshkin
Copy link
Author

I think I will try to switch to ExoPlayer.
We have a lot of different videos on different servers and I'm not sure I have the right to give a link to one of them. And I don't know what specific video could help. If I had a similar Samsung, I would try it on a test project with a test video. But I don't have it

@Ste-RH
Copy link

Ste-RH commented Dec 10, 2024

Are all your videos HLS then? If so, do they all have adaptive variants? (a variety of streams with different resolutions in the main manifest)

@IgorKubyshkin
Copy link
Author

IgorKubyshkin commented Dec 10, 2024

In this moment I switch off HLS, becouse of this issue #2079.

Our videos have these settings:

#EXTM3U
#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=128000
MB128_proxy_128k/MB128_proxy_128k.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=256000
MB128_proxy_256k/MB128_proxy_256k.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=512000
MB128_proxy_512k/MB128_proxy_512k.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=1024000
MB128_proxy_1024k/MB128_proxy_1024k.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=2048000
MB128_proxy_2048k/MB128_proxy_2048k.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=4096000
MB128_proxy_4096k/MB128_proxy_4096k.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1, BANDWIDTH=8192000
MB128_proxy_8192k/MB128_proxy_8192k.m3u8
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:1
#EXT-X-MEDIA-SEQUENCE:0
#EXTINF:0.960000,
MB128_proxy_RU_4096k-0.ts
#EXTINF:1.440000,
MB128_proxy_RU_4096k-1.ts
#EXTINF:0.960000,
MB128_proxy_RU_4096k-2.ts
root /root/all_content/MB128_proxy_4096k #

and encoded like this:
/usr/local/bin/ffmpeg -i MB128_proxy.mp4 -c:v nvenc -pix_fmt yuv420p -preset medium -level 4.1 -pass 1 -a
n -f mp4 -y -b:v 8192k -vf scale=1920:-1 /dev/null

than:

ffmpeg -i MB128_proxy.mp4 -c:v nvenc -pix_fmt yuv420p -preset medium -level 4.1 -pass 2 -c
:a libfdk_aac -b:a 240k -f mp4 -movflags +faststart -y -b:v 8192k -vf scale=1920:-1 -af volume=3.8dB ipad/MB
128_proxy.mp4

@Ste-RH
Copy link

Ste-RH commented Dec 10, 2024

But the crashing has come when using HLS?

@IgorKubyshkin
Copy link
Author

Yes, it has. And it was also present on older versions of the plugin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Android Android platform
Projects
None yet
Development

No branches or pull requests

3 participants