Re: pxa_camera + mt9m1111: Failed to configure for format 50323234
Antonio Ospite schrieb: On Sun, 4 Oct 2009 00:31:24 +0200 (CEST) Guennadi Liakhovetski g.liakhovet...@gmx.de wrote: On Sat, 3 Oct 2009, Antonio Ospite wrote: [...] Anyways your patch works, but the picture is now shifted, see: http://people.openezx.org/ao2/a780-pxa-camera-mt9m111-shifted.jpg Is this because of the new cropping code? Hm, it shouldn't be. Does it look always like this - reproducible? What program are you using? What about other geometry configurations? Have you ever seen this with previous kernel versions? New cropping - neither mplayer nor gstreamer use cropping normally. This seems more like a HSYNC problem to me. Double-check platform data? Is it mioa701 or some custom board? It seemed to be reproducible yesterday, but I can't get it today, maybe it happens in low battery conditions. I am using capture-example.c from v4l2-apps. Never seen before. I am testing this on a Motorola A780, the soc-camera platform code is not in mainline yet. Only for your information. Maybe it helps to reproduce the error. I have the same problem with my own ov9655 driver on a pxa platform since I update to kernel 2.6.30 and add crop support. Every first open of the camera after system reset the image looks like yours. If I use the camera the next time without changing the resolution everything is OK. Only during the first open the resolution of the camera is changed and function fmt set in the ov9655 driver is called twice. I use the camera with my one program and it doesn't use crop. Thanks Guennadi --- Guennadi Liakhovetski, Ph.D. Freelance Open-Source Software Developer http://www.open-technology.de/ Ciao ciao, Antoni Regards, Stefan -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: pxa_camera + mt9m1111: Failed to configure for format 50323234
On Sun, 4 Oct 2009 00:31:24 +0200 (CEST) Guennadi Liakhovetski g.liakhovet...@gmx.de wrote: On Sat, 3 Oct 2009, Antonio Ospite wrote: [...] Anyways your patch works, but the picture is now shifted, see: http://people.openezx.org/ao2/a780-pxa-camera-mt9m111-shifted.jpg Is this because of the new cropping code? Hm, it shouldn't be. Does it look always like this - reproducible? What program are you using? What about other geometry configurations? Have you ever seen this with previous kernel versions? New cropping - neither mplayer nor gstreamer use cropping normally. This seems more like a HSYNC problem to me. Double-check platform data? Is it mioa701 or some custom board? It seemed to be reproducible yesterday, but I can't get it today, maybe it happens in low battery conditions. I am using capture-example.c from v4l2-apps. Never seen before. I am testing this on a Motorola A780, the soc-camera platform code is not in mainline yet. I'll bug you when I hit the problem again. Thanks for your patience. Thanks Guennadi --- Guennadi Liakhovetski, Ph.D. Freelance Open-Source Software Developer http://www.open-technology.de/ Ciao ciao, Antonio -- Antonio Ospite http://ao2.it PGP public key ID: 0x4553B001 A: Because it messes up the order in which people normally read text. See http://en.wikipedia.org/wiki/Posting_style Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing in e-mail? pgpH25dPp0NFK.pgp Description: PGP signature
Re: pxa_camera + mt9m1111: Failed to configure for format 50323234
On Sat, 3 Oct 2009, Antonio Ospite wrote: On Sat, 3 Oct 2009 01:27:04 +0200 (CEST) Guennadi Liakhovetski g.liakhovet...@gmx.de wrote: On Fri, 2 Oct 2009, Antonio Ospite wrote: Hi, after updating to 2.6.32-rc2 I can't capture anymore with the setup in the subject. Indeed:-( Please, verify, that this patch fixes your problem (completely untested), if it does, I'll push it for 2.6.32: pxa_camera: fix camera pixel format configuration A typo prevents correct picel format negotiation with client drivers. typo in the log message too :) s/picel/pixel/ Thanks:-) Signed-off-by: Guennadi Liakhovetski g.liakhovet...@gmx.de --- diff --git a/drivers/media/video/pxa_camera.c b/drivers/media/video/pxa_camera.c index 6952e96..aa831d5 100644 --- a/drivers/media/video/pxa_camera.c +++ b/drivers/media/video/pxa_camera.c @@ -1432,7 +1432,9 @@ static int pxa_camera_set_fmt(struct soc_camera_device *icd, icd-sense = sense; cam_f.fmt.pix.pixelformat = cam_fmt-fourcc; - ret = v4l2_subdev_call(sd, video, s_fmt, f); + ret = v4l2_subdev_call(sd, video, s_fmt, cam_f); + cam_f.fmt.pix.pixelformat = pix-pixelformat; + *pix = cam_f.fmt.pix; icd-sense = NULL; Ok, I can capture again even by only fixing the typo: s/f/cam_f/ but I don't know if this is complete. No, that's not. Anyways your patch works, but the picture is now shifted, see: http://people.openezx.org/ao2/a780-pxa-camera-mt9m111-shifted.jpg Is this because of the new cropping code? Hm, it shouldn't be. Does it look always like this - reproducible? What program are you using? What about other geometry configurations? Have you ever seen this with previous kernel versions? New cropping - neither mplayer nor gstreamer use cropping normally. This seems more like a HSYNC problem to me. Double-check platform data? Is it mioa701 or some custom board? Thanks Guennadi --- Guennadi Liakhovetski, Ph.D. Freelance Open-Source Software Developer http://www.open-technology.de/ -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: pxa_camera + mt9m1111: Failed to configure for format 50323234
On Fri, 2 Oct 2009, Antonio Ospite wrote: Hi, after updating to 2.6.32-rc2 I can't capture anymore with the setup in the subject. Indeed:-( Please, verify, that this patch fixes your problem (completely untested), if it does, I'll push it for 2.6.32: pxa_camera: fix camera pixel format configuration A typo prevents correct picel format negotiation with client drivers. Signed-off-by: Guennadi Liakhovetski g.liakhovet...@gmx.de --- diff --git a/drivers/media/video/pxa_camera.c b/drivers/media/video/pxa_camera.c index 6952e96..aa831d5 100644 --- a/drivers/media/video/pxa_camera.c +++ b/drivers/media/video/pxa_camera.c @@ -1432,7 +1432,9 @@ static int pxa_camera_set_fmt(struct soc_camera_device *icd, icd-sense = sense; cam_f.fmt.pix.pixelformat = cam_fmt-fourcc; - ret = v4l2_subdev_call(sd, video, s_fmt, f); + ret = v4l2_subdev_call(sd, video, s_fmt, cam_f); + cam_f.fmt.pix.pixelformat = pix-pixelformat; + *pix = cam_f.fmt.pix; icd-sense = NULL; Thanks Guennadi Here's the message from userspace: # ./capture-example Cannot open '/dev/video0': 22, Invalid argument which is from the very first open() call. Here's the relevant snippet from dmesg with debug enabled: [ 15.613749] i2c /dev entries driver [ 15.626308] Linux video capture interface: v2.00 [ 15.640834] pxa27x-camera pxa27x-camera.0: Limiting master clock to 2600 [ 15.648696] pxa27x-camera pxa27x-camera.0: LCD clock 10400Hz, target freq 2600Hz, divisor 1 [ 15.656494] pxa27x-camera pxa27x-camera.0: got DMA channel 1 [ 15.665398] pxa27x-camera pxa27x-camera.0: got DMA channel (U) 2 [ 15.673461] pxa27x-camera pxa27x-camera.0: got DMA channel (V) 3 [ 15.686771] camera 0-0: Probing 0-0 [ 15.707545] pxa27x-camera pxa27x-camera.0: Registered platform device at cc889380 data c03a1e98 [ 15.715265] pxa27x-camera pxa27x-camera.0: pxa_camera_activate: Init gpios [ 15.723488] pxa27x-camera pxa27x-camera.0: PXA Camera driver attached to camera 0 [ 15.739092] mt9m111 0-005d: read reg.00d - 0008 [ 15.743812] mt9m111 0-005d: write reg.00d = 0008 - 0 [ 15.748702] mt9m111 0-005d: read reg.00d - 0008 [ 15.753237] mt9m111 0-005d: write reg.00d = 0009 - 0 [ 15.757864] mt9m111 0-005d: read reg.00d - 0009 [ 15.762386] mt9m111 0-005d: write reg.00d = 0029 - 0 [ 15.766938] mt9m111 0-005d: read reg.00d - 0029 [ 15.771670] mt9m111 0-005d: write reg.00d = 0008 - 0 [ 15.776136] mt9m111 0-005d: write reg.0c8 = 970b - 0 [ 15.781325] mt9m111 0-005d: read reg.106 - 700e [ 15.785695] mt9m111 0-005d: write reg.106 = 700e - 0 [ 15.792896] mt9m111 0-005d: read reg.000 - 143a [ 15.796790] mt9m111 0-005d: Detected a MT9M11x chip ID 143a [ 15.805505] pxa27x-camera pxa27x-camera.0: Providing format Planar YUV422 16 bit using CbYCrY 16 bit [ 15.813285] pxa27x-camera pxa27x-camera.0: Providing format CbYCrY 16 bit packed [ 15.820729] pxa27x-camera pxa27x-camera.0: Providing format CrYCbY 16 bit packed [ 15.828221] pxa27x-camera pxa27x-camera.0: Providing format YCbYCr 16 bit packed [ 15.835484] pxa27x-camera pxa27x-camera.0: Providing format YCrYCb 16 bit packed [ 15.842888] pxa27x-camera pxa27x-camera.0: Providing format RGB 565 packed [ 15.850455] pxa27x-camera pxa27x-camera.0: Providing format RGB 555 packed [ 15.858077] pxa27x-camera pxa27x-camera.0: Providing format Bayer (sRGB) 8 bit in pass-through mode [ 15.872455] pxa27x-camera pxa27x-camera.0: PXA Camera driver detached from camera 0 ... [ 70.377781] pxa27x-camera pxa27x-camera.0: Registered platform device at cc889380 data c03a1e98 [ 70.377866] pxa27x-camera pxa27x-camera.0: pxa_camera_activate: Init gpios [ 70.378259] pxa27x-camera pxa27x-camera.0: PXA Camera driver attached to camera 0 [ 70.378336] mt9m111 0-005d: mt9m111_s_fmt fmt=50323234 left=24, top=8, width=1280, height=1024 [ 70.379630] mt9m111 0-005d: write reg.002 = 0018 - 0 [ 70.380589] mt9m111 0-005d: write reg.001 = 0008 - 0 [ 70.382382] mt9m111 0-005d: write reg.1a0 = 0500 - 0 [ 70.383347] mt9m111 0-005d: write reg.1a3 = 0400 - 0 [ 70.384312] mt9m111 0-005d: write reg.1a1 = 0500 - 0 [ 70.385267] mt9m111 0-005d: write reg.1a4 = 0400 - 0 [ 70.386227] mt9m111 0-005d: write reg.1a6 = 0500 - 0 [ 70.387188] mt9m111 0-005d: write reg.1a9 = 0400 - 0 [ 70.393180] mt9m111 0-005d: write reg.1a7 = 0500 - 0 [ 70.394155] mt9m111 0-005d: write reg.1aa = 0400 - 0 [ 70.394224] mt9m111 0-005d: Pixel format not handled : 50323234 [ 70.394265] pxa27x-camera pxa27x-camera.0: Failed to configure for format 50323234 [ 70.394310] pxa27x-camera pxa27x-camera.0: PXA Camera driver detached from camera 0 Format 50323234 is 422P, it looks like pxa-camera is trying to force its native format to the sensor, but I am still investigating; I'll come back when I find more or if I come up with a solution. Thanks,