RenderHeads / UnityPlugin-AVProVideo

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

[Android] slot is not owned by the producer #1878

Open guillaumehf opened 1 month ago

guillaumehf commented 1 month ago

Hi

Problem description:

I play a media, first time everything looks good, then i close the media and reopen it, nothing shows up, and u get these errors : (looks like a surface reuse problem), it's not happening in the editor

2024/05/31 15:32:10.349 19863 19889 Info Unity PLAYER EVENT : Started, None 2024/05/31 15:32:10.349 19863 19889 Info Unity HYPKiosk.VideoPlayerManager:OnPlayerEvent_handler(MediaPlayer, EventType, ErrorCode) 2024/05/31 15:32:10.349 19863 19889 Info Unity UnityEngine.Events.UnityEvent`3:Invoke(T0, T1, T2) 2024/05/31 15:32:10.349 19863 19889 Info Unity RenderHeads.Media.AVProVideo.MediaPlayer:FireEventIfPossible(EventType, Boolean) 2024/05/31 15:32:10.349 19863 19889 Info Unity RenderHeads.Media.AVProVideo.MediaPlayer:HandleOneShotEvents() 2024/05/31 15:32:10.349 19863 19889 Info Unity RenderHeads.Media.AVProVideo.MediaPlayer:UpdateEvents() 2024/05/31 15:32:10.349 19863 19889 Info Unity RenderHeads.Media.AVProVideo.MediaPlayer:Update() 2024/05/31 15:32:10.349 19863 19889 Info Unity 2024/05/31 15:32:10.349 19863 20309 Error BufferQueueProducer SurfaceTexture-1-19863-1 detachBuffer: slot 30 is not owned by the producer (state = FREE) 2024/05/31 15:32:10.349 19863 20309 Error BufferQueueProducer SurfaceTexture-1-19863-1 detachBuffer: slot 31 is not owned by the producer (state = FREE) 2024/05/31 15:32:10.349 19863 20309 Error BufferQueueProducer SurfaceTexture-1-19863-1 detachBuffer: slot 32 is not owned by the producer (state = FREE) 2024/05/31 15:32:10.349 19863 20309 Error BufferQueueProducer SurfaceTexture-1-19863-1 detachBuffer: slot 33 is not owned by the producer (state = FREE) 2024/05/31 15:32:10.349 19863 20309 Error BufferQueueProducer SurfaceTexture-1-19863-1 detachBuffer: slot 34 is not owned by the producer (state = FREE) 2024/05/31 15:32:10.349 19863 20309 Error BufferQueueProducer SurfaceTexture-1-19863-1 detachBuffer: slot 35 is not owned by the producer (state = FREE) 2024/05/31 15:32:10.349 19863 20309 Error BufferQueueProducer SurfaceTexture-1-19863-1 detachBuffer: slot 36 is not owned by the producer (state = FREE) 2024/05/31 15:32:10.349 19863 20309 Error BufferQueueProducer SurfaceTexture-1-19863-1 detachBuffer: slot 37 is not owned by the producer (state = FREE) 2024/05/31 15:32:10.350 19863 20309 Error BufferQueueProducer SurfaceTexture-1-19863-1 detachBuffer: slot 38 is not owned by the producer (state = FREE) 2024/05/31 15:32:10.350 19863 20309 Error BufferQueueProducer SurfaceTexture-1-19863-1 detachBuffer: slot 39 is not owned by the producer (state = FREE) 2024/05/31 15:32:10.350 19863 20309 Error BufferQueueProducer SurfaceTexture-1-19863-1 detachBuffer: slot 40 is not owned by the producer (state = FREE) 2024/05/31 15:32:10.350 19863 20309 Error BufferQueueProducer SurfaceTexture-1-19863-1 detachBuffer: slot 41 is not owned by the producer (state = FREE) 2024/05/31 15:32:10.350 19863 20309 Error BufferQueueProducer SurfaceTexture-1-19863-1 detachBuffer: slot 42 is not owned by the producer (state = FREE) 2024/05/31 15:32:10.350 19863 20309 Error BufferQueueProducer SurfaceTexture-1-19863-1 detachBuffer: slot 43 is not owned by the producer (state = FREE) 2024/05/31 15:32:10.350 19863 20309 Error BufferQueueProducer SurfaceTexture-1-19863-1 detachBuffer: slot 44 is not owned by the producer (state = FREE) 2024/05/31 15:32:10.351 19863 20309 Error BufferQueueProducer SurfaceTexture-1-19863-1 detachBuffer: slot 45 is not owned by the producer (state = FREE) 2024/05/31 15:32:10.351 19863 20309 Error BufferQueueProducer SurfaceTexture-1-19863-1 detachBuffer: slot 46 is not owned by the producer (state = FREE) 2024/05/31 15:32:10.351 19863 20309 Error BufferQueueProducer SurfaceTexture-1-19863-1 detachBuffer: slot 47 is not owned by the producer (state = FREE) 2024/05/31 15:32:10.351 19863 20309 Error BufferQueueProducer SurfaceTexture-1-19863-1 detachBuffer: slot 48 is not owned by the producer (state = FREE) 2024/05/31 15:32:10.352 19863 20309 Error BufferQueueProducer SurfaceTexture-1-19863-1 detachBuffer: slot 49 is not owned by the producer (state = FREE) 2024/05/31 15:32:10.352 19863 20309 Error BufferQueueProducer SurfaceTexture-1-19863-1 detachBuffer: slot 50 is not owned by the producer (state = FREE) 2024/05/31 15:32:10.352 19863 20309 Error BufferQueueProducer SurfaceTexture-1-19863-1 detachBuffer: slot 51 is not owned by the producer (state = FREE) 2024/05/31 15:32:10.352 19863 20309 Error BufferQueueProducer SurfaceTexture-1-19863-1 detachBuffer: slot 52 is not owned by the producer (state = FREE) 2024/05/31 15:32:10.352 19863 20309 Error BufferQueueProducer SurfaceTexture-1-19863-1 detachBuffer: slot 53 is not owned by the producer (state = FREE) 2024/05/31 15:32:10.353 19863 20309 Error BufferQueueProducer SurfaceTexture-1-19863-1 detachBuffer: slot 54 is not owned by the producer (state = FREE) 2024/05/31 15:32:10.354 19863 20309 Error BufferQueueProducer SurfaceTexture-1-19863-1 detachBuffer: slot 55 is not owned by the producer (state = FREE) 2024/05/31 15:32:10.354 19863 20309 Error BufferQueueProducer SurfaceTexture-1-19863-1 detachBuffer: slot 56 is not owned by the producer (state = FREE) 2024/05/31 15:32:10.355 19863 20309 Error BufferQueueProducer SurfaceTexture-1-19863-1 detachBuffer: slot 57 is not owned by the producer (state = FREE) 2024/05/31 15:32:10.355 19863 20309 Error BufferQueueProducer SurfaceTexture-1-19863-1 detachBuffer: slot 58 is not owned by the producer (state = FREE) 2024/05/31 15:32:10.355 19863 20309 Error BufferQueueProducer SurfaceTexture-1-19863-1 detachBuffer: slot 59 is not owned by the producer (state = FREE) 2024/05/31 15:32:10.355 19863 20309 Error BufferQueueProducer SurfaceTexture-1-19863-1 detachBuffer: slot 60 is not owned by the producer (state = FREE) 2024/05/31 15:32:10.355 19863 20309 Error BufferQueueProducer SurfaceTexture-1-19863-1 detachBuffer: slot 61 is not owned by the producer (state = FREE) 2024/05/31 15:32:10.355 19863 20309 Error BufferQueueProducer SurfaceTexture-1-19863-1 detachBuffer: slot 62 is not owned by the producer (state = FREE) 2024/05/31 15:32:10.355 19863 20309 Error BufferQueueProducer SurfaceTexture-1-19863-1 detachBuffer: slot 63 is not owned by the producer (state = FREE)

Device (which devices are you having the issue with - model, OS version number):

Quest3, android level 32 targetted, OS v65, AVPro 3.0.1

Media (tell us about your videos - number of videos, resolution, codec, frame-rate, example URLs):

mkv top/bottom, 5120*5120 AVC, audio stereo

System Information:

AVPro Video: v3.0.1 (plugin v3.0.0f1-ultra) Target Platform: Android Unity: v2022.3.30f1 WindowsEditor OS: Desktop - Alienware Aurora R11 (Alienware) - Windows 11 (10.0.22631) 64bit - English CPU: Intel(R) Core(TM) i7-10700F CPU @ 2.90GHz - 16 threads - 32569KB GPU: NVIDIA GeForce RTX 3070 - NVIDIA - Direct3D 11.0 [level 11.1] - 8018KB - 16384

Chris-RH commented 1 month ago

That's not an error I recognise

  1. Can you provide a full logcat please, as I'm not seeing any AVPro-specific error messages
  2. Which version of Unity is it?
  3. Is it reproducible on other android devices?
  4. Is it reproducible using a new project and only running AVPro Video?
  5. Is this only occurring with this one video or different types?
  6. Are you streaming from a server or playing locally from the device?
Chris-RH commented 3 weeks ago

Hi, we can't help if you don't provide some more information, please.

  1. Can you provide a full logcat please, as I'm not seeing any AVPro-specific error messages
  2. Which version of Unity is it?
  3. Is it reproducible on other android devices?
  4. Is it reproducible using a new project and only running AVPro Video?
  5. Is this only occurring with this one video or different types?
  6. Are you streaming from a server or playing locally from the device?
Ste-RH commented 2 weeks ago

We will be closing this issue soon due to lack of response

Chris-RH commented 2 weeks ago

Closing due to lack of reply

guillaumehf commented 4 days ago

Hello, sorry for the delay.

I've had some time to investigate a bit. It seems my problem is due to the fact that a MediaPlayer is sending multiple FirstFrameReady events before the first frame is actually ready.

Calling player.TextureProducer.GetTexture( 0 ) returns a null texture until it doesn't. [EDIT] Looks like it's not happening the first time you open a media, but only when you load it again or change it.

What i can see in the logs : 2024/06/26 16:44:07.533 27232 27259 Info Unity [AVProVideo] Opening /storage/emulated/0/Android/data/com.hyperfiction.video/files/HFDatas/360/INVASION_TB3.mp4 (offset 0) with API ExoPlayer 2024/06/26 16:44:07.713 27232 27259 Info Unity >>>>>>> MediaPlayerEvent.EventType.FirstFrameReady _currentPlayer.TextureProducer.GetTexture( 0 ) : null 2024/06/26 16:44:07.739 27232 27259 Info Unity >>>>>>> MediaPlayerEvent.EventType.FirstFrameReady _currentPlayer.TextureProducer.GetTexture( 0 ) : null 2024/06/26 16:44:07.753 27232 27259 Info Unity >>>>>>> MediaPlayerEvent.EventType.FirstFrameReady _currentPlayer.TextureProducer.GetTexture( 0 ) : null 2024/06/26 16:44:07.766 27232 27259 Info Unity >>>>>>> MediaPlayerEvent.EventType.FirstFrameReady _currentPlayer.TextureProducer.GetTexture( 0 ) : null 2024/06/26 16:44:07.780 27232 27259 Info Unity >>>>>>> MediaPlayerEvent.EventType.FirstFrameReady _currentPlayer.TextureProducer.GetTexture( 0 ) : null 2024/06/26 16:44:07.795 27232 27259 Info Unity >>>>>>> MediaPlayerEvent.EventType.FirstFrameReady _currentPlayer.TextureProducer.GetTexture( 0 ) : null 2024/06/26 16:44:07.835 27232 27259 Info Unity >>>>>>> MediaPlayerEvent.EventType.FirstFrameReady _currentPlayer.TextureProducer.GetTexture( 0 ) : (UnityEngine.Texture2D)

guillaumehf commented 2 days ago

Hi, looks like the problem is a bit different with version 3.0.5 : the FirstFrameReady is fired only once, but Texture from de producer is null when opening a new media for the first time.