Archive for the ‘MythTV’ Category

mythbuntu mythfilldatabase cron script

Saturday, May 31st, 2008
cat /etc/cron.d/xmltv-uk
#
# mythtv xmltv-uk
#
10 3 * * 0,3    jakob /usr/local/bin/tv_grab_de_prisma –config-file /home/jakob/.xmltv/tv_grab_de_prisma.conf | /usr/bin/mythfilldatabase –file 3 - > /home/jakob/xmltv-de.log

cat /etc/cron.d/xmltv-de
#
# mythtv xmltv-de
#
10 3 * * 1,4    jakob /usr/bin/tv_grab_uk_rt –config-file /home/jakob/.xmltv/tv_grab_uk_rt.conf | /usr/bin/mythfilldatabase –file 2 - > /home/jakob/xmltv-uk.log

Adding a hard drive to MythTV backend, LVM, XFS

Wednesday, April 11th, 2007

Due to all the stuff we’re taping from TV using our MythTV setup (Gardener’s World, A New Year at Kew, Top Gear, The Apprentice, Baumeister Solness, Thomas Ostermeier-Inszenierungen auf 3sat und arte, …), the 280 GB are no longer enough. I bought a Seagate Barracuda 320 GB from LDLC which I installed tonight, just in time for The Apprentice.

Here’s the run through, note there’s no reboot or anything, after the hard drive was physically put in the box, everything was done while the machine was up and running, MythTV was running, and I was watching BBC2.

Have a look whether the drive was correctly recognized.

dmesg extract:

Probing IDE interface ide0...
hda: FUJITSU MPE3136AT, ATA DISK drive
hdb: Maxtor 6Y160P0, ATA DISK drive
ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
Probing IDE interface ide1…
hdc: ST3320620A, ATA DISK drive

ide1 at 0×170-0×177,0×376 on irq 15

Partition the new hard drive, just one partition, type being Linux LVM (8E), not bootable:

mythtv@blancheneige:~$ sudo cfdisk /dev/hdc

Create the XFS file system on the partition:

mythtv@blancheneige:~$ sudo mkfs -t xfs /dev/hdc1
meta-data=/dev/hdc1 isize=256 agcount=16, agsize=4883885 blks
= sectsz=512 attr=0
data = bsize=4096 blocks=78142160, imaxpct=25
= sunit=0 swidth=0 blks, unwritten=1
naming =version 2 bsize=4096
log =internal log bsize=4096 blocks=32768, version=1
= sectsz=512 sunit=0 blks
realtime =none extsz=4096 blocks=0, rtextents=0

Initialize the physical volume by running pvcreate:

mythtv@blancheneige:~$ sudo pvcreate /dev/hdc1
Physical volume "/dev/hdc1" successfully created

Have a look at the fstab, and comment out the previous settings for hdc which was a CD-ROM drive.

mythtv@blancheneige:~$ cat /etc/fstab
# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
/dev/hda1 / ext3 defaults,errors=remount-ro 0 1
/dev/hda9 /home ext3 defaults 0 2
/dev/hda8 /tmp ext3 defaults 0 2
/dev/hda5 /usr ext3 defaults 0 2
/dev/hda6 /var ext3 defaults 0 2
/dev/hda7 none swap sw 0 0
#/dev/hdc /media/cdrom0 iso9660 ro,user,noauto 0 0
#/dev/hdd /media/cdrom1 iso9660 ro,user,noauto 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto 0 0

/dev/vol01/music /var/music xfs defaults 0 0
/dev/vol01/video /var/video xfs defaults 0 0

#10.0.1.5:/home/jakob /mnt/grumpy nfs soft,intr,rsize=8192,wsize=8192 0 0

Make the hard drive (or rather the physical volume) part of the volume group:

mythtv@blancheneige:~$ sudo vgextend vol01 /dev/hdc1
Volume group "vol01" successfully extended

Now extend the logical volume by 289 GB (that number has been found by trial and error, quite small actually compared to the 320 GB printed on the drive case …)

mythtv@blancheneige:~$ sudo lvextend -L+289G /dev/vol01/video
Extending logical volume video to 584.00 GB
Logical volume video successfully resized

Let’s have a look whether it’s been taken into account:

mythtv@blancheneige:~$ sudo lvdisplay /dev/vol01/video
--- Logical volume ---
LV Name /dev/vol01/video
VG Name vol01
LV UUID tNRSPj-wzQ1-rV3x-EVWE-gxTR-3pIY-MAYiRn
LV Write Access read/write
LV Status available
# open 1
LV Size 584.00 GB
Current LE 149504
Segments 5
Allocation inherit
Read ahead sectors 0
Block device 254:0

Yep, looks like it. But we need to grow the file system, otherwise we won’t profit of the new disk:

mythtv@blancheneige:~$ sudo xfs_growfs /var/video/
meta-data=/dev/vol01/video isize=256 agcount=45, agsize=1638400 blks
= sectsz=512 attr=0
data = bsize=4096 blocks=73400320, imaxpct=25
= sunit=0 swidth=0 blks, unwritten=1
naming =version 2 bsize=4096
log =internal bsize=4096 blocks=12800, version=1
= sectsz=512 sunit=0 blks
realtime =none extsz=65536 blocks=0, rtextents=0
data blocks changed from 73400320 to 153092096

Check:

mythtv@blancheneige:~$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/hda1 250M 112M 126M 48% /
tmpfs 442M 0 442M 0% /dev/shm
/dev/hda9 4.6G 3.1G 1.4G 70% /home
/dev/hda8 361M 8.1M 334M 3% /tmp
/dev/hda5 4.4G 2.4G 1.8G 57% /usr
/dev/hda6 2.3G 513M 1.7G 24% /var
/dev/mapper/vol01-music 20G 8.5G 12G 43% /var/music
/dev/mapper/vol01-video 584G 262G 323G 45% /var/video

Mythbackend generating huge amounts of errors

Sunday, September 10th, 2006

My mythtv backend was dying unexpectedly and without reason, and huge binary mysql logs were created each day.

mythbackend.log had thousands of error messages like this one:


2006-09-10 17:52:09.358 DB Error (Recorded program delete recordedmarkup):
Query was:
DELETE FROM recordedmarkup WHERE chanid = ‘29008′ AND starttime = ‘2006-09-09T04:00:00′;
Driver error was [2/1016]:
QMYSQL3: Unable to execute query
Database error was:
Can’t open file: ‘recordedmarkup.MYI’. (errno: 145)

Search found this message:
http://www.mythtv.org/pipermail/mythtv-users/2006-January/118253.html

I ran this command twice, first time there were indeed two corrupted tables, and the second time the output was all OK:


# mysqlcheck -r -u mythtv -pmythtv mythconverg
mythconverg.callsignnetworkmap                     OK
mythconverg.capturecard                            OK
mythconverg.cardinput                              OK
mythconverg.channel                                OK
mythconverg.codecparams                            OK
mythconverg.credits                                OK
mythconverg.dtv_multiplex                          OK
mythconverg.dtv_privatetypes                       OK
mythconverg.dvdinput                               OK
mythconverg.dvdtranscode                           OK
mythconverg.favorites                              OK
mythconverg.filemarkup                             OK
mythconverg.gallerymetadata                        OK
mythconverg.housekeeping                           OK
mythconverg.inuseprograms                          OK
mythconverg.jobqueue                               OK
mythconverg.jumppoints                             OK
mythconverg.keybindings                            OK
mythconverg.keyword                                OK
mythconverg.mythlog                                OK
mythconverg.mythweb_sessions                       OK
mythconverg.networkiconmap                         OK
mythconverg.oldfind                                OK
mythconverg.oldprogram                             OK
mythconverg.oldrecorded                            OK
mythconverg.people                                 OK
mythconverg.pidcache                               OK
mythconverg.playgroup                              OK
mythconverg.profilegroups                          OK
mythconverg.program                                OK
mythconverg.programgenres                          OK
mythconverg.programrating                          OK
mythconverg.recgrouppassword                       OK
mythconverg.record                                 OK
mythconverg.record_tmp                             OK
mythconverg.recorded                               OK
mythconverg.recordedcredits                        OK
mythconverg.recordedmarkup                         OK
mythconverg.recordedprogram                        OK
mythconverg.recordedrating                         OK
mythconverg.recordingprofiles                      OK
mythconverg.recordmatch                            OK
mythconverg.schemalock                             OK
mythconverg.settings                               OK
mythconverg.tvchain                                OK
mythconverg.videobookmarks                         OK
mythconverg.videocategory                          OK
mythconverg.videocountry                           OK
mythconverg.videogenre                             OK
mythconverg.videometadata                          OK
mythconverg.videometadatacountry                   OK
mythconverg.videometadatagenre                     OK
mythconverg.videosource                            OK
mythconverg.videotypes                             OK
mythconverg.xvmc_buffer_settings                   OK

Also found that the EPG was very slow because many icons were expected in /var/video/livetv where they weren’t, and the EPG was requesting them up to 12 times per logo icon. Copied all icons there and checked they were of the correct type.

Finally, I also fixed the problem that the MythTV frontend wouldn’t start automatically. It appears that xdm has been installed by a recent apt-get and is run in runlevel 5, just before everything of my own stuff is run, basically invalidating everything. So, my temporary fix is to exit 0 out of the /etc/rc5.d/S99xdm, which allows my startx-mythtv.sh to take control and start an X session. Also discovered the following useful options for X:


xset s off ## no X screensaver
xset -dpms ## disable energy saving features

which I found this on this page: http://www.pvrweb.com/bbs/index.php?showtopic=4658

Endlich wieder KI.KA!

Saturday, August 12th, 2006

Dank der folgenden Sektion in meiner xorg.conf Datei, gibt’s jetzt endlich wieder deutsches Fernsehen, und noch dazu auf dem neuen Flachbildfernseher, sogar im 16/9-Format.

Section "Monitor"
    Identifier  "Samsung LE32R51B"

    # 1360x768 @ 60.00 Hz (GTF) hsync: 47.70 kHz; pclk: 84.72 MHz
    Modeline "test"  84.72  1360 1424 1568 1776  768 769 772 795  +HSync +VSync

    # 640x480 @ 75.00 Hz (GTF) hsync: 37.65 kHz; pclk: 30.72 MHz
    #Modeline "ok"  30.72  640 664 728 816  480 481 484 502  -HSync +Vsync

    HorizSync   30-61
    VertRefresh 60
EndSection

Ahhh, endlich, es klappt. Hier ein paar Beweisphotos. Zuerst einmal ein Photo vom derzeitigen Status:

MythTV Status

Gehen wir doch mal näher ran, da sieht man mehr:

MythTV Status

Ausserdem kriegen wir nun auch die verschiedenen BBC- und ITV-Sender:

BBC 3 - Dr Who Confidential

Und hier noch ein kurzes Video, das MythTVs Wetterfunktionalität demonstriert, zugegebenermassen nicht sehr informativ, ausser vielleicht, dass es für August viel zu kalt ist.

Ich kann den Punkt “KI.KA” von meiner Todo-Liste streichen, obwohl es noch eine ganze Menge zu tun gibt: Im Moment können wir noch keine DVDs auf diese Art gucken, und auch die AVIs werden noch nicht angezeigt. Ausserdem funktioniert das Ganze derzeit nur mit dem VGA-Kabel, obwohl eigentlich DVI geplant ist. Mal sehen, ob das nicht vielleicht auch bald geht.

xmltv

Saturday, May 13th, 2006

Procedure to add 3sat EPG info to mythtv (the xmltvid C3sat.de has already been entered in the channel table).


$ tv_grab_de_tvtoday --configure --config-file 3sat.xmltv
$ tv_grab_de_tvtoday --config-file 3sat.xmltv --output xmltv.out
$ mythfilldatabase --help
$ mythfilldatabase --file 1 -1 xmltv.out