On some devices, the SDK's native code which invokes RenderScript in order to handle a call to UvcFrame#yuy2ToBitmap() fails with the following errors:
The error Couldn't initialize dispatch table can be traced to this line in RenderScript.cpp of the AOSP codebase. That appears to indicate that this method, also in RenderScript.cpp is returning false, which in turn seems to indicate that the native library for RenderScript is failing to load.
Strangely, this only affects certain devices:
Known Devices Affected:
Moto G5
Moto G2
Galaxy S5
Known Devices Not Affected:
Moto G5 Plus
Nexus 5
Nexus 7 2013
Control Hub
Pixel 1 XL
Galaxy Note 8
Curiously, it was reported that even on these problematic devices, the Vuforia webcam sample worked without issue. This leads me to suspect (though I cannot verify since the C++ source for the native libraries in the SDK has not been released) that jni_frame.cpp does not invoke RenderScript to convert the YUY2 frames to RGB before delivering to Vuforia.
FYI - I was able to fix this issue in EasyOpenCV by using reflection to dump the raw framebuffer into a byte array and then using OpenCV to convert from YUY2 to RGB instead of using UvcFrame#yuy2ToBitmap().
This bug came to my attention through a bug report on my EasyOpenCV library.
On some devices, the SDK's native code which invokes RenderScript in order to handle a call to
UvcFrame#yuy2ToBitmap()
fails with the following errors:The error
Couldn't initialize dispatch table
can be traced to this line inRenderScript.cpp
of the AOSP codebase. That appears to indicate that this method, also inRenderScript.cpp
is returning false, which in turn seems to indicate that the native library for RenderScript is failing to load.Strangely, this only affects certain devices:
Known Devices Affected:
Known Devices Not Affected:
Curiously, it was reported that even on these problematic devices, the Vuforia webcam sample worked without issue. This leads me to suspect (though I cannot verify since the C++ source for the native libraries in the SDK has not been released) that
jni_frame.cpp
does not invoke RenderScript to convert the YUY2 frames to RGB before delivering to Vuforia.FYI - I was able to fix this issue in EasyOpenCV by using reflection to dump the raw framebuffer into a byte array and then using OpenCV to convert from YUY2 to RGB instead of using
UvcFrame#yuy2ToBitmap()
.