public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Kyle Guinn <elyk03@gmail.com>
To: Theodore Kilgore <kilgota@banach.math.auburn.edu>
Cc: Thomas Kaiser <v4l@kaiser-linux.li>,
	Jean-Francois Moine <moinejf@free.fr>,
	Hans de Goede <hdegoede@redhat.com>,
	linux-media@vger.kernel.org
Subject: Re: RFC on proposed patches to mr97310a.c for gspca and v4l
Date: Fri, 17 Apr 2009 19:04:02 -0500	[thread overview]
Message-ID: <200904171904.02986.elyk03@gmail.com> (raw)
In-Reply-To: <alpine.LNX.2.00.0904171225120.11123@banach.math.auburn.edu>

On Friday 17 April 2009 12:50:51 Theodore Kilgore wrote:
> On Thu, 16 Apr 2009, Kyle Guinn wrote:
> > On Thursday 16 April 2009 13:22:11 Theodore Kilgore wrote:
> >> On Thu, 16 Apr 2009, Kyle Guinn wrote:
> >>> I've been looking through the frame headers sent by the MR97310A (the
> >>> Aiptek PenCam VGA+, 08ca:0111).  Here are my observations.
> >>>
> >>> FF FF 00 FF 96 6x x0 xx xx xx xx xx
> >>>
> >>> In binary that looks something like this:
> >>>
> >>> 11111111 11111111 00000000 11111111
> >>> 10010110 011001aa a1010000 bbbbbbbb
> >>> bbbbbbbb cccccccc ccccdddd dddddddd
> >>>
> >>> All of the values look to be MSbit first.  A looks like a 3-bit frame
> >>> sequence number that seems to start with 1 and increments for each
> >>> frame.
> >>
> >> Hmmm. This I never noticed. What you are saying is that the two bytes 6x
> >> and x0 are variable? You are sure about that? What I have previously
> >> experienced is that the first is always 64 with these cameras, and the
> >> second one indicates the absence of compression (in which case it is 0,
> >> which of course only arises for still cameras), or if there is data
> >> compression then it is not zero. I have never seen this byte to change
> >> during a session with a camera. Here is a little table of what I have
> >> previously witnessed, and perhaps you can suggest what to do in order to
> >> see this is not happening:
> >>
> >> Camera		that byte	compression	solved, or not	streaming
> >> Aiptek 		00		no		N/A		no
> >> Aiptek		50		yes		yes		both
> >> the Sakar cam	00		no		N/A		no
> >> ditto		50		yes		yes		both
> >> Argus QuikClix	20		yes		no	doesn't work
> >> Argus DC1620	50		yes		yes	doesn't work
> >> CIF cameras	00		no		N/A		no
> >> ditto		50		yes		yes		no
> >> ditto		d0		yes		no		yes
> >>
> >> Other strange facts are
> >>
> >> -- that the Sakar camera, the Argus QuikClix, and the
> >> DC1620 all share the same USB ID of 0x93a:0x010f and yet only one of
> >> them will stream with the existing driver. The other two go through the
> >> motions, but the isoc packets do not actually get sent, so there is no
> >> image coming out. I do not understand the reason for this; I have been
> >> trying to figure it out and it is rather weird. I should add that, yes,
> >> those two cameras were said to be capable of streaming when I bought
> >> them. Could it be a problem of age? I don't expect that, but maybe.
> >>
> >> -- the CIF cameras all share the USB id of 0x93a:0x010e (I bought
> >> several of them) and they all are using a different compression
> >> algorithm while streaming from what they use if running as still cameras
> >> in compressed mode. This leads to the question whether it is possible to
> >> set the compression algorithm during the initialization sequence, so
> >> that the camera also uses the "0x50" mode while streaming, because we
> >> already know how to use that mode.
> >>
> >> But I have never seen the 0x64 0xX0 bytes used to count the frames.
> >> Could you tell me how to repeat that? It certainly would knock down the
> >> validity of the above table wouldn't it?
> >
> > I've modified libv4l to print out the 12-byte header before it skips over
> > it.
>
> Good idea, and an obvious one. Why did I not think of that?
>
> > Then when I fire up mplayer it prints out each header as each frame is
> > received.  The framerate is only about 5 fps so there isn't a ton of data
> > to parse through.  When I point the camera into a light I get this (at
> > 640x480):
> >
> > ...
> > ff ff 00 ff 96 64 d0 c1 5c c6 00 00
> > ff ff 00 ff 96 65 50 c1 5c c6 00 00
> > ff ff 00 ff 96 65 d0 c1 5c c6 00 00
> > ff ff 00 ff 96 66 50 c1 5c c6 00 00
> > ff ff 00 ff 96 66 d0 c1 5c c6 00 00
> > ff ff 00 ff 96 67 50 c1 5c c6 00 00
> > ff ff 00 ff 96 67 d0 c1 5c c6 00 00
> > ff ff 00 ff 96 64 50 c1 5c c6 00 00
> > ff ff 00 ff 96 64 d0 c1 5c c6 00 00
> > ff ff 00 ff 96 65 50 c1 5c c6 00 00
> > ...
>
> Which camera is this? Is it the Aiptek Pencam VGA+? If so, then I can try
> it, too, because I also have one of them.
>

Yes, that's the one.  Try your others if you can and let me know what happens.

> > Only those 3 bits change, and it looks like a counter to me.  Take a look
> > at the gspca-mars (MR97113A?) subdriver.  I think it tries to accommodate
> > the frame sequence number when looking for the SOF.
>
> No, I don't see that, sorry. What I see is that it looks for the SOF,
> which is declared in pac_common.h to be the well-known FF FF 00 FF 96 and
> no more bytes after that.
>

I'm talking about this code from gspca/mars.c.  Look in sd_pkt_scan().

if (data[0 + p] == 0xff
 && data[1 + p] == 0xff
 && data[2 + p] == 0x00
 && data[3 + p] == 0xff
 && data[4 + p] == 0x96) {
	if (data[5 + p] == 0x64
	 || data[5 + p] == 0x65
	 || data[5 + p] == 0x66
	 || data[5 + p] == 0x67) {

-Kyle

  reply	other threads:[~2009-04-18  0:04 UTC|newest]

Thread overview: 66+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-17 19:09 MR97310A and other image formats Jean-Francois Moine
2009-02-17 19:35 ` Thomas Kaiser
2009-02-18  9:25   ` Jean-Francois Moine
2009-02-18 12:58     ` Thomas Kaiser
2009-02-18 19:17       ` Jean-Francois Moine
2009-02-17 19:43 ` Thomas Kaiser
2009-02-18  1:07 ` Kyle Guinn
2009-02-19  0:40   ` kilgota
2009-03-04  0:12   ` RFC on proposed patches to mr97310a.c for gspca and v4l kilgota
2009-03-04  2:50     ` Kyle Guinn
2009-03-04  5:21       ` kilgota
2009-03-04  8:41         ` Thomas Kaiser
2009-03-04  8:54           ` Thomas Kaiser
2009-03-04 19:01             ` kilgota
2009-03-05 13:02               ` Thomas Kaiser
2009-03-05 18:29                 ` kilgota
2009-03-05 19:19                   ` Thomas Kaiser
2009-03-05 19:45                     ` kilgota
2009-03-05 20:29                       ` Thomas Kaiser
2009-03-05 20:55                         ` kilgota
2009-03-05 20:51                           ` Thomas Kaiser
2009-04-15 23:59                 ` Some questions about mr97310 controls (continuing previous thread on mr97310a.c) Theodore Kilgore
2009-04-16 16:10                   ` Thomas Kaiser
2009-04-16 22:50                     ` Theodore Kilgore
2009-04-17  8:36                       ` Hans de Goede
2009-05-02  1:47                   ` Progress with the MR97310A "CIF" cameras Theodore Kilgore
2009-04-16  5:14           ` RFC on proposed patches to mr97310a.c for gspca and v4l Kyle Guinn
2009-04-16 18:22             ` Theodore Kilgore
2009-04-17  4:33               ` Kyle Guinn
2009-04-17 17:50                 ` Theodore Kilgore
2009-04-18  0:04                   ` Kyle Guinn [this message]
2009-04-18  0:43                     ` Theodore Kilgore
2009-04-21  1:18                     ` RFC on proposed patches to mr97310a.c for gspca and v4l (headers) Theodore Kilgore
2009-04-21  2:44                       ` Theodore Kilgore
2009-05-15 22:31             ` Preliminary results with an SN9C2028 camera Theodore Kilgore
2009-05-19  7:56               ` Hans de Goede
2009-05-19 18:18                 ` Theodore Kilgore
2009-03-04  8:39       ` RFC on proposed patches to mr97310a.c for gspca and v4l Hans de Goede
2009-03-04 18:46         ` kilgota
2009-03-05  1:33         ` Kyle Guinn
2009-03-05  7:01           ` Hans de Goede
2009-03-04  8:35     ` Hans de Goede
2009-03-05  2:49     ` Kyle Guinn
2009-03-05  4:34       ` kilgota
2009-03-05  5:54         ` Kyle Guinn
2009-03-05  6:47           ` kilgota
2009-03-05  7:00           ` Hans de Goede
2009-03-05 19:08             ` kilgota
2009-03-05 19:07               ` Hans de Goede
2009-03-05 20:42                 ` kilgota
2009-03-05 20:40                   ` Hans de Goede
2009-03-05 20:58                     ` kilgota
2009-03-06  1:21                       ` Kyle Guinn
2009-03-06  1:57                         ` kilgota
2009-03-28 22:42                         ` [PATCH] to add new camera in gspca/mr97310a.c Theodore Kilgore
2009-02-19 18:17 ` MR97310A and other image formats kilgota
2009-02-19 19:17   ` Thomas Kaiser
2009-02-19 21:54     ` kilgota
2009-02-19 22:45       ` Thomas Kaiser
2009-02-19 23:50         ` kilgota
2009-02-20  0:52           ` Thomas Kaiser
2009-02-20  1:32             ` kilgota
2009-02-20  8:00               ` Thomas Kaiser
2009-02-20 18:45                 ` kilgota
2009-02-20 19:05                   ` Thomas Kaiser
2009-02-20 20:26                     ` kilgota

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200904171904.02986.elyk03@gmail.com \
    --to=elyk03@gmail.com \
    --cc=hdegoede@redhat.com \
    --cc=kilgota@banach.math.auburn.edu \
    --cc=linux-media@vger.kernel.org \
    --cc=moinejf@free.fr \
    --cc=v4l@kaiser-linux.li \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox