Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 135788 - nxtvepg cannot handle with new VBI kernel interface.
Summary: nxtvepg cannot handle with new VBI kernel interface.
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Lars Weiler (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-06-06 09:16 UTC by Cyril Mertens
Modified: 2008-04-09 07:33 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
media-tv/nxtvepg-2.8.0_pre12.ebuild (nxtvepg-2.8.0_pre12.ebuild,1.73 KB, text/plain)
2006-07-08 01:17 UTC, Martin Egge
Details
nxtvepg-2.8.0_pre12-db.patch (nxtvepg-2.8.0_pre12-db.patch,630 bytes, patch)
2006-07-08 02:04 UTC, Martin Egge
Details | Diff
nxtvepg-2.8.0_pre12-nogui.patch (nxtvepg-2.8.0_pre12-nogui.patch,479 bytes, patch)
2006-07-08 02:07 UTC, Martin Egge
Details | Diff
nxtvepg-2.8.0_pre12-zvbi.patch (nxtvepg-2.8.0_pre12-zvbi.patch,646 bytes, patch)
2006-07-08 02:08 UTC, Martin Egge
Details | Diff
nxtvepg-2.8.0_pre12-dvb.patch (nxtvepg-2.8.0_pre12-dvb.patch,6.59 KB, patch)
2006-07-08 02:10 UTC, Martin Egge
Details | Diff
nxtvepg-2.8.0_pre12-debug_off.patch (nxtvepg-2.8.0_pre12-debug_off.patch,1.45 KB, patch)
2006-07-08 02:11 UTC, Martin Egge
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Cyril Mertens 2006-06-06 09:16:59 UTC
emerge info

Portage 2.0.54-r2 (default-linux/x86/2006.0, gcc-3.4.6, glibc-2.3.6-r3, 2.6.16-gentoo-r9 i686)
=================================================================
System uname: 2.6.16-gentoo-r9 i686 AMD Athlon(tm) XP 2800+
Gentoo Base System version 1.6.14
ccache version 2.3 [enabled]
dev-lang/python:     2.4.2
dev-python/pycrypto: [Not Present]
dev-util/ccache:     2.3
dev-util/confcache:  [Not Present]
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.16.1-r2
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=athlon-xp -Os -pipe -fomit-frame-pointer -ftracer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config"
CONFIG_PROTECT_MASK="/etc/gconf /etc/splash /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -mcpu=i686 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig ccache digest distlocks sandbox sfperms strict"
GENTOO_MIRRORS="http://ftp.belnet.be/mirror/rsync.gentoo.org/gentoo/"
LANG="fr_FR@euro"
LC_ALL="fr_FR@euro"
LINGUAS="fr_FR fr en"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="x86 3dnow X aac acl acpi activefilter alsa apache2 apm arts asf atm audiofile avi bash-completion berkdb bitmap-fonts bzip2 cairo cdparanoia cdr cli crypt cups curl dbus dga dhcp directfb divx4linux dri dvd dvdread eds emboss encode esd exif expat fam ffmpeg flac foomaticdb fortran fr gdbm gif gimp gimpprint glut gnome gphoto2 gpm gstreamer gtk gtk2 gtkhtml guile hal idn ieee1394 imagemagick imlib ipv6 isdnlog jpeg kde lcms libg++ libwww lirc logitech-mouse mad matroska menubar mikmod mmx mng motif mozilla mp3 mpeg ncurses neXt nls nptl nvidia ogg oggvorbis openal opengl oss pam pcre pdflib perl png ppds pppd python qt quicktime readline real reflection rtc ruby samba scanner sdl session spell spl sse ssl svg svga symlink tcltk tcpd tiff truetype truetype-fonts tv_check tv_pick_cgi type1-fonts udev usb v4l2 vorbis win32codecs wma xine xml xml2 xmms xorg xosd xpm xprint xv xvid xvmc zlib zvbi linguas_fr_FR linguas_fr linguas_en userland_GNU kernel_linux elibc_glibc"
Unset:  CTARGET, INSTALL_MASK, LDFLAGS, MAKEOPTS, PORTAGE_RSYNC_EXTRA_OPTS, PORTAGE_RSYNC_OPTS

Some modifications in bttv-vbi.c since the 2.6.16 release affect the behaviour of nxtvepg as it cannot capture VBI data.
A patch should be proposed for the latest release of nxtvepg in order to solve this problem.

When starting nxtvepg I get this output :
Failed to initialize VBI slicer for teletext & VPS

Here are a part of the differences between the bttv-vbi.c file in 2.6.16 and 2.6.15 series :
diff -c /usr/src/linux-2.6.15-gentoo-r1/drivers/media/video/bttv-vbi.c  /usr/src/linux-2.6.16-gentoo-r9/drivers/media/video/bttv-vbi.c
*** /usr/src/linux-2.6.15-gentoo-r1/drivers/media/video/bttv-vbi.c      2006-01-29 17:15:24.000000000 +0100
--- /usr/src/linux-2.6.16-gentoo-r9/drivers/media/video/bttv-vbi.c      2006-06-05 18:40:23.000000000 +0200
***************
*** 31,36 ****
--- 31,42 ----
  #include <asm/io.h>
  #include "bttvp.h"

+ /* Offset from line sync pulse leading edge (0H) in 1 / sampling_rate:
+    bt8x8 /HRESET pulse starts at 0H and has length 64 / fCLKx1 (E|O_VTC
+    HSFMT = 0). VBI_HDELAY (always 0) is an offset from the trailing edge
+    of /HRESET in 1 / fCLKx1, and the sampling_rate tvnorm->Fsc is fCLKx2. */
+ #define VBI_OFFSET ((64 + 0) * 2)
+
  #define VBI_DEFLINES 16
  #define VBI_MAXLINES 32

***************
*** 163,202 ****
  void bttv_vbi_try_fmt(struct bttv_fh *fh, struct v4l2_format *f)
  {
        const struct bttv_tvnorm *tvnorm;
!       u32 start0,start1;
!       s32 count0,count1,count;

        tvnorm = &bttv_tvnorms[fh->btv->tvnorm];
        f->type = V4L2_BUF_TYPE_VBI_CAPTURE;
        f->fmt.vbi.sampling_rate    = tvnorm->Fsc;
        f->fmt.vbi.samples_per_line = 2048;
        f->fmt.vbi.sample_format    = V4L2_PIX_FMT_GREY;
!       f->fmt.vbi.offset           = 244;
        f->fmt.vbi.flags            = 0;
-       switch (fh->btv->tvnorm) {
-       case 1: /* NTSC */
-               start0 = 10;
-               start1 = 273;
-               break;
-       case 0: /* PAL */
-       case 2: /* SECAM */
-       default:
-               start0 = 7;
-               start1 = 320;
-       }

!       count0 = (f->fmt.vbi.start[0] + f->fmt.vbi.count[0]) - start0;
!       count1 = (f->fmt.vbi.start[1] + f->fmt.vbi.count[1]) - start1;
!       count  = max(count0,count1);
!       if (count > VBI_MAXLINES)
!               count = VBI_MAXLINES;
!       if (count < 1)
!               count = 1;

!       f->fmt.vbi.start[0] = start0;
!       f->fmt.vbi.start[1] = start1;
        f->fmt.vbi.count[0] = count;
        f->fmt.vbi.count[1] = count;
  }

  void bttv_vbi_get_fmt(struct bttv_fh *fh, struct v4l2_format *f)
Comment 1 Patrick Kursawe (RETIRED) gentoo-dev 2006-06-07 01:25:04 UTC
Please also note the discussion on
http://sourceforge.net/forum/forum.php?thread_id=1469517&forum_id=217872

Looks like there's no consensus yet how to fix it best.
Comment 2 Sir Pingus 2006-06-25 09:16:21 UTC
here is the solution proposed by Tom Zoerner (the nxtvepg author):

"Appearently the driver is reporting invalid VBI parameters. When using the specified offset (to skip the sync pulse at the start of each TV line) nxtvepg will read slightly beyond the end of each teletext line. This probably won't cause any harm though, hence as a temporary solution you can just comment out lines 680 to 689 in file epgvbi/zvbidecoder.c (i.e. put /* before and */ after them)  
 
-tom " 

Pingus
Comment 3 Patrick Kursawe (RETIRED) gentoo-dev 2006-06-26 02:25:49 UTC
(In reply to comment #2)
> here is the solution proposed by Tom Zoerner (the nxtvepg author):
[...]

Looking at the replies to this posting it looks like this doesn't work for everyone, like
---
"I edit the sourcecode and commented out the lines 680 to 689. Now I get no error messages, while starting nxtvepg, but the acquisition don't work with the parameters "-daemon" and "-passive". 
If I start nxtvepg in normal mode (without any parameters), the acquisition work only sporadicly and mostly a short time. I get the messages, that the acquisition stalled or no reception ... 
The provider scan found no providers with EPG signal!
---
Perhaps the other change (zvbi_rd.offset) he mentions later is also necessary? Since I currently have no chance to test this we have a problem here...
Comment 4 Patrick Kursawe (RETIRED) gentoo-dev 2006-06-26 02:29:03 UTC
Re-assigning since I can't test it any more. Lars, please edit metadata accordingly.
Comment 5 Lars Weiler (RETIRED) gentoo-dev 2006-06-26 04:02:37 UTC
I moved to DVB-T two weeks ago, but I still have my analog-TV hardware around.  I'll test once I boot the old machine.
Comment 6 Martin Egge 2006-07-07 11:58:23 UTC
I can confirm the problems.
I'm working on an ebuild based on nxtvepg-2.8.0_pre12.
Stay tuned.
Comment 7 Martin Egge 2006-07-08 01:17:32 UTC
Created attachment 91194 [details]
media-tv/nxtvepg-2.8.0_pre12.ebuild
Comment 8 Martin Egge 2006-07-08 01:57:45 UTC
Comment on attachment 91194 [details]
media-tv/nxtvepg-2.8.0_pre12.ebuild

So, here we go...
Atached is the the new ebuild for nxtvepg-2.8.0_pre12. The patch files follow.
It's based on an ebuild from gentoo.de [1].

The ebuild works perfectly here with kernel 2.6.16 (suspend2-sources-2.6.16-r8) on an Hauppauge WinTV (Bt878 rev2).

There are several patches for the new useflags:

  X - compiles with gui, otherwise only the daemon will be compiled
  zvbi - compiles nxtvepg to use the Zapping vbi library
  debug - compiles nxtvepg with debug support. We finally have a solution to get rid of the debug.out files -> just disable debug
  dvb -  enables DVB cards (based on [2]). It compiles without errors but due to the lack of appropriate hardware I cannot test it.


So feel free to test this ebuild.


[1] http://www.gentoo.de/viewcvs/media-tv/nxtvepg/nxtvepg-2.8.0_pre5.ebuild?root=gentoo-x86&rev=1.2&view=log
[2] http://nxtvepg.sourceforge.net/tmp/nxtvepg-2.8.0_pre10-dvb.patch.gz
Comment 9 Martin Egge 2006-07-08 02:04:50 UTC
Created attachment 91196 [details, diff]
nxtvepg-2.8.0_pre12-db.patch

This patch lets nxtvepg drop it's database in the user's homedir by default. This allready exists for the latest stable version (2.7.6).
Comment 10 Martin Egge 2006-07-08 02:07:53 UTC
Created attachment 91197 [details, diff]
nxtvepg-2.8.0_pre12-nogui.patch

This patch disable the gui only the daemon will be build.
Comment 11 Martin Egge 2006-07-08 02:08:45 UTC
Created attachment 91198 [details, diff]
nxtvepg-2.8.0_pre12-zvbi.patch

This patch enables the use of the Zapping VBI library.
Comment 12 Martin Egge 2006-07-08 02:10:23 UTC
Created attachment 91200 [details, diff]
nxtvepg-2.8.0_pre12-dvb.patch

This patch enables nxtvepg usage with dvb cards. Compiles without errors. But function is untested due to the lack of appropriate hardware. Feel free to test.
Comment 13 Martin Egge 2006-07-08 02:11:43 UTC
Created attachment 91201 [details, diff]
nxtvepg-2.8.0_pre12-debug_off.patch

This patch disables all debugging which is enabled by default in the original tarball. Finally a solution to get rid of those debug.out files.
Comment 14 Lars Weiler (RETIRED) gentoo-dev 2006-07-08 03:07:53 UTC
Great!  I installed the new nxtvepg on my x86-system with the analog TV-card.  I'll test it with my DVB-system later...
Comment 15 Lars Weiler (RETIRED) gentoo-dev 2008-03-30 14:58:54 UTC
The new version 2.8.0 is in portage.  I guess it will fix your the problems.