Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: MythTV: Dev

Supporting more Hardware capture cards

 

 

MythTV dev RSS feed   Index | Next | Previous | View Threaded


starz909 at yahoo

Nov 21, 2007, 12:34 PM

Post #1 of 10 (1382 views)
Permalink
Supporting more Hardware capture cards

Hi everyone,

I came to a problem with my closed captioning a while
back for both my ATSC card and my H/W MPEG card. For
the ATSC card, my problem was that I was using
libmpeg2 decoding. I heard in some places that this
doesn't support displaying captioning - so I really
think there should be a disclaimer saying such if it
is enabled in MythTV before others spend days wracking
their brains as to why the captioning is not being
displayed.

The reason, by the way, that I enabled libmpeg2
decoding is because it was advertised to be more
efficient on some AMD processors. I got rid of XVMC
because it was making my OSD ugly.

For the H/W MPEG card, the simple reason is that it's
just not supported in Mythtv. For those of you who
know me, you know that I'm using the Avermedia M150
card.
Without using Andrew Malota's patch (copied below
for perusal) I get no screen and mythfrontend crashes.
With the patch and LinuxTV.org's latest blackbird HG
drivers, I get a perfect screen, smooth channel
changing, and good sound. Only I don't get closed
captioning to display. I know that the drivers
support the VBI from the card because a working VBI
device node is created for the software analog side of
the card.

What would it take to have this card officially
supported in Mythtv?

Sam

Andrew Malota's patch (might be word-wrapped):

> Index: libs/libmythtv/mpegrecorder.cpp
>
===================================================================
> --- libs/libmythtv/mpegrecorder.cpp (revision
> 14704)
> +++ libs/libmythtv/mpegrecorder.cpp (working
> copy)
> @@ -324,7 +324,7 @@
>
> bool MpegRecorder::OpenV4L2DeviceAsInput(void)
> {
> - chanfd = open(videodevice.ascii(), O_RDWR);
> + chanfd = open(videodevice.ascii(), O_RDWR |
> O_NONBLOCK);
> if (chanfd < 0)
> {
> VERBOSE(VB_IMPORTANT, LOC_ERR + "Can't open
> video device. " + ENO);
> @@ -447,7 +447,7 @@
>
> SetVBIOptions(chanfd);
>
> - readfd = open(videodevice.ascii(), O_RDWR |
> O_NONBLOCK);
> + readfd = chanfd;
> if (readfd < 0)
> {
> VERBOSE(VB_IMPORTANT, LOC_ERR + "Can't open
> video device." + ENO);
>



____________________________________________________________________________________
Get easy, one-click access to your favorites.
Make Yahoo! your homepage.
http://www.yahoo.com/r/hs
_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev


nigel at ind

Nov 22, 2007, 4:18 PM

Post #2 of 10 (1287 views)
Permalink
Re: Supporting more Hardware capture cards [In reply to]

> For the ATSC card, my problem was that I was using
> libmpeg2 decoding. I heard in some places that this
> doesn't support displaying captioning


I only have one captioned source file handy,
but it does seem to work for me:

...
2007-11-23 11:08:24.732 AFD: Using libmpeg2 for video decoding
2007-11-23 11:08:24.732 AFD: Looking for decoder for MPEG2VIDEO
2007-11-23 11:08:24.732 AFD: Opened codec 0x191f000, id(MPEG2VIDEO)
type(Video)
2007-11-23 11:08:24.732 AFD: Stream #1, has id 0x2316 codec id
DVB_VBI, type Data, bitrate 0 at 0x0x15dc2f70
2007-11-23 11:08:24.733 AFD: Teletext caption #0 is in the English
language on page 8 1.
2007-11-23 11:08:24.733 AFD: data codec (Data)
2007-11-23 11:08:24.733 AFD: Stream #2, has id 0x2315 codec id AC3,
type Audio, bitrate 448000 at 0x0x15dc25d0
2007-11-23 11:08:24.733 AFD: Looking for decoder for AC3
2007-11-23 11:08:24.734 AFD: Opened codec 0x191f800, id(AC3) type(Audio)
2007-11-23 11:08:24.734 RingBuf(myth://
149.135.128.77:6543/1001_20060101110000_20060101113000.nuv):
CalcReadAheadThresh(2413899711 KB)
-> threshhold(64 KB) min read(0 KB) blk size
(32 KB)
2007-11-23 11:08:24.871 Dec: Trying to select track (w/lang)
2007-11-23 11:08:24.871 Dec: Selecting first track
2007-11-23 11:08:24.871 Dec: Selected track #1 in the Unknown language
(0)
2007-11-23 11:08:24.871 Dec: Selected track #1 in the English language
(6647399)

--
Nigel Pearson, nigel [at] ind| I've been talking to-
Telstra Net. Eng., Sydney, Australia | the ship's computer.
Office: 9202 3900 Fax: 9261 3912 | ... It hates me!
Mobile: 0408 664435 Home: 9792 6998 | Marvin


_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev


starz909 at yahoo

Nov 22, 2007, 6:01 PM

Post #3 of 10 (1288 views)
Permalink
Re: Supporting more Hardware capture cards [In reply to]

I was wondering that. I know it didn't work for me
with digital channels, and I saw a few unanswered
posts from people that had the same problem. I also
saw one post from a mail list that said that libmpeg2
didn't support CC very well. But since it wasn't
widely talked about, I just assumed that no-one was
using captioning and/or libmpeg2 or at least didn't
care if captioning was displayed.


--- Nigel Pearson <nigel [at] ind> wrote:

> > For the ATSC card, my problem was that I was using
> > libmpeg2 decoding. I heard in some places that
> this
> > doesn't support displaying captioning
>
>
> I only have one captioned source file handy,
> but it does seem to work for me:
>
> ...
> 2007-11-23 11:08:24.732 AFD: Using libmpeg2 for
> video decoding
> 2007-11-23 11:08:24.732 AFD: Looking for decoder for
> MPEG2VIDEO
> 2007-11-23 11:08:24.732 AFD: Opened codec 0x191f000,
> id(MPEG2VIDEO)
> type(Video)
> 2007-11-23 11:08:24.732 AFD: Stream #1, has id
> 0x2316 codec id
> DVB_VBI, type Data, bitrate 0 at 0x0x15dc2f70
> 2007-11-23 11:08:24.733 AFD: Teletext caption #0 is
> in the English
> language on page 8 1.
> 2007-11-23 11:08:24.733 AFD: data codec (Data)
> 2007-11-23 11:08:24.733 AFD: Stream #2, has id
> 0x2315 codec id AC3,
> type Audio, bitrate 448000 at 0x0x15dc25d0
> 2007-11-23 11:08:24.733 AFD: Looking for decoder for
> AC3
> 2007-11-23 11:08:24.734 AFD: Opened codec 0x191f800,
> id(AC3) type(Audio)
> 2007-11-23 11:08:24.734 RingBuf(myth://
>
149.135.128.77:6543/1001_20060101110000_20060101113000.nuv):
>
> CalcReadAheadThresh(2413899711 KB)
> -> threshhold(64 KB) min
> read(0 KB) blk size
> (32 KB)
> 2007-11-23 11:08:24.871 Dec: Trying to select track
> (w/lang)
> 2007-11-23 11:08:24.871 Dec: Selecting first track
> 2007-11-23 11:08:24.871 Dec: Selected track #1 in
> the Unknown language
> (0)
> 2007-11-23 11:08:24.871 Dec: Selected track #1 in
> the English language
> (6647399)
>
> --
> Nigel Pearson, nigel [at] ind| I've been
> talking to-
> Telstra Net. Eng., Sydney, Australia | the ship's
> computer.
> Office: 9202 3900 Fax: 9261 3912 | ... It hates
> me!
> Mobile: 0408 664435 Home: 9792 6998 | Marvin
>
>
> _______________________________________________
> mythtv-dev mailing list
> mythtv-dev [at] mythtv
>
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
>



____________________________________________________________________________________
Get easy, one-click access to your favorites.
Make Yahoo! your homepage.
http://www.yahoo.com/r/hs
_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev


danielk at cuymedia

Nov 23, 2007, 7:58 AM

Post #4 of 10 (1278 views)
Permalink
Re: Supporting more Hardware capture cards [In reply to]

On Wed, 2007-11-21 at 12:34 -0800, Sam Logen wrote:
> Hi everyone,
>
> I came to a problem with my closed captioning a while
> back for both my ATSC card and my H/W MPEG card. For
> the ATSC card, my problem was that I was using
> libmpeg2 decoding. I heard in some places that this
> doesn't support displaying captioning - so I really
> think there should be a disclaimer saying such if it
> is enabled in MythTV before others spend days wracking
> their brains as to why the captioning is not being
> displayed.

Done. The problem was that the text did not fit in the help
area for the decoder selector. Oscar, the MythTV translation
wrangler had the idea of updating the help text based on which
item you have selected last year, and I finally got around to
implementing it. Now when you select the libmpeg2 decoder it
tells you about this caveat with using this decoder instead
of the Standard full featured decoder.

> For the H/W MPEG card, the simple reason is that it's
> just not supported in Mythtv. For those of you who
> know me, you know that I'm using the Avermedia M150
> card.
<snip>
> What would it take to have this card officially
> supported in Mythtv?

>From the patch it looks like the problem is with the Avermedia M150
driver, so it needs to be patched. The problem appears to be that
the driver only allows the device to be opened once, this is a bug.
I wouldn't totally reject a patch that worked around the driver bug,
but it would need to do the right thing when the bug isn't present
in the drivers, and also properly keep track of the open file
descriptors when the buggy driver is present. The patch you attached
appears to be more of a proof-of-concept patch.

-- Daniel

_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev


starz909 at yahoo

Nov 23, 2007, 1:06 PM

Post #5 of 10 (1274 views)
Permalink
Re: Supporting more Hardware capture cards [In reply to]

Interesting. I hope you don't mind if I tell the V4L
developers what you've told me about the driver. I'll
be in contact with them about this bug.

Sam


--- Daniel Kristjansson <danielk [at] cuymedia> wrote:

> >From the patch it looks like the problem is with
> the Avermedia M150
> driver, so it needs to be patched. The problem
> appears to be that
> the driver only allows the device to be opened once,
> this is a bug.
> I wouldn't totally reject a patch that worked around
> the driver bug,
> but it would need to do the right thing when the bug
> isn't present
> in the drivers, and also properly keep track of the
> open file
> descriptors when the buggy driver is present. The
> patch you attached
> appears to be more of a proof-of-concept patch.
>
> -- Daniel
>
> _______________________________________________
> mythtv-dev mailing list
> mythtv-dev [at] mythtv
>
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
>



____________________________________________________________________________________
Never miss a thing. Make Yahoo your home page.
http://www.yahoo.com/r/hs
_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev


starz909 at yahoo

Nov 24, 2007, 4:45 PM

Post #6 of 10 (1262 views)
Permalink
Re: Supporting more Hardware capture cards [In reply to]

Well, I received a reply from someone from the V4L
mailing lists, and it appears that what, Daniel, you
called a bug, is intentional. As Jelle describes it,
it is to make sure that the mpeg device can only be
opened once.

Sam

--- Jelle Foks <jelle [at] foks> wrote:
> The patch that you included makes the change to
> mythtv so that it opens
> the video device once instead of twice. The
> cx88-mpeg device can only be
> opened once (it checks for that). I believe that was
> added as some kind
> of protection for some cards that can choose between
> either hardware
> encoding or qam/atsc demodulation on the mpeg port,
> to prevent a
> recording-in-progress from being screwed up by
> another program opening
> the device... On my own setup, I simply use a
> patched driver where that
> check/lock is disabled...
>
> I wouldn't say it's a bug in the driver though,
> because afaik it's not a
> bug if a device can't be opened more than once at
> the same time... I'd
> say it's simply not right that mythtv needs to open
> the device twice
> (afaics, there is no need to do so, as shown by the
> result of the patch)...
>
> It's an issue that needs to be resolved, either on
> mythtv's side or the
> cx88-mpeg drive side. I'm not the one who added the
> lock on the driver
> side, nor am I a mythtv developer, so I'll leave the
> fight between who
> has to change what over to others...
>
> About closed-captioning, I don't know anything about
> that, but afaik it
> has nothing to do with cx88-blackbird, because
> closed captioning is the
> vbi device, which is supplied by another part of the
> cx88 driver set.
> I've never been able to get closed captioning to
> work with mythtv
> anyway, including with the pvr-350 card supported by
> the ivtv driver, so
> I've always felt there was something borked about
> mythtv's closed
> captioning support... I don't need closed captioning
> support myself, so
> it never bothered me, really...
>
> Jelle.
>
> >
> > Sam
> >
> >
> > --- Daniel Kristjansson <danielk [at] cuymedia>
> wrote:
> >
> >> >From the patch it looks like the problem is with
> >> the Avermedia M150
> >> driver, so it needs to be patched. The problem
> >> appears to be that
> >> the driver only allows the device to be opened
> once,
> >> this is a bug.
> >> I wouldn't totally reject a patch that worked
> around
> >> the driver bug,
> >> but it would need to do the right thing when the
> bug
> >> isn't present
> >> in the drivers, and also properly keep track of
> the
> >> open file
> >> descriptors when the buggy driver is present. The
> >> patch you attached
> >> appears to be more of a proof-of-concept patch.
> >>
> >> -- Daniel
> >>
> >> _______________________________________________
> >> mythtv-dev mailing list
> >> mythtv-dev [at] mythtv
> >>
> >
>
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
> >
> >
> > ---Mythtv patch begins here (might be word
> wrapped)---
> >
> > Index: libs/libmythtv/mpegrecorder.cpp
> >
>
===================================================================
> > --- libs/libmythtv/mpegrecorder.cpp (revision
> > 14704)
> > +++ libs/libmythtv/mpegrecorder.cpp (working
> copy)
> > @@ -324,7 +324,7 @@
> >
> > bool MpegRecorder::OpenV4L2DeviceAsInput(void)
> > {
> > - chanfd = open(videodevice.ascii(), O_RDWR);
> > + chanfd = open(videodevice.ascii(), O_RDWR |
> > O_NONBLOCK);
> > if (chanfd < 0)
> > {
> > VERBOSE(VB_IMPORTANT, LOC_ERR + "Can't
> open
> > video device. " +
> > ENO);
> > @@ -447,7 +447,7 @@
> >
> > SetVBIOptions(chanfd);
> >
> > - readfd = open(videodevice.ascii(), O_RDWR |
> > O_NONBLOCK);
> > + readfd = chanfd;
> > if (readfd < 0)
> > {
> > VERBOSE(VB_IMPORTANT, LOC_ERR + "Can't
> open
> > video device." +
> > ENO);
> >
> >
> >
>
____________________________________________________________________________________
> > Never miss a thing. Make Yahoo your home page.
> > http://www.yahoo.com/r/hs
> >
> > --
> > video4linux-list mailing list
> > Unsubscribe
>
mailto:video4linux-list-request [at] redhat?subject=unsubscribe
> >
>
https://www.redhat.com/mailman/listinfo/video4linux-list
> >
>



____________________________________________________________________________________
Be a better sports nut! Let your teams follow you
with Yahoo Mobile. Try it now. http://mobile.yahoo.com/sports;_ylt=At9_qDKvtAbMuh1G1SQtBI7ntAcJ
_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev


danielk at cuymedia

Nov 24, 2007, 8:24 PM

Post #7 of 10 (1265 views)
Permalink
Re: Supporting more Hardware capture cards [In reply to]

On Sat, 2007-11-24 at 16:45 -0800, Sam Logen wrote:
> Well, I received a reply from someone from the V4L
> mailing lists, and it appears that what, Daniel, you
> called a bug, is intentional. As Jelle describes it,
> it is to make sure that the mpeg device can only be
> opened once.

Ok, re-examining at the V4L2 spec, it does look like this type
of Microsofty behaviour is unfortunately still allowed. I still
think it's a bad idea to prevent the user from doing something
basic like use one program to tune and another to record. It
seems like that kind of design deficiency would never allow
something like freevo to work elegantly with this device. But
it looks like the V4L2 spec allows it, so it is technically not
a bug. Presumably this was allowed when the spec was written
to make porting bad MS Windows drivers to Linux a trivial task.

In any case, the same advice I gave for a bug work-around patch
applies. It would just be called an 'adding support for XYZ card'
patch instead of a 'working around bug in XYZ card' patch.

-- Daniel

_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev


starz909 at yahoo

Nov 25, 2007, 12:06 AM

Post #8 of 10 (1253 views)
Permalink
Re: Supporting more Hardware capture cards [In reply to]

It's beginning to sound like that behavior is a check
for conexant hybrid cards using the blackbird drivers,
that switch between dvb and broadcast channels. I
found a patch here:

https://www.redhat.com/mailman/private/video4linux-list/2007-May/msg00386.html

That should disable it, and let the hardware get
accessed twice. I'll test the driver patch with an
un-patched MythTV install, and see how that goes.


--- Daniel Kristjansson <danielk [at] cuymedia> wrote:

> Ok, re-examining at the V4L2 spec, it does look like
> this type
> of Microsofty behaviour is unfortunately still
> allowed. I still
> think it's a bad idea to prevent the user from doing
> something
> basic like use one program to tune and another to
> record. It
> seems like that kind of design deficiency would
> never allow
> something like freevo to work elegantly with this
> device. But
> it looks like the V4L2 spec allows it, so it is
> technically not
> a bug. Presumably this was allowed when the spec was
> written
> to make porting bad MS Windows drivers to Linux a
> trivial task.
>
> In any case, the same advice I gave for a bug
> work-around patch
> applies. It would just be called an 'adding support
> for XYZ card'
> patch instead of a 'working around bug in XYZ card'
> patch.
>
> -- Daniel
>
> _______________________________________________
> mythtv-dev mailing list
> mythtv-dev [at] mythtv
>
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
>



____________________________________________________________________________________
Get easy, one-click access to your favorites.
Make Yahoo! your homepage.
http://www.yahoo.com/r/hs
_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev


danielk at cuymedia

Nov 25, 2007, 7:41 AM

Post #9 of 10 (1256 views)
Permalink
Re: Supporting more Hardware capture cards [In reply to]

On Sun, 2007-11-25 at 00:06 -0800, Sam Logen wrote:
> It's beginning to sound like that behavior is a check
> for conexant hybrid cards using the blackbird drivers,
> that switch between dvb and broadcast channels. I
> found a patch here:
>
> https://www.redhat.com/mailman/private/video4linux-list/2007-May/msg00386.html
>
> That should disable it, and let the hardware get
> accessed twice. I'll test the driver patch with an
> un-patched MythTV install, and see how that goes.

Sam, that URL requires a password... Anyway, I find this bit
interesting since the conexant based hybrid cards worked well
in 2006 and early 2007, but then began acting funky and requiring
driver module parameters to work at all. Maybe there is a single
easily revertible patch breaking both MPEG recording, and
analog<->digital switching on hybrid cards?

-- Daniel

_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev


starz909 at yahoo

Nov 25, 2007, 12:30 PM

Post #10 of 10 (1252 views)
Permalink
Re: Supporting more Hardware capture cards [In reply to]

Oops, Sorry. Try this link Daniel:

http://lists-archives.org/video4linux/18478-cx88-blackbird-multiple-fd-s-and-advise_acquire.html

Steven Toth from the V4L list seemed to know something
about it, and wrote me; his email is below.

Sam

--- Steven Toth <stoth [at] linuxtv> wrote:

> The driver has a single resource (the transport bus)
> that can only be
> used by either the DVB-T or the MPEG encoder at any
> given time, any
> attempt to try and use both drives GPIO which breaks
> both analog and/or
> digital.
>
> The driver protects against that from happening.
>
> However, as someone mentioned earlier on this list,
> when I implemented
> that I made an assumption which effected the 88x
> tree (which I believe
> another dev has since patched), which meant that the
> frontend device
> could henceforth be only opened by one app at any
> given time, a
> subsequent request was return -EBUSY (IIRC).
>
> This broke myth, and possibly other apps.
>
> To rectify this, another dev posted a patch on this
> list a few months
> ago (sorry - the author escapes me) and the problem
> should be completely
> resolved in the current master branch of v4l-dvb.
>
> That being said, I see no reason why an application
> needs to open the
> same device multiple times.
>
> Regards,
>
> Steve
>


--- Daniel Kristjansson <danielk [at] cuymedia> wrote:

> On Sun, 2007-11-25 at 00:06 -0800, Sam Logen wrote:
> > It's beginning to sound like that behavior is a
> check
> > for conexant hybrid cards using the blackbird
> drivers,
> > that switch between dvb and broadcast channels. I
> > found a patch here:
> >
> >
>
https://www.redhat.com/mailman/private/video4linux-list/2007-May/msg00386.html
> >
> > That should disable it, and let the hardware get
> > accessed twice. I'll test the driver patch with
> an
> > un-patched MythTV install, and see how that goes.
>
>
> Sam, that URL requires a password... Anyway, I find
> this bit
> interesting since the conexant based hybrid cards
> worked well
> in 2006 and early 2007, but then began acting funky
> and requiring
> driver module parameters to work at all. Maybe there
> is a single
> easily revertible patch breaking both MPEG
> recording, and
> analog<->digital switching on hybrid cards?
>
> -- Daniel
>
> _______________________________________________
> mythtv-dev mailing list
> mythtv-dev [at] mythtv
>
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
>



____________________________________________________________________________________
Never miss a thing. Make Yahoo your home page.
http://www.yahoo.com/r/hs
_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev

MythTV dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.