Search:  
Gentoo Wiki

HOWTO_Setup_X_for_MythTV

This article is part of the HOWTO series.
Installation Kernel & Hardware Networks Portage Software System X Server Gaming Non-x86 Emulators Misc

MythTV Series

MythTV

Installation

Tips/Tweaking

Usage

edit
« Previous – Kernel / System Setup | Next – ALSA Setup »

If you are only going to use your computer to run your MythTV frontend, then a minimalistic window manager is a good idea. You don't need the extra weight of a full-fledged desktop enviornment, because you won't be using most of the extra features. Two commonly used minimalist window managers are evilWM and Fluxbox. See here for a list of alternatives and their install instructions.

If you will be using your computer for more, you might consider something with more features. Try looking through the KDE index and GNOME index guides.

Some window manager installs to not include X, so don't forget to install xorg-x11, if necessary.

emerge -av xorg-x11
Main article: Xorg


Tip: If you have an NVIDIA card, don't forget to use the NVIDIA drivers.

Use xorgconfig to set up X windows after you've installed your chosen window manager:

xorgconfig

Check the resulting xorg.conf file and verify that Option "Device" in Section "InputDevice" points to the proper mouse device for your system (/dev/input/mice is usually correct).

When finished, copy the newly created xorg.conf file to the /etc/X11 directory.

Contents

XOrg Configuration

xorg.conf

File: "Monitor" section /etc/X11/xorg.conf. Standard definition widescreen PAL-I TV:

 Section "Monitor"
        Identifier      "SD TV"
        VendorName      "TV Vendor"
        ModelName       "TV Model"
        HorizSync       15.625 #kHz
        VertRefresh     50.0 #Hz 
        DisplaySize     400 225
 EndSection

Section "Monitor" Options useful to MythTV
DisplaySize 
This allows you to set the aspect ratio of your TV. 400 225 is 16:9 400 300 is 4:3


Nvidia

File: Example "Device" section /etc/X11/xorg.conf for 'Nvidia' drivers:

 Section "Device"
        Identifier      "GeForce 8500 GT 256MB"
        Driver          "nvidia"
        VendorName      "Asus"
        BoardName       "Nvidia GeForce 8500 GT"
        BusID           "PCI:5:0:0"
        Option  "NoLogo"                "True"
        Option  "RenderAccel"           "True"
        Option  "XvmcUsesTextures"      "True"
        Option  "UseEdidDpi"            "False"
        Option  "DPI"                   "100 x 100"
        Option  "UseEvents"             "False"
        Option  "DPMS"                  "False"
 EndSection

Section "Device" Options useful to MythTV
Option "DPI" 
This allows you to set the font DPI and will override any other places it is set (Apart from EDI) . Myth is set to look best when your fonts have a DPI of 100x100.
Option "DPMS" 
Setting this to "False" turns off 'Display Power Management Signaling' for your monitor or TV (Meaning your screen won't blank after 20 mins). However I'm not sure if it is necessary to set this any longer as I believe Myth manages it for you.
Option "NoLogo" 
Setting this to "True" turns off the Nvidia logo when X starts.
Option "RenderAccel" 
Option "UseEdidDpi" 
Setting this to "False" will stop the Nvidia drivers from reading your TV/Monitors EDI and therefore overriding your "DPI" setting.
Option "UseEvents" 
Option "XvmcUsesTextures" 


File: Example "Screen" section /etc/X11/xorg.conf. Standard definition TV:

 Section "Screen"
        Identifier      "Screen0"
        Device          "GeForce 8500 GT 256MB"
        Monitor         "SD TV"
        Option          "TVStandard"            "PAL-I"
        Option          "UseDisplayDevice"      "TV"
        Option          "TVOutFormat"           "SVIDEO"
        Option          "TVOverScan"            "0.0"
        DefaultDepth    24
 EndSection

Section "Screen" Options useful to MythTV
Option "TVOutFormat" 
Tell the Nvidia drivers how they output to your display device. Options are; AUTOSELECT, COMPONENT, COMPOSITE, SCART, SVIDEO
To use COMPOSITE you will need to use the s-video to rgb cable and use the blue connector. The COMPOSITE signal will be on there.
Option "TVOverScan" 
Can be used to enable Overscan, when the TV encoder supports it. Valid values are decimal values in the range 1.0 (which means overscan as much as possible: make the image as large as possible) and 0.0 (which means disable overscanning: make the image as small as possible). Overscanning is disabled (0.0) by default.
Option "TVStandard" 
Used to set the TV out resolution. Options are; PAL-B, PAL-D, PAL-G, PAL-H, PAL-I, PAL-K1, PAL-M, PAL-N, PAL-NC, NTSC-J, NTSC-M, HD480i, HD480p, HD720p, HD1080i, HD1080p, HD576i, HD576p
Option "UseDisplayDevice" 
The "UseDisplayDevice" option can be used if there are multiple display devices connected, and you want the connected TV to be used instead of the connected CRTs and/or DFPs.

XvMC config

Nvidia

If XvMC does not seem to be working with the nvidia binary drivers installed or X is consuming a lot of cpu while using XvMC output in Myth, look for the file XvMCConfig in your /etc/X11 directory. the contents of the file should point to libXvMCNVIDIA_dynamic.so.1 on your system. After a fresh Gentoo build and emerge of .20 mythtv this file did not exist, so i coppied it over from my knoppmyth build and edited it to suit my system. Cpu usage dropped in half and XvMC started working as evidenced by the colorless osd!

File: /etc/X11/XvMCConfig
/usr/lib/libXvMCNVIDIA_dynamic.so.1

VGA to SCART converter

The 'TV out' on most graphics cards produces a less than acceptable picture and has 'hardware locked' resolutions/refresh rates. Using the VGA (RGB) out allows you to have total control.

This method will achieve, by far, the best result when outputting to a SD TV. The picture quality will be equal or better than that of a digibox and motion problems (unsmooth news tickers & camera 'pans') linked with resolution and refresh rates can be fine tuned with modelines. You will need to have an RGB capable SCART input on your TV.

Warning: These converters do not change the refresh rate or frequency of the signal from your graphics card. They will only work providing you supply the TV with the correct screen modes. If you try to send 'monitor' screen modes to the TV you may damage it.

Modelines

To get fine control over the resolution and be able to use a VGA to SCART converter you need to use modelines. Modelines go in the 'Monitor' section and are then referenced in the 'Screen' section of your xorg.conf eg.

File: This is my "Monitor & Screen" section /etc/X11/xorg.conf for 'PAL-I Modelines':

Section "Monitor"
        Identifier      "SD TV"
        VendorName      "Monitor Vendor"
        ModelName       "Monitor Model"
        HorizSync       14 - 18.0 #kHz
        VertRefresh     45 - 65.0 #Hz
        
        ## 720x576 @ 25Hz, 15.6kHz hsync, ccir601 PAL, mpeg, 702 dots displayed
        ModeLine "720x576@25i" 13.5   720 732 795 864  576 581 586 625 interlace -hsync -vsync

        ## Set for 16:9 display. For 4:3 replace 225 with 300.
        DisplaySize     400 225
EndSection

...

Section "Screen"
        Identifier      "Screen0"
        Device          "GeForce 8500 GT 256MB"
        Monitor         "SD TV"
        SubSection      "Display"
                Modes   "702x576@25i" "704x576@25i" "720x576@25i" "768x576@25i" "768x576@50" "720x576@60" "720x576i"
                Depth   24
        EndSubSection
EndSection

Here are some other PAL modelines that may be helpful

       Modeline "800x576pali" 15.38  800 823 895 984  576 580 583 625 -hsync -vsync interlace
       Modeline "800x288pal-half"  15.38  800 823 895 984  288 290 292 313 -hsync -vsync
       Modeline "768x576pali" 14.76  768 789 858 944  576 580 583 625 -hsync -vsync interlace
       Modeline "768x288pal-half"  14.76  768 789 858 944  288 290 292 313 -hsync -vsync
       Modeline "720x576pali" 13.88  720 742 808 888  576 580 583 625 -hsync -vsync interlace
       Modeline "720x288pal-half"  13.88  720 742 808 888  288 290 292 313 -hsync -vsync
       Modeline "704x576pali" 13.50  704 722 786 864  576 580 583 625 -hsync -vsync interlace
       Modeline "704x288pal-half"  13.50  704 722 786 864  288 290 292 313 -hsync -vsync
       Modeline "650x576pali" 12.50  650 669 728 800  576 580 583 625 -hsync -vsync interlace
  1. ## 702x576 @ 25Hz, 15.6kHz hsync, itu-r bt.470 PAL, analog broadcast

ModeLine "702x576@25i" 13.5 702 722 785 864 576 581 586 625 interlace -hsync -vsync

  1. ## 704x576 @ 25Hz, 15.6kHz hsync, itu-r bt.470 PAL, mpeg, 702 dots displayed

ModeLine "704x576@25i" 13.5 704 723 786 864 576 581 586 625 interlace -hsync -vsync

  1. ## 720x576 @ 25Hz, 15.6kHz hsync, ccir601 PAL, mpeg, 702 dots displayed

ModeLine "720x576@25i" 13.5 720 732 795 864 576 581 586 625 interlace -hsync -vsync

  1. ## 768x576 @ 25Hz, 15.6kHz hsync, square dot itu-r bt.470 PAL, TV-monitor, 767 dots displayed

ModeLine "768x576@25i" 14.75 768 789 858 944 576 581 586 625 interlace -hsync -vsync

  1. ## 768x576 @ 50Hz, 31.3kHz hsync, progressive square dot itu-r bt.470 PAL

ModeLine "768x576@50" 29.5 768 789 858 944 576 581 586 625 -hsync -vsync

  1. ## nonstandard PAL (Works with BOB deinterlace) It is 60Hz but works well with nVIDIA PAL-B TV-OUT Nvidia option: Option "TVStandard" "PAL-B"

ModeLine "720x576@60" 32.7 720 744 816 912 576 577 580 597

  1. ## This modeline is 50Hz interlaced and works well with kerneldeint:

ModeLine "720x576i" 13.875 720 744 808 888 576 581 586 625 -hsync -vsync interlace

And some NTSC ones

       Modeline "800x480ntsci" 15.10  800 808 879 960  480 484 487 525 -hsync -vsync interlace
       Modeline "800x240ntsc-half"  15.10  800 808 879 960  240 242 244 263 -hsync -vsync
       Modeline "720x480ntsci" 13.59  720 727 791 864  480 484 487 525 -hsync -vsync interlace
       Modeline "720x240ntsc-half"  13.59  720 727 791 864  240 242 244 263 -hsync -vsync
       Modeline "704x480ntsci" 13.34  704 714 776 848  480 484 487 525 -hsync -vsync interlace
       Modeline "704x240ntsc-half"  13.34  704 714 776 848  240 242 244 263 -hsync -vsync
       Modeline "657x480ntsci" 12.50  657 667 725 792  480 484 487 525 -hsync -vsync interlace
       Modeline "657x240ntsc-half"  12.50  657 667 725 792  240 242 244 263 -hsync -vsync
       Modeline "640x480ntsci" 11.32  640 646 703 786  480 484 487 525 -hsync -vsync interlace
       Modeline "640x240ntsc-half"  11.32  640 646 703 786  240 242 244 263 -hsync -vsync

Nvidia Configuration

File: Example "Device" section /etc/X11/xorg.conf for 'Nvidia' drivers:

Section "Device"
        Identifier      "GeForce 8500 GT 256MB"
        Driver          "nvidia"
        VendorName      "Asus"
        BoardName       "Nvidia GeForce 8500 GT"
        BusID           "PCI:5:0:0"
        Option  "UseEDIDFreqs"          "False"
        Option  "UseEdidDpi"            "False"
        Option  "ModeValidation"        "AllowNon60HzDFPModes, NoMaxPClkCheck, NoEdidMaxPClkCheck, AllowInterlacedModes, NoMaxSizeCheck, NoHorizSyncCheck, NoVertRefreshCheck, NoWidthAlignmentCheck, NoDFPNativeResolutionCheck, NoVirtualSizeCheck, NoVesaModes, NoEdidModes, NoXServerModes, NoPredefinedModes" 
        Option  "NoLogo"                "True"
        Option  "XvmcUsesTextures"      "True"
        Option  "DPI"                   "100 x 100"
        Option  "UseEvents"             "False"
        Option  "DPMS"                  "False"
EndSection


Building a VGA to SCART converter

Before we start I must credit these two pages, most of this information came from these sources:

http://www.idiots.org.uk/vga_rgb_scart/index.html http://www.nexusuk.org/projects/vga2scart/circuit

Materials (aside from leads):

Note: The wattage of the resistors in not really that important as it doesn't carry any real current, so whatever is handy (0.1W should be fine). The above are 0.125W and they worked for me.

The easiest way to do this is to buy a VGA monitor extender lead (just male to male) and a SCART lead that has one of the plastic case connectors you can open. Cut one end off the VGA lead, open and unsolder the SCART connector then solder it to the VGA lead as follows:

Note: You can buy a male VGA connector and a male SCART connector and use shielded CAT5e cable between them if you want to make the lead from scratch.


Converter Schematic:


Image:Vgatoscart_schematic.jpg


These connections should be made:


Name VGA Pin Converter Connection SCART Pin
Red 1 15
Green 2 11
Blue 3 7
Red Ground 6 13
Green Ground 7 9
Blue Ground 8 5
VSync 14 VSync
HSync 13 HSync
Sync Ground 10 Gnd
CSync CSync 20
Sync Ground Gnd 17


I had to use a multimeter to figure out what number pins on the VGA side where what colour wires, as the wire colours made no sense.

Make sure you connect the 'Chassis ground' on the VGA to pin 21 (SCART-GND) on the SCART. The 'GND' on the converter schematic is referring to VGA pin 10 (Sync Ground) which, as the table says, connects to SCART pin 17.

When you are done soldering you can clip the SCART connector casing back around the connector keeping all your work safe! Remember to insulate anything that might contact when enclosed in the small space.

Extra info you may need

Some TVs do not automatically know they are receiving an RGB signal and so all you will get is a blank screen. This can be overcome by giving pins 16(+) and 18(-) on the SCART ~1-3V. This tells the TV it is receiving an RGB signal. You can do this using a 3V DC adapter. A tidier setup is to take power from the PC. Using one pair of CAT5e wire, connect the pins to the +5v and 0v on a PSU molex connector.

The other pin it can be useful to power is SCART pin 8. With ~5-8V it will set the TV to '16:9 AV mode' and with ~9.5-12V '9.5 to 12V'. Powering this will also automatically change the TV to the input when it is active.

Image:Vgatoscart_scart_control.jpg

Note: The 100 Ohm resister is probably a good idea to drop the voltage, however, I didn't use one and my TV still works!

Alternate method

MythTV can be set up in the framebuffer, though this is only recommended for advanced users.

« Previous – Kernel / System Setup | Next – ALSA Setup »

Last modified: Wed, 27 Aug 2008 03:24:00 +0000 Hits: 22,279