Could not load /vendor/lib/hw/android.hardware.drm@1.0-impl.so from sphal namespace: dlopen failed: library "android.hardware.drm@1.0.so" not found


#1

Downloaded source code : https://source.android.com/setup/build/devices
Device: HiKey 960 board.

Trying to play a drm protected content and getting the following error.

07-02 09:39:26.985 2405 3762 E vndksupport: Could not load /vendor/lib/hw/android.hardware.drm@1.0-impl.so from sphal namespace: dlopen failed: library “android.hardware.drm@1.0.so” not found.
07-02 09:39:26.985 2405 3762 E ServiceManagement: Failed to dlopen android.hardware.drm@1.0-impl.so: unknown error
07-02 09:39:26.985 2405 3762 E DrmHal : Failed to find any drm factories

Any help??

Thanks in advance.


#2

I think this is expected behaviour. AFAIK AOSP does not include any DRM decoders…


#3

It seems to be a bug. Reproduce like this:

ADB shell: # setenforce 0

exec in java: “drm = new MediaDrm(UUID);”

01-10 16:19:42.211 2217 2230 E vndksupport: Could not load /vendor/lib/hw/android.hardware.drm@1.0-impl.so from sphal namespace: dlopen failed: library “android.hardware.drm@1.0.so” not found.
01-10 16:19:42.211 2217 2230 E ServiceManagement: Failed to dlopen android.hardware.drm@1.0-impl.so: unknown error
01-10 16:19:42.212 2217 2230 E DrmHal : Failed to find any drm factories
01-10 16:19:42.212 3617 3617 I DrmEngineTest: Failed to create MediaDrm

…now “workaround” to fix the issue

ADB shell: # mount -o remount,rw /vendor
ADB shell: # cp -r /system/lib/* /vendor/lib/

exec in java: “drm = new MediaDrm(UUID);”

01-11 15:33:55.299 2218 2218 I Binder:2218_1: type=1400 audit(0.0:97): avc: denied { read } for name=“android.hardware.drm@1.0-impl.so” dev=“sdd11” ino=407 scontext=u:r:mediadrmserver:s0 tcontext=u:object_r:vendor_file:s0 tclass=file permissive=1
01-11 15:33:55.299 2218 2218 I Binder:2218_1: type=1400 audit(0.0:98): avc: denied { open } for path="/vendor/lib/hw/android.hardware.drm@1.0-impl.so" dev=“sdd11” ino=407 scontext=u:r:mediadrmserver:s0 tcontext=u:object_r:vendor_file:s0 tclass=file permissive=1
01-11 15:33:55.299 2218 2218 I Binder:2218_1: type=1400 audit(0.0:99): avc: denied { getattr } for path="/vendor/lib/hw/android.hardware.drm@1.0-impl.so" dev=“sdd11” ino=407 scontext=u:r:mediadrmserver:s0 tcontext=u:object_r:vendor_file:s0 tclass=file permissive=1
01-11 15:33:55.303 2218 2218 I Binder:2218_1: type=1400 audit(0.0:100): avc: denied { execute } for path="/vendor/lib/android.hardware.drm@1.0.so" dev=“sdd11” ino=467 scontext=u:r:mediadrmserver:s0 tcontext=u:object_r:vendor_file:s0 tclass=file permissive=1
01-11 15:33:55.327 2218 2218 I Binder:2218_1: type=1400 audit(0.0:101): avc: denied { read } for name=“mediadrm” dev=“sdd11” ino=377 scontext=u:r:mediadrmserver:s0 tcontext=u:object_r:vendor_file:s0 tclass=dir permissive=1
01-11 15:33:55.327 2218 2218 I Binder:2218_1: type=1400 audit(0.0:102): avc: denied { open } for path="/vendor/lib/mediadrm" dev=“sdd11” ino=377 scontext=u:r:mediadrmserver:s0 tcontext=u:object_r:vendor_file:s0 tclass=dir permissive=1
01-11 15:33:55.334 2218 2233 I DrmHal : makeDrmFactories: using default passthrough drm instance

Output is different.
I am new to this, but it looks like it has to do with vndk and namespaces in AOSP.


#4

which android version did you have this problem with? aosp master or Pie code base?


#5

AOSP master. Pulled a few days ago.


#6

there was a change on drm hal just merged yesterday,
https://android-review.googlesource.com/c/device/linaro/hikey/+/860444

could you please repo sync your aosp and try again to see if the problem is still there?


#7

Thanks for a quick response. I will try on Monday.


#8

Thanks, and please let me know if it fixes the problem or if there is still any problem


#9

It works! Problem solved.


#10

@chain256, thanks for the information, that’s great.