"Hier staunt der Laie und Fachmann wundert sich."

Samstag, Oktober 29, 2005

KnoppMyth R5A22: Change bootsplash

I like the bootsplash feature that comes with KnoppMyth, but I don't like the picture :-) Sorry, I just don't. But that's not a big problem as you can configure the splash screen yourself. Simply download a theme you like (e.g. from www.bootsplash.de) and isntall it in the /etc/bootsplash/themes directory. Then run
splash -s -f /etc/bootsplash/themes/YOURTHEME/config/YOURCONFIG.cfg > /boot/initrd.gz

Note the single "greater than" character here.

Upgrading to KnoppMyth R5A22

After getting the then latest release R5A16 of KnoppMyth to work with my equipment (Hauppauge PVR 500 and remote, which is a "new" MCE remote), I was anxious to upgrade to the newer version. After all, I had to make quite a lot of changes to the default installation (compile current ivtv and things like that).

Step one: Backup your system -- the easy way

I backed up my system partition /dev/hda1 using
dd if=/dev/hda1 of=/mythtv/backup/mybackup_r5a16.img bs=1024k

This will create a complete, block by block, backup of /dev/hda1 in the file /mythtv/backup/mybackup_r5a16.img. This way I will have all my configuration files in case I forget some of the necessary changes. Or I can even revert to my old system by copying the image file back to /dev/hda1 using
dd if=/mythtv/backup/mybackup_r5a16.img of=/dev/hda1 bs=1024k

This will overwrite the contents of /dev/hda1 with the contents of the image file. This will be my last resort. In fact, I do not plan to do this unless something goes terribly wrong. Instead I plan to use the backup only as a reference source for my old config-files. The image file can easily be mounted, making the contents accessable like a regular filesystem using
mount -o loop /mythtv/backup/mybackup_r5a16.img /mnt/backup

This will mount the backup image read only to the mount point /mnt/backup. (You will need to create this mount point first: mkdir /mnt/backup).

Step two: Prepare KnoppMyth for upgrade

This step is even simpler. Just use the the MythTV menu "KnoppMyth" and there "Backup KnoppMyth". This creates archives of important directories and your mysql database and puts them in /mythtv/backup. The upgrade routine of KnoppMyth will use some of this to restore your configuration. This includes e.g. your channel settings and schedule.

Step three: Upgrade KnoppMyth

Now shut down your system and boot from a new KnoppMyth R5A22 CD. Remember to choose the correct language at the lilo-prompt. E.g. "knoppmyth lang=de" for a German keyboard. When the installation menu appears choose "Auto upgrade". If you are sure that you backed up your data you may proceed. Wait till you have to reboot again, remove the disc and reboot from harddisk.

Step four: First boot after upgrading

One thing I noticed was that the screen resolution had changed. This seems to be because of the bootsplash which is now activated by default (see below). The new resolution makes your fonts appear bigger (not in MythTV but everywhere else) which is not so bad, even though I never bothered to change it before.

After the first boot I expected to have to go through the installation process and having to restore my settings by hand. Surprise, surprise, I did not have to. KnoppMyth obviously comes with an upgrade script which works nicely. It prompts you for the root password and then proceeds to restore your settings (the mysql database) and install some stuff as usual. This version also asks for the remote control you are using. I have a MCE-type remote that came with my TV card. It uses the lirc_mceusb2 driver. This one wasn't listed (I thought) but it turns out that choosing the (original) mceusb driver makes the script ask you whether you are using an old or a new version of the remote. Choosing "new" here corresponds to installing the lirc_mceusb2 driver. So I did all this but the script complains that it should be able to autodetect the remote at this point, which it could not. Thus first thing I checked after completing the install was the remote (using "irw", which should output something on the console if you press a button on the remote). But it doesn't work. -- But I'm jumping ahead of myself. Follow the instructions of the upgrade script and reboot your computer one more time. If you chose to install bootsplash (like I did) you will see an image (a version of the KnoppMyth X background) during the boot process instead of the boot messages. Pressing ESCAPE will show the boot messages though.

Step four: Assessing the upgraded system

Instead of checking dmesg to see if there were any error messages I checked to things: Does the remote work (after all the upgrade script had complained) and do my tuners work?

I had already said that my remote did not work. But the tuners do, both of them. This is nice because last time I had to compile ivtv myself. So KnoppMyth obviously now supports the Hauppauge PVR 500 out of the box. The first time I tried the picture seemed to be too big for the screen though. When I tried again this was gone (strange!). All I did in between was call "ivtv -U" which only outputs the available TV norm on the console.

Anyway, next thing I did was changing KnoppMyths settings for the ivtv-cards in /etc/sysconfig/ivtv/cfg-0 and cfg-1. Because I'm in a PAL country I enabled
IVTV_TYPE=PAL

in both files (i.e. for both tuners of my PVR 500). If you use NTSC then you don't have to change anything as this defaults to NTSC. KnoppMyth uses these configuration files in the script /etc/init.d/set_ivtv_params. [I rebooted after this to see its effects. You don't have to do this here.]

Looking at the LiveTV doesn't look as good as it did before, so I checked the output of "dmesg" for any inconsistencies. While doing that I also disabled (using "modconf") some modules that I'm sure I won't need:
  • under kernel/drivers/media/dvb/bt8xx (do it in this order or it may not work!):
    • dvb-bt8xx (this will also remove bt878, dst_ca, dst, and bttv and possibly more)

Of course, this did not fix the picture quality. I still have to figure out what's wrong with that.

New MythTV setting

Switching to watching Live TV the first time I had also noticed that the program displayed some weird "Signal %" stuff instead of the show's description. Maybe this is related to the new setting in MythTV (mythfrontend) that can be found under Configuration / TV / General / Local settings. There are two new settings called "Guide language #1" and "Guide language #2". Instead of figuring out it's meaning I simply changed if "Arfa" to "German". Of course, you will want to choose your own language. Note that they do not seem to be strictly in alphabetical order, so keep on looking if you can't find the right language right away.

ndiswrapper

I have a WLAN USB adaper (Linksys WUSB54G) which I run with the ndiswrapper modules. There are other ways of doing this (not using ndiswrapper) but I have no time fiddling around with this so I stick to ndiswrapper.

Because I don't have an Internet connection without this card, I had to use the deb-package on my backup image instead of apt-getting the newest one. I created a mount point for my backup image ("mkdir /mnt/loop") and mounted it there:
mount -r -o lo /mythtv/backup/mybackupr5a22.img /mnt/loop
After doing this I was able to access (read only) all my configuration files and everything else via /mnt/loop. First thing I did was update my locate database so the locate command knows about /mnt/loop.
updatedb

Depending on the number of files and speed of your disks this may take a couple of minutes. Afterwards you can use
locate [part_of_name]

to find any files containing [part_of_name]. If used that to locate the driver files for my wlan card (wusb54g). I found them to be at /mnt/loop/etc/ndiswrapper/wusb54g. Using ndiswrapper I installed them with
ndiswrapper -i /mnt/loop/etc/ndiswrapper/wusb54g/wusb54g.inf

If you have a different card then you will need to supply the driver's .inf-file here. Check with "ndiswrapper -l" afterwards if the drivers were correctly installed.

Because I use WPA to protect my WLAN (you should, too!) I also had to install wpa_supplicant. Again, not yet being able to access the internet I had to use my backup image. This time I looked for wpa ("locate wpa") and found the .deb-package at /mnt/loop/var/cache/wpasupplicant_x_i386.deb" where x is a version string, depending on the version you installed. Use "ls /mnt/loop/var/cache/wpa*" to find the correct one. Mine was wpasupplicant_0.4.4-1_i386.deb so I will use that here. Install the package using
dpkg -i /mnt/loop/var/cache/wpasupplicant_0.4.4-1_i386.deb

You will also want to copy the following configuration files (which pertain to the wlan and network in gerneral):
cp /mnt/loop/etc/wpa_supplicant.conf /etc/wpa_supplicant.conf

cp /mnt/loop/etc/default/wpasupplicant /etc/default/wpasupplicant

cp /mnt/loop/etc/network/interfaces /etc/network/interfaces


After that there are a couple of things left to do:
  1. Enable the ndiswrapper-module using modconf (the module is found under "misc", all the way down).
  2. Remove all "linux-wlan-ng" modules using modconf (the modules have their own group right above "misc"). You should disable all of them.
  3. Enalbe wpasupplicant to be started at boot time using
    update-rd.d wpasupplicant defaults

    This will add the script /etc/init.d/wpasupplicant to your default run-levels (2, 3, and 4).
  4. Start wpasupplicant using
    /etc/init.d/wpasupplicant start
  5. Bring up your wlan interface. Mine is called "wlan0" so I do "ifup wlan0". Now you should be able to ping other NICs on you network.


If you used hotplug to bring up your card then you will also want to copy the necessary files. In my case /mnt/loop/etc/hotplug/usb/wlan0 and wlan0.usermap.

Getting the remote to work again

The new upgrade script asks for the type of remote but mine did not work right away. The script installed the correct driver (lirc_mceusb2 in my case) but irw did not show any output. This point to an incorrect /etc/lircd.conf file, and indeed this is the culprit. The upgrade script did not replace it with a correct version (or which would have been even better: with my original one). So I had to do it myself:
cp /mnt/loop/etc/lircd.conf /etc/lircd.conf

After restarting lircd ("/etc/init.d/lirc restart") and quitting and restarting mythfrontend, my remote works like a charm again.

At this point my MythTV box is working as before. I will check out the new features later.

Mittwoch, Oktober 26, 2005

KnoppMyth: Enabling password protection of MythWeb

You created a htpasswd-file and changed the .htaccess-file but MythWeb still does not prompt for password? The reason could be that .htaccess files are being ignored by apache. This can be configured in /etc/apache/httpd.conf.

Look for lines reading
ALLOW OVERRIDE = NONE

This means that apache will ignore your .htaccess files altogether. Note that they usually is more then one line of this kind. If you are on an intranet and you just want to keep certain users from accessing your mythweb, then all you need to do is change the appropriate line to:
ALLOW OVERRIDE = ALL

"The appropriate line" is the one that pertains to the /var/www directory. If you are not sure about this then you should consider reading the documentation at www.apache.org. Don't forget to restart apache afterwards (/etc/init.d/apache restart).

Problem when upgrading to new version of glibc?

Here is an annoyning little problem that I kept running into when I wanted to upgrade to a newer version of glibc:

dpkg kept complaining that there is another version listed in /etc/ld.so.conf. Too bad it didn't say which line it was complaining about or which folder the offending files were in. So I commented out one line after another and ran ldconfig each time. Then I tried to upgrade again, but without any success.

Turn out that comments don't do the trick. You need to acutally delete the lines from /etc/ld.so.conf. (Why does nobody ever tell you these things?)

Dienstag, Oktober 25, 2005

Hints for wpa_supplicant and ndiswrapper on Debian (Sarge)

If you have installed both wpa_supplicant and ndiswrapper and have managed to manually start them from a terminal, then will probably want them to start after the next reboot automatically.

Here is what you need to do:

1) Make sure that you entered the correct options for wpa_supplicant in /etc/default/wpasupplicant. Specifically, you should set "ENALBE=1" and insert a line similar to
OPTIONS="-i wlan0 -D ndiswrapper -c /etc/wpa_supplicant.conf

where "wlan0" is the name that you used in /etc/network/interfaces to identify your card. Speaking of which:
2) Insert a line in /etc/network/interfaces similar to
iface wlan0 inet dhcp

and also don't forget to enalbe the autmatic startup of the interface by adding it to the line starting with "auto", e.g.
auto lo wlan0

3) Now all you have todo is tell Debian to start the wpa_supplicant at boot-time which is done by adding it to the default runlevel like this:
update-rc.d wpasupplicant defaults

(Note the missing underscore "_" here. If this does not work, then try it with "wpa_supplicant".) If you don't have the update-rc.d command on your system then you will most likely have a file called /etc/runlevel.conf. Check this page for more info: http://debiananwenderhandbuch.de/init.html

Freitag, Oktober 21, 2005

Updating tv_grab_de_tvtoday on a KnoppMyth installation

So I decided to go ahead and buy the Hauppauge PVR 500. To make it fit in the AOpen case I removed the built-in card-readers which occupy the 3.5" slot. This is not the nicest solution but it serves my purpose for the time being (i.e. not having a spare 2.5" harddisk).

After installing KnoppMyth (and the latest ivtv 0.4.0, because the one that comes with KnoppMyth is way too old), I wanted to grab the TV listing from TV-Today (I'm in Germany). The version that comes with KnoppMyth is not working due to changes on the TV-Today website, so I had to install an update. There seems to be no doc (at least I could not find one), so here is what I did:


1.) Download http://cvs.sourceforge.net/viewcvs.py/*checkout*/xmltv/xmltv/grab/de_tvtoday/tv_grab_de_tvtoday.in
2.) Replace your current tv_grab_de_tvtoday with this file (renaming it, i.e. removing the ".in"). In KnoppMyth it's in /usr/bin
3.) Make the file executable (chmod 755 tv_grab_de_tvtoday)
4.) Open the file using your favorite text-editor, e.g. nano -w tv_grab_de_tvtoday, and locate the line starting my $SHARE_DIR=undef; and replace the undef by "/usr/share/xmltv" (including the quotes!). Of course, if xmltv is installed in a different dir on your system you should change this line to the appropriate path.
5.) Download http://cvs.sourceforge.net/viewcvs.py/*checkout*/xmltv/xmltv/grab/de_tvtoday/channel_ids
6.) Copy the file to the correct xmltv-sub-directory. Again, on KnoppMyth this is /usr/share/xmltv/tv_grab_de_tvtoday/.
7.) Run mythfilldatabase --manual. This time, it should start grabbing (which, by the way, can take a very long time). After a while (10-60 minutes), it should prompt you with some info it needs from you. You should know what to do from here on.

Montag, Oktober 10, 2005

Abmessungen Hauppauge WinTV PVR 500 / Size of Hauppauge WinTV PVR 500

Mit einer Hauppauge WinTV PVR 500 liebäugelnd hatte ich Befürchtungen, dass sie nicht in mein AOpen XC Cube AE65 II passt (was auch stimmt: sie ist ca. 1 cm zu lang). Google konnte nicht weiter helfen, stattdessen fanden sich häufig falsche Angaben (nämlich die von der PVR 150). Email an Hauppauge geschickt und prompt kam die Antwort (nach nur 59 Minuten!):


Abmessung der Hauppauge WinTV PVR 500 in cm:
Höhe (Hight): 9,9 cm (10,7 cm incl. PCI-Kontakte)
Länge (Lendth): 19,5 cm


English
Above are listed the dimensions of a Hauppauge WinTV PVR 500. I got these directly from Hauppauge. They actually replied to my mail in under an hour -- 59 min. to be exact :-). By the way: The card will not fit into a "regular" AOpen XC Cube AE65 II because it is about 1 cm too long.

It would be an option to use a 2.5" HDD and either cut out a piece of the HD drive cage (which is in the way of the PVR 500) or place the disk behind the card-reader slot. But right now I neither have a spare 2.5" HDD nor a cutting tool -- let alone the time -- to try this.

Donnerstag, Oktober 06, 2005

Getting TV Card of an AOpen XC Cube EA65 II to Work under Linux

This card uses the cx88xx and cx8800 modules but is not recognized by them correctly. So what needs to be done is to pass the parametes "card=5 tuner=38" to the cx8800 module. Easiest way to do this under debian is using debconf.