Re: Framerate is consistently divided by 2.5

2014-09-20 Thread Isaac Nickaein
Hi Laurent,

Even with nodrop=1 the framerate is still stuck at ~12fps when it
should be ~30fps. I ran /yavta -c -f Y800 -s 1280x960 /dev/video0 to
test the camera fps.

Here is the YAVTA output for nodrop=0: http://pastebin.com/bQZcJ0Fd
Here is the YAVTA output for nodrop=1: http://pastebin.com/cFYFUrvN

I used the following command to change the nodrop parameter (UVC is a
built-in kernel module):

echo 1  /sys/module/uvcvideo/parameters/nodrop


I also tried enabling log for the uvcvideo module:

echo 0x  /sys/module/uvcvideo/parameters/trace

And here is the corresponding part of dmesg: http://pastebin.com/eWL3GbE1

There seems to be some errors in this log (e.g. Stream 1 error event
b5 e5 len 12.), but I'm not sure they could be the cause of issue or
not.


Thanks,
Isaac


On Tue, Sep 16, 2014 at 4:08 PM, Laurent Pinchart
laurent.pinch...@ideasonboard.com wrote:
 Hi Isaac,

 On Sunday 14 September 2014 01:57:02 Isaac Nickaein wrote:
 Ah sorry for the confusion. The USB camera was not working on the old
 kernel of ARM board. After patching the kernel, I can grab images but
 the framerate is 1/2.5 of expected framerate. The camera works without
 any issue on my PC (with kernel 3.13) though.

 The uvcvideo driver drops erroneous frame by default. Could you please try
 turning that off by setting the nodrop module parameter to 1 and check if the
 frame rate changes ? Please use the yavta command line test application
 (http://git.ideasonboard.org/yavta.git) as other applications might not
 correctly handle frames with the error bit set, or might not take them into
 account to compute the frame rate.

 The following command line should be all you need (you might want to change
 the resolution and video device to match your system).

 yavta -c -f YUYV -s 640x480 /dev/video0

 --
 Regards,

 Laurent Pinchart

--
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: Framerate is consistently divided by 2.5

2014-09-13 Thread Isaac Nickaein
Ah sorry for the confusion. The USB camera was not working on the old
kernel of ARM board. After patching the kernel, I can grab images but
the framerate is 1/2.5 of expected framerate. The camera works without
any issue on my PC (with kernel 3.13) though.

On Wed, Sep 10, 2014 at 6:11 PM, Laurent Pinchart
laurent.pinch...@ideasonboard.com wrote:
 Hi Isaac,

 On Saturday 06 September 2014 12:35:25 Isaac Nickaein wrote:
 Hi,

 After patching the kernel, the rate that images are captured from the
 camera reduce by a factor of 2.5.

 How have you patched the kernel ? If you have both a working and non-working
 version you could use git-bisect to find the commit that causes this breakage.

 Here are a list of frame rates I have tried followed by the resulted frame-
 rate:

 10 fps -- 4 fps
 15 fps -- 6 fps
 25 fps -- 10 fps
 30 fps -- 12 fps

 Note that all of the rates are consistently divided by 2.5. This seems
 to be a clocking issue to me. Is there any multipliers in V4L2 (or
 UVC?) code in framerate calculation which depends on the hardware and
 be cause of this?

 --
 Regards,

 Laurent Pinchart

--
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


Framerate is consistently divided by 2.5

2014-09-06 Thread Isaac Nickaein
Hi,

After patching the kernel, the rate that images are captured from the
camera reduce by a factor of 2.5. Here are a list of frame rates I
have tried followed by the resulted frame-rate:

10 fps -- 4 fps
15 fps -- 6 fps
25 fps -- 10 fps
30 fps -- 12 fps

Note that all of the rates are consistently divided by 2.5. This seems
to be a clocking issue to me. Is there any multipliers in V4L2 (or
UVC?) code in framerate calculation which depends on the hardware and
be cause of this?

Bests,
Isaac
--
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


Actual framerate is always divided by 2.5

2014-08-30 Thread Isaac Nickaein
Hi,

I am working on a ARM board and have patched its kernel to support
V4L2 with help of Mr. Hans Verkuil (here is the discussion:
http://comments.gmane.org/gmane.linux.drivers.video-input-infrastructure/80350).

The problem I have now is the actual frame rate is divided by a factor
of 2.5. For instance, when I set the framerate to be @25fps, I can
capture images at exact 10fps. Here is more results showing the
framerate reported by v4l2-ctl -P command vs. the measured framerate
inside my C++ code (I capture each image and throw them away to
eliminate irrelevant times in measuring fps):

Reported by v4l2-ctl: 10 fps  -  Actual: 4 fps
Reported by v4l2-ctl: 15 fps  -  Actual: 6 fps
Reported by v4l2-ctl: 25 fps  -  Actual: 10 fps
Reported by v4l2-ctl: 30 fps  -  Actual: 12 fps

This seems to be a clocking issue. Is there any constant multiplier in
V4L2 (or UVC?) code which depends on the hardware and be cause of this
problem?

Thanks,
Isaac
--
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


error: redefinition of 'altera_init' during build on Kernel 3.0.36+

2014-07-27 Thread Isaac Nickaein
Hello,

I get the following error when I try to build the V4L2 on Kernel
3.0.36+ for ARM architecture:

/root/v4l2/media_build/v4l/altera.c:2417:5: error: redefinition of 'altera_init'
 int altera_init(struct altera_config *config, const struct firmware *fw)
 ^
In file included from /root/v4l2/media_build/v4l/altera.c:32:0:
/root/v4l2/media_build/v4l/../linux/include/misc/altera.h:41:19: note:
previous definition of 'altera_init' was here
 static inline int altera_init(struct altera_config *config,
   ^


I checked the altera.h code and apparently, the IS_ENABLED macro is
not defined and causes this problem. I have prepared kernel source at
/lib/modules/3.0.36+/build/ and it builds successfully.

Can anyone help me on this issue?

Bests,
Isaac
--
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: error: redefinition of 'altera_init' during build on Kernel 3.0.36+

2014-07-27 Thread Isaac Nickaein
/linux/kernel.h:659:49: note: in definition of macro 'container_of'
  const typeof( ((type *)0)-member ) *__mptr = (ptr); \
 ^
include/linux/list.h:419:13: note: in expansion of macro 'list_entry'
  for (pos = list_entry((head)-next, typeof(*pos), member); \
 ^
/root/v4l2/media_build/v4l/../linux/include/media/v4l2-device.h:140:3:
note: in expansion of macro 'list_for_each_entry'
   list_for_each_entry((sd), (v4l2_dev)-subdevs, list) \
   ^
/root/v4l2/media_build/v4l/../linux/include/media/v4l2-device.h:184:3:
note: in expansion of macro '__v4l2_device_call_subdevs_p'
   __v4l2_device_call_subdevs_p(v4l2_dev, __sd,  \
   ^
/root/v4l2/media_build/v4l/au0828-video.c:1120:2: note: in expansion
of macro 'v4l2_device_call_all'
  v4l2_device_call_all(dev-v4l2_dev, 0, video, s_std, dev-std);
  ^
In file included from include/linux/module.h:9:0,
 from /root/v4l2/media_build/v4l/au0828-video.c:31:
/root/v4l2/media_build/v4l/au0828-video.c:1120:27: error: 'struct
au0828_dev' has no member named 'v4l2_dev'
  v4l2_device_call_all(dev-v4l2_dev, 0, video, s_std, dev-std);
   ^
include/linux/list.h:420:24: note: in definition of macro 'list_for_each_entry'
   pos-member != (head);  \
^
/root/v4l2/media_build/v4l/../linux/include/media/v4l2-device.h:184:3:
note: in expansion of macro '__v4l2_device_call_subdevs_p'
   __v4l2_device_call_subdevs_p(v4l2_dev, __sd,  \
   ^
/root/v4l2/media_build/v4l/au0828-video.c:1120:2: note: in expansion
of macro 'v4l2_device_call_all'
  v4l2_device_call_all(dev-v4l2_dev, 0, video, s_std, dev-std);
  ^
In file included from include/linux/cache.h:4:0,
 from include/linux/time.h:7,
 from include/linux/stat.h:60,
 from include/linux/module.h:10,
 from /root/v4l2/media_build/v4l/au0828-video.c:31:
/root/v4l2/media_build/v4l/au0828-video.c:1121:27: error: 'struct
au0828_dev' has no member named 'v4l2_dev'
  v4l2_device_call_all(dev-v4l2_dev, 0, tuner, s_frequency, f);
   ^
include/linux/kernel.h:659:49: note: in definition of macro 'container_of'
  const typeof( ((type *)0)-member ) *__mptr = (ptr); \
 ^
include/linux/list.h:419:13: note: in expansion of macro 'list_entry'
  for (pos = list_entry((head)-next, typeof(*pos), member); \
 ^
/root/v4l2/media_build/v4l/../linux/include/media/v4l2-device.h:140:3:
note: in expansion of macro 'list_for_each_entry'
   list_for_each_entry((sd), (v4l2_dev)-subdevs, list) \
   ^
/root/v4l2/media_build/v4l/../linux/include/media/v4l2-device.h:184:3:
note: in expansion of macro '__v4l2_device_call_subdevs_p'
   __v4l2_device_call_subdevs_p(v4l2_dev, __sd,  \
   ^
/root/v4l2/media_build/v4l/au0828-video.c:1121:2: note: in expansion
of macro 'v4l2_device_call_all'
  v4l2_device_call_all(dev-v4l2_dev, 0, tuner, s_frequency, f);
  ^
In file included from include/linux/module.h:9:0,
 from /root/v4l2/media_build/v4l/au0828-video.c:31:
/root/v4l2/media_build/v4l/au0828-video.c:1121:27: error: 'struct
au0828_dev' has no member named 'v4l2_dev'
  v4l2_device_call_all(dev-v4l2_dev, 0, tuner, s_frequency, f);
   ^
include/linux/list.h:420:24: note: in definition of macro 'list_for_each_entry'
   pos-member != (head);  \
^
/root/v4l2/media_build/v4l/../linux/include/media/v4l2-device.h:184:3:
note: in expansion of macro '__v4l2_device_call_subdevs_p'
   __v4l2_device_call_subdevs_p(v4l2_dev, __sd,  \
   ^
/root/v4l2/media_build/v4l/au0828-video.c:1121:2: note: in expansion
of macro 'v4l2_device_call_all'
  v4l2_device_call_all(dev-v4l2_dev, 0, tuner, s_frequency, f);
  ^
/root/v4l2/media_build/v4l/au0828-video.c: In function 'au0828_v4l2_poll':
/root/v4l2/media_build/v4l/au0828-video.c:1171:2: error: implicit
declaration of function 'poll_requested_events'
[-Werror=implicit-function-declaration]
  unsigned long req_events = poll_requested_events(wait);
  ^


On Sun, Jul 27, 2014 at 12:23 PM, Hans Verkuil hverk...@xs4all.nl wrote:
 On 07/27/2014 08:47 AM, Isaac Nickaein wrote:
 Hello,

 I get the following error when I try to build the V4L2 on Kernel
 3.0.36+ for ARM architecture:

 /root/v4l2/media_build/v4l/altera.c:2417:5: error: redefinition of 
 'altera_init'
  int altera_init(struct altera_config *config, const struct firmware *fw)
  ^
 In file included from /root/v4l2/media_build/v4l/altera.c:32:0:
 /root/v4l2/media_build/v4l/../linux/include/misc/altera.h:41:19: note:
 previous definition of 'altera_init' was here
  static inline int altera_init(struct altera_config *config,
^


 I checked the altera.h code and apparently, the IS_ENABLED macro is
 not defined and causes this problem. I have prepared kernel source at
 /lib/modules/3.0.36+/build/ and it builds successfully.

 Can anyone help me on this issue

Re: error: redefinition of 'altera_init' during build on Kernel 3.0.36+

2014-07-27 Thread Isaac Nickaein
'
   const typeof( ((type *)0)-member ) *__mptr = (ptr); \
  ^
 include/linux/list.h:419:13: note: in expansion of macro 'list_entry'
   for (pos = list_entry((head)-next, typeof(*pos), member); \
  ^
 /root/v4l2/media_build/v4l/../linux/include/media/v4l2-device.h:140:3:
 note: in expansion of macro 'list_for_each_entry'
list_for_each_entry((sd), (v4l2_dev)-subdevs, list) \
^
 /root/v4l2/media_build/v4l/../linux/include/media/v4l2-device.h:184:3:
 note: in expansion of macro '__v4l2_device_call_subdevs_p'
__v4l2_device_call_subdevs_p(v4l2_dev, __sd,  \
^
 /root/v4l2/media_build/v4l/au0828-video.c:1120:2: note: in expansion
 of macro 'v4l2_device_call_all'
   v4l2_device_call_all(dev-v4l2_dev, 0, video, s_std, dev-std);
   ^
 In file included from include/linux/module.h:9:0,
  from /root/v4l2/media_build/v4l/au0828-video.c:31:
 /root/v4l2/media_build/v4l/au0828-video.c:1120:27: error: 'struct
 au0828_dev' has no member named 'v4l2_dev'
   v4l2_device_call_all(dev-v4l2_dev, 0, video, s_std, dev-std);
^
 include/linux/list.h:420:24: note: in definition of macro 
 'list_for_each_entry'
pos-member != (head);  \
 ^
 /root/v4l2/media_build/v4l/../linux/include/media/v4l2-device.h:184:3:
 note: in expansion of macro '__v4l2_device_call_subdevs_p'
__v4l2_device_call_subdevs_p(v4l2_dev, __sd,  \
^
 /root/v4l2/media_build/v4l/au0828-video.c:1120:2: note: in expansion
 of macro 'v4l2_device_call_all'
   v4l2_device_call_all(dev-v4l2_dev, 0, video, s_std, dev-std);
   ^
 In file included from include/linux/cache.h:4:0,
  from include/linux/time.h:7,
  from include/linux/stat.h:60,
  from include/linux/module.h:10,
  from /root/v4l2/media_build/v4l/au0828-video.c:31:
 /root/v4l2/media_build/v4l/au0828-video.c:1121:27: error: 'struct
 au0828_dev' has no member named 'v4l2_dev'
   v4l2_device_call_all(dev-v4l2_dev, 0, tuner, s_frequency, f);
^
 include/linux/kernel.h:659:49: note: in definition of macro 'container_of'
   const typeof( ((type *)0)-member ) *__mptr = (ptr); \
  ^
 include/linux/list.h:419:13: note: in expansion of macro 'list_entry'
   for (pos = list_entry((head)-next, typeof(*pos), member); \
  ^
 /root/v4l2/media_build/v4l/../linux/include/media/v4l2-device.h:140:3:
 note: in expansion of macro 'list_for_each_entry'
list_for_each_entry((sd), (v4l2_dev)-subdevs, list) \
^
 /root/v4l2/media_build/v4l/../linux/include/media/v4l2-device.h:184:3:
 note: in expansion of macro '__v4l2_device_call_subdevs_p'
__v4l2_device_call_subdevs_p(v4l2_dev, __sd,  \
^
 /root/v4l2/media_build/v4l/au0828-video.c:1121:2: note: in expansion
 of macro 'v4l2_device_call_all'
   v4l2_device_call_all(dev-v4l2_dev, 0, tuner, s_frequency, f);
   ^
 In file included from include/linux/module.h:9:0,
  from /root/v4l2/media_build/v4l/au0828-video.c:31:
 /root/v4l2/media_build/v4l/au0828-video.c:1121:27: error: 'struct
 au0828_dev' has no member named 'v4l2_dev'
   v4l2_device_call_all(dev-v4l2_dev, 0, tuner, s_frequency, f);
^
 include/linux/list.h:420:24: note: in definition of macro 
 'list_for_each_entry'
pos-member != (head);  \
 ^
 /root/v4l2/media_build/v4l/../linux/include/media/v4l2-device.h:184:3:
 note: in expansion of macro '__v4l2_device_call_subdevs_p'
__v4l2_device_call_subdevs_p(v4l2_dev, __sd,  \
^
 /root/v4l2/media_build/v4l/au0828-video.c:1121:2: note: in expansion
 of macro 'v4l2_device_call_all'
   v4l2_device_call_all(dev-v4l2_dev, 0, tuner, s_frequency, f);
   ^
 /root/v4l2/media_build/v4l/au0828-video.c: In function 'au0828_v4l2_poll':
 /root/v4l2/media_build/v4l/au0828-video.c:1171:2: error: implicit
 declaration of function 'poll_requested_events'
 [-Werror=implicit-function-declaration]
   unsigned long req_events = poll_requested_events(wait);
   ^


 On Sun, Jul 27, 2014 at 12:23 PM, Hans Verkuil hverk...@xs4all.nl wrote:
 On 07/27/2014 08:47 AM, Isaac Nickaein wrote:
 Hello,

 I get the following error when I try to build the V4L2 on Kernel
 3.0.36+ for ARM architecture:

 /root/v4l2/media_build/v4l/altera.c:2417:5: error: redefinition of 
 'altera_init'
  int altera_init(struct altera_config *config, const struct firmware *fw)
  ^
 In file included from /root/v4l2/media_build/v4l/altera.c:32:0:
 /root/v4l2/media_build/v4l/../linux/include/misc/altera.h:41:19: note:
 previous definition of 'altera_init' was here
  static inline int altera_init(struct altera_config *config,
^


 I checked the altera.h code and apparently, the IS_ENABLED macro is
 not defined and causes this problem. I have prepared kernel source at
 /lib/modules/3.0.36+/build/ and it builds successfully.

 Can anyone

Re: error: redefinition of 'altera_init' during build on Kernel 3.0.36+

2014-07-27 Thread Isaac Nickaein
Hi Hans,

I understand. I will get in touch with the maintainer to see how we
can fix this issue.

Thank you so much for the help,
Isaac


On Sun, Jul 27, 2014 at 1:30 PM, Hans Verkuil hverk...@xs4all.nl wrote:
 On 07/27/2014 10:42 AM, Isaac Nickaein wrote:
 On Sun, Jul 27, 2014 at 12:56 PM, Hans Verkuil hverk...@xs4all.nl wrote:
 No. Whoever maintains that repository applied v4l code from some newer
 kernel without apparently ever testing it. This is really the responsibility
 of maintainer of that repository and is out of our control.

 You need to address your questions to that repository maintainer, we can't
 help, I'm afraid.


 Ah I see. I have some issues with v4l2 on this kernel version and I am
 trying to upgrade v4l2 to fix that.

 One last question: Can I remove current v4l codes in kernel, replace
 them with the V4L2 backport (provided by linuxtv), fix the
 compatibility issues (hopefully) to get a kernel source with newer
 v4l2 code?

 I am not sure if the v4l2 backport is the same type of code that is
 present in kernel source at drivers/media/video,
 drivers/media/dvb, etc.

 Yes, you can, but it isn't easy.

 In this repo:

 http://git.linuxtv.org/cgit.cgi/hverkuil/cisco_build.git/tree/?h=cobalt-mainline

 there is a patch-kernel.sh script that can patch a vendor kernel with the v4l
 code from a fairly recent stable kernel (I think it is good for 3.14, I don't
 know if it can backport from a 3.15 kernel).

 You need to set the target, orig_source and source paths correctly and then
 run it.

 You end up with a huge patch that you can apply to your kernel.

 It's probably still not enough since you may have to add compat code from
 v4l/compat.h to the drivers you want to compile in. It depends on what
 drivers you want to compile how much work that is.

 I'm not going to give support for this, so you're on your own. The repo
 owner really should fix his tree.

 Regards,

 Hans
--
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