Installing MythTV on an Athlon64 using Fedora Core

From MythTV

Jump to: navigation, search

This documents my experiences installing MythTV on a full 64-bit version of Fedora Core 3.

You should follow the great installation steps provided by Jarod Wilson along with this, as I am only showing the issues that I had to deal with in the 64-bit world, and with my specific hardware.

I hope this will help others as they venture into the 64 bit world. As this was not my first myth install, and as I have been playing and working with Linux for quite some time, not every intricate detail is shown. Please keep that in mind.

If you have questions, please email me at johanreinalda at yahoo dot com. Please do not expect immediate replies. I also monitor the MythTV users list, and you might get better response there.

Contents

Updates

||7/8/2005||Added securing Apache for Myth Web usage|| ||7/1/2005||Added nvidia-settings information, use of libmpeg2,
note about 32-bit libraries during install|| ||6/28/2005||Added performance info, and more ECS 755-A2 hardware info|| ||6/21/2005||Original posting||

Table of Contents

(This follows Jarod's numbering in his guide)

  • Hardware
  • Installation Method
  • 3. Initial System Setup
  • 5. Updating initial install
  • 7. Installing video drivers
  • 8. Audio setup
  • 9. Installing mythtv
  • 10. Install PVR-150MCE
  • 11 Installing LIRC
  • 12 MySQL
  • 13 Myth setup
  • 14 Auto-starting myth

Jarod's Tips 'n Tricks

  • -Using xine for dvd playing
  • -Mplayer defaults
  • -TV channel icons

Various additional pieces

  • -Setting the video out to cover the full screen
  • -Rebuilding myth from source to get lirc support
  • -Securing Myth Web if your machine is open to Internet
  • -MadWifi install for wireless access to my cable connection

Hardware specific steps

  • -Hardware (re-)configuration
  • -Monitoring hardware with lm_sensors
  • -Motherboard IRQ information
  • -How does this perform?

My Hardware

  • -ECS 755-A2 v1.0a motherboard (socket 754)
  • -AMD Athlon64 2800+ (512kb cache)
  • -1 * 512MB PC3200 Kingston DDR (CL3)
  • -1 * 256MB PC2700 Kingston DDR (CL2.5)
  • -Chaintec SH5200-128-DVI. Nvidia FX5200 (NV34) based card with AGP 8x, 128MB, DVI and S-video; with heatsink instead of fan!
  • -Maxtor 200GB 7200rpm UDMA133 harddisk
  • -Hauppauge PVR150-MCE, NTSC with tuner type 47
  • -Sony 16X DVD-ROM drive
  • -Linksys 802.11abg PCI wifi card, based on Atheros AR5212 chipset (to use madwifi drivers)

Installation Method

I followed Jarod's guide at http://www.wilsonet.com/mythtv/fcmyth.php with the following exceptions/notes/changes per section:


3. Initial System Setup.

I booted from a downloaded install DVD, starting with XFS support, as "linux xfs"

I used the following partitions:

/boot  100MB  ext3
swap   768MB

LVM OS_[[Vol Group]] 10000MB, with
/     2500MB  ext3
/usr  4500MB  ext3
/var  1500MB  ext3

LVM <spare>  10000MB  -> for another OS install, if needed

LVM DATA_[[Vol Group]], remainder of space, about 170GB
/mnt/store  170GB   xfs


Make sure that for a clean 64 bit setup, you do NOT check the bottom 'compatibility libraries' option in the package selection screen. This installs the 32-bit version of just about every library, and adds a lots of headaches lateron. (I've ended up reinstalling after making this mistake.)

5. Updating initial install

after initial install, reboot, ntp config, `mythtv` user create, login as root

Even though I had loaded KDE (not Gnome), I got a plain green window with basic window manager. I had to open a shell and change the window manager like such "switchdesk KDE'. You can then 'exit' and login again with KDE.

We cannot run apt to update packages, since it is not dual-architecture aware

  • (FC3 X86_64 also loads many 32-bits libraries for compatibility; apt gets very confused trying to upgrade such a system)

Read the apt install instructions to make yum work with at the at repo:

Basically, create /etc/yum.repos.d/at-stable.repo with:

[at-stable]
name=ATrpms for Fedora Core $releasever stable
baseurl=http://apt.atrpms.net/fedora/$releasever/en/$basearch/at-stable

Modify `/etc/yum.repos.d/fedora.repo` and `fedora-updates.repo` to point to a mirror near you (comment out the mirror line) I am in West USA, and use `kernels.org`. (See http://www.linuxgazette.com/node/8835 or http://codah.net/articles/fedora-core-3-yum-repositories-setup.html for more)

make sure you import their GPG key! This is important, otherwize you may get all sorts of yum errors about packages from atrpms not having keys, and you might think things have installed when they haven't!

wget http://ATrpms.net/RPM-GPG-KEY.atrpms
rpm --import RPM-GPG-KEY.atrpms

Also configure up2date to use a close mirror, instead of a random mirror that could be far away and slow: edit `/etc/sysconfig/rhn/sources`, comment out all lines and add

yum fedora-core-3 http://mirrors.kernel.org/fedora/core/3/x86_64/os
yum updates-released-fc3 http://mirrors.kernel.org/fedora/core/updates/3/x86_64

(replace with your mirror site, make sure you change `i386` to `x86_64` as needed)

run

yum check-update

if all is well:

yum update

run `up2date` to get the Red Hat GPG key, then run `yum update`. This will go through and load lots of package info. After sometime, I got about a dozen or so conflicts with 'perl'. This seemed to be the perl.i386 package. Uninstall this:

yum remove perl.i386

and rerun 'yum update'. This should succeed and update around 640 packages, including the latest kernel

At this point I made some config changes:

If so needed, turn on Native X vnc support to get remote graphical console access (to X device :0) according to http://www.realvnc.com/products/free/4.1/x0.html

Configure services

Set the following service to not run via "chkconfig off":

  • isdn
  • cups
  • rhnsd
  • bluetooth,
  • Set httpd to run: `chkconfig httpd on`
  • Set vsftpd to run: `chkconfig vsftpd on`

Configure iptables firewall

I maintain a script with all rules in `/usr/local/sbin/iptables-update.sh` I will post this later. Basically, I allow ssh, ftp, vnc from my home lan, and my work pc.

  • reboot, and login again.

You now should have patched system

remove the original kernel: yum remove kernel-2.6.9-1.667



7. Installing video drivers

I opted to run the native Nvidia install routine, to make sure I got x86_64 code:

  • make sure you are not running X, ie not in runlevel5. If you are, edit `/etc/inittab`, and reboot (or run 'init 3'). Change from 5 to 3 in the following line:
id:5:initdefault:
  • download AMD64 drivers from www.nvidia.com (currently v7174)
  • follow step listed to install
    • modify /etc/X11/xorg.conf per the nvidia docs:
    • in module section, remove 'dri' and 'GLcore', add 'glx' if needed
    • in screen section, change 'nv' to 'nvidia'
  • type `startx` to start graphics mode. If all is well, edit the `/etc/inittab` again to start in runlevel 5 (set the 3 back to 5 as show above). On next reboot, you will go graphical again.

Setting S-video out

modify /etc/X11/xorg.conf in the following sections:

Section "Monitor"
    #[[Horiz Sync]] 31.5 - 37.9
    #[[Vert Refresh]] 50.0 - 70.0
    #for best TV-OUT
    [[Horiz Sync]] 30 - 50
    [[Vert Refresh]] 60
[[End Section]]

Section "Device"
    Identifier "Videocard0"
    #Driver "nv"
    Driver "nvidia"
    [[Vendor Name]] "Chaintec"
    [[Board Name]] "SH5200-128-DVI NVIDIA [[Ge Force]] FX 5200"
    Option "[[No Logo]]" "on"

    #possibly needed for XvMC
    #Option "[[Xvmc Uses Textures]]" "true"

    #might cause troubles with XvMC
    #Option "[[Render Accell]]" "1"

    #NTSC svideo out; probably not need (auto-sensed)
    Option "TVStandard" "NTSC-M"
    Option "[[T V Out Format]]" "SVIDEO"
    Option "[[Connected Monitor]]" "TV"
[[End Section]]

I did not bother with setting nvidia defaults in `~/.xinitrc` at this point, since I am running as root, and eventually will run as 'mythtv' for autologin, etc.

7/1/2005: I could not get nvidia-settings to set changes in my ~/.nvidia-settings-rc file, until I did the suggested steps in the Nvidia Readme FAQ section. I commented out all the <dri> line (two of them) in /etc/security/console.perms, and then made sure the permissions on the nvidia devices are proper, as below. All is well now, and when I run nvidia-settings as the mythtv user, the changes are written and then read next time X starts.

You can now set colors, flicker filters, etc. to your wishes and have them remain set after the next restart.

ls -la /dev/nvid*
crw-rw-rw-  1 root root 195, 255 Jun 30 14:22 /dev/nvidia
crw-rw-rw-  1 root root 195,   0 May 19 23:42 /dev/nvidia0
crw-rw-rw-  1 root root 195,   1 May 19 23:42 /dev/nvidia1
crw-rw-rw-  1 root root 195,   2 May 19 23:42 /dev/nvidia2
crw-rw-rw-  1 root root 195,   3 May 19 23:42 /dev/nvidia3
crw-rw-rw-  1 root root 195,   4 May 19 23:42 /dev/nvidia4
crw-rw-rw-  1 root root 195,   5 May 19 23:42 /dev/nvidia5
crw-rw-rw-  1 root root 195,   6 May 19 23:42 /dev/nvidia6
crw-rw-rw-  1 root root 195,   7 May 19 23:42 /dev/nvidia7
crw-rw-rw-  1 root root 195, 255 May 19 23:42 /dev/nvidiactl

8. Audio setup

yum install alsa-kmdl-$KVER.x86_64
yum install alsa-driver.x86_64

and as mythtv user, create the `~/.asoundrc`

I disable the aRts KDE sound server for both 'root' and 'mythtv' logins. (control center -> Sound & Media -> Sound System, deselect 'Enable sound')

This was the first login for mythtv, and I had to change window manager to KDE, as above. While I was in as mythtv, I also disable the screen saver (right-click desktop -> configure -> screensaver -> uncheck 'start automatically'. I also set the panel to auto-hide. Right-click panel -> Configure -> Hiding tab -> choose Hide Automatically


9. Installing mythtv

run yum install mythtv-suite

on 5/23/2005, this installed 56 packages for v0.18.1-108 Note: v0.18.1 builds prior to version 108 had dependency issues for x86_64, and did not install properly.


10. Install PVR-150MCE

I have a Hauppauge PVR150-MCE, NTSC with tuner type 47. I am compiling the 0.3.4 through 0.3.5.c drivers from www.ivtv.tv without any problems, and good performance. My current `/etc/modprobe.conf` contains:

#PVR150-MCE, NTSC, tuner 47
alias char-major-81 videodev
alias char-major-81-0 ivtv
options cx25840 i2c_enable=1 no_black_magic=1
options ivtv ivtv_debug=1

Notes:

  • the saa7127 line is probably not needed (chip is not on board)
  • ivtv drivers after 0.3.5c or thereabouts no longer need the no_black_magic line, in fact they break with it!
  • svideo video input has some image quality issues at this time, but composite is fine

I currently run 0.3.4(p), with antenna on tuner input, and composite video and audio in from an external FTA satellite receiver. This has been up solid for several weeks now, requiring no maintenance.

11 Setting up lirc

I use a homebrew serial port receiver, using the SFH5110 IR chip, with the simplest serial port design on www.lirc.org
I did:

yum install lirc-kmdl-$KVER
yum install lirc

and then added to my `/etc/modprobe.conf` the following to use COM1:

#lirc over COM1
alias char-major-61 lirc_serial
options lirc_serial irq=4 io=0x3f8
install lirc_serial /bin/setserial /dev/ttyS0 uart none ;\
    /sbin/modprobe --ignore-install lirc_serial

To test your hardware, modprobe lirc_serial, then as root run 'mode2' This should show pulses being received: your hardware works!

Now copy an appropriate /etc/lircd.conf for your remote (if you want to create one, run irrecord)

Start the daemon 'service lircd start' and then run 'irw' to test. You should see the remote's buttons being pushed.

Now create `~mythtv/.myth/lircrc` for the myth key mappings, and run mythfrontend.

And then ... nothing worked!

As it turns out, the atrpms for x86_64 do not have native lirc support compiled in (0.18.1-107). This has been fixed since then. You have two options: compile mythtv with lirc (see below), or initially I tried to use irxevent to simulate keyboard input:

Thus I did the following:

I linked the following all to ~mythtv/.myth/lircrc :

~mythtv/.lircrc
~root/.lircrc
~root/.myth/lircrc

This basically allows me to maintain one remote button definitions file (in `~mythtv/.myth/lircrc`)

Now I added ixevent definitions to the lircrc file. Then as the same user as mythfrontend (for me 'mythtv'), run 'irxevent &' (you can test by running foreground, you should see the mapped chars for remote key presses) Then start mythfrontend, and you're in business.

I applied the boot fix from Jarod to have things auto-start. This works fine.

12 MySQL

closely follow all steps and this should be just fine.

13 Myth setup

closely follow all steps and this should be fine.

14 Auto-start mythtv

I replicated all steps. I had trouble with the `nvidia-settings` program not loading my flicker and overscan settings into `~/.nvidia-settings-rc` I hand-created a good copy of it at ~/nvidia-settings-rc.good, and added the following line to ~/.kde/Autostart/myth-load.sh, right before loading nvidia-settings:

cp ~/nvidia-settings-rc.good ~/.nvidia-settings-rc

The key lines to added to the good file were (adjust with your values):

0/[[T V Over Scan]][TV-0]=17 
0/[[T V Flicker Filter]][TV-0]=5 

Upon some googling on this topic, I found a possible fix. Basically, X has to be setup to allow remove configs: run gdmsetup, goto the security tab, and uncheck "Always disallow TCP connections ..." Now run nvidia-settings, and it still does not save to `~/.nvidia-settings-rc`

Jarod's Tips 'n Tricks

Using XINE

Install xine (`yum install xine`), and follow the steps listed to us xine in myth. I disabled autorun as well (rm ~/.kde/Autostart/Autorun.desktop)

Mplayer defaults

Edit the `~/.mplayer/config` file with your settings. I use:

# run full-screen
fs=yes
# zoom image to fill the screen
zoom=yes
# disable mplayer's usual verbosity
really-quiet=yes
# use XVideo for video output
vo=xv
# don't enable joystick
nojoystick=yes
#use native Alsa playback
ao=alsa

Channel Icons

Run the commands as listed!

My EXTRA installation Steps

Setting the video out to cover the full screen

You can tweak the overscan settings, flicker filter settings, etc. with the `nvidia-settings` program. Then you call `nvidia-settings --load-config` before starting myth to set all this. (See Jarod docs) After running this as mythtv, I had a problem where `nvidia-settings` was not maintaining the changes due to not writing them back to `~/.nividia-settings-rc`

As it turns out, nvidia-settings writes values to the X display, and on exit reads the current settings from the X-display to write to the file. Due to a permissions issue, this was not happening. See the Nvidia README FAQ section for more, but basically, I edited the `/etc/security/console.perms` file to comment out the line starting with

<dri>

This prohibites the OS from overwriting permissions on the /dev/nvidiactl device which controls access to settings. I then ran `chmod 0666 /dev/nvidiactl` (and you may need `chown root:root /dev/nvidiactl` as well)

This solved the issue, and changes made with nvidia-settings are now written to `~/.nvidia-settings-rc` for regular users as well!

Securing MythWeb

If for some reason your machine's web server is accessible from the Internet, it's a good idea to secure your Apache installation. Please see the Securing Myth Web How To I wrote. See http://httpd.apache.org/docs-2.0/howto/auth.html for intricate details.

I would still use iptables to secure additionally if you decide to go this route.


MadWifi install

After my initial install/update via Ethernet in my office, this box will go into the living room where there is no wired Ethernet! So I choose to use the madwifi drivers. You can install madwifi from source, but I was not able to successfully compile under x86_64. For one, you require uudecode, which can be gotten in the 'sharutils' package (yum install sharutils.x86_64). But after that I got various compile errors... Good luck that way!

The easiest way to get madwifi drivers working, is simply to install the kernel module with yum:

yum install madwifi-kmdl-$KVER

This installed madwifi-kmdl-2.6.11-1.14_FC3.x86_64

Now run 'kudzu' and it should discover the wifi device. This will allow you to set it to dhcp and adds a line to `/etc/modprobe` as such:

alias ath0 ath_pci

This also creates `/etc/sysconfig/network-scripts/ifcfg-ath0` which is where all settings are kept. You can either edit this file directory, or get the basics loaded through System Settings -> Network by modifying the ath0 device.

My suggestion would be to try this with a non-encrypted access point first, just to make sure it works. You can now run modprobe ath0, and should see the device loaded in lsmod (look for `ath_pci`)

Run `iwconfig ath0` to set your access point information (essid, channel) and you should see an association. Then run ifup ath0, and you should have ip connectivity. Once this works, add WEP128 if so required. I will test WPA-PSK lateron, and add step as I learn them.

I had troubles associating with my ap with a wep128 key. I found the following in the madwifi faq (8.11):

add this to the config somewhere:

iwconfig ath0 key restricted
iwpriv ath0 authmode 2

So I added this to ifcfg-ath0:

IWPRIV="authmode 2"
IWCONFIG="key restricted"

If you are still having errors with encryption, check for the existance of a file called 'keys-ath0'; delete it if it exists, since this will be read by network-functions and used if found over the KEY= setting.

Finally, my working /etc/sysconfig/network-scripts/ifcfg-ath0 ended up looking like this:

#
#variables are parsed & listed in
#/etc/sysconfig/network-scripts/ifup-wireless
#
DEVICE=ath0
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.1.4
NETMASK=255.255.255.0
BROADCAST=192.168.1.255
NETWORK=192.168.1.0
GATEWAY=192.168.1.1
TYPE=Wireless
MODE=Managed
ESSID=wlan-name    <--- put your own essid here
CHANNEL=9
KEY=11111111111111111111111111   <--- put your own key here
IWCONFIG="key restricted"
IWPRIV="authmode 2"


Building mythtv 0.18.1 from the srpm package.

As the available x86_64 packages did not support lirc, I decided to rebuild from the source rpms to enable lirc support (leaving the already installed packages loaded) First, install prerequisites for building:

yum install lame-devel
yum install lirc-lib-devel

Now download the source package, and install. This goes to `/usr/src/redhat/SOURCES/`.

Here, extract the sources:

tar -jxvf mythtv-0.18.1.tar.bz2

now change into the source directory and configure as needed. I run:

cd mythtv-0.18.1
./configure --prefix=/usr --disable-joystick-menu --enable-lirc --enable-xvmc

Check the output to make sure all expected things are turned on. --prefix=/usr sets things to go to the same location as the packages (ie. /usr/bin, /usr/include, etc.), instead of the default /usr/local, which would result in double copies of the executables. I noticed that lirc was not being recognized, even though it's installed. Turns out, the configure script looks for two things: the library, and header (.h) files. The header are installed with the lirc-lib-devel package above, but to fix finding the library, I did:

1. Add file /etc/ld.so.conf.d/lirc-x86_64.conf, containing the line  /usr/lib64/
1. now run ldconfig

You're ready to build!

qmake mythtv.pro
make

If all builds cleanly, run 'make install' (as root) Then restart your box (or backend only: "service mythtbackend restart"), and test the new frontend!

Configuring lm_sensors to monitor CPU & motherboard =

as root, run 'sensors-detect', and step through the configuration. This should result in:

 "Probing for `ITE 8705F Super IO Sensors'
  Success... found at address 0x0290"
  ....

Now follows a summary of the probes I have just done.
Just press ENTER to continue:

Driver `it87' (should be inserted):
  Detects correctly:
** ISA bus address 0x0290 (Busdriver `i2c-isa')
    Chip `ITE 8705F Super IO Sensors' (confidence: 9)
...

To make the sensors modules behave correctly, add these lines to
/etc/modules.conf:

#----cut here----
# I2C module options
alias char-major-89 i2c-dev
#----cut here----

To load everything that is needed, add this to some /etc/rc* file:

#----cut here----
# I2C adapter drivers
modprobe i2c-isa
# I2C chip drivers
modprobe it87
# sleep 2 # optional
/usr/bin/sensors -s # recommended
#----cut here----

Now say YES to generate the /etc/sysconfig/lm_sensors file, and then as root:

service lm_sensors start
chkconfig lm_sensors on    (should already be on, but just in case)

To see various motherboard states, you can now do :

sensors

See also the lm_sensors homepage at http://www2.lm-sensors.nu/~lm78/index.html



Motherboard and Hardware configuration

Flash the bios to the latest (currently the 3.31.2005 v1.0G bios) Make sure you set AGP aperture to 128MB (or whatever memory your video card has)

After I built the box, I had lots of APIC errors in my dmesg output, most likely due to interrupt sharing issue. After not finding much about that, other then making sure you have the latest bios (and lots of comments about 'cheap mobo's/ bad mobo's" causing this), I decided to do the following:

  • in bios
    • disable interrupts for USB (I am not using them)
    • disable parallel port (I don't use it)
    • disable SATA port (I don't use it)
  • Note that when you reboot next, kudzu will run asking you if you want to keep the USB configs, disable them, or delete them. I opted to delete them.
  • disable apic in kernel, by adding 'noapic' to the kernel line in /boot/grub/grub.conf (if you have multiple kernels installed, make sure you set the proper one, or all) I now have the following interrupt map, and have no more errors:

|| CPU0|| ||0:|| 60552954|| XT-PIC|| timer|| ||1:|| 2839|| XT-PIC|| i8042|| ||2:|| 0|| XT-PIC|| cascade|| ||4:|| 197906|| XT-PIC|| lirc_serial|| ||5:|| 93029|| XT-PIC|| ivtv0|| ||7:|| 330401|| XT-PIC|| SiS SI7012|| ||8:|| 2700917|| XT-PIC|| rtc|| ||9:|| 1|| XT-PIC|| acpi|| ||10:|| 7353893|| XT-PIC|| nvidia|| ||11:|| 3685301|| XT-PIC|| ath0|| ||12:|| 6310|| XT-PIC|| i8042|| ||14:|| 114667|| XT-PIC|| ide0|| ||15:|| 121259|| XT-PIC|| ide1|| ||NMI:|| 3645|| ||LOC:|| 60545542|| ||ERR:|| 0|| ||MIS:|| 0||

I run with the following cards:

AGP slot:	FX5200
PCI 1:		PVR-150MCE
PCI 5:		Linksys Wifi card.

ECS 755-A2 Interrupt information

||ECS 755-A2||A||B||C|| D||E||F||G||H|| ||AGP||Shared||-||-||-||-||-||-||-|| ||PCI 1||shared||-||-||-||-||-||-||-|| ||PCI 2||-||shared||-||-||-||-||-||-|| ||PCI 3||-||-||shared||-||-||-||-||-|| ||PCI 4||shared||-||-||-||-||-||-||-|| ||PCI 5||-||-||-||shared||-||-||-||-|| ||Audio||-||shared||-||-||-||-||-||-|| ||LAN||-||-||-||shared||-||-||-||-|| ||SATA||-||-||shared||-||-||-||-||-|| ||USB||-||-||-||-||used||used||used||used||


How does this perform

During all my normal Myth usage, the cpu stays in the lowest cpu speed of 1GHZ (check with cat /etc/cpuinfo). During recording with the PVR-150 it uses about 2-3% cpu at this low speed; playback on the FX5200 card uses roughly 18% cpu (myth and X combined). This means the fans don't have to run too much, and it makes for a reasonably quiet system. Needless to say, when I do transcoding and compiling (mostly 'after hours'), the cpu runs at full speed and full noise :-)

7/1/2005: I changed from the default TV Playback using ffmpeg code to checking the libmpeg2 option in the Options section of myth. This has improved playback picture quality noticably. CPU usage has gone up somewhat, to about 25%, but the AMD64 is staying in the 1GHz mode.

08/23/2005 My AMD64 Experience

Personal tools