I had an application for Gear VR that worked fine with a S8 with Android 7.0, i am trying to use it in another S8 with 8.0 but the applications crashes when i try to load a new scene with loadsceneasync using Unity 2018.1
If i use Unity 5.3.5 the application fails when the progress ended, but the new scene doesnt appear and the application crash. Using 2018 i try target api 8.0 (api 26), with 5.3.5 i set the androidmanifest.xml with target api 26, the same as with 2018. It is about the memory cause if i use a scene with a few textures using 5.3.5 it works, but if i use 2018 it doesnt work even if i set a few textures, it crashes very little later loadsceneasyc starts
In the Android log i get this error, after that i crashes
05-18 06:28:07.723 26838 26883 E Unity : allocation 0x0xc0000007 already registered @ ./Runtime/GfxDevice/opengles/DataBuffersGLES.cpp:l238 size 96; now calling from ./Runtime/GfxDevice/opengles/DataBuffersGLES.cpp:l238 size 96?
05-18 06:28:07.723 26838 26883 W Adreno-GSL: <gsl_ldd_control:541>: ioctl fd 84 code 0xc0140933 (IOCTL_KGSL_TIMESTAMP_EVENT) failed: errno 22 Invalid argument
05-18 06:28:07.723 26838 26883 W Adreno-GSL: <ioctl_kgsl_syncobj_create:3977>: (55, 11, 15208) fail 22 Invalid argument
Please submit a bug report and attach you project, along with full device details: Unity QA: Building quality with passion.
Feel free to post the case # here.
I debugged with Untiy 2018 and gives another error, it crashes just after i connect to server, when it reaches OnStartClient unet method it crashes, but it doesnt with 5.3
I get the error :
05-21 13:51:33.561 25769 26448 F libc : Fatal signal 7 (SIGBUS), code 1, fault addr 0xc28806fe in tid 26448 (UNET)
05-21 13:51:33.588 25769 26290 I TimeWarp: Tear: 0.009735
05-21 13:51:33.621 1554 5406 I WifiTrafficPoller: mCpuCoreBooster Lock
05-21 13:51:33.658 26450 26450 E propClient: PropClient failed to load
05-21 13:51:33.713 26451 26451 I crash_dump32: obtaining output fd from tombstoned
05-21 13:51:33.718 1104 1104 I /system/bin/tombstoned: received crash request for pid 25769
05-21 13:51:33.720 26451 26451 I crash_dump32: performing dump of process 25769 (target tid = 26448)
05-21 13:51:33.721 26451 26451 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
05-21 13:51:33.721 26451 26451 F DEBUG : Build fingerprint: âsamsung/dreamqlteue/dreamqlteue:8.0.0/R16NW/G950U1UEU3CRD4:user/release-keysâ
05-21 13:51:33.721 26451 26451 F DEBUG : Revision: â12â
05-21 13:51:33.721 26451 26451 F DEBUG : ABI: âarmâ
05-21 13:51:33.721 26451 26451 F DEBUG : pid: 25769, tid: 26448, name: UNET >>> <<<
05-21 13:51:33.721 26451 26451 F DEBUG : signal 7 (SIGBUS), code 1 (BUS_ADRALN), fault addr 0xc28806fe
05-21 13:51:33.721 26451 26451 F DEBUG : r0 c2880662 r1 c28806fe r2 00000652 r3 00000652
05-21 13:51:33.721 26451 26451 F DEBUG : r4 0000002a r5 000005aa r6 b6cd4d34 r7 c2880010
05-21 13:51:33.721 26451 26451 F DEBUG : r8 c4d03150 r9 b6cd4c40 sl b6d19590 fp b677f878
05-21 13:51:33.721 26451 26451 F DEBUG : ip c2880010 sp b677f830 lr cc895688 pc cc8956b8 cpsr 60010010
05-21 13:51:33.746 26451 26451 F DEBUG :
05-21 13:51:33.746 26451 26451 F DEBUG : backtrace:
05-21 13:51:33.746 26451 26451 F DEBUG : #00 pc 00d126b8 /data/app/-KVtf1gxrFVApSFQYY_SyAg==/lib/arm/libunity.so (_ZN4UNET27InterThreadCommunicationBusINS_16UnetMemoryBufferENS_12MessageQueueES2_NS_31MemoryBufferAllocatingBehaviourEE26ProducerForceSilentAcquireEi+148)
05-21 13:51:33.746 26451 26451 F DEBUG : #01 pc 00d04ee8 /data/app/-KVtf1gxrFVApSFQYY_SyAg==/lib/arm/libunity.so (_ZN4UNET17PacketDistributor9OnReceiveEPNS_4HostE+196)
05-21 13:51:33.746 26451 26451 F DEBUG : #02 pc 00d049c4 /data/app/-KVtf1gxrFVApSFQYY_SyAg==/lib/arm/libunity.so (_ZN4UNET7Reactor14DispatchSelectEv+540)
05-21 13:51:33.746 26451 26451 F DEBUG : #03 pc 00cfec04 /data/app/KVtf1gxrFVApSFQYY_SyAg==/lib/arm/libunity.so (_ZN4UNET7Reactor3RunEv+40)
05-21 13:51:33.746 26451 26451 F DEBUG : #04 pc 00d0468c /data/app/-KVtf1gxrFVApSFQYY_SyAg==/lib/arm/libunity.so (_ZN4UNET7Reactor10ThreadFuncEPv+16)
05-21 13:51:33.746 26451 26451 F DEBUG : #05 pc 00769c30 /data/app/-KVtf1gxrFVApSFQYY_SyAg==/lib/arm/libunity.so (_ZN6Thread16RunThreadWrapperEPv+84)
05-21 13:51:33.746 26451 26451 F DEBUG : #06 pc 00048e9f /system/lib/libc.so (_ZL15__pthread_startPv+22)
05-21 13:51:33.746 26451 26451 F DEBUG : #07 pc 0001b871 /system/lib/libc.so (__start_thread+32)
@dienat Iâm not going to say anything new
Please submit a bug report and attach you project, along with full device details: Unity QA: Building quality with passion.
Feel free to post the case # here.
Something like this happens on my Android 8.0 too when Iâm trying to use my coroutine for 8th time to analyze color of texture to count score like in Splatoon. I think the problem in InkPainter asset function Es.InkPainter.InkCanvas.GetPaintMainTexture().
The error says:
âAndroidPlayer(HTC_HTC_10@10.63.0.99) allocation 0x0xc00003e8 already registered @ /Users/builduser/buildslave/unity/build/Runtime/GfxDevice/opengles/DataBuffersGLES.cpp:l234 size 4096; now calling from /Users/builduser/buildslave/unity/build/Runtime/GfxDevice/opengles/DataBuffersGLES.cpp:l234 size 4096?â And there are like 300 similar to this error messages, then android device rebooted.
Same happens on my Android 6.0 tablet exactly in the same 8th run of coroutine.
In coroutine to optimize CPU usage of the phone I divided whole 4096x4096 map texture into 256 square pieces, than converted them to Texture2D from RenderTexture (mainTex) and analyzed color of pixels, skipping frames to avoid freezing the game.
Code of coroutine I call every 10 seconds:
public static bool analyzing = false;
public IEnumerator AnalyzeMainTexture()
{
analyzing = true;
mainTex = canvas.GetPaintMainTexture("Sample");
float analyzeStart = Time.time;
Texture2D[] tempTexes = new Texture2D[256];
int width = mainTex.width;
int height = mainTex.height;
int blockWidth = width / (int)Mathf.Sqrt(tempTexes.Length);
int blockHeight = height / (int)Mathf.Sqrt(tempTexes.Length);
int greenPixels = 0;
int redPixels = 0;
for(int i = 0; i < tempTexes.Length; i++)
{
RenderTexture.active = mainTex;
tempTexes[i] = new Texture2D(blockWidth, blockHeight);
tempTexes[i].ReadPixels(new Rect(i / (int)Mathf.Sqrt(tempTexes.Length) * blockWidth,
(i % (int)Mathf.Sqrt(tempTexes.Length)) * blockHeight, blockWidth, blockHeight), 0, 0, false);
for(int j = 0; j < blockWidth; j += 16)
{
for(int k = 0; k < blockHeight; k += 16)
{
Color pixelColor = tempTexes[i].GetPixel(j, k);
if(pixelColor == Color.green)
greenPixels++;
else if(pixelColor == Color.red)
redPixels++;
}
}
RenderTexture.active = null;
//if(i % 4 == 3)
yield return new WaitForEndOfFrame();
}
if(greenPixels + redPixels > 0)
{
greenTeamScore = 100 * greenPixels / (greenPixels + redPixels);
redTeamScore = 100 - greenTeamScore;
}
if(matchEnded)
RpcEndMatch();
//Debug.Log("Green: " + greenPixels);
//Debug.Log("Red: " + redPixels);
Debug.Log("AnalyzeTime: " + (Time.time - analyzeStart));
analyzing = false;
}
How to avoid this error messages? Is it possible on mobile device, which is of course doesnât have graphics card like PC? Most of the time game just exits without any messages, but I finally managed to track this sequence of errors via ADB.
Sorry if my English is bad, I hope you understood what I wanted to say.
@Werfire try allocating just one texture, reading to it once at the beginning of the coroutine, and then doing your analysis in blocks.
Reading back pixels is a very costly operation, and I donât think it matters much if you do it in blocks or read the whole texture back.
@aleksandrk But the reason why I divided texture to blocks is that Texture2D.ReadPixels from 4096x4096 texture makes game to freeze for nearly 0.3 secs even on PC. So I tried to divide ReadPixels by frames, but it seems like created a new problem with memory. For now I decided to just call this coroutine for once in the end of match, so the players wonât know current score and process of calculating result will be more intriguing. Thanks for reply though, I didnât even thought what problem can be in common ReadPixels and not in asset function.
ReadPixels make the CPU wait till the GPU finishes rendering everything till that point, which is super slow. Normally, the CPU doesnât have to wait for the GPU to finish in the middle of the frame. This is very likely the source of your problem.
To check, try lowering the resolution of your texture to e.g. 256x256 and measure the performance.