Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RenderScript: Unable to open shared library: (null)

I wrote a simple application that uses RenderScript to change the camera's preview. There were no issues with other devices except Honor 6X and Nexus 6p both with Android 7.0 where the camera preview only shows a black screen.

The error messages are as follows:

V/RenderScript: Successfully loaded runtime: libRSDriver_adreno.so
E/RenderScript: Unable to open shared library (/data/user_de/0/com.my.test/code_cache/com.android.renderscript.cache/librs.invert.so): (null)
V/RenderScript: Invoking /system/bin/bcc with args '/system/bin/bcc -unroll-runtime -scalarize-load-store -rs-global-info -rs-global-info-skip-constant -o invert -output_path /data/user_de/0/com.my.test/code_cache/com.android.renderscript.cache -bclib /system/lib/libclcore.bc -mtriple armv7-none-linux-gnueabi -O 3 -load libbccQTI.so -fPIC -embedRSInfo /data/user_de/0/com.my.test/code_cache/com.android.renderscript.cache/invert.bc -build-checksum abadcafe'
V/RenderScript: Invoking /system/bin/ld.mc with args '/system/bin/ld.mc -shared -nostdlib /system/lib/libcompiler_rt.so -mtriple=armv7-none-linux-gnueabi --library-path=/system/vendor/lib --library-path=/system/lib -lRSDriver_adreno -lm -lc /data/user_de/0/com.my.test/code_cache/com.android.renderscript.cache/invert.o -o /data/user_de/0/com.my.test/code_cache/com.android.renderscript.cache/librs.invert.so'

My RenderScript file is also the same as to: https://developer.android.com/guide/topics/renderscript/compute.html#writing-an-rs-kernel

#pragma version(1)
#pragma rs java_package_name(com.my.test)

uchar4 RS_KERNEL invert(uchar4 in, uint32_t x, uint32_t y) {
  uchar4 out = in;

  out.r = 255 - in.r;
  out.g = 255 - in.g;
  out.b = 255 - in.b;
  return out;
}

EDIT:

The camera preview only shows a black screen on the mentioned devices.

like image 758
Dhagz Avatar asked May 05 '26 03:05

Dhagz


1 Answers

This is not an issue with RenderScript rather with the Camera or my implementation, see Camera onPreviewFrame not called on some devices as I have found out that some devices do not call the onPreviewFrame which led to this issue.

like image 86
Dhagz Avatar answered May 06 '26 18:05

Dhagz



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!