linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* 950Q CC Extraction (V4L2/VBI)
@ 2013-07-31 15:55 Trevor Anonymous
  2013-07-31 16:00 ` Devin Heitmueller
  0 siblings, 1 reply; 3+ messages in thread
From: Trevor Anonymous @ 2013-07-31 15:55 UTC (permalink / raw)
  To: linux-media

Hi all, new to the list, hope this is an appropriate place to ask this.

Quick question:
I can extract NTSC analog closed captions with the Hauppauge 950Q as follows:
1. Run v4l2-ctl -i 1 ## Set input to composite
2. In a test application, open file /dev/video0
3. Read 1 byte from the file
** Note: This seems to be sufficient to "start" the device
** Calling VIDIOC_STREAMON ioctl is *not* sufficient
4. Run: zvbi-ntsc-cc -c -d /dev/vbi0 ## Prints the closed captions
5. Close file handle to /dev/video0 when finished. Device "stops".
My question: Is opening the device and reading 1 byte a good/ok way to
start the device? I'm only interested in closed captions, and want
this to be as small a footprint as possible. I'm worried that this
method may break in future driver versions.

-----


More details:
I'm involved in an automation project where we need to extract CEA-608
Closed Caption data (NTSC/VBI line 21) from an analog (RF and/or
composite) input stream.

I am evaluating the Hauppauge 950Q for this purpose. The one I've
received uses the xc5000c firmware.

I've found I can use mplayer/vlc to configure and start the device,
and zvbi-ntsc-cc to extract the data. But I need to make this as
simple and lightweight as possible (may want this to run with multiple
devices connected, or run on something like a Raspberry Pi). So I
figured out that reading 1 byte works as I detailed above works, just
not sure if this will suddenly break one day.

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

* Re: 950Q CC Extraction (V4L2/VBI)
  2013-07-31 15:55 950Q CC Extraction (V4L2/VBI) Trevor Anonymous
@ 2013-07-31 16:00 ` Devin Heitmueller
  2013-07-31 16:59   ` Trevor Anonymous
  0 siblings, 1 reply; 3+ messages in thread
From: Devin Heitmueller @ 2013-07-31 16:00 UTC (permalink / raw)
  To: Trevor Anonymous; +Cc: linux-media

On Wed, Jul 31, 2013 at 11:55 AM, Trevor Anonymous
<trevor.forums@gmail.com> wrote:
> Hi all, new to the list, hope this is an appropriate place to ask this.
>
> Quick question:
> I can extract NTSC analog closed captions with the Hauppauge 950Q as follows:
> 1. Run v4l2-ctl -i 1 ## Set input to composite
> 2. In a test application, open file /dev/video0
> 3. Read 1 byte from the file
> ** Note: This seems to be sufficient to "start" the device
> ** Calling VIDIOC_STREAMON ioctl is *not* sufficient
> 4. Run: zvbi-ntsc-cc -c -d /dev/vbi0 ## Prints the closed captions
> 5. Close file handle to /dev/video0 when finished. Device "stops".
> My question: Is opening the device and reading 1 byte a good/ok way to
> start the device? I'm only interested in closed captions, and want
> this to be as small a footprint as possible. I'm worried that this
> method may break in future driver versions.

Hi Trevor,

The fact that you need video streaming in order to access CC is a bug
in the driver (brought to my attention only a couple of weeks ago).  I
didn't properly setup the referencing counting for when to start/stop
the isoc FIFO, so the arrival of data is implicitly tied to the use of
/dev/video.

The hack you've described should work as long as you keep the
filehandle open (in fact it's pretty much what the other user hacked
in userland to workaround the bug).  That said, I would like to fix
the underlying bug so that the driver behaves like it's supposed to
(which means you should be able to access /dev/vbi for CC capture
without having to muck with streaming from /dev/video).  I suspect
that the fix won't cause the workaround you're proposing to stop
working.

Devin

-- 
Devin J. Heitmueller - Kernel Labs
http://www.kernellabs.com

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

* Re: 950Q CC Extraction (V4L2/VBI)
  2013-07-31 16:00 ` Devin Heitmueller
@ 2013-07-31 16:59   ` Trevor Anonymous
  0 siblings, 0 replies; 3+ messages in thread
From: Trevor Anonymous @ 2013-07-31 16:59 UTC (permalink / raw)
  To: Devin Heitmueller; +Cc: linux-media

Great, thanks for your help Devin.

-Trevor


On Wed, Jul 31, 2013 at 12:00 PM, Devin Heitmueller
<dheitmueller@kernellabs.com> wrote:
> On Wed, Jul 31, 2013 at 11:55 AM, Trevor Anonymous
> <trevor.forums@gmail.com> wrote:
>> Hi all, new to the list, hope this is an appropriate place to ask this.
>>
>> Quick question:
>> I can extract NTSC analog closed captions with the Hauppauge 950Q as follows:
>> 1. Run v4l2-ctl -i 1 ## Set input to composite
>> 2. In a test application, open file /dev/video0
>> 3. Read 1 byte from the file
>> ** Note: This seems to be sufficient to "start" the device
>> ** Calling VIDIOC_STREAMON ioctl is *not* sufficient
>> 4. Run: zvbi-ntsc-cc -c -d /dev/vbi0 ## Prints the closed captions
>> 5. Close file handle to /dev/video0 when finished. Device "stops".
>> My question: Is opening the device and reading 1 byte a good/ok way to
>> start the device? I'm only interested in closed captions, and want
>> this to be as small a footprint as possible. I'm worried that this
>> method may break in future driver versions.
>
> Hi Trevor,
>
> The fact that you need video streaming in order to access CC is a bug
> in the driver (brought to my attention only a couple of weeks ago).  I
> didn't properly setup the referencing counting for when to start/stop
> the isoc FIFO, so the arrival of data is implicitly tied to the use of
> /dev/video.
>
> The hack you've described should work as long as you keep the
> filehandle open (in fact it's pretty much what the other user hacked
> in userland to workaround the bug).  That said, I would like to fix
> the underlying bug so that the driver behaves like it's supposed to
> (which means you should be able to access /dev/vbi for CC capture
> without having to muck with streaming from /dev/video).  I suspect
> that the fix won't cause the workaround you're proposing to stop
> working.
>
> Devin
>
> --
> Devin J. Heitmueller - Kernel Labs
> http://www.kernellabs.com

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

end of thread, other threads:[~2013-07-31 16:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-31 15:55 950Q CC Extraction (V4L2/VBI) Trevor Anonymous
2013-07-31 16:00 ` Devin Heitmueller
2013-07-31 16:59   ` Trevor Anonymous

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).