phhusson / treble_experimentations

Notes about tinkering with Android Project Treble
3.4k stars 660 forks source link

huawei p9 camera #614

Open PhieF opened 5 years ago

PhieF commented 5 years ago

Hi,

I'm unable to start the camera on the huawei p9

I guess the error come from a

02-01 22:42:34.077   731   731 E vndksupport: Could not load /vendor/lib/hw/android.hardware.camera.provider@2.4-impl.so from sphal namespace: dlopen failed: library "android.hardware.camera.device@1.0.so" not found.

I also have a

02-01 22:42:34.069   731   731 W cameraserver: type=1400 audit(0.0:173): avc: denied { read } for name="android.hardware.camera.device@1.0.so" dev="mmcblk0p55" ino=3489 scontext=u:r:cameraserver:s0 tcontext=u:object_r:vendor_hal_file:s0 tclass=file permissive=0
02-01 22:42:34.069   731   731 W cameraserver: type=1400 audit(0.0:174): avc: denied { read } for name="hw" dev="mmcblk0p52" ino=211 scontext=u:r:cameraserver:s0 tcontext=u:object_r:system_file:s0 tclass=dir permissive=0
02-01 22:42:34.069   731   731 W cameraserver: type=1400 audit(0.0:175): avc: denied { read } for name="hw" dev="mmcblk0p52" ino=237 scontext=u:r:cameraserver:s0 tcontext=u:object_r:system_file:s0 tclass=dir permissive=0

So I've changed sepolicies to work with that but it doesn't seem to have changed anything

any ideas ??

Thanks !

phhusson commented 5 years ago

@dil3mm4 I remember this is because they didn't treblize camera on older kirins. Are you aware of a workaround?

Le ven. 26 juil. 2019 à 09:42, PhieF notifications@github.com a écrit :

Hi,

I'm unable to start the camera on the huawei p9

I guess the error come from a

02-01 22:42:34.077 731 731 E vndksupport: Could not load /vendor/lib/hw/android.hardware.camera.provider@2.4-impl.so from sphal namespace: dlopen failed: library "android.hardware.camera.device@1.0.so" not found.

I also have a

02-01 22:42:34.069 731 731 W cameraserver: type=1400 audit(0.0:173): avc: denied { read } for name="android.hardware.camera.device@1.0.so" dev="mmcblk0p55" ino=3489 scontext=u:r:cameraserver:s0 tcontext=u:object_r:vendor_hal_file:s0 tclass=file permissive=0 02-01 22:42:34.069 731 731 W cameraserver: type=1400 audit(0.0:174): avc: denied { read } for name="hw" dev="mmcblk0p52" ino=211 scontext=u:r:cameraserver:s0 tcontext=u:object_r:system_file:s0 tclass=dir permissive=0 02-01 22:42:34.069 731 731 W cameraserver: type=1400 audit(0.0:175): avc: denied { read } for name="hw" dev="mmcblk0p52" ino=237 scontext=u:r:cameraserver:s0 tcontext=u:object_r:system_file:s0 tclass=dir permissive=0

So I've changed sepolicies to work with that but it doesn't seem to have changed anything

any ideas ??

Thanks !

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/phhusson/treble_experimentations/issues/614?email_source=notifications&email_token=AAAA4OQTPU4S6SPNVXEVCG3QBKTGBA5CNFSM4IHBJYZKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HBUZXDA, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAA4ORYY5NHTPF7HAUM5LTQBKTGBANCNFSM4IHBJYZA .

Dil3mm4 commented 5 years ago

No.

We had Flex's camera port that was working over O GSIs and it was kinda fine AFAIK. On Pie, I've completely lost interest in having a working camera over it. Tho, I can confirm that at least on PRAGUE, camera was actually working OOB with OpenCamera (even if it's a huge mess as in quality and whatnot).

PhieF commented 5 years ago

I've managed to get it work but by taking libs and stuffs wherever I could so I will try to clean the mess I've done

but it works, front and back

phhusson commented 5 years ago

Erm I should have been clearer. I didn't expect a pull request (I'm not sure I'd merge it since that's not an official treble device) First explain how you fixed it for yourself

Le lun. 29 juil. 2019 à 16:06, PhieF notifications@github.com a écrit :

Almost finished for a pull request, but how to "translate" this policy

/system/bin/camerainit-hi3650.sh u:object_r:phhsu_exec:s0 /system/bin/cameraserver-hi3650.sh u:object_r:phhsu_exec:s0 /system/bin/cameradaemon-hi3650.sh u:object_r:phhsu_exec:s0

this is from openkirin

please ?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/phhusson/treble_experimentations/issues/614?email_source=notifications&email_token=AAAA4OV2QY6VAN6RFK7SC2TQB32NJA5CNFSM4IHBJYZKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3A2COQ#issuecomment-516006202, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAA4OQHPP5G73E4UFV2LI3QB32NJANCNFSM4IHBJYZA .

PhieF commented 5 years ago

OK here it is then extracted from openkirin huaweicamera2.zip

just need to reboot in recovery and execute my script-install.sh I've made for it libs in sphal-compat could be replaced by mount -o bind from vndk-26, using directly vndk-26 doesn't work, I don't know why