[pvrusb2] Problem with wintv-hvr-1950

Roger rogerx at sdf.lonestar.org
Tue Mar 10 23:15:29 CDT 2009


On Tue, 2009-03-10 at 19:57 -0700, jim steele wrote:
> On Tue, Mar 10, 2009 at 4:58 PM, Roger <rogerx at sdf.lonestar.org> wrote:
> > On Tue, 2009-03-10 at 08:37 -0500, Mike Isely wrote:
> >
> >> > root at beagleboard:/# cp /dev/video0 /home/root/test.mpeg
> >>
> >> I usually use 'cat' here out of habit, but the 'cp' command should work
> >> (and I doubt that using 'cp' could result in the problems below).
> >
> > The old behavior of cp would try coping the device file to the new
> > location, which would obviously fail.
> >
> > Interesting that cp can now be used to "cat" a device file.
> >
> > -rwxr-xr-x 1 root root 31K Aug  5  2008 /bin/cat
> > -rwxr-xr-x 1 root root 76K Aug  5  2008 /bin/cp
> >
> > Using cp instead of cat is going to cost you more then twice the memory.
> > And, again although negligible, it might cost a few extra CPU cycles
> > each time it loops.
> 
> This is good to know especially on the beagleboard platform. I'll use
> cat from now on. Do you know of a way that may be even faster and
> leaner than cat?

You could try to write a C/C++ program to access similar functions
(similar to cat) via a lib.  But I don't know which libs to use.  Also,
could write your own code, performing similar to cat, but it might only
save a few CPU cycles.  Since system resources are quite abundant these
days, it's not really necessary.  (Encoding & decoding is the only time
people seem to get concerned about saving CPU cycles.)

Just remember to use ">" with cat.  ie:

$ cat /dev/video0 > test.mpg

(I can see one benefit of using cp, you save time typing the greater then
char and you also save yourself from terminal corruption if you forget the
char.  Even then, typing "$ reset" will reset the terminal.) 

So, all in all, either Mike can point you to a V4L library routine to call
from a C/C++ (or maybe even Python) program or write an Assembly       
program tuned to your arch instead of using cat. ;-)

-- 
Roger
http://rogerx.freeshell.org



More information about the pvrusb2 mailing list