[gonk-l] camera HAL test failure on Nexus 5

RESOLVED DUPLICATE of bug 1112175

Status

Firefox OS
General
RESOLVED DUPLICATE of bug 1112175
3 years ago
3 years ago

People

(Reporter: jolin, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

3 years ago
When running camera tests under device/lge/hammerhead/camera/QCamera2/stack/mm-camera-test/, it prints following error log:

12-03 17:29:19.617  5410  5410 E mm-camera-test:
12-03 17:29:19.617  5410  5410 E mm-camera-test: Camera Test Application
12-03 17:29:19.625  5410  5410 E mm-camera-test: mm_app_load_hal: num_cameras = 2
12-03 17:29:19.629  5410  5410 E mm-camera-test: Running 2 test cases
12-03 17:29:19.636  5410  5410 E mm-camera-test: mm_app_open:BEGIN
12-03 17:29:19.637  5410  5410 D mm-camera-intf: mm_camera_open: dev name = /dev/video1, cam_idx = 1
12-03 17:29:19.637  5410  5410 D mm-camera-intf: mm_camera_open:failed with I/O error retrying after 20 milli-seconds
12-03 17:29:19.657  5410  5410 D mm-camera-intf: mm_camera_open:failed with I/O error retrying after 20 milli-seconds
12-03 17:29:19.677  5410  5410 D mm-camera-intf: mm_camera_open:failed with I/O error retrying after 20 milli-seconds
12-03 17:29:19.697  5410  5410 D mm-camera-intf: mm_camera_open:failed with I/O error retrying after 20 milli-seconds
12-03 17:29:19.717  5410  5410 D mm-camera-intf: mm_camera_open:failed with I/O error retrying after 20 milli-seconds
12-03 17:29:19.737  5410  5410 D mm-camera-intf: mm_camera_open:failed with I/O error retrying after 20 milli-seconds
12-03 17:29:19.758  5410  5410 D mm-camera-intf: mm_camera_open:failed with I/O error retrying after 20 milli-seconds
12-03 17:29:19.778  5410  5410 D mm-camera-intf: mm_camera_open:failed with I/O error retrying after 20 milli-seconds
12-03 17:29:19.798  5410  5410 D mm-camera-intf: mm_camera_open:failed with I/O error retrying after 20 milli-seconds
12-03 17:29:19.818  5410  5410 D mm-camera-intf: mm_camera_open:failed with I/O error retrying after 20 milli-seconds
12-03 17:29:19.838  5410  5410 D mm-camera-intf: mm_camera_open:failed with I/O error retrying after 20 milli-seconds
12-03 17:29:19.858  5410  5410 D mm-camera-intf: mm_camera_open:failed with I/O error retrying after 20 milli-seconds
12-03 17:29:19.878  5410  5410 D mm-camera-intf: mm_camera_open:failed with I/O error retrying after 20 milli-seconds
12-03 17:29:19.898  5410  5410 D mm-camera-intf: mm_camera_open:failed with I/O error retrying after 20 milli-seconds
12-03 17:29:19.918  5410  5410 D mm-camera-intf: mm_camera_open:failed with I/O error retrying after 20 milli-seconds
12-03 17:29:19.939  5410  5410 D mm-camera-intf: mm_camera_open:failed with I/O error retrying after 20 milli-seconds
12-03 17:29:19.959  5410  5410 D mm-camera-intf: mm_camera_open:failed with I/O error retrying after 20 milli-seconds
12-03 17:29:19.979  5410  5410 D mm-camera-intf: mm_camera_open:failed with I/O error retrying after 20 milli-seconds
12-03 17:29:20.000  5410  5410 D mm-camera-intf: mm_camera_open:failed with I/O error retrying after 20 milli-seconds
12-03 17:29:20.020  5410  5410 D mm-camera-intf: mm_camera_open:  opened, break out while loop
12-03 17:29:20.020  5410  5410 E mm-camera-intf: mm_camera_open: cannot open control fd of '/dev/video1' (I/O error)
12-03 17:29:20.020  5410  5410 E mm-camera-intf: camera_open: mm_camera_open err = -1
12-03 17:29:20.020  5410  5410 E mm-camera-test: mm_app_open:dev open error
12-03 17:29:20.020  5410  5410 E mm-camera-test: mm_app_tc_open_close:mm_app_open() cam_idx=0, err=-1
12-03 17:29:20.031  5410  5410 E mm-camera-test: mm_app_tc_open_close:END, rc = -1

Updated

3 years ago
Depends on: 1107300
(Reporter)

Comment 1

3 years ago
Looks like qcamera service (mm-qcamera-daemon) is not started automatically by init in current L-porting build. The errors will be gone once I start it by hand.
(Reporter)

Comment 2

3 years ago
BTW, qcamera stack test still fails because of some ION memory allocation error, but android HAL tests (/hardware/libhardware/tests/camera2/) seems fine.

Updated

3 years ago
No longer depends on: 1107300

Updated

3 years ago
Blocks: 1107300
(Reporter)

Comment 3

3 years ago
TL;DR --- it seems qcamera daemon is not started by init because SELinux is disabled. Kai-Zhen, is there any particular reason that SELinux cannot be enabled, even in permissive mode?


FWICT, the action of starting qcamera daemon (and other services belonging to 'late_start' class in init.hammerhead.rc) will be triggered [1] after file system is mounted [2] successfully.
However, it seems mounting /firmware fails because of the SELinux context specified in options [3]:

=== KLOG BEGIN ===
<4>[    2.370437] SELinux: Unable to set superblock options before the security server is initialized
<6>[    2.370667] fs_mgr: __mount(source=/dev/block/platform/msm_sdcc.1/by-name/modem,target=/firmware,type=vfat)=-1
<3>[    2.370720] fs_mgr: Failed to mount an un-encryptable or wiped partition on/dev/block/platform/msm_sdcc.1/by-name/modem at /firmware options: shortname=lower,uid=1000,gid=1000,dmask=227,fmask=337,context=u:object_r:firmware_file:s0 error: Invalid argument
<3>[    2.370856] init: fs_mgr_mount_all returned an error
<3>[    2.371065] init: fs_mgr_mount_all returned unexpected error 255
=== KLOG END ===

SELinux looks suspicious so I dug around and found it's disabled at [4]. After changing 'androidboot.selinux' to 'permissive', it looks like qcamera daemon is started by init.

[1] https://android.googlesource.com/platform/system/core/+/android-5.0.1_r1/init/builtins.c#555
[2] https://android.googlesource.com/platform/system/core/+/android-5.0.1_r1/init/builtins.c#534
[3] https://github.com/Seinlin/device-hammerhead/commit/674a5c2a3ad778eff30238a64e93bcb6f02168b7
[4] https://github.com/Seinlin/device-hammerhead/commit/e4b9af484df2d747a099bb10c3fe3ec881417a47
Flags: needinfo?(kli)
John, 

"androidboot.selinux=disabled" is set to boot up successfully, no other special reason. After changing 'androidboot.selinux' to 'permissive', this wip patch can also be removed. So I think we should use 'permissive' instead of disabled.

https://github.com/Seinlin/gonk-patches/blob/b2g-5.0.0_r6/all-hammerhead/gonk-misc/0002-Start-b2g-related-processes.patch
Flags: needinfo?(kli)
I've filed a bug to land 'androidboot.selinux=permissive'.
Depends on: 1112175
(Reporter)

Comment 6

3 years ago
Rephrase the summary since we're fine as long as camera HAL test works.
Summary: [gonk-l] mm-qcamera-app test failure on Nexus 5 → [gonk-l] camera HAL test failure on Nexus 5

Comment 7

3 years ago
Kai-Zhen, Are you going to take this bug?
Flags: needinfo?(kli)
No, I am not familiar with camera HAL, I already take and resolve it dependent bug 1112175.
Flags: needinfo?(kli)

Comment 9

3 years ago
Hi John,

Is it possible the issue descirbed on bug 1112017 comment 3 causes the test fail?
Flags: needinfo?(jolin)
(Reporter)

Comment 10

3 years ago
(In reply to Vincent Liu[:vliu] from comment #9)
> Hi John,
> 
> Is it possible the issue descirbed on bug 1112017 comment 3 causes the test
> fail?

 I think Kai-Zhen's patch in bug 1112175 makes starting qcamerasvr manually unnecessary too?
 And after applying Boris' patch in bug 1098970 and wchi's in bug 1107300, I didn't observe the problem in bug 1112017. 

 Anyway, Android camera HAL test works fine now so I'm closing this bug (by marking it as dup. of bug 1112175).
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Flags: needinfo?(jolin)
Resolution: --- → DUPLICATE
Duplicate of bug: 1112175
You need to log in before you can comment on or make changes to this bug.