googlesamples / arcore-depth-lab

ARCore Depth Lab is a set of Depth API samples that provides assets using depth for advanced geometry-aware features in AR interaction and rendering. (UIST 2020)
https://augmentedperception.github.io/depthlab/
Apache License 2.0
762 stars 152 forks source link

Point Cloud Example Crash when using Raw Depth #29

Closed petpetpeter closed 3 years ago

petpetpeter commented 3 years ago

The point cloud example built on the android device crash when pressing the update button to call ComputePointCloud() in PointCloudGenerator.cs

This example works fine without checking "Use Raw Depth" in the inspector

Branch : arcore_sdk_unity Unity Version: 2020.3.9f1 Device : pixel4a

ruofeidu commented 3 years ago

Thank you petpetpeter@ for reporting this bug! I don't have a Pixel 4a at hand; let me ask the team to see if this could be duplicated.

ruofeidu commented 3 years ago

If possible, would you please also comment with the crash log you have received or email me? Thanks!

petpetpeter commented 3 years ago
The crash log from adb shell here. Is this what you ask for?
05-25 12:45:40.386 8497 8520 E AndroidRuntime: FATAL EXCEPTION: UnityMain 05-25 12:45:40.386 8497 8520 E AndroidRuntime: Process: com.DefaultCompany.RealAR, PID: 8497 05-25 12:45:40.386 8497 8520 E AndroidRuntime: java.lang.Error: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 05-25 12:45:40.386 8497 8520 E AndroidRuntime: Version '2020.3.9f1 (108be757e447)', Build type 'Release', Scripting Backend 'il2cpp', CPU 'arm64-v8a' 05-25 12:45:40.386 8497 8520 E AndroidRuntime: Build fingerprint: 'google/sunfish/sunfish:11/RQ2A.210305.006/7119741:user/release-keys' 05-25 12:45:40.386 8497 8520 E AndroidRuntime: Revision: 'MP1.0' 05-25 12:45:40.386 8497 8520 E AndroidRuntime: ABI: 'arm64' 05-25 12:45:40.386 8497 8520 E AndroidRuntime: Timestamp: 2021-05-25 12:45:40+0900 05-25 12:45:40.386 8497 8520 E AndroidRuntime: pid: 8497, tid: 8520, name: UnityMain >>> com.DefaultCompany.RealAR <<< 05-25 12:45:40.386 8497 8520 E AndroidRuntime: uid: 10284 05-25 12:45:40.386 8497 8520 E AndroidRuntime: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0xffffffffed7ea3e0 05-25 12:45:40.386 8497 8520 E AndroidRuntime: x0 000000791a4e6020 x1 ffffffffed7ea3e0 x2 0000000000007080 x3 000000791a4e6020 05-25 12:45:40.386 8497 8520 E AndroidRuntime: x4 ffffffffed7f1460 x5 000000791a4ed0a0 x6 6564697274536c65 x7 0000007a8327d54c 05-25 12:45:40.386 8497 8520 E AndroidRuntime: x8 000000791a4e6000 x9 0000000000000000 x10 0000000000000001 x11 00000000ee6b2800 05-25 12:45:40.386 8497 8520 E AndroidRuntime: x12 0000000000000018 x13 00000c2adbb0e0c4 x14 0003b9e121b887e1 x15 00000000012fad66 05-25 12:45:40.386 8497 8520 E AndroidRuntime: x16 0000007a83f91b40 x17 0000007d7f7e62c0 x18 0000007a84012000 x19 000000791a4e6000 05-25 12:45:40.386 8497 8520 E AndroidRuntime: x20 ffffffffed7ea3e0 x21 000000792cb2e800 x22 0000007ad1413bb0 x23 0000007a83fdd210 05-25 12:45:40.386 8497 8520 E AndroidRuntime: x24 0000000000000000 x25 0000000000000000 x26 0000007a83fdcb80 x27 0000000000000000 05-25 12:45:40.386 8497 8520 E AndroidRuntime: x28 0000007a83fe2798 x29 0000007a8327d590 05-25 12:45:40.386 8497 8520 E AndroidRuntime: sp 0000007a8327d530 lr 0000007a83a239fc pc 0000007d7f7e6238 05-25 12:45:40.386 8497 8520 E AndroidRuntime: 05-25 12:45:40.386 8497 8520 E AndroidRuntime: backtrace: 05-25 12:45:40.386 8497 8520 E AndroidRuntime: #00 pc 000000000004a238 /apex/com.android.runtime/lib64/bionic/libc.so (__memcpy+232) (BuildId: 49090ae59e6ae37f8beae53c551820ad) 05-25 12:45:40.386 8497 8520 E AndroidRuntime: #01 pc 00000000007a09f8 /data/app/~~Gl_7nMTYZNetIM32bec3Og==/com.DefaultCompany.RealAR-HsKqf0CZDg3ST-y0i5Hvag==/lib/arm64/libil2cpp.so (BuildId: 2439d38b943124432d6a58642c3bb4d38dbbd326) 05-25 12:45:40.386 8497 8520 E AndroidRuntime: #02 pc 0000000000484514 /data/app/~~Gl_7nMTYZNetIM32bec3Og==/com.DefaultCompany.RealAR-HsKqf0CZDg3ST-y0i5Hvag==/lib/arm64/libil2cpp.so (BuildId: 2439d38b943124432d6a58642c3bb4d38dbbd326) 05-25 12:45:40.386 8497 8520 E AndroidRuntime: #03 pc 00000000006004dc /data/app/~~Gl_7nMTYZNetIM32bec3Og==/com.DefaultCompany.RealAR-HsKqf0CZDg3ST-y0i5Hvag==/lib/arm64/libil2cpp.so (BuildId: 2439d38b943124432d6a58642c3bb4d38dbbd326) 05-25 12:45:40.386 8497 8520 E AndroidRuntime: #04 pc 0000000000413e4c /data/app/~~Gl_7nMTYZNetIM32bec3Og==/com.DefaultCompany.RealAR-HsKqf0CZDg3ST-y0i5Hvag==/lib/arm64/libil2cpp.so (BuildId: 2439d38b943124432d6a58642c3bb4d38dbbd326) 05-25 12:45:40.386 8497 8520 E AndroidRuntime: #05 pc 0000000000447408 /data/app/~~Gl_7nMTYZNetIM32bec3Og==/com.DefaultCompany.RealAR-HsKqf0CZDg3ST-y0i5Hvag==/lib/arm64/libil2cpp.so (BuildId: 2439d38b943124432d6a58642c3bb4d38dbbd326) 05-25 12:45:40.386 8497 8520 E AndroidRuntime: #06 pc 0000000000447a7c /data/app/~~Gl_7nMTYZNetIM32bec3Og==/com.DefaultCompany.RealAR-HsKqf0CZDg3ST-y0i5Hvag==/lib/arm64/libil2cpp.so (BuildId: 2439d38b943124432d6a58642c3bb4d38dbbd326) 05-25 12:45:40.386 8497 8520 E AndroidRuntime: #07 pc 00000000007c8a50 /data/app/~~Gl_7nMTYZNetIM32bec3Og==/com.DefaultCompany.RealAR-HsKqf0CZDg3ST-y0i5Hvag==/lib/arm64/libil2cpp.so (BuildId: 2439d38b943124432d6a58642c3bb4d38dbbd326) 05-25 12:45:40.386 8497 8520 E AndroidRuntime: #08 pc 000000000079ce4c /data/app/~~Gl_7nMTYZNetIM32bec3Og==/com.DefaultCompany.RealAR-HsKqf0CZDg3ST-y0i5Hvag==/lib/arm64/libil2cpp.so (BuildId: 2439d38b943124432d6a58642c3bb4d38dbbd326) 05-25 12:45:40.386 8497 8520 E AndroidRuntime: #09 pc 0000000000881ff4 /data/app/~~Gl_7nMTYZNetIM32bec3Og==/com.DefaultCompany.RealAR-HsKqf0CZDg3ST-y0i5Hvag==/lib/arm64/libil2cpp.so (BuildId: 2439d38b943124432d6a58642c3bb4d38dbbd326) 05-25 12:45:40.386 8497 8520 E AndroidRuntime: #10 pc 00000000008815a0 /data/app/~~Gl_7nMTYZNetIM32bec3Og==/com.DefaultCompany.RealAR-HsKqf0CZDg3ST-y0i5Hvag==/lib/arm64/libil2cpp.so (BuildId: 2439d38b943124432d6a58642c3bb4d38dbbd326) 05-25 12:45:40.386 8497 8520 E AndroidRuntime: #11 pc 00000000008812d4 /data/app/~~Gl_7nMTYZNetIM32bec3Og==/com.DefaultCompany.RealAR-HsKqf0CZDg3ST-y0i5Hvag==/lib/arm64/libil2cpp.so (BuildId: 2439d38b943124432d6a58642c3bb4d38dbbd326) 05-25 12:45:40.386 8497 8520 E AndroidRuntime: #12 pc 0000000000239378 /data/app/~~Gl_7nMTYZNetIM32bec3Og==/com.DefaultCompany.RealAR-HsKqf0CZDg3ST-y0i5Hvag==/lib/arm64/libil2cpp.so (BuildId: 2439d38b943124432d6a58642c3bb4d38dbbd326) 05-25 12:45:40.386 8497 8520 E AndroidRuntime: #13 pc 00000000002e574c /data/app/~~Gl_7nMTYZNetIM32bec3Og==/com.DefaultCompany.RealAR-HsKqf0CZDg3ST-y0i5Hvag==/lib/arm64/libil2cpp.so (BuildId: 2439d38b943124432d6a58642c3bb4d38dbbd326) 05-25 12:45:40.386 8497 8520 E AndroidRuntime: #14 pc 0000000000294324 /data/app/~~Gl_7nMTYZNetIM32bec3Og==/com.DefaultCompany.RealAR-HsKqf0CZDg3ST-y0i5Hvag==/lib/arm64/libunity.so (BuildId: 26880a4a88b54d8d0cc3c44dfa4bafead6a80f28) 05-25 12:45:40.386 8497 8520 E AndroidRuntime: #15 pc 00000000002a28a0 /data/app/~~Gl_7nMTYZNetIM32bec3Og==/com.DefaultCompany.RealAR-HsKqf0CZDg3ST-y0i5Hvag==/lib/arm64/libunity.so (BuildId: 26880a4a88b54d8d0cc3c44dfa4bafead6a80f28) 05-25 12:45:40.386 8497 8520 E AndroidRuntime: #16 pc 00000000002add78 /data/app/~~Gl_7nMTYZNetIM32bec3Og==/com.DefaultCompany.RealAR-HsKqf0CZDg3ST-y0i5Hvag==/lib/arm64/libunity.so (BuildId: 26880a4a88b54d8d0cc3c44dfa4bafead6a80f28) 05-25 12:45:40.386 8497 8520 E AndroidRuntime: #17 pc 0000000000185880 /data/app/~~Gl_7nMTYZNetIM32bec3Og==/com.DefaultCompany.RealAR-HsKqf0CZDg3ST-y0i5Hvag==/lib/arm64/libunity.so (BuildId: 26880a4a88b54d8d0cc3c44dfa4bafead6a80f28) 05-25 12:45:40.386 8497 8520 E AndroidRuntime: #18 pc 00000000001fa83c /data/app/~~Gl_7nMTYZNetIM32bec3Og==/com.DefaultCompany.RealAR-HsKqf0CZDg3ST-y0i5Hvag==/lib/arm64/libunity.so (BuildId: 26880a4a88b54d8d0cc3c44dfa4bafead6a80f28) 05-25 12:45:40.386 8497 8520 E AndroidRuntime: #19 pc 00000000001fa870 /data/app/~~Gl_7nMTYZNetIM32bec3Og==/com.DefaultCompany.RealAR-HsKqf0CZDg3ST-y0i5Hvag==/lib/arm64/libunity.so (BuildId: 26880a4a88b54d8d0cc3c44dfa4bafead6a80f28) 05-25 12:45:40.386 8497 8520 E AndroidRuntime: #20 pc 00000000001faab4 /data/app/~~Gl_7nMTYZNetIM32bec3Og==/com.DefaultCompany.RealAR-HsKqf0CZDg3ST-y0i5Hvag==/lib/arm64/libunity.so (BuildId: 26880a4a88b54d8d0cc3c44dfa4bafead6a80f28) 05-25 12:45:40.386 8497 8520 E AndroidRuntime: #21 pc 000000000030ee88 /data/app/~~Gl_7nMTYZNetIM32bec3Og==/com.DefaultCompany.RealAR-HsKqf0CZDg3ST-y0i5Hvag==/lib/arm64/libunity.so (BuildId: 26880a4a88b54d8d0cc3c44dfa4bafead6a80f28) 05-25 12:45:40.386 8497 8520 E AndroidRuntime: #22 pc 0000000000323918 /data/app/~~Gl_7nMTYZNetIM32bec3Og==/com.DefaultCompany.RealAR-HsKqf0CZDg3ST-y0i5Hvag==/lib/arm64/libunity.so (BuildId: 26880a4a88b54d8d0cc3c44dfa4bafead6a80f28) 05-25 12:45:40.386 8497 8520 E AndroidRuntime: #23 pc 000000000000838c /data/app/~~Gl_7nMTYZNetIM32bec3Og==/com.DefaultCompany.RealAR-HsKqf0CZDg3ST-y0i5Hvag==/oat/arm64/base.odex 05-25 12:45:40.386 8497 8520 E AndroidRuntime: 05-25 12:45:40.386 8497 8520 E AndroidRuntime: at libc.__memcpy(__memcpy:232) 05-25 12:45:40.386 8497 8520 E AndroidRuntime: at libil2cpp.0x7a09f8(Native Method) 05-25 12:45:40.386 8497 8520 E AndroidRuntime: at libil2cpp.0x484514(Native Method) 05-25 12:45:40.386 8497 8520 E AndroidRuntime: at libil2cpp.0x6004dc(Native Method) 05-25 12:45:40.386 8497 8520 E AndroidRuntime: at libil2cpp.0x413e4c(Native Method) 05-25 12:45:40.386 8497 8520 E AndroidRuntime: at libil2cpp.0x447408(Native Method) 05-25 12:45:40.386 8497 8520 E AndroidRuntime: at libil2cpp.0x447a7c(Native Method) 05-25 12:45:40.386 8497 8520 E AndroidRuntime: at libil2cpp.0x7c8a50(Native Method) 05-25 12:45:40.386 8497 8520 E AndroidRuntime: at libil2cpp.0x79ce4c(Native Method) 05-25 12:45:40.386 8497 8520 E AndroidRuntime: at libil2cpp.0x881ff4(Native Method) 05-25 12:45:40.386 8497 8520 E AndroidRuntime: at libil2cpp.0x8815a0(Native Method) 05-25 12:45:40.386 8497 8520 E AndroidRuntime: at libil2cpp.0x8812d4(Native Method) 05-25 12:45:40.386 8497 8520 E AndroidRuntime: at libil2cpp.0x239378(Native Method) 05-25 12:45:40.386 8497 8520 E AndroidRuntime: at libil2cpp.0x2e574c(Native Method) 05-25 12:45:40.386 8497 8520 E AndroidRuntime: at libunity.0x294324(Native Method) 05-25 12:45:40.386 8497 8520 E AndroidRuntime: at libunity.0x2a28a0(Native Method) 05-25 12:45:40.386 8497 8520 E AndroidRuntime: at libunity.0x2add78(Native Method) 05-25 12:45:40.386 8497 8520 E AndroidRuntime: at libunity.0x185880(Native Method) 05-25 12:45:40.386 8497 8520 E AndroidRuntime: at libunity.0x1fa83c(Native Method) 05-25 12:45:40.386 8497 8520 E AndroidRuntime: at libunity.0x1fa870(Native Method) 05-25 12:45:40.386 8497 8520 E AndroidRuntime: at libunity.0x1faab4(Native Method) 05-25 12:45:40.386 8497 8520 E AndroidRuntime: at libunity.0x30ee88(Native Method) 05-25 12:45:40.386 8497 8520 E AndroidRuntime: at libunity.0x323918(Native Method) 05-25 12:45:40.386 8497 8520 E AndroidRuntime: at base.0x838c(Native Method)

P.S. I also try on Xiao Mi9 and found the same problem.

reneschulte commented 3 years ago

For me it's not crashing but running very slow. The code looks very inefficient iterating over all pixels and masking them out. Why not in the shader? Anyhow, I guess it's a performance issue bringing down the UI thread.

petpetpeter commented 3 years ago

For me it's not crashing but running very slow. The code looks very inefficient iterating over all pixels and masking them out. Why not in the shader? Anyhow, I guess it's a performance issue bringing down the UI thread.

I also think that might be the problem. Unfortunately, I don't have a more powerful phone to test. I take a look at RawPointCloudBelender.cs where the point cloud array is buffered. Using the UpdateRawPointCloud() function seems good on my device.

I change the color source to ColorRampGenerator similar to ComputePointCloud()

Here is the result
reneschulte commented 3 years ago

I change the color source to ColorRampGenerator similar to ComputePointCloud()

Very nice. Can you share the edits? Maybe in a PR?

ruofeidu commented 3 years ago

I am glad to see you guys are making progress here. Sorry that I don't have enough bandwidth to test on every phone and the code example was only written in an efficient way. I am happy to take your PRs and merge the codebase :)

petpetpeter commented 3 years ago

I have made a PR on this topic so I think we can close this issue now. Thank you for your help.

ruofeidu commented 3 years ago

Thank you! I'll try to review and merge in the next few days! Happy weekends!