Matrox G450

From MythTV Official Wiki
Revision as of 16:39, 11 April 2006 by Lynchmv (talk | contribs)

Jump to: navigation, search

HowTo Enable TVOut with a Matrox G450

This overview will cover how to get the TVOut working on a Matrox G450 using FC4 and MythTV .19. This covers my experience with this setup and how I got it to work.

For the most part, I followed Jarod's Guide on getting MythTV set up on Fedora Core. The initial setup was a little difficult in the GUI because while the installer correctly identified my Matrox G450, the Matrox drivers that ship for x.org are for v. <= 6.8.1 while the installer uses 6.8.2. No biggie, I've set up FC before and was able to get by.

After the installation completed (around Step 4 in Jarod's guide), I grabbed the updated Matrox drivers from Matrox. Setting them up is easy - download, extract run install.sh to have the files copied to the correct place. A quick restart of X (ctrl+alt+backspace) gets everything nice and pretty.

After doing some reading in various places, I discovered that in order to get the framebuffer devices created so we can use them, we have to load the matrox modules at boot. We need to create /etc/sysconfig/modules/matrox.modules with the following code:

#!/bin/sh
/sbin/modprobe i2c-matroxfb
/sbin/modprobe matroxfb_Ti3026
/sbin/modprobe matroxfb_crtc2
/sbin/modprobe matroxfb_maven

Remember to make it executable (chmod +x /etc/sysconfig/modules/matrox.modules) and then reboot. After the system comes back up, you should have 2 framebuffer devices listed in /dev

# ls -l /dev/fb?
crw-------  1 mythtv root 29, 0 Apr  6 14:46 /dev/fb0
crw-------  1 mythtv root 29, 1 Apr  6 14:46 /dev/fb1

Now, to get the TVOut (Step 7 in Jarod's guide) working we need to download matroxset - a tool for manipulating the Matrox fb devices. It's a simple install also, download, extract, make, copy to /usr/bin and you're ready to use it. The matroxset tool doesn't have to be run as root as long as the user has read/write access to the fb devices. Run the following commands to get the framebuffers in a usable state for TVOut:

matroxset -f /dev/fb0 -m 5
matroxset -f /dev/fb1 -m 2
matroxset -f /dev/fb1 -o 1 2

The first line turns off the secondary output, the second line connects the secondary output to /dev/fb1 and the third line sets the secondary output to NTSC (use -o 1 1 for PAL). You should now be able to test the output with mplayer.

mplayer -vo fbdev -fb /dev/fb1 /path/to/testvideo.mpg

You can also scale the mplayer output using the "-vop scale" option like so:

mplayer -vo fbdev -fb /dev/fb1 -vop expand=640:480,scale=640:-2 /path/to/testvideo.mpg

That should play your video on your TV if everything is working correctly.

Now, to get the display going to your TV (still step 7 in Jarod's guide) for normal operation use the following xorg.conf:

Section “ServerLayout”
   Identifier “tvout”
   Screen “Display 2"
   InputDevice “Mouse0" “CorePointer”
   InputDevice “Keyboard0" “CoreKeyboard”
EndSection
Section “Files”
   RgbPath “/usr/X11R6/lib/X11/rgb”
   FontPath “unix/:7100"
EndSection
Section “Module”
   Load “dbe”
   Load “extmod”
   Load “fbdevhw”
   Load “glx”
   Load “record”
   Load “freetype”
   Load “type1"
   Load “dri”
   Load “v4l”
EndSection
Section “InputDevice”
   Identifier “Keyboard0"
   Driver “kbd”
   Option “XkbModel” “pc105"
   Option “XkbLayout” “us”
EndSection
Section “InputDevice”
   Identifier “Mouse0"
   Driver “mouse”
   Option “Protocol” “IMPS/2"
   Option “Device” “/dev/input/mice”
   Option “ZAxisMapping” “4 5"
   Option “Emulate3Buttons” “yes”
EndSection
Section “Device”
   Identifier “MATROX CARD 1"
   Driver “fbdev”
   VendorName “Matrox”
   BoardName “G450"
   Driver “fbdev”
   BusID “PCI:1:0:0"
   Option “UseFBDev”
   Option “HWcursor” “no”
   Option “fbdev” “/dev/fb0"
EndSection
Section “Device”
   Identifier “MATROX CARD 2"
   Driver “fbdev”
   VendorName “Matrox”
   BoardName “G450"
   Option “fbdev” “/dev/fb1"
EndSection
Section “Monitor”
   Identifier “console”
   HorizSync 30-68
   VertRefresh 50-120
     Mode “720×480"
       DotClock 34.564
       HTimings 720 752 840 928
       VTimings 480 484 488 504
       Flags “-HSync” “-VSync”
     EndMode
EndSection
Section “Screen”
   Identifier “Display 1"
   Device “MATROX CARD 2"
   Monitor “console”
   DefaultDepth 16
     SubSection “Display”
       Depth 16
       Modes “720×480"
     EndSubSection
EndSection
Section “Screen”
   Identifier “Display 2"
   Device “MATROX CARD 2"
   Monitor “console”
   DefaultDepth 16
     SubSection “Display”
       Depth 16
       Modes “720×480"
     EndSubSection
EndSection
Section “DRI”
   Mode 0666
EndSection

Keep in mind that this file works for me and yours may need some tweaking. I found a working G450 xorg.conf here and modified it a bit because I initially had mythfrontend being run on both heads - not good. The above xorg.conf runs X only on the 2nd head.

Now, around step 14 in Jarod's guide, automatic configuration is set up. I added the following lines (after line 6) to my ~/.kde/Autostart/myth-load.sh to set up my Matrox fb devices and enable TVOut:

## MATROX FIX
/usr/bin/matroxset -f /dev/fb0 -m 5
/usr/bin/matroxset -f /dev/fb1 -m 2
/usr/bin/matroxset -f /dev/fb1 -o 1 2

Continue following Jarod's guide and you *should* be up and running with your Matrox G450 in no time!

References:

Matrox G450/G550 TV-Out

Matrox Linux

Matrox DualHead