Renderscript support

2019-09-04 01:24发布

问题:

Does the GDK support Renderscript? I wanted to run some image processing algorithms on Glass's Camera. However, the process crashes with a SIGSEGVfault.

Here is the stack trace:

11-23 23:48:39.021: VERBOSE/RenderScript(1568): rsContextCreate dev=0x663468
11-23 23:48:39.021: VERBOSE/RenderScript(1568): 0x69a550 Launching thread(s), CPUs 2
11-23 23:48:39.060: VERBOSE/ScriptC(1568): Create script for resource = oilpaintingeffect
11-23 23:48:39.060: INFO/bcc(1568): LIBBCC build time: 2013/11/04 21:14:59
11-23 23:48:39.060: INFO/bcc(1568): LIBBCC build revision: 31e50d678d2a8aa28c6f38cccebfa3da2f78df4a modified (git)
11-23 23:48:39.100: DEBUG/StopWatch(1568): StopWatch calcFileSHA1 time (us): 37902
11-23 23:48:39.115: DEBUG/StopWatch(1568): StopWatch calcFileSHA1 time (us): 6469
11-23 23:48:39.115: WARN/bcc(1568): Unable to open /data/data/com.rahulrav.glass.posterize/cache/oilpaintingeffect.o in read mode.  (reason: No such file or directory)
11-23 23:48:39.264: ASSERT/libc(1568): Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1)
11-23 23:48:39.662: INFO/DEBUG(103): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
11-23 23:48:39.662: INFO/DEBUG(103): Build fingerprint: 'Google/glass_1/glass-1:4.0.4/XRT35/901188:user/release-keys'
11-23 23:48:39.662: INFO/DEBUG(103): pid: 1568, tid: 1603  >>> com.rahulrav.glass.posterize <<<
11-23 23:48:39.662: INFO/DEBUG(103): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr deadbaad
11-23 23:48:39.662: INFO/DEBUG(103): r0 deadbaad  r1 00000001  r2 40000000  r3 00000000
11-23 23:48:39.662: INFO/DEBUG(103): r4 00000000  r5 00000027  r6 59a3ca18  r7 fffff9ec
11-23 23:48:39.662: INFO/DEBUG(103): r8 00000002  r9 5c03c760  10 59a0fddc  fp 00000000
11-23 23:48:39.662: INFO/DEBUG(103): ip ffffffff  sp 5c03c710  lr 400e7051  pc 400e37d4  cpsr 60010030
11-23 23:48:39.662: INFO/DEBUG(103): d0  0a21646574726f62  d1  6e756f6620656c6d
11-23 23:48:39.662: INFO/DEBUG(103): d2  696c707061207970  d3  6874206f74207369
11-23 23:48:39.662: INFO/DEBUG(103): d4  0081c5300063b240  d5  007b0520007b0550
11-23 23:48:39.662: INFO/DEBUG(103): d6  007d31a0007ebef8  d7  007d3090007d3338
11-23 23:48:39.662: INFO/DEBUG(103): d8  0000000000000000  d9  0000000000000000
11-23 23:48:39.662: INFO/DEBUG(103): d10 0000000000000000  d11 0000000000000000
11-23 23:48:39.662: INFO/DEBUG(103): d12 0000000000000000  d13 0000000000000000
11-23 23:48:39.662: INFO/DEBUG(103): d14 0000000000000000  d15 0000000000000000
11-23 23:48:39.662: INFO/DEBUG(103): d16 0000000000000000  d17 8b8b8b8b8b8b8c8c
11-23 23:48:39.662: INFO/DEBUG(103): d18 8b8b8b8b8b8b8b8c  d19 8b8b8b8b8b8b8b8b
11-23 23:48:39.662: INFO/DEBUG(103): d20 8b8b8b8b8b8b8b8b  d21 8a8b8b8b8b8b8b8b
11-23 23:48:39.662: INFO/DEBUG(103): d22 8a8a8b8b8b8b8b8b  d23 8a8a8a8b8b8b8b8b
11-23 23:48:39.662: INFO/DEBUG(103): d24 0170017301760178  d25 016201640167016a
11-23 23:48:39.662: INFO/DEBUG(103): d26 016d017001730175  d27 015f016101640167
11-23 23:48:39.662: INFO/DEBUG(103): d28 016a016d01700172  d29 015c015e01610164
11-23 23:48:39.662: INFO/DEBUG(103): d30 0168016b016e0170  d31 015a015c015f0162
11-23 23:48:39.662: INFO/DEBUG(103): scr 88000013
11-23 23:48:39.943: INFO/PowerManagerService(191): Auto-brightness: light sensor = 4, brightness = 10 mHighestLightSensorValue: 5
11-23 23:48:40.100: INFO/DEBUG(103): #00  pc 000177d4  /system/lib/libc.so
11-23 23:48:40.107: INFO/DEBUG(103): #01  pc 00375e88  /system/lib/libbcc.so
11-23 23:48:40.107: INFO/DEBUG(103): #02  pc 0037bb32  /system/lib/libbcc.so
11-23 23:48:40.115: INFO/DEBUG(103): #03  pc 0036de06  /system/lib/libbcc.so (_ZN4llvm13FPPassManager13runOnFunctionERNS_8FunctionE)
11-23 23:48:40.115: INFO/DEBUG(103): #04  pc 0036de6a  /system/lib/libbcc.so (_ZN4llvm13FPPassManager11runOnModuleERNS_6ModuleE)
11-23 23:48:40.115: INFO/DEBUG(103): #05  pc 0036daf2  /system/lib/libbcc.so (_ZN4llvm13MPPassManager11runOnModuleERNS_6ModuleE)
11-23 23:48:40.123: INFO/DEBUG(103): #06  pc 0036dbca  /system/lib/libbcc.so (_ZN4llvm15PassManagerImpl3runERNS_6ModuleE)
11-23 23:48:40.123: INFO/DEBUG(103): #07  pc 0036dc98  /system/lib/libbcc.so (_ZN4llvm11PassManager3runERNS_6ModuleE)
11-23 23:48:40.131: INFO/DEBUG(103): #08  pc 00054b98  /system/lib/libbcc.so (_ZN3bcc8Compiler12runMCCodeGenEPN4llvm10TargetDataEPNS1_13TargetMachineE)
11-23 23:48:40.131: INFO/DEBUG(103): #09  pc 00055164  /system/lib/libbcc.so (_ZN3bcc8Compiler7compileEb)
11-23 23:48:40.131: INFO/DEBUG(103): #10  pc 00056676  /system/lib/libbcc.so (_ZN3bcc6Script15internalCompileEb)
11-23 23:48:40.139: INFO/DEBUG(103): #11  pc 00056e58  /system/lib/libbcc.so (_ZN3bcc6Script17prepareExecutableEPKcS2_m)
11-23 23:48:40.139: INFO/DEBUG(103): #12  pc 00053ab2  /system/lib/libbcc.so (bccPrepareExecutable)
11-23 23:48:40.139: INFO/DEBUG(103): #13  pc 0002c4ac  /system/lib/libRS.so (_Z13rsdScriptInitPKN7android12renderscript7ContextEPNS0_7ScriptCEPKcS7_PKhjj)
11-23 23:48:40.154: INFO/DEBUG(103): #14  pc 00029324  /system/lib/libRS.so (_ZN7android12renderscript7ScriptC11runCompilerEPNS0_7ContextEPKcS5_PKhj)
11-23 23:48:40.154: INFO/DEBUG(103): #15  pc 00029846  /system/lib/libRS.so (_ZN7android12renderscript17rsi_ScriptCCreateEPNS0_7ContextEPKcjS4_jS4_j)
11-23 23:48:40.154: INFO/DEBUG(103): #16  pc 00033ad8  /system/lib/libRS.so (_ZN7android12renderscript17rsp_ScriptCCreateEPNS0_7ContextEPKvj)
11-23 23:48:40.162: INFO/DEBUG(103): #17  pc 0002a8ae  /system/lib/libRS.so (_ZN7android12renderscript8ThreadIO16playCoreCommandsEPNS0_7ContextEby)
11-23 23:48:40.162: INFO/DEBUG(103): #18  pc 00022346  /system/lib/libRS.so (_ZN7android12renderscript7Context10threadProcEPv)
11-23 23:48:40.162: INFO/DEBUG(103): #19  pc 00012d90  /system/lib/libc.so (__thread_entry)
11-23 23:48:40.162: INFO/DEBUG(103): #20  pc 000128dc  /system/lib/libc.so (pthread_create)
11-23 23:48:40.170: INFO/DEBUG(103): code around pc:
11-23 23:48:40.170: INFO/DEBUG(103): 400e37b4 4623b15c 2c006824 e026d1fb b12368db  \.#F$h.,..&..h#.
11-23 23:48:40.170: INFO/DEBUG(103): 400e37c4 21014a17 6011447a 48124798 24002527  .J.!zD.`.G.H'%.$
11-23 23:48:40.170: INFO/DEBUG(103): 400e37d4 f7f47005 2106ef46 efe2f7f5 460aa901  .p..F..!.......F
11-23 23:48:40.170: INFO/DEBUG(103): 400e37e4 f04f2006 94015380 94029303 eb9ef7f5  . O..S..........
11-23 23:48:40.170: INFO/DEBUG(103): 400e37f4 4622a905 f7f52002 f7f4eba8 2106ef32  .."F. ......2..!
11-23 23:48:40.170: INFO/DEBUG(103): code around lr:
11-23 23:48:40.170: INFO/DEBUG(103): 400e7030 41f0e92d 46804c0c 447c2600 68a56824  -..A.L.F.&|D$h.h
11-23 23:48:40.170: INFO/DEBUG(103): 400e7040 e0076867 300cf9b5 dd022b00 47c04628  gh.....0.+..(F.G
11-23 23:48:40.170: INFO/DEBUG(103): 400e7050 35544306 37fff117 6824d5f4 d1ee2c00  .CT5...7..$h.,..
11-23 23:48:40.170: INFO/DEBUG(103): 400e7060 e8bd4630 bf0081f0 000284ce 41f0e92d  0F..........-..A
11-23 23:48:40.178: INFO/DEBUG(103): 400e7070 fb01b086 9004f602 461f4815 4615460c  .........H.F.F.F
11-23 23:48:40.178: INFO/DEBUG(103): memory map around addr deadbaad:
11-23 23:48:40.178: INFO/DEBUG(103): beaf7000-beb18000 [stack]
11-23 23:48:40.178: INFO/DEBUG(103): (no map for address)
11-23 23:48:40.178: INFO/DEBUG(103): ffff0000-ffff1000 [vectors]
11-23 23:48:40.178: INFO/DEBUG(103): stack:
11-23 23:48:40.178: INFO/DEBUG(103): 5c03c6d0  fffff9ec
11-23 23:48:40.178: INFO/DEBUG(103): 5c03c6d4  000000f1
11-23 23:48:40.178: INFO/DEBUG(103): 5c03c6d8  000000f1
11-23 23:48:40.178: INFO/DEBUG(103): 5c03c6dc  59a0fddc  /system/lib/libbcc.so
11-23 23:48:40.178: INFO/DEBUG(103): 5c03c6e0  4010f74c  /system/lib/libc.so
11-23 23:48:40.185: INFO/DEBUG(103): 5c03c6e4  4011484c
11-23 23:48:40.185: INFO/DEBUG(103): 5c03c6e8  00000000
11-23 23:48:40.185: INFO/DEBUG(103): 5c03c6ec  400e7051  /system/lib/libc.so
11-23 23:48:40.185: INFO/DEBUG(103): 5c03c6f0  00000000
11-23 23:48:40.185: INFO/DEBUG(103): 5c03c6f4  5c03c724
11-23 23:48:40.185: INFO/DEBUG(103): 5c03c6f8  59a3ca18
11-23 23:48:40.185: INFO/DEBUG(103): 5c03c6fc  fffff9ec
11-23 23:48:40.185: INFO/DEBUG(103): 5c03c700  00000002
11-23 23:48:40.193: INFO/DEBUG(103): 5c03c704  400e61bd  /system/lib/libc.so
11-23 23:48:40.193: INFO/DEBUG(103): 5c03c708  df0027ad
11-23 23:48:40.193: INFO/DEBUG(103): 5c03c70c  00000000
11-23 23:48:40.193: INFO/DEBUG(103): #00 5c03c710  000000f0
11-23 23:48:40.193: INFO/DEBUG(103): 5c03c714  00829038  [heap]
11-23 23:48:40.193: INFO/DEBUG(103): 5c03c718  00000000
11-23 23:48:40.193: INFO/DEBUG(103): 5c03c71c  59991685  /system/lib/libbcc.so
11-23 23:48:40.193: INFO/DEBUG(103): 5c03c720  00829128  [heap]
11-23 23:48:40.193: INFO/DEBUG(103): 5c03c724  fffffbdf
11-23 23:48:40.193: INFO/DEBUG(103): 5c03c728  59a3ca18
11-23 23:48:40.193: INFO/DEBUG(103): 5c03c72c  00829128  [heap]
11-23 23:48:40.193: INFO/DEBUG(103): 5c03c730  0083caac  [heap]
11-23 23:48:40.193: INFO/DEBUG(103): 5c03c734  5995ee8b  /system/lib/libbcc.so
11-23 23:48:40.193: INFO/DEBUG(103): #01 5c03c738  0083ca88  [heap]
11-23 23:48:40.193: INFO/DEBUG(103): 5c03c73c  0063b2f8  [heap]
11-23 23:48:40.193: INFO/DEBUG(103): 5c03c740  59a3c0b1
11-23 23:48:40.193: INFO/DEBUG(103): 5c03c744  59964b37  /system/lib/libbcc.so
11-23 23:48:41.068: ERROR/RenderScript(1568): RS watchdog timeout: 0
11-23 23:48:43.068: ERROR/RenderScript(1568): RS watchdog timeout: 0
11-23 23:48:44.248: DEBUG/PowerManagerService(191): setTimeoutLocked now=412115 when=415115 currentTimeoutOverride=-1 nextTimeoutOverride=-1 currentState=1 nextState=0
11-23 23:48:44.803: INFO/WindowManager(191): WIN DEATH: Window{418d0e40 com.rahulrav.glass.posterize/com.rahulrav.glass.posterize.PosterizeGlass paused=false}
11-23 23:48:44.803: INFO/ActivityManager(191): Process com.rahulrav.glass.posterize (pid 1568) has died.
11-23 23:48:44.803: WARN/ActivityManager(191): Force removing ActivityRecord{418dfa48 com.rahulrav.glass.posterize/.PosterizeGlass}: app died, no saved state

回答1:

There may be another problem with your code — this Renderscript tutorial works on Glass, so if you can investigate how that demo differs from your code, we might be able to track down the problem.



回答2:

I don't have a definite answer, but my RenderScript application failed on the Glass with a similar error: Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1).

I think the problem may be that the Glass filesystem doesn't allow for transferring object files (*.o). I get an error similar to your 'Unable to open /data/data/.../oilpaintingeffect.o in read mode. (reason: No such file or directory)'