All of lore.kernel.org
 help / color / mirror / Atom feed
* omap3-isp-live does not allocate big enough buffers?
@ 2012-10-08  7:46 Florian Neuhaus
  2012-10-08 14:06 ` Laurent Pinchart
  0 siblings, 1 reply; 4+ messages in thread
From: Florian Neuhaus @ 2012-10-08  7:46 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: linux-media

Hi Laurent

I am working on a demo-application for displaying a videostream on a 
beagleboard. Now I have seen that you have done something similar, 
but if I run your "live" application out of the omap3-isp-live repo,
then I get the following error:

root@beagleboard:~# modprobe omap_vout video1_numbuffers=3 
video2_numbuffers=3 video1_bufsize=771200 video2_bufsize=771200 
vid1_static_vrfb_alloc=n vid2_static_vrfb_alloc=n
root@beagleboard:~# ./live
fb size is 800x480
Device /dev/video6 opened: OMAP3 ISP resizer output (media).
viewfinder configured for 2011 800x482
AEWB: #win 10x7 start 16x74 size 256x256 inc 30x30
trying to allocate 800x480
Device /dev/video7 opened: omap_vout ().
3 buffers requested.
Buffer 0 mapped at address 0xb6d68000.
Buffer 1 mapped at address 0xb6cac000.
Buffer 2 mapped at address 0xb6bf0000.
3 buffers requested.
Buffer 0 too small (771200 bytes required, 770048 bytes available).
error: unable to allocate buffers for viewfinder.
error: unable to set buffers pool

This seems to happen in the v4l2_alloc_buffers function of v4l2.c
when memtype is V4L2_MEMORY_USERPTR. Has it been broken in the
newer kernel versions? Do you have hint where I should start fixing?

I am using the following config:
beagleboard-xm
linux-omap branch, tag v3.5
leopard imaging li-5m03 with mt9p031

Greetings,
Florian


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: omap3-isp-live does not allocate big enough buffers?
  2012-10-08  7:46 omap3-isp-live does not allocate big enough buffers? Florian Neuhaus
@ 2012-10-08 14:06 ` Laurent Pinchart
  2012-10-10  9:19   ` AW: " Florian Neuhaus
  0 siblings, 1 reply; 4+ messages in thread
From: Laurent Pinchart @ 2012-10-08 14:06 UTC (permalink / raw)
  To: Florian Neuhaus; +Cc: linux-media

Hi Florian,

On Monday 08 October 2012 07:46:35 Florian Neuhaus wrote:
> Hi Laurent
> 
> I am working on a demo-application for displaying a videostream on a
> beagleboard. Now I have seen that you have done something similar,
> but if I run your "live" application out of the omap3-isp-live repo,
> then I get the following error:
> 
> root@beagleboard:~# modprobe omap_vout video1_numbuffers=3
> video2_numbuffers=3 video1_bufsize=771200 video2_bufsize=771200
> vid1_static_vrfb_alloc=n vid2_static_vrfb_alloc=n
> root@beagleboard:~# ./live
> fb size is 800x480
> Device /dev/video6 opened: OMAP3 ISP resizer output (media).
> viewfinder configured for 2011 800x482

This is your problem. The viewfinder resolution is larger than the framebuffer 
resolution, so the buffers allocated from the framebuffer are too small for 
the ISP.

The OMAP3 ISP resizer can't scale down 1944 pixels (the native sensor height) 
to exactly 480 pixels as that would exceed the resizer limits. You will thus 
have to crop the sensor image slightly. Cropping is supported by libomap3isp 
and by the snapshot application but not by the live application. Ideally the 
live application or the libomap3isp library should realize that the ISP limits 
are exceeded and configure cropping on the sensor accordingly. As an interim 
solution you could add manual crop support to the live application using the 
snapshot application crop support code as an example.

> AEWB: #win 10x7 start 16x74 size 256x256 inc 30x30
> trying to allocate 800x480
> Device /dev/video7 opened: omap_vout ().
> 3 buffers requested.
> Buffer 0 mapped at address 0xb6d68000.
> Buffer 1 mapped at address 0xb6cac000.
> Buffer 2 mapped at address 0xb6bf0000.
> 3 buffers requested.
> Buffer 0 too small (771200 bytes required, 770048 bytes available).
> error: unable to allocate buffers for viewfinder.
> error: unable to set buffers pool
> 
> This seems to happen in the v4l2_alloc_buffers function of v4l2.c
> when memtype is V4L2_MEMORY_USERPTR. Has it been broken in the
> newer kernel versions? Do you have hint where I should start fixing?
> 
> I am using the following config:
> beagleboard-xm
> linux-omap branch, tag v3.5
> leopard imaging li-5m03 with mt9p031

-- 
Regards,

Laurent Pinchart


^ permalink raw reply	[flat|nested] 4+ messages in thread

* AW: omap3-isp-live does not allocate big enough buffers?
  2012-10-08 14:06 ` Laurent Pinchart
@ 2012-10-10  9:19   ` Florian Neuhaus
  2012-10-10 14:59     ` Laurent Pinchart
  0 siblings, 1 reply; 4+ messages in thread
From: Florian Neuhaus @ 2012-10-10  9:19 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: linux-media

Hi Laurent,

Thank you for your fast answer. 

Laurent Pinchart wrote on 2012-10-08:

> The OMAP3 ISP resizer can't scale down 1944 pixels (the native sensor
> height) to exactly 480 pixels as that would exceed the resizer limits.
> You will thus have to crop the sensor image slightly. Cropping is
> supported by libomap3isp and by the snapshot application but not by the live application.
> Ideally the live application or the libomap3isp library should realize
> that the ISP limits are exceeded and configure cropping on the sensor
> accordingly. As an interim solution you could add manual crop support
> to the live application using the snapshot application crop support code as an example.

I have seen, that the resizer "only" supports downscaling by 0.25, so with all the cropping, 1944 lines will come down to 482 which is too big for my framebuffer.
If I apply some cropping in the omap3_isp_viewfinder_setup function, the output will work as expected.
Now I'm going to crop on the sensor (or better on the first entity that supports cropping, as in your code) if the ratio "sensor input -> viewfinder output" exceeds 0.25. Are you interested in a patch for this?

Regards,
Florian




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: AW: omap3-isp-live does not allocate big enough buffers?
  2012-10-10  9:19   ` AW: " Florian Neuhaus
@ 2012-10-10 14:59     ` Laurent Pinchart
  0 siblings, 0 replies; 4+ messages in thread
From: Laurent Pinchart @ 2012-10-10 14:59 UTC (permalink / raw)
  To: Florian Neuhaus; +Cc: linux-media

Hi Florian,

On Wednesday 10 October 2012 09:19:37 Florian Neuhaus wrote:
> Laurent Pinchart wrote on 2012-10-08:
> >
> > The OMAP3 ISP resizer can't scale down 1944 pixels (the native sensor
> > height) to exactly 480 pixels as that would exceed the resizer limits.
> > You will thus have to crop the sensor image slightly. Cropping is
> > supported by libomap3isp and by the snapshot application but not by the
> > live application. Ideally the live application or the libomap3isp library
> > should realize that the ISP limits are exceeded and configure cropping on
> > the sensor accordingly. As an interim solution you could add manual crop
> > support to the live application using the snapshot application crop
> > support code as an example.
>
> I have seen, that the resizer "only" supports downscaling by 0.25, so with
> all the cropping, 1944 lines will come down to 482 which is too big for my
> framebuffer. If I apply some cropping in the omap3_isp_viewfinder_setup
> function, the output will work as expected. Now I'm going to crop on the
> sensor (or better on the first entity that supports cropping, as in your
> code) if the ratio "sensor input -> viewfinder output" exceeds 0.25. Are
> you interested in a patch for this?

Sure. I wonder if it wouldn't make more sense to crop on the resizer though, 
what do you think ?

-- 
Regards,

Laurent Pinchart


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-10-10 14:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-08  7:46 omap3-isp-live does not allocate big enough buffers? Florian Neuhaus
2012-10-08 14:06 ` Laurent Pinchart
2012-10-10  9:19   ` AW: " Florian Neuhaus
2012-10-10 14:59     ` Laurent Pinchart

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.