• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Needing some help with camera

Status
Not open for further replies.

phenomx4

Android Expert
Recognized Developer
I am currently developing CM9 for the Optimus Elite and I hit a wall and can't go any further without any help from experts. The problem is when I open the camera it force closes. I am using this patch to get the camera hal to load and here is the logcat and dmesg. If I am missing something you need, please let me know.
 
Can you post your kernel, and device and vendor files? Almost looks like the same stupid errors we had on the Triumph as your having a segv fault on libc.
 
Looks like you don't have all of the stuff needed in the frameworks. Also you need to do the dmesg right after you try to open the camera, that is how I figured out that our front cameras permissions weren't setup correctly. Also the parser errors may have something to do with it,

[HIGH]04-22 20:12:39.243: E/ExtendedExtractor(18639): Failed to open MM_PARSER_LIB, dlerror = Cannot load library: reloc_library[1314]: 18639 cannot locate '_ZN7android11MediaSource13getBufferInfoERNS_2spINS_7IMemoryEEEPj'...
04-22 20:12:39.243: E/ExtendedExtractor(18639):

04-22 20:12:39.263: E/ExtendedExtractor(18639): Failed to open MM_PARSER_LITE_LIB, dlerror = Cannot load library: reloc_library[1314]: 18639 cannot locate '_ZN7android11MediaSource23getNumberOfVideoBuffersEv'...
04-22 20:12:39.263: E/ExtendedExtractor(18639):
[/HIGH]These could be two things,
1 you don't have the MM parser .so files
2 the cameraHal is calling for getNumberOfVideoBuffers but your proprietary files use a different naming. For instance we had to change these to match our kernel.

[HIGH]static camera_info_t HAL_cameraInfo[MSM_MAX_CAMERA_SENSORS]; [/HIGH]to
[HIGH]static camera_info_t HAL_cameraInfo[MAX_SENSOR_NUM]; [/HIGH]You should be able to reference your msm_camera.h and run the strings command on your libcamera.so to find any missing entries that you may need in both the cameraHal and the frameworks.

This is the Frameworks camera commit from the Triumph to give you an idea.
https://github.com/MT-ParanoidAndro...mmit/bf314265d9f143d73ffe25a0a3b44922623449ea


If you have any questions feel free to ask.
 
Looks like you don't have all of the stuff needed in the frameworks. Also you need to do the dmesg right after you try to open the camera, that is how I figured out that our front cameras permissions weren't setup correctly. Also the parser errors may have something to do with it,

[HIGH]04-22 20:12:39.243: E/ExtendedExtractor(18639): Failed to open MM_PARSER_LIB, dlerror = Cannot load library: reloc_library[1314]: 18639 cannot locate '_ZN7android11MediaSource13getBufferInfoERNS_2spINS_7IMemoryEEEPj'...
04-22 20:12:39.243: E/ExtendedExtractor(18639):

04-22 20:12:39.263: E/ExtendedExtractor(18639): Failed to open MM_PARSER_LITE_LIB, dlerror = Cannot load library: reloc_library[1314]: 18639 cannot locate '_ZN7android11MediaSource23getNumberOfVideoBuffersEv'...
04-22 20:12:39.263: E/ExtendedExtractor(18639):
[/HIGH]These could be two things,
1 you don't have the MM parser .so files
2 the cameraHal is calling for getNumberOfVideoBuffers but your proprietary files use a different naming. For instance we had to change these to match our kernel.

[HIGH]static camera_info_t HAL_cameraInfo[MSM_MAX_CAMERA_SENSORS]; [/HIGH]to
[HIGH]static camera_info_t HAL_cameraInfo[MAX_SENSOR_NUM]; [/HIGH]You should be able to reference your msm_camera.h and run the strings command on your libcamera.so to find any missing entries that you may need in both the cameraHal and the frameworks.

This is the Frameworks camera commit from the Triumph to give you an idea.
https://github.com/MT-ParanoidAndro...mmit/bf314265d9f143d73ffe25a0a3b44922623449ea


If you have any questions feel free to ask.

thanks for the detailed reply, I have made a change or two in the camera wrapper and it still crashes when opening the camera but this time it has a bit of a different message.

logcat:
new camera oe cm9 - Pastebin.com

dmesg:
new camera oe cm9 - Pastebin.com
 
thanks for the detailed reply, I have made a change or two in the camera wrapper and it still crashes when opening the camera but this time it has a bit of a different message.

logcat:
new camera oe cm9 - Pastebin.com

dmesg:
new camera oe cm9 - Pastebin.com
You're gonna have to run the strings command on libcamera and find the missing strings in frameworks. Look at the commit above to figure out where they need to go.

Open the folder where your libcamera is and run
[HIGH]strings libcamera.so >libcamera.txt[/HIGH]You are looking for camera parameters like KEY_SUPPORTED_WIDESCREEN then add [HIGH]static const char KEY_SUPPORTED_WIDESCREEN[];[/HIGH]to the frameworks files.

I have no coding experience, except for the Triumph, so I can't give you a clear answer, you just have to try to figure it out. I am not familiar at all with your phone, and there is not a lot of info around, so it makes it hard to get right to the point, as you probably already know.

The other thing is in your init.rc file you may have to set up permissions for control0 and config0 or something like that, I cant remember off the top of my head.

Found this searching google don't know if it is gonna be right for your phone, but gives you the gist.
[HIGH]#Add permissions for camera access
chmod 0666 /dev/msm_camera/config0
chmod 0666 /dev/msm_camera/control0
chmod 0666 /dev/msm_camera/frame0
chmod 0666 /dev/graphics/fb0[/HIGH]
 
Here is an updated logcat. camera from cm9 crashes but MXCamera does not crash but has a black preview screen. Everything seems to load just fine just crashes when trying to start preview for the camera. I can turn on the flash on and I have no preview just a black screen. trying to take a picture either crashes or makes the app stop responding.


Logcat:

08-07 10:08:33.885: I/insta(1688): ***************************************** 08 - Pastebin.com

In dmesg I get the following message about the camera.

"__msm_control: wait_event error -110"
 
There appears to be a parameter "HFR" that the camera is attempting to set, but it's not appropriate for the sensor. This could mean that parameter is not part of the command-set, or it could mean that parameter is not being set/applied properly. I'm not certain this is the issue, but since the camera thread is timing out, it could be due to waiting for a proper configuration, and HFR is borking it.
 
There appears to be a parameter "HFR" that the camera is attempting to set, but it's not appropriate for the sensor. This could mean that parameter is not part of the command-set, or it could mean that parameter is not being set/applied properly. I'm not certain this is the issue, but since the camera thread is timing out, it could be due to waiting for a proper configuration, and HFR is borking it.

That appears in the stock camera log so I don't think that's it but I did notice it not setting auto focus mode to "continuous" which the stock camera does. It seems to set it to "auto" which the camera doesn't like apparently.
 
Here is an updated logcat. camera from cm9 crashes but MXCamera does not crash but has a black preview screen. Everything seems to load just fine just crashes when trying to start preview for the camera. I can turn on the flash on and I have no preview just a black screen. trying to take a picture either crashes or makes the app stop responding.


Logcat:

08-07 10:08:33.885: I/insta(1688): ***************************************** 08 - Pastebin.com

In dmesg I get the following message about the camera.

"__msm_control: wait_event error -110"
Looking at the logcat you still have

08-07 10:08:34.165: A/libc(1795): Fatal signal 8 (SIGFPE) at 0x00000703 (code=0)

There should be something in the dmesg, possibly related to the segfault. plus you may need to look for permission errors in the dmesg. And look at permissions in the uevent in the kernel some may need to be changed like from system system to system camera or system media server.

The preview may be related to the pmem in the kernel, there is info here, don't know if it will help.

Also is this a common error? If not it may be related to touch focus. Just a shot in the dark.

08-07 10:08:35.146: E/CursorWindow(1501): Failed to read row 0, column -1 from a CursorWindow which has 1 rows, 5 columns.

Not too much info to go from so these are just some observations.
 
Looking at the logcat you still have

08-07 10:08:34.165: A/libc(1795): Fatal signal 8 (SIGFPE) at 0x00000703 (code=0)

There should be something in the dmesg, possibly related to the segfault. plus you may need to look for permission errors in the dmesg. And look at permissions in the uevent in the kernel some may need to be changed like from system system to system camera or system media server.

The preview may be related to the pmem in the kernel, there is info here, don't know if it will help.

Also is this a common error? If not it may be related to touch focus. Just a shot in the dark.

08-07 10:08:35.146: E/CursorWindow(1501): Failed to read row 0, column -1 from a CursorWindow which has 1 rows, 5 columns.

Not too much info to go from so these are just some observations.

Nothing in dmesg about the segfault or permission issues. Ill check out the pmem
 
Found a app that shows preview but its all rainbow colored. I've been told its the pixel format but changing it doesn't seem to have an effect. Any ideas?
 

Attachments

  • 1376345990290.jpg
    1376345990290.jpg
    77.7 KB · Views: 49
Found a app that shows preview but its all rainbow colored. I've been told its the pixel format but changing it doesn't seem to have an effect. Any ideas?

You might want to make sure that the file that you are changing is actually being used. I know that sometimes I have found files that should be used that are over ridden by another file for the same task.
 
You might want to make sure that the file that you are changing is actually being used. I know that sometimes I have found files that should be used that are over ridden by another file for the same task.

I've got passed the preview error. Now I get a crash when trying to take a picture. Did you have the same problem for the triumph?
 
Yeah, it would crash if you check the thread on the triumph it has details of the progress and such. What errors are you seeing on crash?
 
Status
Not open for further replies.
Back
Top Bottom