[Q] cm7 nightly camera preview freeze

Search This thread

slugthru

Senior Member
Feb 18, 2012
54
33
Hello everybody,

I've noticed on my incs that for every cm7 nightly I tried the camera preview has a bug: the preview starts and freezes immediately. The preview only updates when there's some interaction with the screen (like changing the zoom level) .

The camera is working, it takes pictures and the flash is functional.
This behaviour is not present in the 7.1 stable version, but all nightly exibit the same behaviours - including a self build one from yesterday's git.

Also, this happens with the standard camera app and with camera360, but lg camera works ok.

Has anyone seen this behaviour - and is there a fix for it?
Thanks.
 

Psyloid

Senior Member
May 26, 2011
971
237
Hello everybody,

I've noticed on my incs that for every cm7 nightly I tried the camera preview has a bug: the preview starts and freezes immediately. The preview only updates when there's some interaction with the screen (like changing the zoom level) .

The camera is working, it takes pictures and the flash is functional.
This behaviour is not present in the 7.1 stable version, but all nightly exibit the same behaviours - including a self build one from yesterday's git.

Also, this happens with the standard camera app and with camera360, but lg camera works ok.

Has anyone seen this behaviour - and is there a fix for it?
Thanks.

known bug; no Fix
 
  • Like
Reactions: slugthru

slugthru

Senior Member
Feb 18, 2012
54
33
Any details available of the bug?
My guess is that it's not in the driver, but rather in the way the preview is aquired and displayed.
If so it should be easier to fix.

Sent from my Incredible S using XDA
 

slugthru

Senior Member
Feb 18, 2012
54
33
Thanks, already tried that, but it doesn't help.


Sent from my Incredible S using XDA
 

bigeyes0x0

Senior Member
Jun 20, 2011
1,342
1,640
Saigon
That's really weird, when I tried Kujira's CM Nighty 20120215, it works well with Tiamat 1.1.5 kernel.
 

Psyloid

Senior Member
May 26, 2011
971
237
Yes, I saw on the cm7 nightly thread people reporting the latest KANGs from kaijura working with no camera problems.
Tried that but doesn't work for me :(

Sent from my Incredible S using XDA

Didn't work for me either ...

Sent from my GT-P7100 using XDA Premium HD app
 

slugthru

Senior Member
Feb 18, 2012
54
33
Didn't work for me either ...

Sent from my GT-P7100 using XDA Premium HD app

Did you by chance find any replacement for the camcorder?
The lg camera works ok, but the camcorder records with a very low framerate (like maybe two fps).

Meanwhile I'll stick with cm stable, camera and camcorder work ok and adding a virtuous_oc gives a decent battery life.


Sent from my Incredible S using XDA
 

slugthru

Senior Member
Feb 18, 2012
54
33
kernel build overlay errors

I have noticed some errors that show in the logcat when opening camera preview in the nightly and they seem related to the overlay library:
E/OverlayLIB( 1425): setPosition failed

So I've been trying to look closely to this problem and tried to build my own kernel from cyanogenmod.
Managed to build and boot ok, but I see a bigger problem with the kernel I compiled: when opening a camera preview I see no image (camera still takes pictures ok) and I see in the logs other overlay related errors repeating all over the place:

......
D/mm-camera( 2255): virtual android::status_t android::QualcommCameraHardware::setParameters(const android::CameraParameters&), final_rc=0
V/mm-camera( 2255): setParameters: X
I/ActivityManager( 1425): Displayed com.android.camera/.Camera: +1s327ms
W/mm-camera( 2255): Overlay object NULL. returning
V/mm-camera( 2255): Valid overlay object
E/OverlayLIB( 2255): overlay play failed.
E/Overlay ( 2255): Queuebuffer failed for framebuffer 0
E/OverlayLIB( 2255): overlay play failed.
E/Overlay ( 2255): Queuebuffer failed for framebuffer 0
E/OverlayLIB( 2255): overlay play failed.
E/Overlay ( 2255): Queuebuffer failed for framebuffer 0
D/mm-camera( 2255): TRIGGER_NORMAL
E/OverlayLIB( 2255): overlay play failed.
E/Overlay ( 2255): Queuebuffer failed for framebuffer 0
.......

If anybody has any ideea what I missed in the configuration of the kernel I would appreciate the help.
I should mention that I've tried from cyanogen git both cm-kernel-vivo-2.6.35 and htc-kernel-msm7x30, with the configs copied from defconfig, I did no changes in the config parameters.

Thanks.
 

Psyloid

Senior Member
May 26, 2011
971
237
just my two cents : stop messing with CM7 and go for CM9 Ice cold sandwich ...
camera works 95% flawless with Angel camera Dx on it
 

slugthru

Senior Member
Feb 18, 2012
54
33
Possible fix

I might have found the source of the problem in the kernel's msm framebuffer driver.

I didn't have time to look into more detail but I noticed that in drivers/video/msm/msm_fb.c you have a check for the overlay_play result and force update and sleeping state (don't know what this is for).
If I remove this check and just go everytime with msmfb_pan_update than I no longer see the freeze.

This is the whole diff for my test, if anybody know how to code this the proper way please go ahead:

--- a/drivers/video/msm/msm_fb.c
+++ b/drivers/video/msm/msm_fb.c
@@ -805,7 +805,7 @@ static int msmfb_overlay_play(struct fb_info *info, unsigned long *argp)
int ret;
struct msmfb_overlay_data req;
struct file *p_src_file = 0;
- struct msmfb_info *msmfb = info->par;
+// struct msmfb_info *msmfb = info->par;

ret = copy_from_user(&req, argp, sizeof(req));
if (ret) {
@@ -816,12 +816,11 @@ static int msmfb_overlay_play(struct fb_info *info, unsigned long *argp)

ret = mdp->overlay_play(mdp, info, &req, &p_src_file);

- if (ret == 0 && (mdp->overrides & MSM_MDP_FORCE_UPDATE)
- && msmfb->sleeping == AWAKE) {
+// if (ret == 0) {
msmfb_pan_update(info,
0, 0, info->var.xres, info->var.yres,
info->var.yoffset, 1);
- }
+// }

if (p_src_file)
put_pmem_file(p_src_file);

Unfortunately I won't be able to go ahead with it this week so be my guest :)
 

slugthru

Senior Member
Feb 18, 2012
54
33
Fixed CM7 nightly camera freeze

Ok, I've had some time today and finally settled on a fix - don't know if it's the "right one" but it solves my problem.

That means that camera works ok, camcorder works ok with the CM7 nightly.

The fix: for vivo it will no longer reset the force update override in the panel setup (for everyone interested see below the file changed with diffs).

For who wants to test this I've attached a kernel update (based on the vanilla cm7 gingerbread): View attachment cm7_kernel_cam_fix.zip. (PS: no support for this).

Have fun!

diff --git a/arch/arm/mach-msm/board-vivow-panel.c b/arch/arm/mach-msm/board-vivow-panel.c
index 94ebc62..b91d3c3 100644
--- a/arch/arm/mach-msm/board-vivow-panel.c
+++ b/arch/arm/mach-msm/board-vivow-panel.c
@@ -1106,13 +1106,15 @@ int __init vivow_init_panel(unsigned int sys_rev)

B(KERN_INFO "%s(%d): enter. panel_type 0x%08x\n", __func__, __LINE__, panel_type);

+#ifndef CONFIG_MACH_VIVO
//use dmap for hitachi panel
if(panel_type == PANEL_VIVOW_HITACHI)
{
mdp_pdata.overrides = 0;
pr_err("%s: mdp_pdata.overrides = 0\n", __func__);
}
-
+#endif
+
msm_device_mdp.dev.platform_data = &mdp_pdata;
rc = platform_device_register(&msm_device_mdp);
if (rc)
 

slugthru

Senior Member
Feb 18, 2012
54
33
just my two cents : stop messing with CM7 and go for CM9 Ice cold sandwich ...
camera works 95% flawless with Angel camera Dx on it

You might be right but for the moment CM9/AOKP are not stable enough for me to use daily (eg camera - with Angel cam - stopped working after 5-10 pictures).

Besides, it's been fun :)
 

slugthru

Senior Member
Feb 18, 2012
54
33
Btw, can anybody post a link to this fix in the cm7 nightly thread ?
Looks like I dont have enough "thank you's" to post in the development forums :(

Sent from my Incredible S using XDA
 

Nonverbose

Senior Member
Sep 18, 2011
1,644
992
Adelaide
Btw, can anybody post a link to this fix in the cm7 nightly thread
Looks like I dont have enough "thank you's" to post in the development forums :(

Sent from my Incredible S using XDA

I think its a 10 post minimum to post in the dev forum, you should be OK now.

Edit: thanks for posting this, I have recently gone back to cm7 from which the reason I left it for sense is because of the camera issue. Having had no satisfaction it any of the sense customs (every kernel available to this device has Bluetooth dropout issues) I installed a cm7 'nightly' with tiamat kernel and used a third party camera app to get around the camera freeze issues I was experiencing. This seems like a much better fix.
 
Last edited:

kaijura

Senior Member
Jan 1, 2011
1,318
1,813
@slugthru
nice work, you should submit this on the cm gerrit review. None of their devs who manage the vivo read this section anymore and I don't see anyone ever dev'ing for the vivo except kali- / Guilio.

You should do it so that they are aware of it and can implement a patch.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 9
    Fixed CM7 nightly camera freeze

    Ok, I've had some time today and finally settled on a fix - don't know if it's the "right one" but it solves my problem.

    That means that camera works ok, camcorder works ok with the CM7 nightly.

    The fix: for vivo it will no longer reset the force update override in the panel setup (for everyone interested see below the file changed with diffs).

    For who wants to test this I've attached a kernel update (based on the vanilla cm7 gingerbread): View attachment cm7_kernel_cam_fix.zip. (PS: no support for this).

    Have fun!

    diff --git a/arch/arm/mach-msm/board-vivow-panel.c b/arch/arm/mach-msm/board-vivow-panel.c
    index 94ebc62..b91d3c3 100644
    --- a/arch/arm/mach-msm/board-vivow-panel.c
    +++ b/arch/arm/mach-msm/board-vivow-panel.c
    @@ -1106,13 +1106,15 @@ int __init vivow_init_panel(unsigned int sys_rev)

    B(KERN_INFO "%s(%d): enter. panel_type 0x%08x\n", __func__, __LINE__, panel_type);

    +#ifndef CONFIG_MACH_VIVO
    //use dmap for hitachi panel
    if(panel_type == PANEL_VIVOW_HITACHI)
    {
    mdp_pdata.overrides = 0;
    pr_err("%s: mdp_pdata.overrides = 0\n", __func__);
    }
    -
    +#endif
    +
    msm_device_mdp.dev.platform_data = &mdp_pdata;
    rc = platform_device_register(&msm_device_mdp);
    if (rc)
    2
    It works!!! Thank you man!!!

    You're welcome! Good to know it is working for somebody else besides me :)

    Sent from my HTC Incredible S using XDA
    1
    Hello everybody,

    I've noticed on my incs that for every cm7 nightly I tried the camera preview has a bug: the preview starts and freezes immediately. The preview only updates when there's some interaction with the screen (like changing the zoom level) .

    The camera is working, it takes pictures and the flash is functional.
    This behaviour is not present in the 7.1 stable version, but all nightly exibit the same behaviours - including a self build one from yesterday's git.

    Also, this happens with the standard camera app and with camera360, but lg camera works ok.

    Has anyone seen this behaviour - and is there a fix for it?
    Thanks.

    known bug; no Fix
    1
    Use Tiamat kernel. I had that with LordMod's kernel.