public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Edgar Toernig <froese@gmx.de>
To: linux-kernel@vger.kernel.org
Cc: video4linux-list@redhat.com
Subject: bttv 2.6.16: wrong VBI_OFFSET?
Date: Mon, 24 Apr 2006 19:02:00 +0200	[thread overview]
Message-ID: <20060424190200.653333fe.froese@gmx.de> (raw)

Hi,

in 2.6.16 the code in driver/media/video/bttv-vbi.c was changed
a little bit.  Beside other things, the constant 244 for the vbi
offset was replaced by a #define VBI_OFFSET 128.

Afaics, the old value 244 was correct - was the change to 128
intentionally?

The reason I ask is because it broke the teletext decoder AleVT.
The teletext standard defines where the clock run-in pulses
have to lie (13th bit at 12us/-1us/+0.4us).  For the complete
16 bits of clock run-in that comes down to 9.2us for the start
of the first bit and 12.9us for the end of the last bit.

Here are two oscilloscope shots showing the difference between
offset 244 and 128 - the red line is the interval 9.2us-12.9us:

	http://goron.de/~froese/vbi-offset244.gif
	http://goron.de/~froese/vbi-offset128.gif

As one can see, offset 244 fits very well.  The clock run-in
lies where it's expected.  With offset 128 it's completely
off - no way to find it at that position.

One can also see that the sampling starts somewhere within
the color burst, not at the trailing edge of hsync as some
comment in the code may imply.

Ciao, ET.


PS: In bttv_vb_try_fmt code was changed from 32 to 64 bit
arithmetic:

|        /* s64 to prevent overflow. */
|        count0 = (s64) f->fmt.vbi.start[0] + f->fmt.vbi.count[0]
|                - tvnorm->vbistart[0];
|        ...

What should that change fix?  These values will never overflow -
they fit into 16 bits each.

             reply	other threads:[~2006-04-24 17:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-24 17:02 Edgar Toernig [this message]
2006-04-24 19:09 ` bttv 2.6.16: wrong VBI_OFFSET? matthieu castet
2006-04-24 21:55   ` Edgar Toernig

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=20060424190200.653333fe.froese@gmx.de \
    --to=froese@gmx.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=video4linux-list@redhat.com \
    /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