0

I've created an Android app using RenderScript, it works on a wide variety of systems but it seems to not run on specifically the Pixel 5.

I have tried to debug it with a real device but I cannot find the source of the issue. I get the following errors (yuv420888.so is my RS file):

Failed loading RS driver: dlopen failed: library "libRSDriver_adreno.so
Failed to load runtime libRSDriver_adreno.so, loading default
...
Unable to open shared library (/data/user_de/0/com.example.app/code_cache/com.android.renderscript.cache/librs.yuv420888.so): (null)

And then I get a larger stack of errors about some unimplemented method:

2022-01-26 11:49:30.190 4366-4972/com.example.app E/CameraCaptureSession: Session 0: Exception while stopping repeating: 
    android.hardware.camera2.CameraAccessException: CAMERA_ERROR (3): cancelRequest:459: Camera 0: Error clearing streaming request: Function not implemented (-38)
        at android.hardware.camera2.CameraManager.throwAsPublicException(CameraManager.java:1009)
        at android.hardware.camera2.impl.ICameraDeviceUserWrapper.cancelRequest(ICameraDeviceUserWrapper.java:99)
        at android.hardware.camera2.impl.CameraDeviceImpl.stopRepeating(CameraDeviceImpl.java:1251)
        at android.hardware.camera2.impl.CameraCaptureSessionImpl.close(CameraCaptureSessionImpl.java:578)
        at android.hardware.camera2.impl.CameraCaptureSessionImpl$2.onDisconnected(CameraCaptureSessionImpl.java:789)
        at android.hardware.camera2.impl.CameraDeviceImpl$7.run(CameraDeviceImpl.java:245)
        at android.os.Handler.handleCallback(Handler.java:938)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:223)
        at android.os.HandlerThread.run(HandlerThread.java:67)
     Caused by: android.os.ServiceSpecificException: cancelRequest:459: Camera 0: Error clearing streaming request: Function not implemented (-38) (code 10)
        at android.os.Parcel.createExceptionOrNull(Parcel.java:2387)
        at android.os.Parcel.createException(Parcel.java:2357)
        at android.os.Parcel.readException(Parcel.java:2340)
        at android.os.Parcel.readException(Parcel.java:2282)
        at android.hardware.camera2.ICameraDeviceUser$Stub$Proxy.cancelRequest(ICameraDeviceUser.java:732)
        at android.hardware.camera2.impl.ICameraDeviceUserWrapper.cancelRequest(ICameraDeviceUserWrapper.java:97)

For info:

Here are some random interesting settings from my gradle files:

classpath 'com.android.tools.build:gradle:3.3.3'
classpath 'com.google.gms:google-services:4.1.0'

...

multiDexEnabled 
renderscriptTargetApi 23
renderscriptSupportModeEnabled false

...

ndkVersion '20.1.5948944'

...

ndk {
  abiFilters "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
  moduleName "my_lib"
  ldLibs "log"
}

What could be the issue?

N3sh
  • 881
  • 8
  • 37
  • A couple of items: 1) RenderScript is deprecated (https://developer.android.com/guide/topics/renderscript/migrate), but that error/warning message is actually harmless. It just means that it is only CPU accelerated, not GPU accelerated. 2) The error is coming from camera2, more specifically relating to a missing function regarding cancelRequest(). Do you call any APIs that might make use of that? Is there a timeout in your code? To help simplify things, you might want to migrate off RS first, and see if the error still occurs. – Stephen Hines Jan 26 '22 at 17:54
  • Can I migrate from RS even with gradle 3.3.3? Anyway, I tried to search for `cancelRequest` and nothing shows up. – N3sh Jan 26 '22 at 19:35
  • Are you actually using RenderScript in your app? I don't understand why you think that the gradle version matters. You likely want to migrate away from RS, or at least stop running that code temporarily to see if it makes the issue go away. Are you using camera2? – Stephen Hines Jan 27 '22 at 00:06
  • Yeah, I'm using it to convert from YUV to RGB. I tried removing RS and it still shows the same issue. So far I only managed to remove the error when commenting out ` mCaptureSession.setRepeatingRequest(captureBuilder.build(), capturedFrameCallback, null);` – N3sh Jan 27 '22 at 09:44
  • I wonder if the issue is the underlying library... I'm trying to upgrade to build tools 32 and see – N3sh Jan 27 '22 at 10:56
  • Are you calling `stopRepeating()` or `abortCaptures()`? I'm definitely out of my knowledge on this area, but I suspect that one of those is the API that calls `cancelRequest()`. https://developer.android.com/reference/android/hardware/camera2/CameraCaptureSession#stopRepeating() says that it's only available starting in API level 21, so that's another possible reason why this might be misbehaving. What device are you running on (and what version of Android)? – Stephen Hines Jan 27 '22 at 16:54
  • Not calling any of those. It seems that they are called internally at the beginning when the camera service disconnects. This is happening only on a Pixel 5 with Android 11 (R) and using API level 30. – N3sh Jan 27 '22 at 18:16

0 Answers0