All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [ANNOUNCE] Videobuf improvements to allow its usage with USB drivers
@ 2008-04-13 15:28 Mauro Carvalho Chehab
  2008-04-13 15:43 ` Markus Rechberger
  0 siblings, 1 reply; 15+ messages in thread
From: Mauro Carvalho Chehab @ 2008-04-13 15:28 UTC (permalink / raw
  To: Video, Linux DVB


Videobuf Improvements for USB Devices
=====================================

Videobuf history
================

If you are familiar with V4L and kernel development, you probably know that one
of the hardest part of the driver is to control the video stream that arrives
from the device, and need to be sent to an userspace application.

To address this task, a kernel module, called videobuf, is widely used for
quite a long time at the PCI devices. 

However, previously, this driver were restricted to DMA devices. Specifically,
it used to work only with PCI devices whose steams are provided via DMA, and
for chipsets that supports scatter/gather mode. 

On scatter/gatter DMA mode, the data I/O is splitted into several small buffers.
This worked fine for bttv, saa7134 and cx88 devices, whose PCI bridge is
capable of handling such transfers.

However, due to their specific hardware restrictions, videobuf couldn't be used
by USB devices. Due to that, each V4L USB driver had to implement their own
buffering schema.

I've started some time ago a project to make videobuf more generic. In order to
to that, videobuf were splitted into two files:

	- videobuf-core - with core features, not specific to DMA or PCI;
	- videobuf-dma-sg - for PCI DMA scatter/gather devices.

After that, I've created another videobuf instance, called videobuf-vmalloc.

This one uses memory alloced with vmalloc_user(). This is the same approach used
by other USB drivers. The first test for the newer core driver were to port the
virtual video driver (vivi) to work with it.

The videobuf split revealed several bad locks inside the driver.

Several developers helped to solve those issues, including: Brandon Philips,
Nick Piggin, Jonathan Corbet, Trent Piepho,  Adrian Bunk and Andrew Morton.

Also, Guennadi Liakhovetski removed PCI specific details, on videobuf-dma-sg.
Now, the same driver can also be used by other architectures that don't provide
PCI interfaces, like ARM.

videobuf for USB devices
========================

The last round for the code improvement just happened this week: the conversion
of em28xx to use videobuf.

This round happened thanks to the help of Aidan Thornton, that got a proposed
patch I send him, and help me to fix and address several issues on this complex
task.

So, the first USB driver that is working perfectly is available for testing at:
	http://linuxtv.org/hg/~mchehab/em28xx-vb

This driver were tested with several widely used userspace apps: tvtime,
mplayer, xawtv and mythtv. It were also tested with the testing tool 
v4l2-apps/test/code_example, available inside the tree.

I'll port the changesets soon to the master development trees.

The new approach has several advantages over the old one:
	- buffering code inside em28xx-video is now clean and easy to
understand;

	- the same buffering code can be easily ported to other USB drivers;

	- by using the same videobuf code, all drivers will have the same
behaviour. This will help userspace apps to be more independent of specific
devices;

	- the performance of the newer code is much more optimized than the
previous code;
	
	- redundant streaming handling code is now inside V4L core;

	- It is now easy to add overlay and userptr support for those drivers;

	- It is now easy to use videobuf-dvb for USB devices also.

Things yet to be done
=====================

1) videobuf operating memory modes:

The old videobuf and the newvideobuf-dma-sg supports all streaming modes
present at V4L1 and V4L2 API:
	VIDIOCMBUF;
	reading /dev/video?;
	kernel mmapped memory;
	userspace mmapped memory;
	overlay mode, to send video input streams directly into video adapter memory.

The new videobuf-vmalloc shares the same core stuff. However, it currently
doesn't implement userspace mmapped memory or overlay mode. The other three
modes are already supported. 

It doesn't seem to be hard to add the missing modes. Probably, the only
function that will need more code is videobuf_iolock(). I've already started to
code a patch to add userspace mmap. This may be useful to allow some userspace
apps that relies on this method to work.

2) videobuf-dvb

This driver allows using the same videobuf handling also for DVB devices. This
driver works fine with videobuf-dma-sg. Theoretically, it should work fine also
with USB drivers.

3) tm6000

This is the first driver I've made to use videobuf. Unfortunately, the driver
is loosing URB frames. I suspect that it is a hardware problem. I expect to
finish this driver soon, since there are several new TV devices using this
chipset.

4) porting other usb drivers to use videobuf

This will help to cleanup their source code, and fix some API non-compliance.

5) videobuf for non scatter/gather DMA

There are a few devices in the market that supports only contiguous DMA
transfer. This is the case, for example of Marvel cafe chips, used on OLPC.

For those devices, it would be interesting to create a new videobuf module, and
migrate them to this solution.

I'd like to thank all of you that helped with this development, and to the
improvement of the Linux kernel support for video input devices.

APPENDIX: Performance tests of the both versions of em28xx driver
=================================================================

This is the performance tests I did, running code_example to get 1,000 frames
@29.995 Hz (about 35 seconds of stream), tested on a i386 machine, running at
1,5GHz:

	The old driver:

$ time -f "%E: %Us User time, %Ss Kernel time, %P CPU used" ./capture_example
0:34.21: 8.22s User time, 25.16s Kernel time, 97% CPU used

	The videobuf-based driver:

$ time -f "%E: %Us User time, %Ss Kernel time, %P CPU used" ./capture_example
0:35.36: 0.01s User time, 0.05s Kernel time, 0% CPU used

	Conclusion:

The time consumption to receive the stream where reduced from about 33.38
seconds to 0.05 seconds. 

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

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

* RE: [ANNOUNCE] Videobuf improvements to allow its usage with USB drivers
  2008-04-13 15:28 [ANNOUNCE] Videobuf improvements to allow its usage with USB drivers Mauro Carvalho Chehab
@ 2008-04-13 15:43 ` Markus Rechberger
  2008-04-13 16:17   ` Markus Rechberger
  0 siblings, 1 reply; 15+ messages in thread
From: Markus Rechberger @ 2008-04-13 15:43 UTC (permalink / raw
  To: Mauro Carvalho Chehab, Video, Linux DVB


--- Mauro Carvalho Chehab <mchehab@infradead.org>
schrieb:

> 
> Videobuf Improvements for USB Devices
> =====================================
> 
> Videobuf history
> ================
> 
> If you are familiar with V4L and kernel development,
> you probably know that one
> of the hardest part of the driver is to control the
> video stream that arrives
> from the device, and need to be sent to an userspace
> application.
> 
> To address this task, a kernel module, called
> videobuf, is widely used for
> quite a long time at the PCI devices. 
> 
> However, previously, this driver were restricted to
> DMA devices. Specifically,
> it used to work only with PCI devices whose steams
> are provided via DMA, and
> for chipsets that supports scatter/gather mode. 
> 
> On scatter/gatter DMA mode, the data I/O is splitted
> into several small buffers.
> This worked fine for bttv, saa7134 and cx88 devices,
> whose PCI bridge is
> capable of handling such transfers.
> 
> However, due to their specific hardware
> restrictions, videobuf couldn't be used
> by USB devices. Due to that, each V4L USB driver had
> to implement their own
> buffering schema.
> 
> I've started some time ago a project to make
> videobuf more generic. In order to
> to that, videobuf were splitted into two files:
> 
> 	- videobuf-core - with core features, not specific
> to DMA or PCI;
> 	- videobuf-dma-sg - for PCI DMA scatter/gather
> devices.
> 
> After that, I've created another videobuf instance,
> called videobuf-vmalloc.
> 
> This one uses memory alloced with vmalloc_user().
> This is the same approach used
> by other USB drivers. The first test for the newer
> core driver were to port the
> virtual video driver (vivi) to work with it.
> 
> The videobuf split revealed several bad locks inside
> the driver.
> 
> Several developers helped to solve those issues,
> including: Brandon Philips,
> Nick Piggin, Jonathan Corbet, Trent Piepho,  Adrian
> Bunk and Andrew Morton.
> 
> Also, Guennadi Liakhovetski removed PCI specific
> details, on videobuf-dma-sg.
> Now, the same driver can also be used by other
> architectures that don't provide
> PCI interfaces, like ARM.
> 
> videobuf for USB devices
> ========================
> 
> The last round for the code improvement just
> happened this week: the conversion
> of em28xx to use videobuf.
> 
> This round happened thanks to the help of Aidan
> Thornton, that got a proposed
> patch I send him, and help me to fix and address
> several issues on this complex
> task.
> 
> So, the first USB driver that is working perfectly
> is available for testing at:
> 	http://linuxtv.org/hg/~mchehab/em28xx-vb
> 
> This driver were tested with several widely used
> userspace apps: tvtime,
> mplayer, xawtv and mythtv. It were also tested with
> the testing tool 
> v4l2-apps/test/code_example, available inside the
> tree.
> 
> I'll port the changesets soon to the master
> development trees.
> 
> The new approach has several advantages over the old
> one:
> 	- buffering code inside em28xx-video is now clean
> and easy to
> understand;
> 
> 	- the same buffering code can be easily ported to
> other USB drivers;
> 
> 	- by using the same videobuf code, all drivers will
> have the same
> behaviour. This will help userspace apps to be more
> independent of specific
> devices;
> 
> 	- the performance of the newer code is much more
> optimized than the
> previous code;
> 	
> 	- redundant streaming handling code is now inside
> V4L core;
> 
> 	- It is now easy to add overlay and userptr support
> for those drivers;
> 
> 	- It is now easy to use videobuf-dvb for USB
> devices also.
> 
> Things yet to be done
> =====================
> 
> 1) videobuf operating memory modes:
> 
> The old videobuf and the newvideobuf-dma-sg supports
> all streaming modes
> present at V4L1 and V4L2 API:
> 	VIDIOCMBUF;
> 	reading /dev/video?;
> 	kernel mmapped memory;
> 	userspace mmapped memory;
> 	overlay mode, to send video input streams directly
> into video adapter memory.
> 
> The new videobuf-vmalloc shares the same core stuff.
> However, it currently
> doesn't implement userspace mmapped memory or
> overlay mode. The other three
> modes are already supported. 
> 
> It doesn't seem to be hard to add the missing modes.
> Probably, the only
> function that will need more code is
> videobuf_iolock(). I've already started to
> code a patch to add userspace mmap. This may be
> useful to allow some userspace
> apps that relies on this method to work.
> 
> 2) videobuf-dvb
> 
> This driver allows using the same videobuf handling
> also for DVB devices. This
> driver works fine with videobuf-dma-sg.
> Theoretically, it should work fine also
> with USB drivers.
> 
> 3) tm6000
> 
> This is the first driver I've made to use videobuf.
> Unfortunately, the driver
> is loosing URB frames. I suspect that it is a
> hardware problem. I expect to
> finish this driver soon, since there are several new
> TV devices using this
> chipset.
> 
> 4) porting other usb drivers to use videobuf
> 
> This will help to cleanup their source code, and fix
> some API non-compliance.
> 
> 5) videobuf for non scatter/gather DMA
> 
> There are a few devices in the market that supports
> only contiguous DMA
> transfer. This is the case, for example of Marvel
> cafe chips, used on OLPC.
> 
> For those devices, it would be interesting to create
> a new videobuf module, and
> migrate them to this solution.
> 
> I'd like to thank all of you that helped with this
> development, and to the
> improvement of the Linux kernel support for video
> input devices.
> 
> APPENDIX: Performance tests of the both versions of
> em28xx driver
>
=================================================================
> 
> This is the performance tests I did, running
> code_example to get 1,000 frames
> @29.995 Hz (about 35 seconds of stream), tested on a
> i386 machine, running at
> 1,5GHz:
> 
> 

This sounds interesting, where can someone find this
code_example?

Markus

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

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

* RE: [ANNOUNCE] Videobuf improvements to allow its usage with USB drivers
  2008-04-13 15:43 ` Markus Rechberger
@ 2008-04-13 16:17   ` Markus Rechberger
  2008-04-13 20:22     ` Mauro Carvalho Chehab
  0 siblings, 1 reply; 15+ messages in thread
From: Markus Rechberger @ 2008-04-13 16:17 UTC (permalink / raw
  To: Mauro Carvalho Chehab, Video


> === message truncated ===
> This is the performance tests I did, running >
code_example to get 1,000
 frames
> @29.995 Hz (about 35 seconds of stream), tested on a
i386 machine,
>  running at
> 1,5GHz:

>         The old driver:

> $ time -f "%E: %Us User time, %Ss Kernel time, %P
CPU used"
>  ./capture_example
> 0:34.21: 8.22s User time, 25.16s Kernel time, 97% 
CPU used

>        The videobuf-based driver:

> $ time -f "%E: %Us User time, %Ss Kernel time, %P
CPU used"
>  ./capture_example
> 0:35.36: 0.01s User time, 0.05s Kernel time, 0% CPU
used

>        Conclusion:

> The time consumption to receive the stream where 
reduced from about
 33.38
> seconds to 0.05 seconds

the question is moreover what made capture_example go
up to 100% CPU in the first try and to 0% in the
second one.
I'm not sure about the old implementation in the
original driver, although I'm just curious about the
details here. xawtv usually uses very little cputime
at all. 
If I use 
"$ time mplayer tv:// -tv driver=v4l2" it shows up 

real 0m40.972s
user 0m0.230s
sys  0m0.050s

your benchmark is a bit unclear.

Markus

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

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

* Re: [ANNOUNCE] Videobuf improvements to allow its usage with USB drivers
  2008-04-13 16:17   ` Markus Rechberger
@ 2008-04-13 20:22     ` Mauro Carvalho Chehab
  2008-04-13 20:34       ` Markus Rechberger
  0 siblings, 1 reply; 15+ messages in thread
From: Mauro Carvalho Chehab @ 2008-04-13 20:22 UTC (permalink / raw
  To: Markus Rechberger; +Cc: Video

On Sun, 13 Apr 2008 18:17:54 +0200 (CEST)
Markus Rechberger <mrechberger@empiatech.com> wrote:

> >        Conclusion:
> 
> > The time consumption to receive the stream where reduced from about 33.38 seconds to 0.05 seconds
> 
> the question is moreover what made capture_example go
> up to 100% CPU in the first try and to 0% in the
> second one.
> I'm not sure about the old implementation in the
> original driver, although I'm just curious about the
> details here. xawtv usually uses very little cputime
> at all. 
> If I use 
> "$ time mplayer tv:// -tv driver=v4l2" it shows up 
> 
> real 0m40.972s
> user 0m0.230s
> sys  0m0.050s
> 
> your benchmark is a bit unclear.

The advantage of using capture_example for benchmark tests is that it is a very
simple mmap loop, without multi-thread, and just discarding the return. With
this, you're timing just the minimal requirements for receiving frames.

A TV application will also need to use the video adapter to present images, and
may do some other tasks, like running DSP algorithms for de-interlacing. It may
also discard frames, if there's not enough CPU to work will all of them. So,
you will never know how much of those times are due to V4L kernelspace part.

On the tests I did here with TV applications, the amount of performance,
reported by "top" also indicated that the previous approach were worse.

For example, on the same centino machine @1.5 GHZ, mplayer with "-tv driver=v4l2"
were ranging from 30% to 75% of CPU. With videobuf, the CPU consumption were
close to 23%, without much variation.

Cheers,
Mauro

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

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

* Re: [ANNOUNCE] Videobuf improvements to allow its usage with USB drivers
  2008-04-13 20:22     ` Mauro Carvalho Chehab
@ 2008-04-13 20:34       ` Markus Rechberger
  2008-04-13 20:49         ` H. Willstrand
  2008-04-13 21:10         ` [ANNOUNCE] Videobuf improvements to allow its usage with USB drivers Mauro Carvalho Chehab
  0 siblings, 2 replies; 15+ messages in thread
From: Markus Rechberger @ 2008-04-13 20:34 UTC (permalink / raw
  To: Mauro Carvalho Chehab; +Cc: Video


--- Mauro Carvalho Chehab <mchehab@infradead.org>
schrieb:

> On Sun, 13 Apr 2008 18:17:54 +0200 (CEST)
> Markus Rechberger <mrechberger@empiatech.com> wrote:
> 
> > >        Conclusion:
> > 
> > > The time consumption to receive the stream where
> reduced from about 33.38 seconds to 0.05 seconds
> > 
> > the question is moreover what made capture_example
> go
> > up to 100% CPU in the first try and to 0% in the
> > second one.
> > I'm not sure about the old implementation in the
> > original driver, although I'm just curious about
> the
> > details here. xawtv usually uses very little
> cputime
> > at all. 
> > If I use 
> > "$ time mplayer tv:// -tv driver=v4l2" it shows up
> 
> > 
> > real 0m40.972s
> > user 0m0.230s
> > sys  0m0.050s
> > 
> > your benchmark is a bit unclear.
> 
> The advantage of using capture_example for benchmark
> tests is that it is a very
> simple mmap loop, without multi-thread, and just
> discarding the return. With
> this, you're timing just the minimal requirements
> for receiving frames.
> 
> A TV application will also need to use the video
> adapter to present images, and
> may do some other tasks, like running DSP algorithms
> for de-interlacing. It may
> also discard frames, if there's not enough CPU to
> work will all of them. So,
> you will never know how much of those times are due
> to V4L kernelspace part.
> 
> On the tests I did here with TV applications, the
> amount of performance,
> reported by "top" also indicated that the previous
> approach were worse.
> 
> For example, on the same centino machine @1.5 GHZ,
> mplayer with "-tv driver=v4l2"
> were ranging from 30% to 75% of CPU. With videobuf,
> the CPU consumption were
> close to 23%, without much variation.
> 

my eeePC shows up 0-5% CPU usage with mplayer
fullscreen without videobuf, seems more like
something's broken in your testapplication or
somewhere else?

mplayer uses the memory mapped interface for this.

Also the command 
"$ mplayer -benchmark tv:// -tv driver=v4l2"

CPU Intel 620 Mhz

Markus

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

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

* Re: [ANNOUNCE] Videobuf improvements to allow its usage with USB drivers
  2008-04-13 20:34       ` Markus Rechberger
@ 2008-04-13 20:49         ` H. Willstrand
  2008-04-13 20:55           ` Markus Rechberger
       [not found]           ` <6gvfio$4n3l24@rrcs-agw-01.hrndva.rr.com>
  2008-04-13 21:10         ` [ANNOUNCE] Videobuf improvements to allow its usage with USB drivers Mauro Carvalho Chehab
  1 sibling, 2 replies; 15+ messages in thread
From: H. Willstrand @ 2008-04-13 20:49 UTC (permalink / raw
  To: Markus Rechberger; +Cc: Video, Mauro Carvalho Chehab

On Sun, Apr 13, 2008 at 10:34 PM, Markus Rechberger
<mrechberger@empiatech.com> wrote:
>
>  --- Mauro Carvalho Chehab <mchehab@infradead.org>
>  schrieb:
>
>
>
> > On Sun, 13 Apr 2008 18:17:54 +0200 (CEST)
>  > Markus Rechberger <mrechberger@empiatech.com> wrote:
>  >
>  > > >        Conclusion:
>  > >
>  > > > The time consumption to receive the stream where
>  > reduced from about 33.38 seconds to 0.05 seconds
>  > >
>  > > the question is moreover what made capture_example
>  > go
>  > > up to 100% CPU in the first try and to 0% in the
>  > > second one.
>  > > I'm not sure about the old implementation in the
>  > > original driver, although I'm just curious about
>  > the
>  > > details here. xawtv usually uses very little
>  > cputime
>  > > at all.
>  > > If I use
>  > > "$ time mplayer tv:// -tv driver=v4l2" it shows up
>  >
>  > >
>  > > real 0m40.972s
>  > > user 0m0.230s
>  > > sys  0m0.050s
>  > >
>  > > your benchmark is a bit unclear.
>  >
>  > The advantage of using capture_example for benchmark
>  > tests is that it is a very
>  > simple mmap loop, without multi-thread, and just
>  > discarding the return. With
>  > this, you're timing just the minimal requirements
>  > for receiving frames.
>  >
>  > A TV application will also need to use the video
>  > adapter to present images, and
>  > may do some other tasks, like running DSP algorithms
>  > for de-interlacing. It may
>  > also discard frames, if there's not enough CPU to
>  > work will all of them. So,
>  > you will never know how much of those times are due
>  > to V4L kernelspace part.
>  >
>  > On the tests I did here with TV applications, the
>  > amount of performance,
>  > reported by "top" also indicated that the previous
>  > approach were worse.
>  >
>  > For example, on the same centino machine @1.5 GHZ,
>  > mplayer with "-tv driver=v4l2"
>  > were ranging from 30% to 75% of CPU. With videobuf,
>  > the CPU consumption were
>  > close to 23%, without much variation.
>  >
>
>  my eeePC shows up 0-5% CPU usage with mplayer
>  fullscreen without videobuf, seems more like
>  something's broken in your testapplication or
>  somewhere else?
>

Using the em28xx?
My is about 40-70% CPU...

Br H.Willstrand

>  mplayer uses the memory mapped interface for this.
>
>  Also the command
>  "$ mplayer -benchmark tv:// -tv driver=v4l2"
>
>  CPU Intel 620 Mhz
>
>  Markus
>
>
>
>  --
>  video4linux-list mailing list
>  Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
>  https://www.redhat.com/mailman/listinfo/video4linux-list
>

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

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

* Re: [ANNOUNCE] Videobuf improvements to allow its usage with USB drivers
  2008-04-13 20:49         ` H. Willstrand
@ 2008-04-13 20:55           ` Markus Rechberger
       [not found]           ` <6gvfio$4n3l24@rrcs-agw-01.hrndva.rr.com>
  1 sibling, 0 replies; 15+ messages in thread
From: Markus Rechberger @ 2008-04-13 20:55 UTC (permalink / raw
  To: H. Willstrand; +Cc: Video, Mauro Carvalho Chehab


--- "H. Willstrand" <h.willstrand@gmail.com> schrieb:

> On Sun, Apr 13, 2008 at 10:34 PM, Markus Rechberger
> <mrechberger@empiatech.com> wrote:
> >
> >  --- Mauro Carvalho Chehab <mchehab@infradead.org>
> >  schrieb:
> >
> >
> >
> > > On Sun, 13 Apr 2008 18:17:54 +0200 (CEST)
> >  > Markus Rechberger <mrechberger@empiatech.com>
> wrote:
> >  >
> >  > > >        Conclusion:
> >  > >
> >  > > > The time consumption to receive the stream
> where
> >  > reduced from about 33.38 seconds to 0.05
> seconds
> >  > >
> >  > > the question is moreover what made
> capture_example
> >  > go
> >  > > up to 100% CPU in the first try and to 0% in
> the
> >  > > second one.
> >  > > I'm not sure about the old implementation in
> the
> >  > > original driver, although I'm just curious
> about
> >  > the
> >  > > details here. xawtv usually uses very little
> >  > cputime
> >  > > at all.
> >  > > If I use
> >  > > "$ time mplayer tv:// -tv driver=v4l2" it
> shows up
> >  >
> >  > >
> >  > > real 0m40.972s
> >  > > user 0m0.230s
> >  > > sys  0m0.050s
> >  > >
> >  > > your benchmark is a bit unclear.
> >  >
> >  > The advantage of using capture_example for
> benchmark
> >  > tests is that it is a very
> >  > simple mmap loop, without multi-thread, and
> just
> >  > discarding the return. With
> >  > this, you're timing just the minimal
> requirements
> >  > for receiving frames.
> >  >
> >  > A TV application will also need to use the
> video
> >  > adapter to present images, and
> >  > may do some other tasks, like running DSP
> algorithms
> >  > for de-interlacing. It may
> >  > also discard frames, if there's not enough CPU
> to
> >  > work will all of them. So,
> >  > you will never know how much of those times are
> due
> >  > to V4L kernelspace part.
> >  >
> >  > On the tests I did here with TV applications,
> the
> >  > amount of performance,
> >  > reported by "top" also indicated that the
> previous
> >  > approach were worse.
> >  >
> >  > For example, on the same centino machine @1.5
> GHZ,
> >  > mplayer with "-tv driver=v4l2"
> >  > were ranging from 30% to 75% of CPU. With
> videobuf,
> >  > the CPU consumption were
> >  > close to 23%, without much variation.
> >  >
> >
> >  my eeePC shows up 0-5% CPU usage with mplayer
> >  fullscreen without videobuf, seems more like
> >  something's broken in your testapplication or
> >  somewhere else?
> >
> 
> Using the em28xx?
> My is about 40-70% CPU...
> 

with mplayer yes.
I can provide a login to that eeePC to verify it by
yourself even.

The eeePC comes with a 2.6.21.4 kernel, the em28xx
module is from mcentral.de (and only that module),
although I don't think that matters.

tvtime needs more cputime because it does
deinterlacing ~5-20% 

Again on the eeePC.

Markus

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

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

* Re: [ANNOUNCE] Videobuf improvements to allow its usage with USB drivers
  2008-04-13 20:34       ` Markus Rechberger
  2008-04-13 20:49         ` H. Willstrand
@ 2008-04-13 21:10         ` Mauro Carvalho Chehab
  2008-04-13 21:38           ` Markus Rechberger
  1 sibling, 1 reply; 15+ messages in thread
From: Mauro Carvalho Chehab @ 2008-04-13 21:10 UTC (permalink / raw
  To: Markus Rechberger; +Cc: Video

> my eeePC shows up 0-5% CPU usage with mplayer
> fullscreen without videobuf, seems more like
> something's broken in your testapplication or
> somewhere else?

The test application (capture_example) is the one documented at the V4L2 spec.
The only difference is that I've incremented count to 1000, to get more frames.
I don't see what's wrong on it.

Cheers,
Mauro

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

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

* Re: [ANNOUNCE] Videobuf improvements to allow its usage with USB drivers
  2008-04-13 21:10         ` [ANNOUNCE] Videobuf improvements to allow its usage with USB drivers Mauro Carvalho Chehab
@ 2008-04-13 21:38           ` Markus Rechberger
  2008-04-13 21:42             ` Mauro Carvalho Chehab
  0 siblings, 1 reply; 15+ messages in thread
From: Markus Rechberger @ 2008-04-13 21:38 UTC (permalink / raw
  To: Mauro Carvalho Chehab; +Cc: Video


--- Mauro Carvalho Chehab <mchehab@infradead.org>
schrieb:

> > my eeePC shows up 0-5% CPU usage with mplayer
> > fullscreen without videobuf, seems more like
> > something's broken in your testapplication or
> > somewhere else?
> 
> The test application (capture_example) is the one
> documented at the V4L2 spec.
> The only difference is that I've incremented count
> to 1000, to get more frames.
> I don't see what's wrong on it.
> 

I just tested capture_example on the eeePC (again non
videobuf).

$ time ./capture_example
.................. (printed this around 100 times?)
real   0m4.312s
user   0m0.010s
sys    0m0.000s

strace clearly shows up VIDIOC_QBUF, VIDIOC_DQBUF.

So the question is rather what makes the results so
bad on your system. 
How can the userspace application go up to 100%, while
the system isn't that busy?

Markus

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

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

* Re: [ANNOUNCE] Videobuf improvements to allow its usage with USB drivers
  2008-04-13 21:38           ` Markus Rechberger
@ 2008-04-13 21:42             ` Mauro Carvalho Chehab
  2008-04-13 21:54               ` Markus Rechberger
  0 siblings, 1 reply; 15+ messages in thread
From: Mauro Carvalho Chehab @ 2008-04-13 21:42 UTC (permalink / raw
  To: Markus Rechberger; +Cc: Video

On Sun, 13 Apr 2008 23:38:24 +0200 (CEST)
Markus Rechberger <mrechberger@empiatech.com> wrote:

> 
> --- Mauro Carvalho Chehab <mchehab@infradead.org>
> schrieb:
> 
> > > my eeePC shows up 0-5% CPU usage with mplayer
> > > fullscreen without videobuf, seems more like
> > > something's broken in your testapplication or
> > > somewhere else?
> > 
> > The test application (capture_example) is the one
> > documented at the V4L2 spec.
> > The only difference is that I've incremented count
> > to 1000, to get more frames.
> > I don't see what's wrong on it.
> > 
> 
> I just tested capture_example on the eeePC (again non
> videobuf).
> 
> $ time ./capture_example
> .................. (printed this around 100 times?)
> real   0m4.312s
> user   0m0.010s
> sys    0m0.000s
> 
> strace clearly shows up VIDIOC_QBUF, VIDIOC_DQBUF.
> 
> So the question is rather what makes the results so
> bad on your system. 
> How can the userspace application go up to 100%, while
> the system isn't that busy?

Are you running your tests against the in-kernel version? Also, you're running
with count = 100 (the 100 dots). You need to edit the example code, and move to
1000 to have the same basement as I used here.

Cheers,
Mauro

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

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

* Re: [ANNOUNCE] Videobuf improvements to allow its usage with USB drivers
  2008-04-13 21:42             ` Mauro Carvalho Chehab
@ 2008-04-13 21:54               ` Markus Rechberger
  2008-04-13 22:02                 ` Markus Rechberger
  0 siblings, 1 reply; 15+ messages in thread
From: Markus Rechberger @ 2008-04-13 21:54 UTC (permalink / raw
  To: Mauro Carvalho Chehab; +Cc: Video


--- Mauro Carvalho Chehab <mchehab@infradead.org>
schrieb:

> On Sun, 13 Apr 2008 23:38:24 +0200 (CEST)
> Markus Rechberger <mrechberger@empiatech.com> wrote:
> 
> > 
> > --- Mauro Carvalho Chehab <mchehab@infradead.org>
> > schrieb:
> > 
> > > > my eeePC shows up 0-5% CPU usage with mplayer
> > > > fullscreen without videobuf, seems more like
> > > > something's broken in your testapplication or
> > > > somewhere else?
> > > 
> > > The test application (capture_example) is the
> one
> > > documented at the V4L2 spec.
> > > The only difference is that I've incremented
> count
> > > to 1000, to get more frames.
> > > I don't see what's wrong on it.
> > > 
> > 
> > I just tested capture_example on the eeePC (again
> non
> > videobuf).
> > 
> > $ time ./capture_example
> > .................. (printed this around 100
> times?)
> > real   0m4.312s
> > user   0m0.010s
> > sys    0m0.000s
> > 
> > strace clearly shows up VIDIOC_QBUF, VIDIOC_DQBUF.
> > 
> > So the question is rather what makes the results
> so
> > bad on your system. 
> > How can the userspace application go up to 100%,
> while
> > the system isn't that busy?
> 
> Are you running your tests against the in-kernel
> version? 

v4l-dvb-experimental/em28xx-userspace 2 from
mcentral.de use the same algorithms.

I ran capture_example again with count=1000

first run:
real 0m40.393s
user 0m0.000s
sys  0m0.020s
second run:
real 0m40.294s
user 0m0.000s
sys  0m0.030s
third run:
real 0m40.394s
user 0m0.000s
sys 0m0.010s

> Also, you're running
> with count = 100 (the 100 dots). You need to edit
> the example code, and move to
> 1000 to have the same basement as I used here.
> 

I just did so.

seems really like an improvement but into the wrong
direction :-)

Markus

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

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

* Re: [ANNOUNCE] Videobuf improvements to allow its usage with USB drivers
  2008-04-13 21:54               ` Markus Rechberger
@ 2008-04-13 22:02                 ` Markus Rechberger
  0 siblings, 0 replies; 15+ messages in thread
From: Markus Rechberger @ 2008-04-13 22:02 UTC (permalink / raw
  To: Mauro Carvalho Chehab; +Cc: Video


--- Markus Rechberger <mrechberger@empiatech.com>
schrieb:

> 
> --- Mauro Carvalho Chehab <mchehab@infradead.org>
> schrieb:
> 
> > On Sun, 13 Apr 2008 23:38:24 +0200 (CEST)
> > Markus Rechberger <mrechberger@empiatech.com>
> wrote:
> > 
> > > 
> > > --- Mauro Carvalho Chehab
> <mchehab@infradead.org>
> > > schrieb:
> > > 
> > > > > my eeePC shows up 0-5% CPU usage with
> mplayer
> > > > > fullscreen without videobuf, seems more like
> > > > > something's broken in your testapplication
> or
> > > > > somewhere else?
> > > > 
> > > > The test application (capture_example) is the
> > one
> > > > documented at the V4L2 spec.
> > > > The only difference is that I've incremented
> > count
> > > > to 1000, to get more frames.
> > > > I don't see what's wrong on it.
> > > > 
> > > 
> > > I just tested capture_example on the eeePC
> (again
> > non
> > > videobuf).
> > > 
> > > $ time ./capture_example
> > > .................. (printed this around 100
> > times?)
> > > real   0m4.312s
> > > user   0m0.010s
> > > sys    0m0.000s
> > > 
> > > strace clearly shows up VIDIOC_QBUF,
> VIDIOC_DQBUF.
> > > 
> > > So the question is rather what makes the results
> > so
> > > bad on your system. 
> > > How can the userspace application go up to 100%,
> > while
> > > the system isn't that busy?
> > 
> > Are you running your tests against the in-kernel
> > version? 
> 
> v4l-dvb-experimental/em28xx-userspace 2 from
> mcentral.de use the same algorithms.
> 
> I ran capture_example again with count=1000
> 
> first run:
> real 0m40.393s
> user 0m0.000s
> sys  0m0.020s
> second run:
> real 0m40.294s
> user 0m0.000s
> sys  0m0.030s
> third run:
> real 0m40.394s
> user 0m0.000s
> sys 0m0.010s
> 

also try to reproduce it several times, maybe you only
gave it one try. Basically everything seems to stay
the same with/without that update.

Markus

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

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

* RE: video4linux help
       [not found]           ` <6gvfio$4n3l24@rrcs-agw-01.hrndva.rr.com>
@ 2008-04-14  0:08             ` Markus Rechberger
  2008-04-14 10:26               ` H. Willstrand
  2008-04-14 20:26             ` Mauro Carvalho Chehab
  1 sibling, 1 reply; 15+ messages in thread
From: Markus Rechberger @ 2008-04-14  0:08 UTC (permalink / raw
  To: Karl Kobata; +Cc: video4linux-list


--- Karl Kobata <karl.kobata@syncira.com> schrieb:

> I am new to this user group.  Will someone help?
> 
> I have mailed 2 queries for help to
> 'video4linux-list@redhat.com'.  First, I
> emailed this on Apr 9, but have had no response to
> them.  2nd, in looking at
> the archive list, the queries are not even listed.
> 
> What am I doing wrong?
> 

good question, probably because your mail didn't get
through for some reason.
At least I don't have anything in my mail account.

Markus

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

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

* Re: video4linux help
  2008-04-14  0:08             ` video4linux help Markus Rechberger
@ 2008-04-14 10:26               ` H. Willstrand
  0 siblings, 0 replies; 15+ messages in thread
From: H. Willstrand @ 2008-04-14 10:26 UTC (permalink / raw
  To: Karl Kobata; +Cc: video4linux-list

On Mon, Apr 14, 2008 at 2:08 AM, Markus Rechberger
<mrechberger@empiatech.com> wrote:
>
>  --- Karl Kobata <karl.kobata@syncira.com> schrieb:
>
>
>  > I am new to this user group.  Will someone help?
>  >
>  > I have mailed 2 queries for help to
>  > 'video4linux-list@redhat.com'.  First, I
>  > emailed this on Apr 9, but have had no response to
>  > them.  2nd, in looking at
>  > the archive list, the queries are not even listed.
>  >
>  > What am I doing wrong?
>  >
>
>  good question, probably because your mail didn't get
>  through for some reason.
>  At least I don't have anything in my mail account.
>
>  Markus
>

I can't find any either...

//H.Willstrand

>  --
>  video4linux-list mailing list
>  Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
>  https://www.redhat.com/mailman/listinfo/video4linux-list
>

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

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

* Re: video4linux help
       [not found]           ` <6gvfio$4n3l24@rrcs-agw-01.hrndva.rr.com>
  2008-04-14  0:08             ` video4linux help Markus Rechberger
@ 2008-04-14 20:26             ` Mauro Carvalho Chehab
  1 sibling, 0 replies; 15+ messages in thread
From: Mauro Carvalho Chehab @ 2008-04-14 20:26 UTC (permalink / raw
  To: Karl Kobata; +Cc: 'Video'

On Sun, 13 Apr 2008 16:52:38 -0700
"Karl Kobata" <karl.kobata@syncira.com> wrote:

> I am new to this user group.  Will someone help?
> 
> I have mailed 2 queries for help to 'video4linux-list@redhat.com'.  First, I
> emailed this on Apr 9, but have had no response to them.  2nd, in looking at
> the archive list, the queries are not even listed.

It seems that your emails to the ML never arrived.

Maybe you could try to check your subscription there.

Cheers,
Mauro

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

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

end of thread, other threads:[~2008-04-14 20:28 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-13 15:28 [ANNOUNCE] Videobuf improvements to allow its usage with USB drivers Mauro Carvalho Chehab
2008-04-13 15:43 ` Markus Rechberger
2008-04-13 16:17   ` Markus Rechberger
2008-04-13 20:22     ` Mauro Carvalho Chehab
2008-04-13 20:34       ` Markus Rechberger
2008-04-13 20:49         ` H. Willstrand
2008-04-13 20:55           ` Markus Rechberger
     [not found]           ` <6gvfio$4n3l24@rrcs-agw-01.hrndva.rr.com>
2008-04-14  0:08             ` video4linux help Markus Rechberger
2008-04-14 10:26               ` H. Willstrand
2008-04-14 20:26             ` Mauro Carvalho Chehab
2008-04-13 21:10         ` [ANNOUNCE] Videobuf improvements to allow its usage with USB drivers Mauro Carvalho Chehab
2008-04-13 21:38           ` Markus Rechberger
2008-04-13 21:42             ` Mauro Carvalho Chehab
2008-04-13 21:54               ` Markus Rechberger
2008-04-13 22:02                 ` Markus Rechberger

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.