Search Posts:



January 2014

1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31

I recently removed Fedora Core from my life by installing Gentoo on my mythtv system. I remain skeptical as to Gentoo's overall value for most circumstances, but it's particularly well suited for this task because:

1) The compile USE flags can be used to customize MythTV and its miscellaneous requirements to your tastes
2) Many of the funky drivers and software packages exist in Portage

Gentoo is to my knowledge the only distribution that provides an "official" way to install MythTV and the crazy tv-related drivers, if that means anything to you. Fedora of course has atrpms and other third party repos, from which you can pull the packages you require with yum, but you end up with a bastard system with a mish-mash of vendor supplied packages and 3rd party versions. Everything may work - maybe - but your system is at best a confusing mess.

Gentoo has a lot of weaknesses, which I mentioned before. But if there's any task it's particularly well suited for, I believe MythTV is it.

Let's look at the big issues and why they're tolerable:

1) Installation. Installation still sucks. This time I used stage3, and it sucked somewhat less, but it definitely still sucked. I'm willing to put up with the horrendous and laborious install because, once the system is up and running, I should NEVER have to go through something like it again (compare to fedora core, which you need to effectively reinstall from disc with every version upgrade).
2) Compilation. Yes, it takes a while. Yes, it's a pain in the ass. But on my P4 2.4 GHz it's not unbearable, and given that I only have the bare minimum number of packages installed it didn't take *too* long all told.
3) Moving Target. Gentoo is a moving target, as are all the ports. There is no freeze, it's always changing. But then, so is MythTV - in this case, that's pretty much irrelevant.

Gentoo is, basically, a less mature clone of FreeBSD built around the Linux kernel with a core set of GNU tools. But given that all of the funky software and drivers you need for MythTV are included, it's actually very well suited for this task.

So, here's the gentoo-specific parts of the procedure (instructions on the configuration of the various services can be found in the mythtv docs and/or the man pages and/or the fedora mythtv howto, which is undoubtedly the best mythtv-related resource out there).

1) Install Gentoo (check out the handbook). I recommend stage 3 unless this is just a learning exercise. When you're configuring your kernel, make sure to use the drivers you need, and include support for i2c (for LIRC), alsa, and bttv (if you'll be using brooktree). Be sure to modify your /etc/modules.autoload.d/kernel-2.6 file to include stuff such as your NIC driver if you didn't compile it into your kernel. After you get done with this crap, you probably want to take a break.

2) Get sound working. Make sure to include "alsa" in your /etc/make.conf USE flags, and if you're feeling daring you may want to add "-oss" there as well. emerge alsa-utils. If you compiled your kernel with oss emulation support, you will want to emerge alsa-oss here as well. Start the alsa daemon (/etc/init.d/alsasound start) which should run alsaconf the first time you do it, if not run alsaconf manually. Make sure to de-mute your sound sources with alsamixer if alsaconf didn't do it for you. Check with mpg123 on an mp3 file to ensure that things work, then "rc-update add alsasound default" to make it active on boot. Note that for some reason having the emu10k1 (soundblaster) driver compiled into the kernel itself caused issues for me (probably due to alsasound daemon wanting to load a module), recompiling as a module fixed them. You don't need to load emu10k1 module in your modules.d, the alsasound daemon loads it when it starts.

3) Get your video drivers, X, and mplayer. I installed nvidia-glx which (I think) pulled in nvidia-kernel as a dependency. The 4k stacks option is no longer needed when compiling your kernel, just FYI if you used older nvidia drivers. emerge nvidia-glx, xorg-x11, some fonts (freefonts, corefonts, maybe some others as needed), mplayer, and your window manager (I used evilwm). Note that this will be a LONG compile, so it might be a good thing to do right before bedtime. When you feel like digging in again, run xorgconfig if you don't want to modify the default xorg.conf file manually. Make *sure* to specify the "nvidia" (not "nv") driver here (again, consult the documentation for the more essoteric options you may want for TV out). You can try using the x font server, but I gave up on that after a few minutes of tinkering unsuccesfully, instead just using the local font directories in my xorg.conf file. Fire up xdm and make sure you can log in ("/etc/init.d/xdm start"). You'll probably want to run xdm by default, unless you'll start x some other way... "rc-update add xdm default"

4) Get your Hauppauge drivers working. Modify /etc/portage/package.keywords to include something like "media-tv/ivtv ~x86" to allow for dev versions. emerge ivtv and pray! If you can insmod it afterwards then add "ivtv" to your /etc/modules.autoload.d/kernel-2.6 file. This DID work for me, but I've seen mixed reports and other instructions, so it's entirely possible that the ivtv ebuild will be broken for you - if so, you'll need to do some more work and install it the generic, non-gentoo way, which I won't go into here. You'll want to test this with mplayer - start up mplayer and try to play "/dev/video0" - if it works, move on.

5) Get and install mysql. Emerge mysql - easily done. Make sure permissions are right and note your root database password. You need to set up a database for mythtv at some point, but I can't remember what's involved exactly - check the mythtv docs for info (since I was migrating from an existing install, I already had my mysql database which I just reused). Start mysql on boot - "rc-update add mysql default"

6) Set up lirc. Unmask development packages again in /etc/portage/package.keywords "app-misc/lirc". Set the flag to compile for the hauppauge IR device (add "LIRC_OPTS="--with-driver=hauppauge"" to /etc/make.conf). Go ahead and add "lirc" to your USE variable in make.conf. emerge lirc, load the modules (lirc_i2c), then test it with irw to make sure it works. Add to /etc/conf.d/lircd "LIRCD_OPTS="-d /dev/lirc/0"" to specify the device file to use. Start the daemon ("/etc/init.d/lircd start"). Create (using irrecord) or borrow a lircd.conf file, a ~/.lircrc file, and a ~/.mythtv/lircrc file for your remote. Add "lirc_i2c" to your /etc/modules.autoload.d/kernel-2.6 file.

7) Get and install mythtv and friends. emerge -s myth first to locate all the various mythtv packages you'll need. Modify /etc/portage/package.keywords to include entries such as "media-tv/mythtv ~x86" for *all* of those mythtv packages to unmask development and get the .17 branch (this is a PITA, but myth* has a TON of deps and you probably don't want dev versions of them all - if you do "export ACCEPT_KEYWORDS="~x86"" and then emerge all the myth stuff you'll end up with a lot of development versions of the deps, which may not be what you want). After it's all compiled, run mythsetup within X and set things up as desired. Fire up the backend ("/etc/init.d/mythbackend start"), make it default ("rc-update add default mythbackend"), start the frontend. Pray everything works.

8) Tidy up, create your .xinitrc and .xsession files as needed.

All in all, there's not much gentoo-specific stuff to it. I've set up mythtv on a few different distros now and doing so on gentoo is actually relatively painless, though the compile times are a bit frustrating if you have a slower machine. The best thing is that we can (in theory at least) now use portage to update every single piece that we've installed.

So, while gentoo linux does still suck, I wholeheartedly recommend it in this role.

New Comment

Author (required)

Email (required)


Spam validation (required)
Enter the sum of 7 and 6:

Body (required)

Comments |Back