Forums - Cannot find DSP runtime on Samsung Tab S3

8 posts / 0 new
Last post
Cannot find DSP runtime on Samsung Tab S3
hzhang
Join Date: 23 Oct 17
Posts: 5
Posted: Mon, 2017-10-30 21:04

Hi,

I am tring to run models on Samsung Tab S3 by using SNPE 1.6.0. I made simple test applications (both native and Java) and followed the documentation instructions. Both CPU and GPU mode can run, but not the DSP mode. I also ran the example Android application, image-classifier, included in SNPE 1.6.0. Only the CPU and GPU runtime were found, which appear in the menu. 

But if I use snpe-net-run and manually put the files onto the device, following steps shown in the "Running the Inception v3 Model" tutorial, it can run and pick the DSP runtime. That is, only snpe-net-run can run on the DSP runtime. Why is it? Did I do something wrong?

Thanks, 

Best regards.

Harry

  • Up0
  • Down0
jesliger
Join Date: 6 Aug 13
Posts: 75
Posted: Thu, 2017-11-02 10:21

Hi Harry.  Thanks for trying out SNPE.  We have not tried the Galaxy Tab S3, but we've tried many other commercial devices.

The ability to run snpe-net-run using DSP, but not an APK, can be related to the permissions provided to APKs.  There is a file called public.libraries.txt in /vendor/ect (or just /etc) that is a list of libraries that APKs are allowed to use.  This file needs to contain libadsprpc.so in it.  If you could check that, it would be great.  If it doesn't have libadsprpc.so in there, then the DSP runtime won't be available.  If it *does* have libadsprpc.so, then we have to investigate further.

Also, if you could provide logcat output when using the APK, we could have a look.

We've had one other person have a similar issue with a different Android N device.  We are looking into it.  

Thanks

 

  • Up0
  • Down0
jesliger
Join Date: 6 Aug 13
Posts: 75
Posted: Thu, 2017-11-02 11:20

Ok we tried 1.6.0 on a OnePlus 5 running Android 7.1.1.  THe image-classifiers application that you build with SNPE SDK is able to detect the DSP runtime and use it.  /vendor/etc/public.libraries.txt contains libadsprpc.so on this device.  

So.. next step is for you to check /vendor/etc/public.libraries.txt and then provide logcats from your device please.

  • Up0
  • Down0
hzhang
Join Date: 23 Oct 17
Posts: 5
Posted: Thu, 2017-11-02 17:04

Thank you very much Jesliger,

I checked both the files in /vendor/etc/ and /etc/. It looks the lib is not in either of the lists. The content are as follows:

gts3lwifi:/ $ cat /etc/public.libraries.txt
libandroid.so
libc.so
libcamera2ndk.so
libdl.so
libEGL.so
libGLESv1_CM.so
libGLESv2.so
libGLESv3.so
libicui18n.so
libicuuc.so
libjnigraphics.so
liblog.so
libmediandk.so
libm.so
libOpenMAXAL.so
libOpenSLES.so
libRS.so
libstdc++.so
libvulkan.so
libwebviewchromium_plat_support.so
libz.so
 
gts3lwifi:/ $ cat /vendor/etc/public.libraries.txt
libAutoEnhance.so
libMcClient.so
libMcRegistry.so
libOpenCL.so
libOpenCv.so
libPhotoEnhance.so
libQjpeg.so
libSDKRecognitionText.so
libSEF.so
libSamsungPkcs11Wrapper.so
libSecMMCodec.so
lib_AnimationEngine_N.so 64
libandroid_ssrm.so
libapa_jni.so
libapex_jni.so
libexifa.so
libjack.so
libjpega.so
libknox_remotedesktopclient.so
libopensslsmime.so
libqti-perfd-client.so
libqti_performance.so
libquram.so
libquramagifencoder.so
libquramagifencoder_L.so
libremotedesktop_client.so
libsaiv.so
libsaiv_HprFace_FD_jni.so
libsaiv_HprFace_LD_jni.so
libsaiv_HprFace_utils_jni.so
libsaiv_nightshot.so
libsaiv_vision.so
libsechelper_engine.so
libsecimaging.so
libsecjpeginterface.so
libsecpkcs11_engine.so
libsecure_storage_jni.so
libsemcamera_jni.so
libsmart_cropping.so
libsomp.so
libsurfaceutil.so
libtlc_tz_ccm.so
libvideoeditor_N_zf.so 64
libvideoeditor_jni_N_zf.so 64
 
The logcat output is not attached since it is too long, but I will attach it if required.
 
My question is, can I work around it even the file is not in the list?
 
Thanks,
Best regards,
 
Harry 
 
  • Up0
  • Down0
jesliger
Join Date: 6 Aug 13
Posts: 75
Posted: Wed, 2017-11-15 20:00

Thanks for the reply.  We found the same issue on a Tab S3 that we have.  We have not solved this problem yet.  Device manufactures are free to configure public.libraries.txt any way they want.. and it can result in limitations as to what APKs can do.

One  possible way to work around this is to try bundling libadsprpc.so inside your APK.  It (libadsprpc.so) may have other dependencies that must be bundled as well.  You may have to pull these libraries from your device in order to bundle them. See this:   

https://www.google.ca/amp/s/ravindragv.wordpress.com/2017/01/30/android-n-and-shared-libraries/amp/

This is probably a non-sanctioned solution (ie. not google approved and not scalable.)

 

  • Up0
  • Down0
hzhang
Join Date: 23 Oct 17
Posts: 5
Posted: Sun, 2017-11-26 22:30

Thanks Jesliger,

I finally made it working by copying the libs as you mentioned. 

Greatly appreciate your help!

Harry

 

 

  • Up0
  • Down0
jesliger
Join Date: 6 Aug 13
Posts: 75
Posted: Tue, 2017-11-28 07:35

Glad you made some progress.  Please keep in mind my previous comment   "This is probably a non-sanctioned solution (ie. not google approved and not scalable.)"

In short : this solution is not guaranteed to work on other devices.  libadsprpc.so is a platform library that, in theory, could be different for every device.  

  • Up0
  • Down0
zhongjunzhang
Join Date: 23 Oct 18
Posts: 2
Posted: Fri, 2019-09-20 02:43

Hello Jesliger,

I have the same problem by using SNPE-1.30.0.480. SampleCode can run at DSP mode, but Android application can't (I also set ADSP_LIBRARY_PATH). Following is my jni native code:

  std::stringstream path;

  path << "/data/local/tmp/snpeexample/lib/dsp;/system/lib/rfsa/adsp;/system/vendor/lib/rfsa/adsp;/dsp";
  if (setenv("ADSP_LIBRARY_PATH", path.str().c_str(), 1 /*override*/) == 0) {
    VLOG(1) << "setenv success.\n" << param_.ToString();
  }
  param_ = param;
  zdl::DlSystem::Runtime_t runtime = zdl::DlSystem::Runtime_t::DSP;
  runtime = checkRuntime(runtime);
 
///checkRuntime function
zdl::DlSystem::Runtime_t checkRuntime(zdl::DlSystem::Runtime_t runtime)
{
    static zdl::DlSystem::Version_t Version = zdl::SNPE::SNPEFactory::getLibraryVersion();
 
    if (!zdl::SNPE::SNPEFactory::isRuntimeAvailable(runtime)) {
        __android_log_print(4, "STDOUT", "Selected runtime not present. Falling back to CPU.");
        runtime = zdl::DlSystem::Runtime_t::CPU;
    }
    return runtime;
}
 
///public.libraries.txt
1|sagit:/vendor/etc $ cat public.libraries.txt
libqti-perfd-client.so
libadsprpc.so
libcdsprpc.so
libsdsprpc.so
libqvrservice_client.so
libtzcom.so
libvraudio_client.so
libOpenCL.so
 
Looking forward to your reply, thanks.
 
 
 

 

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.