Myth Box Software Build Log

(part of BuildingFreevo.)

This HOWTO is a good starting point for the software.

I think KnoppMyth will be the first port of call; most writeups on the net seem to suggest that it's got a good set of pre-patched binaries, saving a lot of time patching and handbuilding. Also, I like Debian/Knoppix, and going for another linux distro would be wasting time; I don't plan to be using anything but MythTV on the box much anyway.

cdrecord dev=/dev/cdrom driveropts=burnfree -speed=16 \
    -verbose -dao -data ~/DL/KnoppMythR5A12.iso

sadly this seems way too slow; it gets into grub, but cannot load the kernel it seems. So another way to get KnoppMyth onto the machine is required.

...After a couple of hours of looking into PXE and net booting, it turns out that in fact, it *will* boot from the USB CD/DVD drive -- as long as that is plugged into the bottom USB port and there's no other USB devices plugged in! ah, hardware.

So, onward with KnoppMyth setup.

it seems "knoppix" and "knoppix26" are not supported, but "expert" works. Quick trace of the expert install steps:

Into the KnoppMyth setup screen (http://www.mysettopbox.tv/doc.html). Now, since I want to use LVM for my KnoppMyth partitions, I'll go for a manual install...

    hda5 / 2GB [bootable]
    hda6 swap 800MB
    hda7 /cache 500MB *
    hda8 /myth  500MB *
    hda9 LVM    all the rest of the space

mkswap /dev/hda6 && swapon /dev/hda6
mke2fs -j -m1 -L root -M / /dev/hda5
mke2fs -j -m1 -L cache -M /cache /dev/hda7
mke2fs -j -m1 -L myth -M /myth /dev/hda8

left hda9 blank for now

OK, I'm happy with that. Reboot off the Knoppix CD and leave the machine running memtest.

...back to find errors...

Bad RAM stick

wouldn't you just know it. memtest reports:

Tst  Pass    Failing Address          Good     Bad      Err-Bits Count Chan
---  ----    ----------------------   ----     -----    -------- ----- ----
  4     0    00015847e28 - 344.4MB    fffbffff fffbfbff 00000400     2    1

This is with memtest-86 v3.0. Re-tested with memtest86+ v1.55, and got the same bit failure:

Tst  Pass    Failing Address          Good     Bad      Err-Bits Count Chan
---  ----    ----------------------   ----     -----    -------- ----- ----
  6     0    00015847e28 - 344.4MB    fffbffff fffbfbff 00000400     5

(test #6 is "Moving inversions, 32 bit pattern".)

If I want to use BADRAM: the setting to avoid that word is

reran test with BIOS set to "Failsafe defaults" and same bit fails; memtest86+ v1.55 testing the range from 344MB-345MB repeatedly finds that bit failing even with conservative settings.

OK, how to get this repaired?

the part was: pqi POWER Series 184-Pin 512MB DDR PC-2100 - Retail Item# N82E16820141173: $45.50

[http://www.newegg.com/app/faq_product.asp?DEPA=0&ShowItem=1#xmenu1 NewEgg warranty info]:

so, that's a possible TODO.

CARRYING ON WITH THE SETUP

next step, networking.

ifconfig eth1:

      inet addr:10.19.72.7  Bcast:10.19.72.255  Mask:255.255.255.0

changed eth1 to be statically addressed: /etc/network/interfaces:

iface eth1 inet static
        address 10.19.72.99
        network 10.19.72.0
        netmask 255.255.255.0
        up route add -net default gw 10.19.72.1
        down route del default gw 10.19.72.1

Next, LVM

[email protected]:~$ sudo pvcreate /dev/hda9
  Physical volume "/dev/hda9" successfully created

 * create a volume group, "vg":
[email protected]:~$ sudo vgcreate vg /dev/hda9
  /dev/hdc: open failed: No such device or address
  /dev/hda1: read failed after 0 of 2048 at 0: Input/output error
  /dev/hda2: open failed: No such device or address
  /dev/hda3: open failed: No such device or address
  /dev/hdc: open failed: No such device or address
  /dev/hda1: read failed after 0 of 2048 at 0: Input/output error
  /dev/hda2: open failed: No such device or address
  /dev/hda3: open failed: No such device or address
  /dev/hdc: open failed: No such device or address
  /dev/hda1: read failed after 0 of 2048 at 0: Input/output error
  /dev/hda2: open failed: No such device or address
  /dev/hda3: open failed: No such device or address
  Volume group "vg" successfully created

(those devices are nonexistent, so that's expected.)

[email protected]:~$ sudo vgdisplay vg
  /dev/hdc: open failed: No such device or address
  /dev/hda1: read failed after 0 of 2048 at 0: Input/output error
  /dev/hda2: open failed: No such device or address
  /dev/hda3: open failed: No such device or address
  --- Volume group ---
  VG Name               vg
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  1
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                0
  Open LV               0
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               70.99 GB
  PE Size               4.00 MB
  Total PE              18173
  Alloc PE / Size       0 / 0
  Free  PE / Size       18173 / 70.99 GB
  VG UUID               0jrnld-xX82-MX3s-MPxc-OH06-0XTd-yXEBBN

added hda8, hda9, and vgextend'd onto those. now:

  Free  PE / Size       18411 / 71.92 GB

suggested new layout:

        /               2GB
        /var            500MB
        /cache          8GB
        /myth           50GB

        + 800MB swap = 61300MB, leaving 10.62GB free for minor tweaks
        and possible eventually just allocating entirely to /myth.

as noted on the wiki page
http://knoppmythwiki.homelinux.org/index.php?page=LvmHowTo , I had
to add the device-mapper:
modprobe dm-mod
echo dm-mod >> /etc/modules

sudo lvcreate -L 500M -n var vg
sudo lvcreate -L 8G -n cache vg
sudo lvcreate -L 50G -n myth vg
sudo update-rc.d lvm start 26 S . stop 82 1 .

sudo mke2fs -j -m1 -L var /dev/vg/var
sudo mke2fs -j -m0 -i8000000 -L cache /dev/vg/cache
sudo mke2fs -j -m0 -i8000000 -L myth /dev/vg/myth

sudo mkdir /mnt/tmp
sudo mount /dev/vg/myth /mnt/tmp
sudo cp -a /myth/* /mnt/tmp
sudo umount /dev/vg/myth
sudo mv /myth /myth-
sudo mkdir /myth
sudo mount /dev/vg/myth /myth
sudo chmod 1777 /myth

sudo mount /dev/vg/cache /mnt/tmp
sudo cp -a /cache/* /mnt/tmp
sudo umount /dev/vg/cache
sudo mv /cache /cache-
sudo mkdir /cache
sudo mount /dev/vg/cache /cache
sudo chmod 1777 /cache

sudo mount /dev/vg/var /mnt/tmp
sudo cp -a /var/* /mnt/tmp
sudo umount /dev/vg/var
sudo mkdir /bigvar
sudo mount /dev/vg/var /bigvar

sudo mkdir /var/REMOVE
for dir in log mail opt spool ; do
  sudo mv /var/$dir /var/REMOVE && sudo ln -s /bigvar/$dir /var/$dir
done

[assuming there were no errors in all of the above:]
sudo rm -rf /var/REMOVE /cache- /myth-
sudo rm -rf /bigvar/{autofs,backups,cache,lib,local,lock,run,tmp,www}

added to /etc/fstab:

/dev/vg/cache   /cache  ext3    defaults,auto   0 2
/dev/vg/myth    /myth   ext3    defaults,auto   0 2
/dev/vg/var     /bigvar ext3    defaults,auto   0 2

also added a tmpfs, always good to have one of these!:

none    /tmpfs  tmpfs   defaults        0       0

: jm 62...; sudo mkdir /tmpfs
: exit=0 Sun Apr 10 15:16:16 PDT 2005; cd /usr/src/kernel-source-2.6.9-chw
: jm 63...; sudo mount !$
sudo mount /tmpfs

Memtest Boot Image

Installed memtest86+:

added to /etc/lilo.conf:

image  = /boot/memtest86+.bin
 label = memtest86+

And rerun memtest overnight, this time using BIOS failsafe defaults.

2005-04-10: the same bit is bad in the overnight memtests. it's bad RAM and I'll have to RMA it (eventually).

In the meantime: box comes up, but ethernet driver doesn't start! a couple of reboots do the same, then another reboots gives a kernel panic in memory allocation for soundcard initialisation from ALSA modules. (eek!)

init 6 and set BIOS to use optimized defaults again. continue reboot, and yep, eth1 has returned; something in the BIOS optimized defaults is required for eth1 to work.

annoyance: vim isn't installed. sudo apt-get install vim

fixed /etc/lvm/lvm.conf:

    # Exclude the cdrom drive
# jm - commented
# filter = [ "r|/dev/cdrom|" ]

# jm - just hda's, thanks
    filter = [ "a|^/dev/hda|", "r/.*/" ]

annoyance: knoppix does stupid things in /etc/profile, which breaks scp if you use $PS1 being set as an indication of an interactive shell (as /bin/sh doco used to recommend). workaround below. also remove bash completion:

# [ "$PS1" -a -f /etc/bash_completion ] && . /etc/bash_completion
# PS1="\[email protected]\h:\w\\$ "

(ps: note that the bash completion line even uses the $PS1-exists trick itself in that line! hello Knoppix developers!!)

The Gigafast UIC-741 USB Wifi Dongle

http://linux-lc100020.sourceforge.net/

get drivers for: zd1201-0.14 zd1201-0.14-fw from that project's download page, and unpack:

cd /usr/src/
sudo mkdir jm-patches_2.6.9
sudo chown jm jm-patches_2.6.9
cd jm-patches_2.6.9

mkdir zd1201-0.14; cd zd1201-0.14; tar xvfz /home/jm/zd1201-0.14.tar.gz
cd ..
tar xvfz /home/jm/zd1201-0.14-fw.tar.gz

argh, need to apply a patch to the kernel USB subsys to work around some stupid vendor bugginess.

cd /usr/src/
sudo tar xfj kernel-source-2.6.9-chw.tar.bz2
cd kernel-source-2.6.9-chw/
sudo patch -p1< /usr/src/jm-patches_2.6.9/zd1201-0.14/2.6.8.1-usb-broken-discriptor.diff

next, just rebuild the kernel. I don't want to do any tweaking away from distro defaults if I can avoid it...

sudo make oldconfig
sudo make all modules install modules_install

        reboot, and...

cd /usr/src/jm-patches_2.6.9/zd1201-0.14
make
sudo make install

: exit=0 Sun Apr 10 20:31:53 PDT 2005; cd /usr/src/jm-patches_2.6.9/zd1201-0.14-fw
sudo make

sudo depmod -ae
sudo modprobe zd1201
iwconfig wlan0
sudo iwconfig wlan0 essid "MY ESSID"
sudo iwconfig wlan0 channel 1

    it works! so vi /etc/network/interfaces:

auto lo eth1 wlan0
iface wlan0 inet static
        address 10.19.72.98
        network 10.19.72.0
        netmask 255.255.255.0
        wireless-essid MY ESSID
        wireless-channel 1
        up route add -net default gw 10.19.72.1
        down route del default gw 10.19.72.1

------EOF-------
sudo ifup wlan0
sudo ifdown eth1
sudo vi /etc/modules

    append the line:

zd1201
------EOF-------
{{{

    hey presto, everything is going via wlan0 now! however, wlan0 doesn't come
    up at boot -- looks like it requires hotplug, and that's set to runs after
    networking. doh.  add a local boot script to work around this:

{{{
sudo vi /etc/init.d/local
#!/bin/sh
ifup wlan0
------EOF-------

sudo chmod 755 /etc/init.d/local
sudo update-rc.d local start 99 5 .

    turning off unused daemons;

sudo update-rc.d -f inetd remove
sudo update-rc.d -f portmap remove

/etc/default/rcS:
DELAYLOGIN=no

The remote

followed http://www.mythtv.org/docs/mythtv-HOWTO-22.html#ss22.2 . However there were no signs of life when running "irw". so: http://knoppmythwiki.homelinux.org/index.php?page=Hauppauge250Remote says:

sudo install-i586-l

Following that page's instructions -- there's a plethora of same-but-different remotes by Hauppauge. Genius hardware people again. Checked the sticker inside the remote's battery compartment; it's an A415-HPG.

wget http://lirc.sourceforge.net/remotes/hauppauge/lircd.conf.hauppauge

edit that file, remove all other sections except for the A415-HPG one, installed as /etc/lircd.conf . Restarted "lircd", ran "irw", and the correct presses now show up. yay.

To get mythtv to work correctly, use bindings from here: http://mysettopbox.tv/phpBB2/viewtopic.php?t=3178

finally: make it run at boot.

echo lircd >> /etc/initd.local

CPU Frequency Scaling

http://radagast.bglug.ca/epia/epia_howto/x967.html cpu freq control! 'longhaul', 'cpufreq_userspace'

/etc/modules:

# power mgmt, cpu freq scaling
cpufreq_userspace
longhaul

sudo vi /etc/default/powernowd: }}} OPTIONS=-v

: jm 11...; sudo /etc/init.d/powernowd start
sudo update-rc.d powernowd start 99 5 . stop 02 1 .

WARNING: updated as of Jun 16 2005 -- it appears this may be causing hard hangs (uninterruptible with magic SysRq). I've turned it off here.

install lm_sensors:

  modprobe i2c-core i2c-isa
  modprobe vt1211
  correct sum: http://www.seanm.ca/eden/lmsensors.html
  http://www.courville.org/phpwiki/lm_sensors
  sudo modprobe i2c-viapro ; sudo modprobe i2c-proc
  sudo modprobe i2c-core ; sudo modprobe i2c-isa
  sudo modprobe vt1211

installed hddtemp, and:

sudo crontab -e
*/5 * * * * logger "`sensors | perl -ne '/Proc/ and s/\(.*$// and print'`"

out of disk space! wtf? ah, it's /usr/src. create a new /home volume for that and the home dirs...

sudo lvcreate -L 1G -n home vg
sudo mke2fs -j -m1 -L home /dev/vg/home
sudo mkdir /home.new
sudo mount /dev/vg/home /home.new
sudo cp -a /home/* /home.new
sudo cp -a /usr/src /home.new/usr-src
sudo mv /usr/src{,-}
sudo ln -s /home.new/usr-src /usr/src
sudo umount /dev/vg/home
sudo mv /home /home-
sudo mkdir /home
sudo mount /dev/vg/home /home

[if it looks good:]
sudo rm -rf /home- /usr/src-

add to /etc/fstab:
/dev/vg/home   /home  ext3    defaults,auto   0 2

SMART daemon

sudo vi /etc/smartd.conf
# jm:off
# DEVICESCAN
/dev/hda -a -o on -S on -s S/../.././04

/etc/default/smartmontools:
start_smartd=yes
sudo update-rc.d smartmontools start 99 5 . stop 02 1 .

Sound

alsamixer
['M' to unmute the appropriate channels]
[set Master, PCM and Line to 85% ish]
mplayer -fs ~/test.mp3
[works!]
sudo alsactl store

hookups to TV also work -- direct from soundcard at least.

Getting TV-in, TV-out working

sudo modprobe ivtv-fb
fb0: iTVC15 TV out frame buffer device

: jm 37...; sudo modprobe saa7127 enable_output=1 output_select=0 test_image=1
: jm 40...; ivtvctl -u 0x3000 -p 6


sudo modprobe ivtv
sudo modprobe ivtv-fb

        added those to /etc/modules

ivtv: Initialized WinTV PVR 350, card #0
ivtv-osd: fb1: iTVC15 TV out frame buffer device

sudo rmmod saa7127; sudo modprobe saa7127 test_image=1

NOTE: "output_select" and "enable_output" are NOT supported on this
driver on KnoppMyth, despite ALL the howtos suggesting them.  bizarro.
if they're used, you get noise and an error in dmesg!

sudo rmmod saa7127; sudo modprobe saa7127

    got ivtvdrv.o from http://membres.lycos.fr/badzzzz/
    and installed
    edit XF86Config-4 to use:

Driver      "ivtvdev"
Option      "fbdev" "/dev/fb1"
BusID "00:0x14.0"

        I had the lime-green effect, too.  fix:

: jm 19...; sudo ivtvctl -j reg=0x6c,val=0xfa -d /dev/video16
: jm 20...; sudo ivtvctl -j reg=0x2d,val=0x38 -d /dev/video16

TV Recording

from http://home.comcast.net/~alf_park/mythtv.html --

   ivtvctl -u 0x3000
   ivtvctl -p 4
   ivtvctl -f width=720,height=480
   ivtvctl -v input=3,output=1
   cat /dev/video0 > test.mpg

works -- I get an MPEG full of static!

according to the debian walkthrough I need to fix my "tuner" line due to:

Apr 14 21:52:46 potato kernel: tveeprom: tuner = LG TAPE H001F MK3 (idx = 68, type = 47)
...
Apr 14 21:52:46 potato kernel: tveeprom: tuner fmt = NTSC(M) (eeprom = 0x08, v4l2 = 0x00001000)

so change module line to read:

options tuner type=47

sudo su - mythtv
export DISPLAY=:0
killall mythfrontend
mythtv-setup

   ptune.pl -f ntsc-cable-hrc -d /dev/video -c "9"
   ivtvctl -p 4
   dd if=/dev/video0 bs=64k count=29 of=test.mpg ; mplayer -fs test.mpg

: jm 4...; sudo /etc/cron.daily/mythtv-backend

Sound in TV

[got ivtv-0.2.0-rc3i from ivtv site and unpacked]

cd /home/jm/ftp/ivtv-0.2.0-rc3i/driver
make
find /lib/modules -name 'msp3400*' -print
[remove BOTH found files]
: jm 113...; sudo cp msp3400.ko /lib/modules/2.6.9-chw-4/extra/msp3400.ko
: jm 120...; sudo depmod -ae
sudo reboot

[next, go into mythtv setup screen and set volume to control Master, instead of PCM.]

The remote revisited

Some mods necessary to get the lircd config files matching up... ~mythtv/.mythtv/lircrc

: jm 35...; mysqlcheck -Ap --auto-repair --user=root [no password]

Getting plain AVI video out working

First, get the video browsing working, and make the dir writable so files can be uploaded:

sudo mkdir ~mythtv/.mythtv/MythVideo
sudo chmod 777 ~mythtv/.mythtv/MythVideo

After investigating all the following options and rebuilding MPlayer with the ivtvosd patch:

http://www.poptix.net/ivtv/May-2004/msg00275.html http://www.poptix.net/ivtv/Mar-2004/msg00125.html http://www.poptix.net/ivtv/Jul-2004/msg00495.html http://membres.lycos.fr/badzzzz/

configure --prefix=/usr/local/ivtvmplayer \
    --disable-dvdread --disable-cdparanoia --disable-unrarlib 
make

/usr/local/ivtvmplayer/bin/mplayer -ao oss:/dev/dsp -cache 8192 -fs -zoom -quiet -framedrop -vo ivtv  /myth/video/test.avi

http://www.gossamer-threads.com/lists/ivtv/devel/8176

it finally turns out that it's pretty much impossible :( Basically the PVR-350 cannot do normal bitmap display fast enough. argh. so:

Displaying video on alternate TV-Out

Alternative option: set up a second TV Out from the onboard tv-out S-Video connector! See PvrDoubleTvOut for details and scripts.

Restarting with Blue button

MythFrontend is unreliable, freezing quite frequently. Workaround: use 'irexec' separately to bind an action to one of the unused buttons, which restarts MythTV when it's pressed.

added to end of /etc/init.d/local:

irexec /usr/local/etc/irexec.restarter &

/usr/local/etc/irexec.restarter:

begin
  prog = irexec
  button = Yellow
  config = /usr/local/etc/mythrestart.sh &
end

begin
  prog = irexec
  button = Blue
  config = /usr/local/etc/mythfullrestart.sh &
end

/usr/local/etc/mythrestart.sh:

#!/bin/sh

( echo "Restarting front end" | festival --tts ) &
killall mythfrontend
/etc/init.d/gdm stop

echo "RESTARTED: `date`" > /tmpfs/tst.log

ivtvfbctl /dev/fb0 -globalalpha
ivtvfbctl /dev/fb0 -nolocalalpha
/etc/init.d/gdm start

# ( echo "Done." | festival --tts ) &

/usr/local/etc/mythfullrestart.sh:

#!/bin/sh
echo "RESTARTED: `date`" > /tmpfs/tst.log

( echo "Restarting everything..." | festival --tts ) &

sudo /etc/init.d/gdm stop
sudo /etc/init.d/mythtv-backend stop
sleep 1
sudo /etc/init.d/mythtv-backend start
sudo /etc/init.d/gdm start

( echo "Done." | festival --tts ) &

Hopefully reliability will improve eventually ;)

Streaming Audio (BBC radio etc)

http://knoppmythwiki.homelinux.org/index.php?page=MythStreamInstall

cd /home/jm/ftp/MPlayer-1.0pre5-ivtv-osd-4
./configure  --disable-dvdread --disable-cdparanoia --disable-inet6 \
--disable-ftp --enable-debug --with-codecsdir=/usr/local/lib/codecs \
--with-reallibdir=/usr/local/lib/codecs --with-win32libdir=/usr/local/lib/codecs \
--with-livelibdir=/usr/local/lib/codecs --enable-xv 

make
sudo make -n install

sudo tar cvfz ~/ftp/mplayerbackup.tgz \
  /usr/local/{share,etc,lib}/mplayer \
  /usr/local/man/man1/{mencoder,mplayer}.1 \
  /usr/local/bin/{mencoder,mplayer} \
  /usr/local/lib/libdha.*

sudo make install

sudo ldconfig

/usr/local/bin/mplayer -v 3 'rtsp://rmlivev8.bbc.net.uk/farm/*/ev7/live24/radio4/live/r4_dsat_g2.ra'
        [works!]


sudo chmod 664 /dev/rtc
        [mplayer complains about it, so why not]

applied changes to /usr/share/mythtv XML config files (cool!) from http://knoppmythwiki.homelinux.org/index.php?page=MythStreamInstall

One problem -- half of my streams are BBC Radio stations which use RAM redirector files. in other words their permanent URLs are http links, which in turn contain the RTSP address of this week's stream, which may change intermittently. However, mplayer doesn't support these RAM redirectors, only the RTSP streams!

Workaround -- install a wrapper script around mplayer:

  sudo mv /usr/local/bin/mplayer /usr/local/bin/mplayer.real
  sudo vi /usr/local/bin/mplayer

/usr/local/bin/mplayer:

#!/usr/bin/perl -w

use strict;
my $file = $ARGV[scalar @ARGV - 1];

if ($file =~ /^http.*\.ram$/) {
  print "intercepted RAM play\n";

  my @realurls = get_urls_from_ram_file($file);
  pop @ARGV;
  push @ARGV, @realurls;
}
else {
  print "non-RAM file: '$file'\n";
}

print "exec'ing: mplayer ",join(' ',@ARGV)."\n";
exec {"mplayer.real"} "mplayer", @ARGV or die;

sub get_urls_from_ram_file {
  my $url = shift;
  my @urls = ();

  open (IN, "-|", "wget", "--output-document=-", $url);
  while (<IN>) {
    /^(rtsp:.*)$/ and push(@urls, $1);
  }
  close IN;
  return @urls;
}

sudo chmod 755 /usr/local/bin/mplayer

NFS access to the myth machine

: jm 13...; sudo chmod 777 video music gallery games

sudo /etc/init.d/portmap start
sudo /etc/init.d/nfs-common start
sudo mkdir /myth
sudo mount potato:/myth /myth

[unreliable -- crashes the wifi.  NFS is not a workable option.
let's try samba instead...]

: jm 5...; sudo /etc/init.d/samba start
: jm 6...; sudo smbpasswd -a mythtv
[set password]
[can now access it through nautilus!  konqueror doesn't work though
for some reason, but no big deal.]

For sftp access -- added a user using "adduser":
public:x:1001:1001:Public File Transfer:/myth:/bin/bash

Remote access to mythfrontend

http://knoppmythwiki.homelinux.org/index.php?page=x11vncHowTo

: jm 1...; sudo apt-get install x11vnc
sudo vi /etc/gdm/PreSession/Default
/usr/bin/x11vnc -nap -wait 50 -passwd [PASSWORD] -display :0 -forever -o /tmpfs/x11vnc.log -bg &

also: http://knoppmythwiki.homelinux.org/index.php?page=SecuringMythWebHowTo exactly as described!

Spinning down the disk when idle

specs on the disk: Model=WDC WD800JB-00JJA0, FwRev=05.01C05, SerialNo=WD-WCAM94212346 http://wdc.custhelp.com/cgi-bin/wdc.cfg/php/enduser/std_adp.php?p_faqid=699&p_created=1037217622

Performance Specifications
Average Seek - Read 8.9 ms average
        - Write         10.9 ms average
Track-to-Track Seek     2.0 ms average
Full Stroke Seek        21 ms average
Index Pulse Period      8.3 ms (nominal)
Average Latency         4.2 ms (nominal)
Rotational Speed        7200 RPM (nominal)
Buffer Size     8 MB
Spindle Start Time
- From Power-on to Drive Ready 1        = 8.0 s average 
- From Power-on to Rotational Speed 2   = 6.0 s average 
Spindle Stop Time       5.1 s average
Contact Start/Stop Cycles (CSS)         50,000 minimum

Power Management Commands
Operating Mode  RMS Current 1   Power, Typical 1
                12 VDC  5 VDC    
Idle (E1H)      330 mA  675 mA  7.25 W
Standby (E0H)   20 mA   200 mA  1.2 W
Sleep (E6H)     20 mA   50 mA   0.5 W

Operating Temperature and Humidity
  Temperature 2         5°C to 55°C (41°F to 131°F) 
  Humidity              5-85% RH non-condensing
                        33°C (maximum wet bulb)
  Thermal Gradient      20°C/hour (maximum)
  Humidity Gradient     20%/hour (maximum)

sudo vi /etc/syslog.conf
# jm: warnings or higher, log with a sync
*.warn                          /var/log/warn.log
auth,authpriv.*                 -/var/log/auth.log
uucp.*                          -/var/log/uucp.log
mail.err                        -/var/log/mail.err
news.crit                       -/var/log/news/news.crit
news.err                        -/var/log/news/news.err

sudo vi /etc/init.d/sysklogd
SYSLOGD="-m 0"

: jm 67...; sudo /etc/init.d/sysklogd restart

        hddtemp: setting RUN_DAEMON to false doesn't work.  have to
        hack the script

sudo vi /etc/init.d/hddtemp
        [at start:]

exit    #jm

spin down after 10 minutes of idleness:
sudo hdparm -S 120 /dev/hda

: root 127...; sudo vi /etc/mysql/my.cnf
comment "log=" line
: root 128...; sudo /etc/init.d/mysql restart

thinking about this. with 50000 spindown/spinup cycles specced for, let's say with spinup/down 4 times an hour:

        4*24*30 = 2880 cycles per month
        50000/2880 = 17.36 months before failure

that's not so good! maybe not a good idea then. I'm going to leave it out.

hdparm

/dev/hda:
 Timing buffered disk reads:   56 MB in  3.04 seconds =  18.42 MB/sec
 Timing buffered disk reads:   60 MB in  3.02 seconds =  19.84 MB/sec
 Timing buffered disk reads:   56 MB in  3.03 seconds =  18.50 MB/sec
 Timing buffered disk reads:   56 MB in  3.04 seconds =  18.42 MB/sec

/dev/hda:
 multcount    = 16 (on)
 IO_support   =  1 (32-bit)
 unmaskirq    =  1 (on)
 using_dma    =  1 (on)
 keepsettings =  0 (off)
 readonly     =  0 (off)
 readahead    = 6344 (on)
 geometry     = 65535/16/63, sectors = 80026361856, start = 0

pretty much optimal out-of-the-box!

Odd interrupts

: jm 6...; cat /proc/interrupts

           CPU0
  0:     415010          XT-PIC  timer
  2:          0          XT-PIC  cascade
  8:          1          XT-PIC  rtc
  9:          0          XT-PIC  acpi
 10:          0          XT-PIC  uhci_hcd, VIA8233
 11:      59204          XT-PIC  ohci1394, uhci_hcd, ivtv0
 12:          2          XT-PIC  ehci_hcd
 14:      10921          XT-PIC  ide0
 15:       5216          XT-PIC  uhci_hcd
NMI:          0
LOC:          0
ERR:        785             <<<NOTE!
MIS:          0

what are the ERRs? found in dmesg: spurious 8259A interrupt: IRQ7.

http://test.linuxfromscratch.org/lfs/faq.html#spurious-8259A-interrupt notes it's harmless. suggests rebuilding the kernel without CONFIG_LOCAL_APIC, which I may do if I'm rebuilding anyway (TODO).

however, I don't like having 3 busy devices on one interrupt. TODO: BIOS tweak for ivtv PCI card irq?

added to /etc/lilo.conf:

# new
image=/boot/vmlinuz-2.6.9-chw-4
        label=Linux
        initrd=/boot/initrd.gz
        append="noapm noacpi noapic nolapic pci=biosirq"
        read-only

# original default
image=/boot/vmlinuz-2.6.9-chw-4
        label=LinuxBasic
        initrd=/boot/initrd.gz
        read-only
#       restricted
#       alias=1

Didn't make any difference though ;)

further tweaks -- remove unused drivers and modules:

sudo rmmod eth1394
sudo rmmod ohci1394
sudo rmmod sbp2
sudo rmmod ieee1394
sudo rmmod shpchp pciehp pci_hotplug
sudo rmmod sg
sudo rmmod parport_pc
sudo rmmod parport
sudo rmmod 8250
sudo rmmod serial_core
sudo rmmod ds
sudo rmmod yenta_socket
sudo rmmod pcmcia_core
sudo rmmod usb_storage
sudo rmmod ohci_hcd
sudo rmmod megaraid
sudo rmmod tmscsim
sudo rmmod aic7xxx
sudo rmmod a100u2w
sudo rmmod ide_cd

wow, Knoppix really loads a pile of crap ;) added to /etc/hotplug/blacklist:

# Apr 18 2005 jm
shpchp
pciehp
pci_hotplug
sg
parport_pc
parport
8250
serial_core
ds
yenta_socket
pcmcia_core
usb_storage
ohci_hcd
megaraid
tmscsim
aic7xxx
a100u2w
ide_cd
eth1394
ohci1394
sbp2
ieee1394

lines removed from /etc/modules:

ide_cd
a100u2w
aic7xxx
ieee1394
megaraid
ohci1394
sbp2
tmscsim
pcmcia_core
yenta_socket
ds
serial_core
8250
parport
parport_pc
usb_storage
ohci_hcd
ipv6
thermal
processor
fan
button
battery
ac

[so that's where they're all coming from!!]

For now it seems like the BIOS is the only way to reselect different IRQs for the PVR-350 PCI card, and it doesn't offer that option. So this task is on the back burner.

Channel Icons

KnoppMyth HOWTO

wget http://cvs.mythtv.org/cgi-bin/viewcvs.cgi/*checkout*/mythtv/contrib/mkiconmap.pl
: jm 89...; mkx mkiconmap.pl
: jm 90...; ./mkiconmap.pl
[answered prompts]
: jm 92...; sudo su mythtv -c "mythfilldatabase --import-icon-map iconmap.xml --update-icon-map"

Time Sync

KnoppMyth HOWTO

sudo ntpdate pool.ntp.org

[and added to cron at 3.55 AM every day. I don't want a full-blown ntpd running on this triggering disk and CPU activity.]

FreevoSoftwareBuildLog (last edited 2006-11-06 10:28:37 by 212-2-179-194)