(Editor’s note: More gentoo MythTV installation notes… don’t expect order here, for that, see my wiki…)
OK, all my gear has arrived, I sent back the bad CPU and motherboard and got replacements, everything is humming (very quietly I might add! what a sweet case…), and I’m ready for the final (ha!) gentoo Media Center install.
I’m using this gear:
MSI K8NGM2-FID
NForce 430
GeForce 6150
8 channel HD audio codec RealTek ALC880 (INTEL)
I started with the gentoo 2006.1 live CD. Apparently it is now vogue to use the live CD for the stage 3 “quick” install. Fire it up and you’ll see two installers on the desktop, a command line version, and a GTK+ version. Might as well go with the GTK+.
You will get a chance to configure a few things along the way. Resist the urge to tweak – I played with USE flags until I couldn’t see straight, only to have the installer puke because of them (one of the USB related flags I believe).
SO, grab the live CD, pop it in, and fire up the GTK+ installer. For the fastest ramp-up, select the networkless installation and use all the defaults. You’ll get a chance to set up partitions – choose something similar to what is provided as the “recommended” setup (something like a 50MB boot partition, a 2GB swap partition, and a root partition that takes up the rest of the available space).
Once that’s done, you can reboot and get to your hard drive installation of gentoo. Try it out, why not! But then I dropped back to the live CD, to add b-tree indexing to the directories of my ext3 filesystems. Here, assuming your main ext3 root partition is /dev/sda2:
e2fsck /dev/sda2 # make sure we’re healthy before we start
tune2fs -O +dir_index /dev/sda2 # install the feature
e2fsck -Df /dev/sda2 # force a check, including building the b-tree indexes for directories
OK. Now, for reference, here’s the result of running net-setup (on the live CD):
# This network configuration was written by net-setup
iface_eth0=”192.168.21.177 broadcast 255.255.255.255 netmask 255.255.255.0″
gateway=”eth0/192.168.21.1″
Also make note of /etc/resolv.conf, for cloning.
nameserver 24.25.5.150
nameserver 24.25.5.149
Next, I need to set things up so that gcc does a nice job compiling my system. This means we edit /etc/make.conf. But why leave the live CD environment? You can just mount your partitions, and set up the gentoo environment, right from within the live CD. Here’s make.conf for my AMD64 X2 system (the mounted file ended up at /mnt/sda2/etc/make.conf):
#MDM Also added -mtune cause i saw it somewhere and thought “what the hellâ€
#MDM Also heard that -pipe is good (from the handbook: use pipes rather than temporary files (during) compilation)
CFLAGS=â€-march=k8 -mtune=k8 -O2 -pipeâ€
CHOST=â€x86_64-pc-linux-gnuâ€
CXXFLAGS=â€${CFLAGS}â€
#MDM “MAKEOPTS for a 2-CPU systemâ€
MAKEOPTS=â€-j3″
ACCEPT_KEYWORDS=””
USE=” X alsa amd64 arts avi berkdb bitmap-fonts cairo cdr cli crypt cups dbus dlloader dri dvd dvdr eds elibc_glibc emboss encode esd fam firefox fortran gdbm gif gnome gpm gstreamer gtk gtk2 hal input_devices_evdev input_devices_keyboard input_devices_mouse ipv6 isdnlog jpeg kde kernel_linux ldap libg++ mad mikmod mp3 mpeg ncurses nls nptl nptlonly ogg opengl oss pam pcre pdflib perl png ppds pppd python qt3 qt4 quicktime readline reflection sdl session spell spl ssl tcpd truetype truetype-fonts type1-fonts udev unicode userland_GNU vorbis xml xorg xv zlib”
FEATURES=””
Where did I get those USE flags? Beats me. Seriously, they are out of control. I mean, it doesn’t get more direct than USE flags, they are the core of how you configure linux, but geesh, somebody put a leash on them. At the very least, start organizing them, so I don’t have to wade through things like an “amd” use flag that applies to some tetris clone, or whatever. Here are more USE flags, one from a previous MythTV install:
… and another from Matt, a Red Hat admin I was lucky enough to connect with lately.
-beagle -cups cairo cddb cdr cdparanoia cdrom cjk codecs curl curlwrappers dbus dbm dpms dri \
divx4linux dlloader -dmx dts dv dvb dvd dvdr dvdread -esd eds encode exif expat \
-f77 faac fame flac faad fam ffmpeg firefox fontconfig -font-server -fortran freetype gd gif gtk \
-gaim -gksu -gimpprint glep glitz glx -gnome -gnomedb -gnutls gphoto2 -hal -hardened howl idea idn ieee1394 imap \
imlib2 imagemagick innodb -ipv6 -jack ipod imlib -java javascript jpeg \
-kde kdeenablefinal kerberos -krb4 lirc lcms ldap -libg++ live lzo lzw maildir matroska \
mad -madwifi md5sum -motif mime mmap mmx mng -mono -mozilla moznocompose moznoirc \
moznomail -mozsvg mp3 mp4 mpeg mpeg4 mplayer musicbrainz mysql network -nls nptl \
nptlonly nautilus nvidia ntlm offensive ogg oss openal opengl oscar parse-clocks pcap -pcmcia \
ofx pam_chroot pam_console pam_timestamp pcre png quicktime \
pnp pthreads qt3 real rtc -samba sasl smime \
snmp spreadsheet spamassassin sqlite sse sse2 stream svg sdl -svga -tcltk -tetex tiff theora threads truetype truetype-fonts \
type1-fonts type1 usb utf8 userlocales unicode vcd vorbis vim -vim-with-x vnc wifi wmf \
xfs xine xml xml2 xmlrpc xpm -xprint xrandr udev win32codecs -libcaca -speex xscreensaver xsl \
-xmms xvmc xvid zeroconf mmxext 3dnowext 3dnow transcode x264 X xv”
Yikes. Well we’ll stab at it with this for now:
# http://gentoo-wiki.com/HOWTO_Setup_MythTV
# http://gentoo-wiki.com/HOWTO_Setup_Kernel/System_for_MythTV
# my previous installations
# default live CD install
# Matt
USE=”X 3dnow 3dnowext alsa amd64 apache2 arts avi bash-completion berkdb bitmap-\fonts bzip2 bzlib cairo cddb cdr cdparanoia cdrom cli codecs crypt cups curl cur\lwrappers dbus dlloader dri dvb dvd dvdr dvdread eds elibc_glibc emboss encode e\sd fam firefox flac fortran gdbm gif gnome gpm gstreamer gtk gtk2 hal ieee1394 i\magemagick imlib innodb input_devices_evdev input_devices_keyboard input_devices\_mouse ipv6 isdnlog javascript jpeg kde kerberos kernel_linux ldap libg++ lirc m\ad md5sum mikmod mmx mmxext -mozilla mp3 mp4 mpeg mpeg4 mplayer mysql mythtv net\ ncurses nls nptl nptlonly nvidia ogg oggvorbis opengl oss pam pcre pdflib perl \png pnp ppds pppd python qt3 qt4 quicktime readline real reflection samba sasl s\dl session spell spl sse sse2 ssl stream tcpd tiff transcode truetype truetype-f\onts type1-fonts udev unicode usb userland_GNU v41 vcd vnc vorbis xfs xinerama x\ml xmms xorg xscreensaver xv xvid xvmc wifi win32codecs wmf zlib”
# MDM the “new” Xorg way.. WHATEVAH!!
INPUT_DEVICES=”keyboard mouse”
VIDEO_CARDS=”nvidia”
Now let’s go get down and dirty with a reboot into our very own gentoo installation. Once we’ve done that, we’ve got to set up networking. In my case, that meant tweaking /etc/conf.d/net, which for some reason does not use the same formatting as the live CD. Oh well, no big deal, here’s the updated format. To directly set up the network:
localhost ~ # route add default gw 192.168.21.1
To make the settings stick, put them here:
HOSTNAME=”tdm3″
localhost ~ # cat /etc/conf.d/net
config_eth0=( “192.168.21.177 broadcast 255.255.255.255 netmask 255.255.255.0” )
routes_eth0=( “default gw 192.168.21.1” )
OK, I’ve got network, whoop! Time to grab a beer… whew! Carrying on, we’re going to compile our very own kernel now, because we are super bad ass and unstoppably invincible and all that good shiznit. Start here.
emerge screen
screen
emerge portage
etc-update
emerge –newuse –deep system
emerge –newuse –deep mythtv
Etc. etc. etc. OK I am much further along now. I added support for the video built into my motherboard – it’s the new higher-end nVidia onboard chip (GeForce 350?), which includes TV-Out. I added support for an X driver for the TV-Out of my PVR-350, which includes direct mpeg2 decoding. So now I have two options for output to play around with. Wicked!
Next, sound. More specifically, Advanced Linux Sound Architecture, whoop! Here’s the Gentoo ALSA Guide. You can either use ALSA provided by the kernel, or you can bolt on ALSA support via Gentoo’s media-sound/alsa-driver package. I’m going with the first route. At first, it might sound easier to let portage keep things humming, but take a look at the pros/cons list – once you get sound working, you won’t have to deal with it again, if you go the first route. Let’s do it – next up, go find a driver.
Research:
—-
Although the board uses the ALC880 chipset, it may be worth noting that lspci still references nVidia Audio.
I’m using the snd-hda-intel driver from alsa-driver 1.0.11-rc2.
—-
For those having trouble with sound on the K8NGM2-FID, check your alsa config (/etc/modules.d/alsa on Gentoo, not sure about others).
For some reason, alsaconf kept writing errored configuration (as I described previously.
Using alsa-drive 1.0.11-rc2, my config file looks like this:
# $Header: /var/cvsroot/gentoo-x86/media-sound/alsa-utils/files/alsa-modules.conf-rc,v 1.4 2004/11/16 01:31:22 eradicator Exp $
# ALSA portion
# OSS/Free portion
##
## IMPORTANT:
## You need to customise this section for your specific sound card(s)
## and then run `update-modules’ command.
## Read alsa-driver’s INSTALL file in /usr/share/doc for more info.
##
## ALSA portion
alias snd-card-0 snd-hda-intel
## alias snd-card-1 snd-ens1371
## OSS/Free portion
alias sound-slot-0 snd-card-0
## alias sound-slot-1 snd-card-1
##
# OSS/Free portion – card #1
## OSS/Free portion – card #2
## alias sound-service-1-0 snd-mixer-oss
## alias sound-service-1-3 snd-pcm-oss
## alias sound-service-1-12 snd-pcm-oss
alias /dev/mixer snd-mixer-oss
alias /dev/dsp snd-pcm-oss
alias /dev/midi snd-seq-oss
# Set this to the correct number of cards.
# — BEGIN: Generated by ALSACONF, do not edit. —
# — ALSACONF version 1.0.10 —
alias snd-card-0 snd-hda-intel
alias sound-slot-0 snd-hda-intel
# — END: Generated by ALSACONF, do not edit. —
—-
Originally Posted by lintweaker
I am still having some problems getting ALSA to correcly configure/recognize my onboard soundcard (Nvidia HDA with ACL880). This in on a MSI K8NGM2-FID motherboard.
I do get sound from line out but the volume is really low. SPDIF out won’t work. Although I got it working through the OSS emulation(????).
What alsa module parameters should work?
Details from my FC4 /etc/modprobe.conf:
alias snd-card-0 snd-hda-intel
options snd-card-0 index=0
options snd-hda-intel index=0
remove snd-hda-intel { /usr/sbin/alsactl store 0 >/dev/null 2>&1 || : ; }; /sbin
/modprobe -r –ignore-remove snd-hda-intel
SPDIF works fine, except for the very first time a system is started up. When playing audio for the first time on system startup, it is very very very screechy, but afterwards it is perfect. Probably a module initialization step missing. I don’t know about analog audio output. For mythtv ALSA config, I specify iec958. For mplayer -ao alsa:device=iec958.
—-
an Intel HD Audio compatible chip (ALC880) manufactered from Realtek
As it seems that there is Realtek support for the device, another choice is to download the latest driver version (called realtek-linux-audiopack-3.5.1.tar.bz2) from www.realtek.com.tw (never tried).
http://www.realtek.com.tw/downloads/dlhd-2.aspx?lineid=2004052&famid=2004052&series=2004061&Software=True
(err that’s for an old kernel, looks gross, don’t touch it)
Unmute the audio channels:
amixer set PCM 100% unmute
amixer set Front 100% unmute
make menuconfig:
<*> Advanced Linux Sound Architecture
PCI devices —>
<*> Intel HD Audio
Next emerge latest media-sound/alsa-drivers from portage (1.0.10_rc3 as time of writing)
echo “media-sound/alsa-drivers ~x86″ >> /etc/portage/package.keywords
emerge alsa-driver
modprobe snd_hda_intel
and configure /etc/make.conf for compiling only the correct audio device
File: /etc/make.conf
ALSA_CARDS=”hda-intel”
Note: If the card doesn’t work try to pass the model name to the module arguments (model=z71v or model=asus)
—-
OK, let’s try using snd-hda-intel. Now where is that in the menuconfig? Just as specified in the last research notes (above), cool.
Hey weren’t there a bunch of modules for the PVR-350? Checking my notes from my last install… yeah, but somehow I managed to get them pretty much turned on already (well duh, it’s working). :>
“Device Driversâ€; “Multimedia Devicesâ€; “Video For Linuxâ€; “BT848 Video For Linuxâ€
I think I’m ready for another kernel compile. Here goes.
screen
make
make modules_install
ls /boot
cp arch/x86_64/boot/bzImage /boot/kernel-genkernel-x86_64-2.6.17-gentoo-r8_mdm-menuconfig_2
A quick edit of /boot/grub/grub.conf, and we’re ready to reboot (with sound?!). Yep, groovy. Now I thought I’d check in with my recordings… looks like the clock is off and I’m recording the wrong shows, grumble… emerge ntp should fix that. I’m synching with ntp on startup but not bothering to run the daemon to stay synched all the time, revisit if needed.
Get TV-Out working
Well, back to this task. As I said before I have two options, you’d think I could get one of them working. Trying to get the PVR-350 TV-Out working first. Following this. Here’s what I needed to do to set it up.
Goofy gentoo doesn’t use the “standard” run levels. To boot into a “runlevel 3” equivalent, you should add this to the end of the kernel line in grub.conf (since gentoo uses “default, single, nonetwork” and other silly runlevel names (ls /etc/runlevels) (you can even cook up your own, ugg :> ) ):
Select the new kernel line during boot, and you’ll be prompted with “initializing runlevel 3” DUH! :> Then you can really play with X. Muck with /etc/X11/xorg.conf, as directed in that link, above, then try it out with this:
…and it will tell you all the things you’ve screwed up. Sigh. Looks like this won’t get finished in time to surprise Andrea when she returns from sunny Florida, oh well.
I DID manage to get DVD playback working. Great advice from the Fedora Mythtv guy to use xine, which is sweet. I did have to coax gentoo along, by adding my user to the cdrom and cdrw groups (and then RELOGIN, don’t forget that!)…
gpasswd -a m cdrw
And I don’t have the auto-play working yet, you have to select Play DVD. Whatever, good enough for now.
Now back to TVout-land…
I have two options: nvidia and PVR-350. I am going with whatever is easier for now. I went through the setup of the PVR-350, up to configuring X. Before killing myself on that, let’s try the nvidia driver. The nvidia driver has been pretty solid so far. Again, it came down to X configuration. There are lots of HOWTO’s out there, with lots of BAD INFORMATION. Where is the nvidia reference for this stuff? Basically, you set a bunch of options in xorg.conf, which the driver uses. Here are the important lines from what I finally used to get the GeForce 6150 to switch to TV out:
Option “TVOutFormat” “SVIDEO”
Option “TVStandard” “NTSC-M”
Option “ConnectedMonitor” “TV”
Secion
The kicker was the “ConnectedMonitor” line – one HOWTO had me convinced that you used an xorg.conf monitor name there. WRONG. Use “TV”. Several hours lost on that one. Upwards and onwards.
Done:
In Progress:
Plug in the USB thingee and try this…
Bus 002 Device 002: ID 15c2:ffdc SoundGraph Inc. iMON PAD Remote Controller
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 002: ID 0ace:1215 ZyDAS
Bus 001 Device 001: ID 0000:0000
Looks like the ZyDAS is the wireless USB device, I’ve seen ZyDAS drivers mentioned. Googling around brought me here. Did this next…
emerge net-wireless/zd1211
– net-wireless/zd1211-83 (masked by: ~amd64 keyword)
But the docs on the homepage say it is AMD64-compatible. Also found this, where it’s worked for others. So… upwards to unmask the sorry little thing…
# MDM Also unmasking my wireless driver… cmon gentoo give it up…
net-wireless/zd1211 ~amd64
Now retry the emerge… whoop there it is! There were a bunch of type warnings, guess that’s why it was masked…
* This is done because ZyDAS corp. had made two different versions
* of the ZD1211 Chipset.
* Please look at http://zd1211.ath.cx/ to see which one is the best
* for your WiFi adapter or, if you prefer, launch both…
Cool.
lsmod
(there it is, sweet)
I do NOT understand where the stupid eth0/wlan0 or whatever is supposed to COME from – just because I added a module, does that make it appear the next time I reboot? Maybe I need some kernel configuration tweaks… gentoo docs are failing me, for the first time. Rrrr. I will try autoloading the ZyDAS module and rebooting…
# MDM Is this where I put my Zonet ZyDAS-based wireless USB adapter driver???
zd1211
reboot
Yes! That did it, I now have a wlan0!! Whew, what a PITA. Time to configure!
Do NOT ignore emerge messages (I had to emerge wpa_supplicant twice just to get to them again, rrr…)…
* To use you must create the configuration file
* /etc/wpa_supplicant/wpa_supplicant.conf
*
* An example configuration file is available as
* /usr/share/doc/wpa_supplicant-0.5.4/wpa_supplicant.conf.example.gz
So let’s do it. I created the file as follows:
ctrl_interface=/var/run/wpa_supplicant
# Ensure that only root can read the WPA configuration
ctrl_interface_group=0
# Let wpa_supplicant take care of scanning and AP selection
ap_scan=1
# Shared WEP key connection (no WPA, no IEEE 802.1X)
# MDM No quotes on key = HEX
network={
ssid=”Michael5776135″
key_mgmt=NONE
wep_key0=hexhexhexhexhex
wep_tx_keyidx=0
priority=5
}
Now to try it out…
No good. The driver isn’t compatible. Apparently some folks have hacked around with the driver and made it work. I’m done hacking for now. On to wireless-tools…
Wireless-tools went OK, I’ve gotten everything working so that [/etc/init.d/net.wlan0 start] brings everything up. But WEP is not activated for some ignorant reason. Rrr… for another day…
To Do list:
—-
Back. All is well.
Added MythArchive, a DVD burner helper.
Working on ability to rip DVD.
emerge mythdvd (make sure you have the transcode USE flag set)
rc-update add mtd default (the Myth Transcoder Daemon, required!)
/etc/init.d/mtd start
configure the rip temp directory in mythfrontend to point to something writeable
Now try again…