Bug 2491 (os2008_camera)

Summary: cant run camera applications with v4l2
Product: [Maemo Official Platform] Core Reporter: Sven J. <sven.bugzilla.2008>
Component: KernelAssignee: unassigned <nobody>
Status: RESOLVED FIXED QA Contact: linux-kernel-bugs
Severity: major    
Priority: Low CC: andre_klapper, maemo, sakari.ailus
Version: 4.0Keywords: community-diablo, patch
Target Milestone: 5.0-alpha-pre1   
Hardware: N800   
OS: Linux   
Attachments: modified camera example for os2008
modified example code for os2008
Makefile to build the camera example in chinook
motion software's console output
Makefile to build the camera example in chinook
1/2 half there, fixed the camera example problem
ARM: OMAP 2: Camera: Don't return -EIO in VIDIOC_DQBUF

Description Sven J. (reporter) 2007-12-04 22:42:28 UTC
Hi!

Since i upgraded my N800 to OS2008 i can not run my camera based applications.
I tried with motion, vor v4l2 support, which did not work.

Then i tried to use the gstreamer stuff with the camera example.

The outcome of the example_camera code was this:
"Nokia-N800:/home/user# ./example_camera 
example_camera[1996]: GLIB ERROR ** default - GST error: v4l2src_calls.c(964):
gst_v4l2src_set_capture (): /test-camera/camera_src:
Tried to capture at 15/2 fps, but device returned 8/1 fps

aborting...
Aborted (core dumped)"

I will attach the files to this bug report. I hope someone can help getting
v4l2 /camera running again. Its a major problem for me (development project
with opencv).

regards, Sven
Comment 1 Sven J. (reporter) 2007-12-04 22:43:13 UTC
Created an attachment (id=650) [details]
modified camera example for os2008
Comment 2 Sven J. (reporter) 2007-12-04 22:43:36 UTC
Created an attachment (id=651) [details]
modified example code for os2008
Comment 3 Sven J. (reporter) 2007-12-04 22:44:06 UTC
Created an attachment (id=652) [details]
Makefile to build the camera example in chinook
Comment 4 Sven J. (reporter) 2007-12-04 22:45:57 UTC
Created an attachment (id=653) [details]
motion software's console output
Comment 5 Sven J. (reporter) 2007-12-04 22:51:32 UTC
Created an attachment (id=654) [details]
Makefile to build the camera example in chinook
Comment 6 Sven J. (reporter) 2007-12-04 23:55:10 UTC
Created an attachment (id=655) [details]
1/2 half there, fixed  the camera example problem

Added a framerate request:
"framerate", GST_TYPE_FRACTION, 25, 1,
Comment 7 Sven J. (reporter) 2007-12-04 23:56:53 UTC
gstreamer example fixed with the framerate definition, but v4l2 still does not
work
Comment 8 Sakari Ailus nokia 2007-12-11 11:29:09 UTC
I haven't run the test program, but after reading the logs I guess that this is
because VIDIOC_DQBUF returns -EIO if there's an error in the frame. The V4L2
spec allows this but it seems that a number of applications don't appreciate
it.

Could you try the attached kernel patch?
Comment 9 Sakari Ailus nokia 2007-12-11 11:30:18 UTC
Created an attachment (id=661) [details]
ARM: OMAP 2: Camera: Don't return -EIO in VIDIOC_DQBUF
Comment 10 Andre Klapper maemo.org 2008-10-22 20:02:28 UTC
Sven: Did you have a chance to test the patch provided by Sakari?

Sakari: Has your patch been committed already? If so, in which upstream kernel
revision (or Maemo software/kernel version)?
Comment 11 Sakari Ailus nokia 2008-10-28 15:48:45 UTC
Ooops. The patch has been in linux-omap since Februrary or so. :) I don't know
about Maemo releases.
Comment 12 Andre Klapper maemo.org 2008-10-28 16:15:22 UTC
Sakari:
Any git revision number or URL? Would make it easy to find out the upstream
kernel version and compare to kernel versions shipped in Maemo (and set the
Target Milestone here correctly).

Setting status to RESOLVED FIXED. Thanks for the feedback!
Comment 13 Lucas Maneos 2009-10-04 19:21:26 UTC
The patch hasn't been applied to Diablo (kernel 2.6.21-200842), but it seems
present in Fremantle's drivers/media/video/omap34xxcam.c (since pre-alpha1 at
least).
Comment 14 Lucas Maneos 2009-10-22 07:56:42 UTC
Marking patches of interest to Diablo (Maemo4) community updates, please excuse
the noise.