Modify

Opened 12 years ago

Closed 12 years ago

Last modified 11 years ago

#368 closed patch (fixed)

Teletext patch for DVB/IVTV cards

Reported by: Frank Muenchow (beebof -at- gmx dot de) Owned by: danielk
Priority: minor Milestone: 0.20
Component: mythtv Version: 0.20
Severity: low Keywords:
Cc: Ticket locked: no

Description

Here you can find a patch for displaying teletext with ivtv and dvb cards. (against r7297):

http://mitglied.lycos.de/beebof/myth.html

Note that this patch for the "analogue" teletext (as defined in ETSI EN 300 706).

Important! This patch breaks the definition of TOGGLECC (Toggle CC / Toggle Teletext). My intention was to recognize automatically what type of card is used (ivtv/dvb or another) but I actually don't know how to realize that and even if I would, I couldn't test, because I only have a DVB card.

Thanks to Martin Barnasconi who did the initial patch for IVTV cards.

Attachments (17)

mythtv_teletext_20050923.tar.bz2 (22.2 KB) - added by beebof -at- gmx dot de 12 years ago.
mythdvb_teletext.tbz (21.0 KB) - added by danielk 12 years ago.
updated patch
myth_dvb_ivtv_teletext.patch.bz2 (22.2 KB) - added by danielk 12 years ago.
updated version
myth_dvb_ivtv_teletext-v2.patch.bz2 (21.8 KB) - added by danielk 12 years ago.
updated version of patch
myth_dvb_ivtv_teletext-v3.patch.bz2 (13.8 KB) - added by danielk 12 years ago.
updated version
mythtv_teletext.tar.bz2 (13.8 KB) - added by beebof 12 years ago.
update
osdsurface.diff (3.0 KB) - added by paulh 12 years ago.
adds protection to the usedRegions to make it thread safe
mythtv_teletext.tar.2.bz2 (14.1 KB) - added by beebof 12 years ago.
updated patch
mythtv_teletext_20060111.patch (75.5 KB) - added by beebof 12 years ago.
new patc
mfe-debug.tar.gz (7.0 KB) - added by jyrki.n@… 12 years ago.
mythfrontend segmentation fault logs
processdvbdatapacket.diff (699 bytes) - added by jyrki.n@… 12 years ago.
Patch to handle data_unit for stuffing without hitting VERBOSE(...)
oc-ivtv_teletext_bt (13.6 KB) - added by oscar 12 years ago.
BT of teletext crash using r9050 and ivtv
teletext.diff (6.7 KB) - added by frankm 12 years ago.
fixes problems with doubleheighted characters / teletext key bindings
mythtv_teletext_20060310.diff (2.9 KB) - added by frankm 12 years ago.
Patch to get it working again
mythtv_teletext_20060320.diff.gz (2.2 KB) - added by frankm 12 years ago.
split teletext and cpations
mythtv_teletext_20060325.diff.gz (5.2 KB) - added by frankm 12 years ago.
enable teletext captions
teletext.2.diff (1.7 KB) - added by frankm 12 years ago.
fix for teletext captions

Download all attachments as: .zip

Change History (52)

Changed 12 years ago by beebof -at- gmx dot de

Changed 12 years ago by danielk

updated patch

comment:1 Changed 12 years ago by danielk

  • Milestone set to 0.20
  • Owner changed from ijr to danielk
  • Severity changed from medium to low
  • Status changed from new to assigned
  • Type changed from enhancement to patch
  • Version set to head

I've fixed a few things in the patch, but it still needs some care.

First, you can't inherit two QObject's, nor can you use virtual inheritance for the QObject. So I've disabled the signals and slots in the TeletextView? class. The affected areas are marked with "FIXME" ifdef's. Try to just use direct calls when possible, it is too easy to make mistakes like this with Qt signals.

There was also a logic error in one of the switch statements because you didn't use bracing for the loops, and then commented out the statement, so it put the next couple case's inside the loops. This is fixed.

Also no TAB characters are allowed... this messes up the formatting of the patches and makes them harder to read. I think I got rid of most of them.

For the ivtv/dvb/other test look at TV::GetLockTimeout?(), if you replace the query with "SELECT cardtype FROM capturecard WHERE cardid = :CARDID" then you will have the card type.

Part of the mpegts.c patch was rejected, and I didn't know what you were doing so please look at that.

comment:2 Changed 12 years ago by danielk

Oh, and please doxygen document all the new methods, classes, and variables. Thx.

Changed 12 years ago by danielk

updated version

comment:3 Changed 12 years ago by danielk

Looks good, but I don't think I'll be able to review this fully before 0.19.

But on a cursory review it looks ok. I did some renaming of functions and added some const correctness. The only thing you really have to look at is the variables at the end of VBIDecoder. These were global and I made them instance variables.

Also what version of ivtv is needed to test this? I noticed you changed the VBI encoding for ivtv. What was the problem with the existing encodings? My hope was that old recordings would have decodable captions...

comment:4 Changed 12 years ago by anonymous

I downloaded this patch (mythtv_teletext_20050923.tar.bz2) and applied to revision 7827 (as shown in the patch file). It applies OK, Myth compiles OK, but on trying to see subtitles, I get nothing at all. Maybe it is something related to the ivtv driver version, because I get some error in the myth console output saying that it was not able to record (not sure about the exact word used) VBI. I use the stable release 0.4 of ivtv driver, with a Hauppage PVR-250 card. There is something I can try? Which version of ivtv driver did you use? Maybe it is another key to access teletext (not "T")? Thanks. Joaquin.

comment:5 Changed 12 years ago by beebof

I don't know if it works with ivtv cards (I don't have one), but I know that it had worked, and I didn't change anything of the encoding/decoding part for ivtv cards. Maybe, somebody with an ivtv card could test it again?

Joaquin: Teletext should start with your key for "TOGGLECC" (normally T) - then, you should see either the teletext start page or (if no data is present) "teletext page unavailable".

comment:6 Changed 12 years ago by oscar

More testing with IVTV (version 0.4.0). Two cards (250 and 350) are set up with VBI device /dev/vbi0 and /dev/vbi1.

During recording, mythbackend spits out some:

vbi: Invalid argument

mythfrontend doesn't report anything relevant even with the vbi verbose flag. With one of the cards recording i got a "Teletext page unavailable" when hitting T.

If i cat /dev/vbi0 during recording I get alot of data, allthough nothing on vbi1..

comment:7 Changed 12 years ago by oscar

Also just found this in dmesg:

ivtv0 warning: Starting VBI after starting an encoding, seems to not work.

comment:8 Changed 12 years ago by Jochen

I've tryed the patch before a few days, but i can't view a few of my recordings after that, myth quitts with a segfault!

Changed 12 years ago by danielk

updated version of patch

comment:9 Changed 12 years ago by danielk

(In [8222]) References #368.

Adds a vbi verbosity option. Code using it will be checked in over the next few days as part of enabling VBI capture and display for ivtv v4.0+ drivers, and perhaps embedded teletext in DVB as well.

comment:10 Changed 12 years ago by danielk

(In [8240]) References #368.

This enables decoding closed caption data in ivtv recordings.

comment:11 Changed 12 years ago by gkruse@…

Wanted to try this out, but I get the following in the backend log:

2005-12-12 12:20:56.254 Can't enable VBI recording (2) vbi: Invalid argument

This is with ivtv 0.4.0

comment:12 Changed 12 years ago by anonymous

You probably have a pvr-150/500 - ivtv doesn't support CC on those.

comment:13 Changed 12 years ago by danielk

(In [8241]) References #368.

More of Frank Muenchow's patch.

This adds decoding for field 2 w/ivtv, so we can now decode XDS. XDS tells you about the channel, program name, V-Chip, time, etc.

This also adds decoding for VPS and WSS; these are printed out when you run with '-v vbi'. The VPS info would of course be more useful on the backend, but that is left as an exersize for people in PAL land. The WSS info could be very useful on the frontend as it tells you the aspect ratio of analog transmissons...

Changed 12 years ago by danielk

updated version

Changed 12 years ago by beebof

update

comment:14 Changed 12 years ago by beebof

updated patch

Decoding and caching should work like requested. OSDTypeTeletext::PageUpdated?() and OSDTypeTeletext::HeaderUpdated?() segfaults - I don't know why yet (I'm not very familiar in OSD Programming) - maybe somebody take a look on this :)

And: I cannot test the IVTV part - but it *should* work.

Changed 12 years ago by paulh

adds protection to the usedRegions to make it thread safe

comment:15 Changed 12 years ago by paulh

The osdsurface patch fixes the regular segfaults in PageUpdated?() and HeaderUpdated?() when using the teletext patch.

Something seems to be broken with the last teletext patch in the page caching. The headers are all being cached ok but the rest of the page is either missing completely (just a black background) or there are a few lines at the top with the lines below missing. The v3 patch didn't have this problem so the reorganising has changed something. I'm using the IVTV driver.

comment:16 Changed 12 years ago by danielk

paulh, I believe that code is commented out in v3, I sent Frank Muenchow an e-mail with the info on the things that are broken. If you want to work on this contact him directly, he didn't have much time the last time I e-mailed him (before X-Mas), but he may have more time now.

Changed 12 years ago by beebof

updated patch

comment:17 Changed 12 years ago by beebof aka frank

paulh, your patch works fine. :)

I've attached the newest patch - with some changes in AddTeletextData?. Please try it - hopefully, it will work now.

comment:18 Changed 12 years ago by beebof

sorry, the filename is broken. It should be "mythtv_teletext.tar.bz2"

comment:19 Changed 12 years ago by alfi

Hey All

I have try the mythtv_teletext.tar.2.bz2 (against 8930) on Canal Digital Nordig and it works :-) but I get “NVP: prebuffering pause” on the frontend :-(

/Mark

comment:20 Changed 12 years ago by anonymous

I am also experiencing frontend crashes with the new teletext patch applied (“NVP: prebuffering pause”). I'm using svn 8730. Great work though! I have been using your old patch since this summer and it has helped me countless times while watching asian moviews.

/Peter

Changed 12 years ago by beebof

new patc

comment:21 Changed 12 years ago by beebof

updated patch including changes from Paul H.

Changes (most of them by Paul H. - thanks!): It determines the stream type and adds it only if it's teletext (reference: Changeset 8517).

Resets the page cache when changing channel.

Fix the drawing of the header only the last 32 characters are printable unlike other rows where 40 characters are printable.

Only draw the header for pages that are in the current magazine and try to only update the page when necessary to try to reduce flicker.

Add a status line above the header that shows available subpages or an error message like "Page Not Available".

Make moving to the next/previous page and subpage a little smarter.

Update SetBackgroundColor?() to accept TTColor::TRANSPARENT used by the subtitle and news flash stuff.

Update DrawLine?() to use the 'start box' and 'end box' codes used by subtitle pages. Not quite working 100% right yet.

Add support for the reveal function used by some teletext pages that hide the answers to a quiz until you press the reveal key.

Add some defines for the page flags.

Change a lot of tabs to spaces to make the source more in line with the rest of myth.

A few fixes to the Fast Text stuff. (not working 100% yet)

Other fixes I have forgot about.

Changed 12 years ago by jyrki.n@…

mythfrontend segmentation fault logs

comment:22 Changed 12 years ago by jyrki.n@…

  • Type changed from patch to task

Just for completing my attachement. I got segmentation fault when I activating second instance of teletext viewing (LiveTV -> Teletext on -> Teletext off -> channel change -> Teletext on = segmentation fault). I'm trying to dig into this myself, but any shortcuts are welcome...

comment:23 Changed 12 years ago by danielk

(In [9037]) References #368. Add recognition of DVB encoded VBI stream in MPEG streams.

comment:24 Changed 12 years ago by danielk

(In [9040]) References #368. Adds DVB Teletext decoder by applying patch.

This adds DVB Teletext decoding to MythTV.

To enable just press 'T' when watching a DVB recording. F2 -> F6 switches between colored menus, and F12 reveals hidden text.

I'm not closing the ticke because I only have a couple test streams to test this with, and I've fixed a couple segfaults... But since this unstability is only exposed when you enable this previously unimplemented feature, I'm applying to SVN now.

Please attach any DVB Teletext crash backtraces to #368 for Frank and me to look at.

Changed 12 years ago by jyrki.n@…

Patch to handle data_unit for stuffing without hitting VERBOSE(...)

Changed 12 years ago by oscar

BT of teletext crash using r9050 and ivtv

comment:25 Changed 12 years ago by oscar

Attached a bt of teletext with ivtv. Sometimes works a couple of page changes, sometimes dies at once..

Changed 12 years ago by frankm

fixes problems with doubleheighted characters / teletext key bindings

comment:26 Changed 12 years ago by frank

Attached a patch that fixes a possible problem with displaying doubleheighted characters. (hopefully)

Also adds Teletext keybindings. You have to delete the "TV Playback" keybindings for MENURED, MENUGREEN, MENUYELLOW, MENUBLUE, MENUWHITE and REVEAL as they are not used anymore.

comment:27 Changed 12 years ago by frankm

It seems that [9291] breaks DVB teletext. To get it working again, apply the attached patch.

  • I changed NVP->GetCaptionMode?(): It's used to determine which type of caption is used - but textDisplayMode is set because of the result of this function - Daniel, please have a look at this, it may be dirty (and I only changed the TeletextMode? A)
  • The OSDTypeTeletext has to be initialized before the TV starts - because the decoded date in TeletextDecoder? is passed to this and otherwise it doesn't work (and doesn't cache)

Changed 12 years ago by frankm

Patch to get it working again

comment:28 Changed 12 years ago by danielk

(In [9346]) References #368. Fixes a few problems with DVB/IVTV teletext decoder.

I have not re-enabled this decoder as the default decoder, when it is possible to run it. The code for doing this is in NVP::SetCaptionsEnabled?(), but I commented it out on purpose in the last commit. First, because it doesn't decode captions (at least when you first enable it), and second because it is still very very unstable. But, this teletext decoder can be accessed by binding "NEXTCC" and pressing that key until you get past the subtitle streams.

Changed 12 years ago by frankm

split teletext and cpations

comment:29 Changed 12 years ago by frankm

The patch splits captions and teletext. You need to bind "TOGGLETT" to get teletext working.

Changed 12 years ago by frankm

enable teletext captions

comment:30 Changed 12 years ago by frankm

Update my latest patch:

  • enable teletext with "TOGGLETT"
  • teletext captions are recognized and can be enabled in playback menu.

This is experimental! Please test and let me know if it works for you. Take a look at the frontend log with -v playback, you should get something like this when you have teletext captions:

2006-03-25 22:40:15.359 AFD: Teletext caption #4 is in the Finnish language on page 6 153.

comment:31 Changed 12 years ago by danielk

  • Resolution set to fixed
  • Status changed from assigned to closed

(In [9547]) Closes #368, by applying patch.

This patch appears to fix all outstanding problems with Frank's new ivtv/dvb teletext decorder.

Changed 12 years ago by frankm

fix for teletext captions

comment:32 Changed 12 years ago by frankm

  • Resolution fixed deleted
  • Status changed from closed to reopened

Attached a fix for teletext captions and teletext is jusdt called "Teletext", not "Teletext Menu" (at least here in Germany)

comment:33 Changed 12 years ago by danielk

  • Resolution set to fixed
  • Status changed from reopened to closed

(In [9617]) Closes #368, fixes some Teletext caption selection code by applying patch from Frank M.

I didn't apply the help text changes, that should be done through the German translation file.

comment:34 Changed 11 years ago by anonymous

  • Version changed from head to 0.20

comment:35 Changed 11 years ago by anonymous

  • Type changed from task to patch

Add Comment

Modify Ticket

Action
as closed The owner will remain danielk.
The resolution will be deleted. Next status will be 'new'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.