I also have the same problem and it’s driving me crazy. I am using quite large 360 video files, around 5gb per video and I’m running the app on an oculus go. When I reload a video 3 times in a short amount of time it crashes. Then I tried making a new videoplayer when I want to change a video and destroying the old one but now it just instantly crashes when I try to change the video. This is my adb logcat output:
09-11 02:05:01.696 22170 22487 I Unity : changed url
09-11 02:05:01.696 22170 22487 I Unity : UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
09-11 02:05:01.696 22170 22487 I Unity : UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
09-11 02:05:01.696 22170 22487 I Unity : UnityEngine.Logger:Log(LogType, Object)
09-11 02:05:01.696 22170 22487 I Unity : UnityEngine.Debug:Log(Object)
09-11 02:05:01.696 22170 22487 I Unity : WebServer:ListenerCallback(IAsyncResult) (at C:\Users\Felix\MyFirstGame\Assets\WebServer.cs:156)
09-11 02:05:01.696 22170 22487 I Unity : System.Net.ListenerAsyncResult:InvokeCallback(Object)
09-11 02:05:01.696 22170 22487 I Unity : System.Threading.QueueUserWorkItemCallback:System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
09-11 02:05:01.696 22170 22487 I Unity : System.Threading.ThreadPoolWorkQueue:smile:ispatch()
09-11 02:05:01.696 22170 22487 I Unity : System.Threading._ThreadPoolWaitCallback:PerformWaitCallback()
09-11 02:05:01.696 22170 22487 I Unity :
09-11 02:05:01.696 22170 22487 I Unity : (Filename: C Line: 0)
09-11 02:05:01.696 22170 22487 I Unity :
09-11 02:05:01.702 22170 22487 I Unity : started video3
09-11 02:05:01.702 22170 22487 I Unity : UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
09-11 02:05:01.702 22170 22487 I Unity : UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
09-11 02:05:01.702 22170 22487 I Unity : UnityEngine.Logger:Log(LogType, Object)
09-11 02:05:01.702 22170 22487 I Unity : UnityEngine.Debug:Log(Object)
09-11 02:05:01.702 22170 22487 I Unity : WebServer:ListenerCallback(IAsyncResult) (at C:\Users\Felix\MyFirstGame\Assets\WebServer.cs:159)
09-11 02:05:01.702 22170 22487 I Unity : System.Net.ListenerAsyncResult:InvokeCallback(Object)
09-11 02:05:01.702 22170 22487 I Unity : System.Threading.QueueUserWorkItemCallback:System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
09-11 02:05:01.702 22170 22487 I Unity : System.Threading.ThreadPoolWorkQueue:smile:ispatch()
09-11 02:05:01.702 22170 22487 I Unity : System.Threading._ThreadPoolWaitCallback:PerformWaitCallback()
09-11 02:05:01.702 22170 22487 I Unity :
09-11 02:05:01.702 22170 22487 I Unity : (Filename: C Line: 0)
09-11 02:05:01.702 22170 22487 I Unity :
09-11 02:05:01.738 22170 22185 I Unity : created new video player
09-11 02:05:01.738 22170 22185 I Unity : UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
09-11 02:05:01.738 22170 22185 I Unity : UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
09-11 02:05:01.738 22170 22185 I Unity : UnityEngine.Logger:Log(LogType, Object)
09-11 02:05:01.738 22170 22185 I Unity : UnityEngine.Debug:Log(Object)
09-11 02:05:01.738 22170 22185 I Unity : WebServer:Update() (at C:\Users\Felix\MyFirstGame\Assets\WebServer.cs:65)
09-11 02:05:01.738 22170 22185 I Unity :
09-11 02:05:01.738 22170 22185 I Unity : (Filename: C Line: 0)
09-11 02:05:01.738 22170 22185 I Unity :
09-11 02:05:01.752 22170 22236 D Unity : Unloading 4 Unused Serialized files (Serialized files now loaded: 0)
09-11 02:05:01.757 22170 22185 I Unity : changed url in main thread
09-11 02:05:01.757 22170 22185 I Unity : UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
09-11 02:05:01.757 22170 22185 I Unity : UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
09-11 02:05:01.757 22170 22185 I Unity : UnityEngine.Logger:Log(LogType, Object)
09-11 02:05:01.757 22170 22185 I Unity : UnityEngine.Debug:Log(Object)
09-11 02:05:01.757 22170 22185 I Unity : WebServer:Update() (at C:\Users\Felix\MyFirstGame\Assets\WebServer.cs:78)
09-11 02:05:01.757 22170 22185 I Unity :
09-11 02:05:01.757 22170 22185 I Unity : (Filename: C Line: 0)
09-11 02:05:01.757 22170 22185 I Unity :
09-11 02:05:01.780 592 2754 W ServiceManager: Permission failure: com.oma.drm.permission.ACCESS_OMA_DRM from uid=10182 pid=22170
09-11 02:05:01.782 22170 22185 D Unity : System memory in use before: 17.0 MB.
09-11 02:05:01.798 22170 22185 D Unity : System memory in use after: 17.1 MB.
09-11 02:05:01.798 22170 22185 D Unity :
09-11 02:05:01.798 22170 22185 D Unity : Unloading 3 unused Assets to reduce memory usage. Loaded Objects now: 742.
09-11 02:05:01.798 22170 22185 D Unity : Total: 16.163699 ms (FindLiveObjects: 0.871041 ms CreateObjectMapping: 0.125520 ms MarkObjects: 12.846407 ms DeleteObjects: 2.311198 ms)
09-11 02:05:01.798 22170 22185 D Unity :
09-11 02:05:01.859 596 2869 I OMX-VDEC-1080P: omx_vdec::component_deinit() complete
09-11 02:05:01.863 596 2869 I OMX-VDEC-1080P: Exit OMX vdec Destructor: fd=8
09-11 02:05:01.865 596 2869 I OMX-VDEC-1080P: Video slvp perflock released
09-11 02:05:01.892 592 2754 W ServiceManager: Permission failure: com.oma.drm.permission.ACCESS_OMA_DRM from uid=10182 pid=22170
09-11 02:05:01.901 592 592 W ServiceManager: Permission failure: com.oma.drm.permission.ACCESS_OMA_DRM from uid=10182 pid=22170
09-11 02:05:01.902 598 598 I ExtendedExtractor: QTIParser is prefered .. flags 0
09-11 02:05:01.906 598 598 D MMParserExtractor: setExtraFlags called with flags 0 for paser instance f5f2dd20
09-11 02:05:01.906 598 598 I ExtendedExtractor: ExtendedExtractor::create 0xf5f2dd20
09-11 02:05:01.942 598 2824 E MM_OSAL : Atom::Atom _success is false due to size < DEFAULT_ATOM_SIZE
09-11 02:05:01.971 598 2824 E MM_OSAL : Atom::Atom _success is false due to size < DEFAULT_ATOM_SIZE
09-11 02:05:02.030 31468 31875 I MediaPlayerService: MediaPlayerService::getOMX
09-11 02:05:02.031 22170 22491 I OMXClient: MuxOMX ctor
09-11 02:05:02.038 596 1517 I OMXMaster: makeComponentInstance(OMX.qcom.video.decoder.hevc) in mediacodec process
09-11 02:05:02.040 596 1517 I OMX-VDEC-1080P: Video slvp perflock acquired
09-11 02:05:02.042 596 1517 I OMX-VDEC-1080P: component_init: OMX.qcom.video.decoder.hevc : fd=8
09-11 02:05:02.056 596 1517 I OMX-VDEC-1080P: omx_vdec::component_init() success : fd=8
09-11 02:05:02.059 22170 22491 I ExtendedACodec: setupVideoDecoder()
09-11 02:05:02.059 22170 22491 I ExtendedACodec: vpp-enable search is 0 and value is 0
09-11 02:05:02.062 596 2843 E OMX-VDEC-1080P: Extension: OMX.google.android.index.storeANWBufferInMetadata not implemented
09-11 02:05:02.062 596 2843 E OMX-VDEC-1080P: Extension: OMX.google.android.index.configureVideoTunnelMode not implemented
09-11 02:05:02.062 596 2843 E OMX-VDEC-1080P: Extension: OMX.google.android.index.useAndroidNativeBuffer is supported
09-11 02:05:02.098 596 596 E C2DColorConvert: unknown format passed for luma alignment number
09-11 02:05:02.099 596 1517 E C2DColorConvert: unknown format passed for luma alignment number
09-11 02:05:02.100 596 2841 E C2DColorConvert: unknown format passed for luma alignment number
09-11 02:05:02.103 22170 22491 I ExtendedACodec: Decoder will be in frame by frame mode
09-11 02:05:02.108 596 2866 E C2DColorConvert: unknown format passed for luma alignment number
09-11 02:05:02.109 596 2869 E C2DColorConvert: unknown format passed for luma alignment number
09-11 02:05:02.111 596 1517 E OMXNodeInstance: getParameter(2540255:qcom.decoder.hevc, ??(0x7f000044)) ERROR: UnsupportedSetting(0x80001019)
09-11 02:05:02.185 596 2843 E C2DColorConvert: unknown format passed for luma alignment number
09-11 02:05:02.312 31467 917 W audio_hw_extn: audio_extn_snd_device_out_get_parameters: Error(22): audio usecase 1 returned NULL
09-11 02:05:02.466 22170 22230 I VrApi : FPS=31,Prd=32ms,Tear=0,Early=0,Stale=34,VSnc=1,Lat=1,Fov=0,CPU2/GPU=4/3,1593/401MHz,OC=F,TA=E/0/0,SP=F/N/N,Mem=1804MHz,Free=499MB,PSM=0,PLS=0,Temp=31.7C/25.0C,TW=1.82ms,App=16.04ms,GD=0.00ms,CPU&GPU=0.00ms,LCnt=1,GPU%=0.49,CPU%=0.84(W1.00),DSF=1.00
09-11 02:05:02.470 31468 31477 I MediaPlayerService: MediaPlayerService::getOMX
09-11 02:05:02.472 22170 22497 I OMXClient: MuxOMX ctor
09-11 02:05:02.475 596 596 I OMXMaster: makeComponentInstance(OMX.google.aac.decoder) in mediacodec process
09-11 02:05:02.519 596 22498 I SoftAAC2: Reconfiguring decoder: 0->48000 Hz, 0->2 channels
09-11 02:05:02.742 596 1517 E C2DColorConvert: unknown format passed for luma alignment number
09-11 02:05:02.743 596 747 E C2DColorConvert: unknown format passed for luma alignment number
09-11 02:05:02.746 596 2866 E OMXNodeInstance: getParameter(2540255:qcom.decoder.hevc, ??(0x7f000044)) ERROR: UnsupportedSetting(0x80001019)
09-11 02:05:02.780 596 2869 E C2DColorConvert: unknown format passed for luma alignment number
09-11 02:05:02.780 596 2869 E C2DColorConvert: unknown format passed for luma alignment number
09-11 02:05:03.406 572 572 I lowmemorykiller: Killing 'android.process.media' (22302), uid 10006, adj 900
09-11 02:05:03.406 572 572 I lowmemorykiller: to free 36392kB because cache 218936kB is below limit 221184kB for oom_adj 900
09-11 02:05:03.406 572 572 I lowmemorykiller: Free memory is 34792kB below reserved
09-11 02:05:03.446 31651 32011 I ActivityManager: Process android.process.media (pid 22302) has died
09-11 02:05:03.446 31651 32011 D ActivityManager: cleanUpApplicationRecord -- 22302
09-11 02:05:03.455 572 572 D LMKTelemetry: LMK telemetry stats: {"killed_task_adj":900,"killed_task_name":"android.process.media","killed_task_size_kbytes":36392,"killed_task_uid":10006,"os_cache_kbytes":218936,"os_cache_min_kbytes":221184,"os_min_adj":900,"os_prev_overcommit_kbytes":34792,"processes":"null\n","source":1,"zram_enabled":0}
09-11 02:05:03.460 31651 31700 W libprocessgroup: failed to open /acct/uid_10006/pid_22302/cgroup.procs: No such file or directory
09-11 02:05:03.516 22170 22230 I VrApi : FPS=30,Prd=36ms,Tear=0,Early=0,Stale=55,VSnc=1,Lat=1,Fov=0,CPU2/GPU=4/3,1593/401MHz,OC=F,TA=E/0/0,SP=F/N/N,Mem=1804MHz,Free=202MB,PSM=0,PLS=0,Temp=31.7C/25.0C,TW=1.71ms,App=3.43ms,GD=0.00ms,CPU&GPU=0.00ms,LCnt=1,GPU%=0.21,CPU%=0.97(W1.00),DSF=1.00
09-11 02:05:03.638 572 572 I lowmemorykiller: Killing 'com.oculus.micservice' (22262), uid 1000, adj 800
09-11 02:05:03.638 572 572 I lowmemorykiller: to free 27252kB because cache 125532kB is below limit 129024kB for oom_adj 300
09-11 02:05:03.638 572 572 I lowmemorykiller: Free memory is 32500kB below reserved
Obviously somehow the memory is instantly full and android starts klling off processes with lowmemory killer. The first error after sending the command is
09-11 02:05:01.942 598 2824 E MM_OSAL : Atom::Atom _success is false due to size < DEFAULT_ATOM_SIZE
09-11 02:05:01.971 598 2824 E MM_OSAL : Atom::Atom _success is false due to size < DEFAULT_ATOM_SIZE
that might have something to do with it but I have no idea. Does anybody know I can get this to work?
This is my code from the update method:
if (_stopped)
{
_videoPlayer.Stop();
_stopped = false; //reset variable
Destroy(_videoPlayer); //destroy old video player and create a new one below
gameObject.AddComponent<UnityEngine.Video.VideoPlayer>();
_videoPlayer = GetComponent<VideoPlayer>();
//set basic settings of the new videoplayer
_videoPlayer.enabled = true;
_videoPlayer.skipOnDrop = true;
_videoPlayer.renderMode = VideoRenderMode.RenderTexture;
_videoPlayer.targetTexture = Resources.Load<RenderTexture>("RT 360 Video");
_videoPlayer.aspectRatio = VideoAspectRatio.FitHorizontally;
_videoPlayer.audioOutputMode = VideoAudioOutputMode.Direct;
Debug.Log("created new video player");
Resources.UnloadUnusedAssets(); //manual garbage collection
GC.Collect();
}
if(_urlChanged && _url != "") {
_videoPlayer.url = _url;
_urlChanged = false;
_videoPlayer.Prepare();
Debug.Log("changed url in main thread");
}
I tried it with and without garbage collection, with and without preparing before playing the video. When using the same video player and just changing the url it crashes after 3 reloads as I already mentioned but with this code (trying to make a new videoplayer every time) it just crashes instantly when I reload the video.