This blog details the work I'm doing to turn the old computer I used in college into a Freevo system that uses Slackware Linux. I'll post the steps I take (hopefully something resembling a tutorial) and links to drivers or helpful websites. No promises on quality writing, but I still hope it can help! My system is detailed below. If you have any questions about how I got my stuff working, please contact me through my website. The link is on the left. Happy Linuxing!

My System:

Friday, October 17, 2003

XMLTV 

I have updated this post to reflect changes in the XMLTV installation. It seems easier this time. It's basically the same, though.

You can read the XMLTV project page and download the XMLTV source files at SourceForge. The XMLTV page at the Freevo site has some useful information too.

Download the XMLTV package at SourceForge and read the README file. A little more than halfway down is a list of dependencies that you'll probably need to get. You'll need to make use of a program called cpan, which comes with Perl (which for some crazy reason I forgot to install with Slackware!). Type cpan and configuration will start. I used the default values (just hit enter) for almost everything. For the FTP servers I just picked some random ones. Doesn't really matter.

After configuration you're given the cpan> prompt. From there you can begin installing all the perl modules you need (again, they're listed in the README file that comes with XMLTV). I ended up installing some of the optional ones too, even though I didn't really know what they did. To install, just type install, space, and then the package you want to install, like install XML::Twig. If the package you're installing requires another package, it'll ask you if you want to install the required package(s) first. Answer yes, obviously.

Some of the installations may fail. My LWP package refused to install because too many errors were produced during the test. Just force it by putting force before the installation command (force install LWP). I forced the installation despite having a large percentage of failures and my XMLTV works just fine.

Follow the instructions in the README to install. Pick the grabber(s) you need when you run perl Makefile.PL. If you're an American all you want are tv_grab_na_dd and tv_grab_na_icons (if you want to retrieve icons for each channel). Once you've picked the programs you want to install it'll create the makefile. The makefile maker will let you know if you're missing any needed modules.

Once you've run make, make test, and make install, you'll want to configure tv_grab_na_dd by running:
tv_grab_na_dd --configure

Follow all instructions. You need a Zap2it account. Follow all prompts. It's pretty straight-forward!

Now in your /etc/freevo/local_conf.py file there's a field called XMLTV_GRABBER where you specify which grabber you're using (it'll probably be '/usr/local/bin/tv_grab_na_dd') and XMLTV_DAYS where you can specify the number of days of TV listings you want to retrieve. Retrieve the listings by executing ./freevo tv_grab in your Freevo directory. The local_conf.py file also has a TV_CHANNELS field where you can specify the names of all the channels. To generate this list, a friend of mine wrote a very useful Perl script. Put it in a file (like xmltv2freevo.pl) and run it after you've grabbed listings at least once. Then run the script by executing perl xmltv2freevo.pl < /tmp/TV.xml (this assumes you've got the listings going to the default location). Place the output in the local_conf.py file.
while () {
chomp;
if (/^\s+$/) {
$disp_name=0;
$last_id = $1;
} elsif (/^\s+(.+)<\/display-name>$/) {
if($disp_name==0){
$last_name = $1;
}elsif($disp_name==2){
$last_chan = $1;
$length = length($last_chan);
if($length<=1){
$last_chan="0".$last_chan;
}
}
$disp_name++;
} elsif (/^\s+<\/channel>$/) {
$string="\(\"$last_id\"\, \"$last_name\"\, \"$last_chan\"\)\,";
$hash{$last_chan}=$string;
#print $string;
}
}
for $keys (sort keys %hash){
$output = $hash{$keys};
print "$output\n";
}

You may want to make a cron job that will retrieve the listings automatically. I hope to update with that information later.

Old post:
XMLTV was not fun to install. Well, to clarify I should say that XMLTV itself wasn't so bad, but all its dependencies were a pain in the ass until I figured out what you can get away with. Had I read the XMLTV page at the Freevo site I would've known.

First you should grab the XMLTV package from SourceForge: http://sourceforge.net/project/showfiles.php?group_id=39046

Untar it and read the README file. In there is a list of the Perl packages you need to install before installing XMLTV itself. You can get them a few ways, but I chose the CPAN route. It was tough, but I got through it.

First, run the following command to set up and start CPAN:
perl -MCPAN -e shell
I used the default values (just hit enter) for almost everything. For the FTP servers I just picked some random ones. Doesn't really matter.

I was then given the cpan> prompt. From there you can begin installing all the perl modules you need (again, they're listed in the README file that comes with XMLTV). I ended up installing some of the optional ones too, even though I didn't really know what they did. To install, just type install, space, and then the package you want to install, like install XML::Twig. If the package you're installing requires another package, it'll ask you if you want to install the required package(s) first. Answer yes, obviously.

Some of the installations may fail. My LWP package refused to install because too many errors were produced during the test. Just force it by putting force before the installation command (force install LWP). I forced the installation despite having a large percentage of failures and my XMLTV works just fine.

Once all the necessary modules are installed you can install XMLTV itself. Just follow the directions in the README. When XMLTV has successfully installed (and if it doesn't successfully install I have no idea what to do; try installing the necessary perl packages again), run tv_grab_na --configure to set up the data needed to grab TV listings. It asks you for a ZIP code and other junk. It'll fetch the channels for your area and put them in a configuration file located at ~/.xmltv/. I forget the exact filename, but it's the only file in there and I'll edit this entry later.

To grab listings and put them in a file, do tv_grab_na --days <num days> /<path>/<filename>. You can leave out the --days <num days>, but setting it to 1 or 2 for testing purposes makes the download go more quickly. By default Freevo wants to find the listings in /tmp/TV.xml so you should probably put it there (tv_grab_na --days 1 /tmp/TV.xml) unless you specify otherwise in Freevo's local_conf.py file.

Now you've got the listings, but local_conf.py still needs to be updated with the channel list. The XMLTV wiki at the Freevo site has a couple scripts you cause to extract the channel data from the TV listings file and output it into the format that Freevo wants. I took the output from one of those scripts, ordered it the way I wanted to, and had to then had to change the station name and number for each entry manually so they'd be the way I wanted it.

For some reason freevo_conf.py has a default channel list in there that you need to comment out or delete. Or I guess you could add your channel list to that file, but either way I thought that file was never to be modified. Who knows. Also, if you start up Freevo, look at the listings, and find that the channel list doesn't reflect the changes you've made, delete the file in /tmp/freevo/cache/ that has the word "pickle" in it (forget the actual name of the file, but it's impossible to miss). When you start Freevo again and look at the listings it'll regenerate this pickle file.

I thought XMLTV would be one of the easier things to set up, but it's been a pretty big pain in the ass. Works OK for me now, though. Eventually I'll set up a cron job so that the listings are retrieved automatically on a regular basis.

Wednesday, October 15, 2003

Connection lost! 

I'm at work installing XMLTV when the terminal just stops responding. Maybe the power went out, or the wireless network cut out, or the DSL is down on Verizon's end. I'm pissed. I was in the middle of something. Right now I'm repeatedly pinging until I get a response in hopes that whatever caused the failure will undo itself.

Getting the TV up 

The video card is now set up properly, but more on that later.

My TV card's chipset (BT878) is supported by the bttv driver, which fortunately comes with Slackware. Many cards are supported by this driver, and it seemed to work pretty well because my card was detected when I installed Slackware and booted it for the first time.

Problem was that when I tried to use xawtv to watch TV, I'd get nothing. For some reason I could still use the composite input (I hooked up a game console to test that out), but no success with trying to tune into a station.

The problem was easily fixed, though. Auto-detection wasn't sufficient. I physically removed the TV card from my computer and examined the card for any information identifying it. Two very important pieces of information were there: 1.) the model number of the card (in my case, CPH060) and 2.) the make and model of the tuner (Temic 4032 FY5). This gave me something to Google, and I found this crucial page: http://freevo.sourceforge.net/cgi-bin/moin.cgi/BttvPage

All I had to do was find the number corresponding to my specific card (58) and my tuner (6). There are instructions on the page I linked to detailing how to tell what the bttv module is auto-identifying your card as, how to remove that assignment, set a new assignment, and then set it permanently so it is identified properly each time you boot up.

rmmod bttv
rmmod tuner

got rid of the current settings.

modprobe bttv card=58 tuner=6
set the new settings.

And adding
options bttv card=58 tuner=6
in the /etc/modules.conf file allowed that to be set each time the computer booted. To commit the changes right away, run depmod.

Again, that's all on the site. If you're lucky, auto-detection will identify the right card and you won't have to go through all of that. If not, the above might help.

And as I said above, xawtv works very well for watching TV. MPlayer works great, too. This is the command I use to bring it up on channel 35:
mplayer tv://35 -tv driver=v4l:width=640:height=480:norm=NTSC:chanlist=us-cable -fs -nocache

h is channel up and k is channel down. man mplayer will tell you everything you need to know.

Tuesday, October 14, 2003

Wrong driver! 

OK, so I thought I had an ATI video card and installed the wrong friggen' driver. I guess it couldn't have been all that bad since everything still worked fine. Well, almost. The image wasn't centered on the screen like it was before I installed the new driver.

Slackware detected my card just fine. But I was trying to get this program called tvtime to work, and it suggested trying a binary ATI driver. So I did. I still want a driver specific to my card, but this time, the RIGHT ONE.

O'Reilly Network: Video Playback and Encoding with MPlayer and MEncode 

Cubemate Justin (I guess he's my Linux mentor) shared this article about how awesome MPlayer is. It's a pretty amazing piece of software. Eventually I'll get into the command line arguments I use when I play a movie file or watch TV using MPlayer.

O'Reilly Network: Video Playback and Encoding with MPlayer and MEncode

Monday, October 13, 2003

Yay, TV! 

I just got my TV card working with xawtv and mplayer. Sound works too! Unfortunately, I'm behind on my journaling (and it's bedtime right now), so I won't get to details of my amazing success with the TV card until later. Next up is how I got better (but are they REALLY better?) video drivers and made my FVWM95 GUI all weird.

Getting sound 

I have a Monster MX300 sound card. That fact is more or less irrelevant because it's the chipset that really matters. The MX300 uses the Aureal Vortex 2, designated AU8830 or just 8830.

A quick Google search seemed to indicate that there was plenty of support out there for this card/chipset. One site had Aureal's original Linux drivers. The company is out of business, though, so there's no more support from them, plus for some reason I couldn't untar them. That page also suggests unofficial drivers from the Linux Aureal Driver project at SourceForge. That looked promising, but I couldn't untar those files either! When I tried, I got an error indicating some data was missing. Then I tried the OpenVortex Project, but their download area is totally empty!

I finally found drivers that I could unpack at http://jayasolutions.0catch.com/03gnulinux.html. Since this is the only source of this driver that I've been able to find, I'm keeping a copy on my server as well. You can get it here: au88xx-1.1.3.1.tar.gz. The README file indicates that this is from the SourceForge Aureal project, but again, none of those files worked for me.

So I just untarred them to my /tmp directory and did a make install-all per the README's instructions. The MX300 was listed among the supported cards, so that made me happy.

I first tested my new sound capabilities with xmms, which is a Winamp-like MP3 player. Worked beautifully. The next day I got mplayer and had similarly positive results. The driver doesn't seem to support ALSA (Advanced Linux Sound Architecture), at least not for me. When I'm using Mozilla I still get periodic errors about no alsa card being found, or something like that. Also, when I run alsaconf it will not detect my sound card. I don't really care. I can play media files and that's all I'm worried about.

Sunday, October 12, 2003

Getting the WUSB11 to work 

I have a Linksys WUSB11 v2.6 Wireless USB Network Adapter. I wanted it to work with Linux. Now it does. Here's what I did:

Linux was detecting the USB network adapter, so I at least knew that USB devices were working. I just needed the proper driver, which I found at http://at76c503a.berlios.de/. I also got the Linux wireless tools, which were apparently supposed to come with Slackware, but I may have accidentally left that package out. That adds iwconfig so that you can, of course, configure wireless devices. I installed the driver and the wireless tools and rebooted, but ifconfig still showed nothing. Then I was reading this thread at LinuxQuestions.org, which suggested setting an IP address manually with ifconfig and then using iwconfig to manually set the ESSID, channel, key, etc. That allowed me to ping my router, but DHCP still wasn't assigning the Linux box an IP address. I screwed around some more, but gave up for the night.

Finally on Saturday morning I read something that lead me to the final solution. I added the following lines to my /etc/rc.d/rc.local file, which gets called on bootup:
iwconfig wlan0 mode Managed rate 11M channel 10 essid Hyrule key <128-bit key here>
route add default gw 192.168.1.1
dhcpcd wlan0


So I tell Linux all the details of my wireless access point, assign the default gateway to my router (Linksys default IP), and then manually request to be given an IP address by my router's DHCP server. This did the trick. The only other problem I had was that if I didn't shutdown Linux gracefully (my X server would hang sometimes and I'd have to turn the PC off), the .pid file from dhcpcd (/etc/dhcpc/dhcpcd-wlan0.pid) was left. When Linux booted up again, dhcpcd wouldn't run because that .pid file was still there. I added a line to the /etc/rc.d/rc.0 file to delete the .pid file, but I'm thinking now it's pretty much useless. If and when this problem occurs, I'll delete the .pid file myself.

So wireless networking works on my Linux box like a charm.

Saturday recap 

So here's what I did yesterday:

Mike dropped off Partition Commander for me, so I moved some of the media files I had off the hard drive and onto CD and cleared off 2 GB for my Linux partitions. I had a Slackware 9.1 installation disc that I made the previous day. Slackware.com has a number of locations for you to download ISO image files so you can burn a bootable CD.

I booted off the CD just fine and chose the defaults whenever it prompted me. I decided due to laziness and lack of hard drive space that I was only going to have 2 partitions: a 384 MB swap partition (I've got 384 MB of RAM) and a partition for everything else. To make them actual Linux partitions, though, you need to run cfdisk (or fdisk if you don't need any fancy menus), set the swap partition to type 82 (Linux swap), the other one to type 83 (Linux), and then write the change to the partition. As Justin reassured me, writing will not destroy other partitions.

Once the drives were mounted, I was ready to run the setup program. I can't recall what I chose to install, but I know I left out KDE and Gnome (they were on disc 2) and got rid of a bunch of other things too, to save disc space.

Now my main concern was of course getting the dual boot with Windows 2000 to work properly. It's really quite simple. You'll find a number of instructions on the internet that should correspond to this. At some point you'll be given some options about installing LILO. Choose the expert installation, then choose "Begin" and answer each prompt. The most important one will ask you where you want to install it. Make sure you choose "Root" (install to superblock). It's selected by default so you probably won't mess up. Then add the Linux and Windows partitions (if you have Windows partitions to add) and install LILO.

Once Linux installation is finished, you have to grab the first 512 byte of the Linux root partition. That's pretty easy. Just execute this command: dd if=/dev/hdax of=/tmp/bootsect.lnx bs=512 count=1. Replace the red x with the number of the root Linux partition. Note that the instructions at Slackware.com reverse the bs and the count values! Maybe that works too, I don't know, but I know for a fact that the way I describe it works. Anyway, now bootsect.lnx is in your /tmp directory. If the Windows partition is FAT32 or FAT16 you can just copy it over, but if it's NTFS you should mount a floppy (mount /dev/fd0 /floppy), copy the bootsect.lnx file over to the floppy drive, restart the computer to Windows (at this point you can't boot to Linux), and then copy the file from the floppy to C:\.

Finally, you have to add a line to the boot.ini file. If this file doesn't exist, go to the command prompt (Start->Run and type cmd, hit Enter) and run this command at the root (C:\) directory: attrib -r -a -s -h boot.ini. Edit boot.ini by adding this line to the end of the file: C:\bootsect.lnx="Slackware Linux" That's it! When you reboot you'll get an option to choose between the two OSes.

Now the first time I tried this and selected Linux, nothing happened. But I just made a new file of the first 512 bytes, recopied it to the Windows partition, and everything was cool after that.

Once Linux was up, the first thing I wanted to do was to get my 802.11b wireless USB adapter working (it's a Linksys WUSB11). Last night that effort failed, but my next entry will have what I did to get it working.

This page is powered by Blogger. Isn't yours?