Howto:xdriver

From IVTV

Jump to: navigation, search

This page copied from ivtv.writeme.ch on 3-30-2006.

HowTo for setting up the alternative X Driver. This is an alternative to running the generic X-on-a-framebuffer driver using the ivtv-fb driver. Its supposed to be somewhat faster, too.

See ((Framebuffer HowTo)) for setting up the ivtv-fb based setup. Also, the TvOutHowto page covers some of the X setup.

Note, this X driver still requires that the ivtv-fb driver be installed. Using this driver just optimizes the connection between the X server and the ivtv framebuffer.

Additional information on the X driver is available at Howto:XDriver

Contents

Installation

(May 2005: I installed from the 0.3.3u release, and compiled against the source from X.org's X11R6.8.2. With Linux 2.6.11.5 kernel headers.)

(October 2005: With driver 0.10.6 and xorg X11R6.8.2, line 18 in ivtvhw.c should be changed from #include "asm/page.h" to #include "sys/user.h" otherwise the build complains about conflicting types)

  • The X driver ivtvdev is included in source and binary form in the Chris' ivtv releases (in the utils/ directory).
  • To build the source (you'll need X dev headers. I built with the Xorg source)
    • Untar the driver source tarball from the utils directory. You can do this anywhere.
    • Cd down to the makefile (in xc/programs/Xserver/hw/xfree86/drivers/ivtv)
    • run xmkmf "/path/to/X/sources". (Run 'make' for instructions.)
    • run make (xmkmf generates a new Makefile)
      • I had to put explicit defintions for uint32_t and uint64_t in ivtvhw.h. Ugh.
    • This will leave ivtvdv_drv.o in the current directory (and put one off in the X build tree)
  • Or use the pre-built binary. (I didn't try this.)
  • Copy driver to /usr/X11R6/lib/modules/drivers/
  • Update driver section in your X config file. Something like this:
 Section "Device"
    Identifier  "Hauppauge PVR 350 iTVC15 Framebuffer"
    Driver      "ivtvdev"
    Option      "fbdev" "/dev/fb1"      # <-- modify if using another device
    BusID "PCI:2:10:0" # get the ID with lspci convert the value from hexa to decimal
 EndSection
  • Make sure ivtv-fb is loaded (modprobe ivtv-fb).
  • Restart X
  • Start something on the second display
    • env DISPLAY=:0.1 xterm & should start an xterm on your TV.
    • This is not Xinerama (so you can't drag windows between), but the mouse should move between windows correctly.

Compiling on a RedHat Compatible System

These steps worked on a CentOS 4.2 (RedHat Enterprise) x86_64 System

  • Download and extract xdriver source. Here I'll use the home directory (~).
  • Install xorg-x11 source RPM, for me xorg-x11-6.8.2-1.EL.13.20.src.rpm
  • cd /usr/src/redhat/SPECS/
  • rpmbuild -bc xorg-x11.spec -- This took a good half hour on my 2.8Ghz P4-521. This patches and compiles but does not install the source. I wonder if rpmbuild -bp would be enough for this to work?
  • cd ~/ivtv_xdriver_0.10.6/xc/programs/Xserver/hw/xfree86/drivers/ivtv
  • xmkmf /usr/src/redhat/BUILD/xorg-x11-6.8.2/xc
  • make
  • cp ivtvdev_drv.o /usr/X11R6/lib64/modules/drivers On an i386 system the destination for the copy should be /usr/X11R6/lib/modules/drivers.
  • Edit /etc/X11/xorg.conf (see above).
  • Restart X

Note that I did not have to make any of the changes or patches to the source noted above. The xdriver source compiled as is. Check /var/log/Xorg.0.log after restarting X to see that the driver is loading. My log file stated that the driver is compiled for 4.3.99.902 while I clearly have 6.8.2 installed. Odd, but it still works.

Alternative Installation

Copy the directrory ivtv_xdriver_0.10.6/ivtvdrv/xc/programs/Xserver/hw/xfree86/drivers/ivtv/ from the untared ivtv_xdriver_src_0.10.6.tgz driver into the X11R6.8.2/xc/programs/Xserver/hw/xfree86/drivers directory and add to X11R6.8.2/xc/config/cf/host.def the line:

  #define XF86ExtraCardDrivers ivtv

Issues

Overscan: The picture is "bigger" than the TV, so you can't see any of the edges. Try the hack listed here:

http://www.datasheetarchive.com/datasheet/pdf/10/1072741.html

February 2006: this link is broken.

In the doc/ directory of the source, there is a note in README.ivtvfb file regarding overscan for versions >= 0.10.6 of the driver. From the file:


It's possible to change the output resolution via randr support. Although multiple resolutions can be defined, the framebuffer output cannot be scaled. This means that a mode such as 640x400 will not fill the entire screen & there will be a blank area surrounding it. This is useful for restricting the framebuffer output to the non-overscan area of the TV screen. To add new modes, edit the 'Monitor' section adding the new mode information.

i.e for NTSC

   Mode "640x400"
     # D: 23.831 MHz, H: 29.788 kHz, V: 59.936 Hz
     DotClock 23.832
     HTimings 640 735 759 800
     VTimings 400 454 456 497
     Flags    "-HSync" "-VSync"
   EndMode

for PAL

   Mode "640x480"
     # D: 23.720 MHz, H: 29.650 kHz, V: 50.001 Hz
     DotClock 23.721
     HTimings 640 735 759 800
     VTimings 480 542 544 593
     Flags    "-HSync" "-VSync"
   EndMode

Remember to add the new mode to the 'Modes' line in the 'Screen' section. i.e. 'Modes "720x480"' becomes 'Modes "720x480" "640x400"'

Thanks

From ivtvdev.c: Authors: Alan Hourihane and Michel Dänzer

Sources

development