Difference between revisions of "User:Cowbutt"

From MythTV Official Wiki
Jump to: navigation, search
m (Hauppauge Nova-T-500 checklist)
m (/etc/lircd.conf)
 
(23 intermediate revisions by the same user not shown)
Line 26: Line 26:
 
* Antec NSK-6582B case
 
* Antec NSK-6582B case
 
* 1*Hauppauge Nova-T DVB-T tuner
 
* 1*Hauppauge Nova-T DVB-T tuner
* 1*Hauppauge Nova-T-500 dual DVB-T tuner with Hauppauge infra-red remote control (Note that the Nova-T-500 needs to be configured quite carefully for reliable operation! A checklist is included.)
+
* 1*Hauppauge Nova-T-500 dual DVB-T tuner with Hauppauge infra-red remote control (Note that the Nova-T-500 needs to be configured quite carefully for reliable operation! A [http://www.mythtv.org/wiki/User:Cowbutt#Hauppauge_Nova-T-500_checklist configuration checklist] is included.)
 
* 1*D-Link quad-port NIC
 
* 1*D-Link quad-port NIC
 
* Asus 7600GS Silent/HTD 256MB fanless VGA card (originally planned to use an Asus GT240 Silent/DI/1GB DDR3 card, but [http://www.mythtv.org/wiki/NVidiaProprietaryDriver#User_experience_with_NVidia_cards it can't output a 15kHz VGA signal]. I'm using it elsewhere until I have a TV with DVI or HDMI input.)
 
* Asus 7600GS Silent/HTD 256MB fanless VGA card (originally planned to use an Asus GT240 Silent/DI/1GB DDR3 card, but [http://www.mythtv.org/wiki/NVidiaProprietaryDriver#User_experience_with_NVidia_cards it can't output a 15kHz VGA signal]. I'm using it elsewhere until I have a TV with DVI or HDMI input.)
Line 252: Line 252:
 
     }
 
     }
 
</pre></code>
 
</pre></code>
 +
 +
==== /etc/gdm/custom.conf ====
 +
 +
Set <code>AutomaticLogin=mythtv</code> in the <code>[daemon]</code> section to configure <code>gdm</code> to auto login as the <code>mythtv</code> user when X starts.
  
 
==== /etc/X11/xorg.conf ====
 
==== /etc/X11/xorg.conf ====
Line 750: Line 754:
  
 
===== /etc/lircd.conf =====
 
===== /etc/lircd.conf =====
 +
Due to changes in the IR remote code in the kernel between Fedora 8 and Fedora 14, I needed to regenerate this file using <code>irrecord --disable-namespace -H devinput -d /dev/input/by-path/pci-[...]-event-ir $HOME/lircd.conf</code>.
 +
 +
Before I could do so, I also needed to [http://www.lirc.org/html/devinput.html configure HAL to ignore the IR device nodes] by creating a couple of <code>.fdi</code> files under <code>/usr/share/hal/fdi/preprobe/20thirdparty/</code>
 +
 
<code><pre>
 
<code><pre>
  
Line 830: Line 838:
 
</pre></code>
 
</pre></code>
  
Due to changes in the IR remote code in the kernel between Fedora 8 and Fedora 14, I needed to regenerate this file using <code>irrecord -H devinput -d /dev/input/by-path/pci-[...]-event-ir $HOME/lircd.conf</code>. I also needed to [http://www.lirc.org/html/devinput.html configure HAL to ignore the IR device nodes].
+
====== /usr/share/hal/fdi/preprobe/20thirdparty/10-ignore-dvbusb-ir.fdi ======
 
 
==== /usr/share/hal/fdi/preprobe/20thirdparty/10-ignore-cx88-ir.fdi ====
 
 
<code><pre>
 
<code><pre>
 
<?xml version="1.0" encoding="UTF-8"?>
 
<?xml version="1.0" encoding="UTF-8"?>
 
<deviceinfo version="0.2">
 
<deviceinfo version="0.2">
 
<device>
 
<device>
   <match key="info.product" contains_ncase="cx88 ir">
+
   <match key="info.product" contains_ncase="IR-receiver">
 
     <merge key="info.ignore" type="bool">true</merge>
 
     <merge key="info.ignore" type="bool">true</merge>
 
   </match>
 
   </match>
Line 844: Line 850:
 
</pre></code>
 
</pre></code>
  
==== /usr/share/hal/fdi/preprobe/20thirdparty/10-ignore-dvbusb-ir.fdi ====
+
====== /usr/share/hal/fdi/preprobe/20thirdparty/10-ignore-dvbusb-ir.fdi ======
 
<code><pre>
 
<code><pre>
 
<?xml version="1.0" encoding="UTF-8"?>
 
<?xml version="1.0" encoding="UTF-8"?>
Line 856: Line 862:
 
</pre></code>
 
</pre></code>
  
===== $HOME/.lircrc =====
+
===== /usr/local/bin/mythpowerbutton.sh =====
 
<code><pre>
 
<code><pre>
# Power Button
+
#!/bin/bash
begin
+
PROG=mythfrontend
prog = irexec
+
#PROG=gnome-session
#button = OFF
+
STATUS=`ps -e | grep $PROG | grep -v grep | wc -l | awk '{print $1}'`
button = Power
 
#button = POWER # (for my RS15-2116 remote)
 
repeat = 0
 
config = /usr/local/bin/mythpowerbutton.sh
 
end
 
  
# ~/.mythtv/lircrc#
+
if [ `echo $DISPLAY | grep -c ":0"` -ge 1 ]
# MythTV native LIRC config file for
+
then
# the Hauppauge PVR 150 silver remote
+
    if [ $STATUS -eq 0 ]
#
+
    then
# Modified from Jarod Wilson's which came from Jeff Campbell's
+
        echo "use mythconverg; update cardinput set startchan=1;" | mysql -u root --password=root   
# and Brad Templeton's
+
# xrandr -s 768x576
# Modified still further by Robert Jones
+
xrandr -s 1024x576 # AJB 20071104
# Here we have the jump point commands.  They only work if you have
+
# xrandr -s 1280x576 # AJB 20071231 - doesn't really work out!
# defined function keys for these jump points.  For me the most
+
        #( $PROG & )
# common command is the menu of recordings, so I put that on "videos"
+
# add ionice -c 2 -n 0 AJB20110120
# even though that's counter-intuitive
+
        ( ionice -c 2 -n 0 $PROG >/dev/null 2>&1 & )
 
+
    else
begin
+
        killall $PROG
prog = mythtv
+
        echo "use mythconverg; update cardinput set startchan=1;" | mysql -u root --password=root
button = TV
+
    fi
repeat = 3
+
fi
config = F1
+
exit 0
end
+
# try to fix problems with MythArchive mythtranscode sometimes failing
 +
rm -f ~mythtv/.ICEauthority
 +
</pre></code>
  
begin
+
==== Sound ====
prog = mythtv
+
===== /home/mythtv/.asoundrc =====
button = Videos
+
<code><pre>
repeat = 3
+
# Do not use this directly--it requires specific rate, channels, and format
config = F2
+
pcm.dmix-digital {
end
+
  type dmix
 +
  ipc_key 1235
 +
  slave {
 +
    pcm "digital-hw"
 +
    period_time 0
 +
    period_size 1024
 +
    buffer_size 4096
 +
    rate 48000
 +
  }
 +
}
  
# Not yet defined
+
# Control device (mixer, etc.) for the card
begin
+
ctl.dmix-digital {
prog = mythtv
+
  type hw
button = Music
+
  card 0
repeat = 3
+
}
config = F3
 
end
 
  
begin
+
pcm.!default {
prog = mythtv
+
  type plug
button = Pictures
+
  slave {
repeat = 3
+
    pcm multi
config = F4
+
    rate 48000
end
+
  }
 +
  hint {
 +
    show on
 +
    description "Multiple Output - Use analog and digital outputs simultaneously"
 +
  }
 +
  ttable.0.0 1.0
 +
  ttable.1.1 1.0
 +
  ttable.0.2 1.0
 +
  ttable.1.3 1.0
 +
}
  
begin
+
pcm.ajb {
prog = mythtv
+
  type plug
button = Guide
+
  slave {
repeat = 3
+
    pcm multi
config = F5
+
    rate 48000
end
+
  }
 +
  hint {
 +
    show on
 +
    description "AJB Multiple Output - Use analog and digital outputs simultaneously"
 +
  }
 +
  ttable.0.0 1.0
 +
  ttable.1.1 1.0
 +
  ttable.0.2 1.0
 +
  ttable.1.3 1.0
 +
}
  
begin
+
pcm.stereo {
prog = mythtv
+
  type plug
button = Radio
+
  slave {
repeat = 3
+
    pcm multi
config = F6
+
    rate 48000
end
+
  }
 
+
  hint {
begin
+
    show on
prog = mythtv
+
    description "Multiple Stereo Output - Use analog and digital outputs simultaneously"
button = UP
+
  }
repeat = 3
+
  ttable.0.0 1.0
config = Up
+
  ttable.1.1 1.0
end
+
  ttable.0.2 1.0
 +
  ttable.1.3 1.0
 +
}
  
begin
+
ctl.stereo {
prog = mythtv
+
  type hw
button = DOWN
+
  card 0
repeat = 3
+
}
config = Down
 
end
 
  
begin
+
pcm.multi {
prog = mythtv
+
  type multi
button = LEFT
+
  slaves.a.pcm "analog-hw"
repeat = 3
+
  slaves.a.channels 2
config = Left
+
  slaves.b.pcm "digital-hw"
end
+
  slaves.b.channels 2
 +
  bindings.0.slave a
 +
  bindings.0.channel 0
 +
  bindings.1.slave a
 +
  bindings.1.channel 1
 +
  bindings.2.slave b
 +
  bindings.2.channel 0
 +
  bindings.3.slave b
 +
  bindings.3.channel 1
 +
  hint {
 +
    show on
 +
    description "Multiple Output - Use analog and digital outputs simultaneously"
 +
  }
 +
}
  
begin
+
ctl.multi {
prog = mythtv
+
  type hw
button = RIGHT
+
  card 0
repeat = 3
+
}
config = Right
+
</pre></code>
end
 
  
# Channel Up
+
===== MythTV configuration =====
begin
+
<pre>
prog = mythtv
+
AudioOutputDevice = ALSA:ajb # IMPORTANT - makes MythTV output simultaneously to front (analog) and S/PDIF (digital) outputs, albeit in Stereo only.
button = ChannelUp
+
MusicAudioDevice = ALSA:ajb
repeat = 3
+
PassThruOutputDevice = ALSA:iec958:AES0=6 # digital output
config = Up
+
PassThruDeviceOverride = 1 # Separate digital output = enabled
end
+
AC3PassThru = 0 # Dolby Digital = disabled
 +
DTSPassThru = 0 # DTS = disabled
 +
MixerDevice = ALSA:default
 +
MixerControl = PCM
 +
MasterMixerVolume = 100
 +
PCMMixerVolume = 94
 +
AudioDefaultUpmix = 0 # Upconvert stereo to 5.1 surround = disabled
 +
AudioUpmixType = 0 # Upmix quality?
 +
Audio48kOverride = 0 # Force audio device output to 48kHz = disabled
 +
AdvancedAudioSettings = 1 # Advanced Audio Configuration = enabled
 +
DecodeExtraAudio = 1
 +
SRCQualityOverride = 0 # Override SRC quality = disabled
 +
SRCQuality = 1
 +
Speaker
 +
</pre>
  
# Channel Down
+
Note that if MythTV only has a single audio path. A side effect of this is that it cannot be configured both to pass through multi-channel (e.g. 5.1) digital audio and to output stereo analogue audio simultaneously. If you try, you will end up hearing ugly compressed digital noise through your analogue output.
begin
 
prog = mythtv
 
button = ChannelDown
 
repeat = 3
 
config = Down
 
end
 
  
# OK/Select
+
Configured like this, I get stereo audio on both the analogue and digital S/PDIF outputs. I usually watch MythTV recordings with only my TV's speakers enabled, but if I mute my TV and switch on my AV receiver, this is adequate. I have a cheap DVD player if I want to hear a 5.1 DVD. If more UK Freeview broadcasts were > 2.0 audio, I might reconsider this configuration.
begin
+
 
prog = mythtv
+
=== MythTV configuration ===
button = OK
+
 
config = Space
+
==== MythTV Playback Settings ====
end
+
* Enable realtime priority threads
 +
* Extra audio buffering
 +
* Custom Video Playback Profile: Decoder=Standard (ffmpeg), Max CPUs=1, Deblocking filter=enabled, Video renderer=xv-blit, OSD renderer=chromakey, OSD fade=disabled, Primary deinterlacer=Bob (2x), Fallback deinterlacer=None
 +
* OpenGL vsync setting is no longer present
 +
* Enable SyncToVBlank=1, XVideoTextureSyncToVBlank=1, XVideoBlitterSyncToVBlank=1 and XVideoSyncToDisplay=1 in <code>$HOME/.nvidia-settings-rc</code>
 +
* Use 1024x576 for UI, 720x576pali for playback
  
# Play
+
The bug that resulted in XVideo regions displayed on interlaced displays being scandoubled appears to no longer be present with the combination of 7600GS/GT hardware, nVidia driver version 256.53 and MythTV 0.24-fixes. Output is full vertical resolution, jitter free and scrolling credits are smooth.
begin
 
prog = mythtv
 
button = Play
 
config = Return
 
end
 
  
# Stop
+
For belt-and-braces, I use <code>ionice</code> to run <code>mythfrontend</code> and <code>mythbackend</code> with the highest priority (0) in the best-effort (class=2) IO scheduling class:
begin
 
prog = mythtv
 
button = Stop
 
config = I
 
end
 
  
# Escape/Exit/Back
+
<pre><code>
begin
+
--- /etc/rc.d/init.d/mythbackend.fedora 2011-01-20 23:08:09.650056748 +0000
prog = mythtv
+
+++ /etc/rc.d/init.d/mythbackend 2011-02-12 20:09:09.233178903 +0000
button = Back
+
@@ -36,7 +36,8 @@
config = Esc
+
  fi
end
+
  export MYTHCONFDIR="$MYTHTV_HOME"
 +
  export HOME="$MYTHTV_HOME"
 +
-  daemon $binary $OPTIONS
 +
+  # add ionice -c 2 -n 0 AJB20110120
 +
+  daemon ionice -c 2 -n 0 $binary $OPTIONS
 +
  RETVAL=$?
 +
  echo
 +
  [ $RETVAL = 0 ] && touch /var/lock/subsys/$prog
 +
</code></pre>
  
# clashes with irexec definition - AJB 20060401
+
The MySQL daemon is run with priority slightly lower at 1 (still within the 'best-effort' IO scheduling class):
## Power Off/Exit
 
#begin
 
#prog = mythtv
 
#button = Power
 
#config = Esc
 
#end
 
  
 +
<pre><code>
 +
--- /etc/rc.d/init.d/mysqld.fedora 2011-01-20 23:08:24.259515784 +0000
 +
+++ /etc/rc.d/init.d/mysqld 2011-01-20 23:11:11.200950806 +0000
 +
@@ -96,7 +96,8 @@
 +
# and some users might prefer to configure logging to syslog.)
 +
# Note: set --basedir to prevent probes that might trigger SELinux
 +
# alarms, per bug #547485
 +
- $exec  --datadir="$datadir" --socket="$socketfile" \
 +
+ # add ionice -c 2 -n 1 AJB20110120
 +
+ ionice -c 2 -n 1 $exec  --datadir="$datadir" --socket="$socketfile" \
 +
--pid-file="$mypidfile" \
 +
--basedir=/usr --user=mysql >/dev/null 2>&1 &
 +
safe_pid=$!
 +
</code></pre>
  
# Pause
+
Other IO-intensive background processes (e.g. mirroring using rsync, certain elements of MythArchive) are run only within the idle (class=3) IO scheduling class. Generally, the only playback disruption I experience is [http://www.gossamer-threads.com/lists/mythtv/users/475136 coincident with the flurry of database activity at the start and end of a new recording]. There is [http://www.gossamer-threads.com/lists/mythtv/dev/198520?do=post_view_threaded#198520 scope for running mythfrontend within the realtime (class=1) IO scheduling class], but I have not yet experimented with this.
begin
 
prog = mythtv
 
button = Pause
 
repeat = 3
 
config = P
 
end
 
  
# Mute
+
==== Wrap mythfilldatabase ====
begin
+
<code><pre>
prog = mythtv
+
#!/bin/sh
button = Mute
+
echo "mythfilldatabase started `date`" >>/var/lib/mythtv/mythfilldatabase.log
repeat = 3
+
echo "Parameters:" >>/var/lib/mythtv/mythfilldatabase.log
config = |
+
for i in $*
end
+
do
 +
/bin/echo -n "<$i> " >>/var/lib/mythtv/mythfilldatabase.log
 +
done
 +
echo "User: `whoami`" >>/var/lib/mythtv/mythfilldatabase.log
 +
echo "Groups: `groups`" >>/var/lib/mythtv/mythfilldatabase.log
 +
echo "PWD: `pwd`" >>/var/lib/mythtv/mythfilldatabase.log
 +
echo "Environment: " >>/var/lib/mythtv/mythfilldatabase.log
 +
#export XMLTV_SUPPLEMENT="http://supplement.xmltv.org"
 +
export XMLTV_SUPPLEMENT="/etc/mythtv/.xmltv/supplement/"
 +
export XMLTV_SUPPLEMENT_VERBOSE=1
 +
export >>/var/lib/mythtv/mythfilldatabase.log
 +
#rm -rf $HOME/.xmltv/supplement/tv_grab_uk_rt/*
 +
cd $HOME/.xmltv/supplement/tv_grab_uk_rt/
 +
wget -N -nv http://supplement.xmltv.org/tv_grab_uk_rt/channel_ids
 +
wget -N -nv http://supplement.xmltv.org/tv_grab_uk_rt/prog_titles_to_process
 +
wget -N -nv http://supplement.xmltv.org/tv_grab_uk_rt/utf8_fixups
 +
cd $HOME
 +
#echo "waiting 10s"
 +
#sleep 10s
  
# Fast forward (30 sec default)
+
su -c "ionice -c 3 nice /usr/bin/mythfilldatabase $*" mythtv
begin
+
</pre></code>
prog = mythtv
 
button = Skip
 
repeat = 3
 
config = >
 
end
 
  
# Rewind (10 sec default)
+
This script sets xmltv to use updated (aka supplement) channel data files, downloading them automatically if they have changed. It also runs <code>mythfilldatabase</code> in the 'idle' IO scheduling class. Configure MythTV to use this script using mythtv-setup.
begin
 
prog = mythtv
 
button = Replay
 
repeat = 3
 
config = <
 
end
 
  
# Skip forward (10 min default)
+
==== Wrap /usr/bin/mythcommflag ====
begin
 
prog = mythtv
 
button = NextTrack
 
repeat = 3
 
config = End
 
end
 
  
# Skip backward (10 min default)
+
<code>mv /usr/bin/mythcommflag /usr/bin/mythcommflag.fedora</code>, then put this script in its place:
begin
 
prog = mythtv
 
button = PreviousTrack
 
repeat = 3
 
config = Home
 
end
 
  
# Record
+
<code><pre>
begin
+
#!/bin/bash
prog = mythtv
 
button = Record
 
repeat = 3
 
config = R
 
end
 
  
# Delete
 
begin
 
prog = mythtv
 
button = Red
 
repeat = 3
 
config = D
 
end
 
  
# Decrease play speed
+
# edit/tune these #
begin
+
# Allow ad breaks to be upto 400s long by coalescing non-silence
prog = mythtv
+
MAXCOMMBREAKSECS=400
button = Green
+
# mytharchivehelper isn't frame-accurate, and mythcommflag won't add final cut pair if the end of the cut is greater
repeat = 3
+
# than the actual final frame, so subtract $ENDFUDGEFRAMES from the value mytharchivehelper returns
config = J
+
ENDFUDGEFRAMES=75
end
+
# -70dB and minimum of 0.15s to be considered 'silent'
 
+
MP3SPLT_OPTS="th=-70,min=0.15"
# Display EPG while in live TV,
+
# Log file
# View selected show while in EPG
+
LOGFILE="/var/log/mythtv/mythcommflag-wrapper"
begin
+
# Copy commercial skiplist to cutlist automatically? 1=Enabled
prog = mythtv
+
COPYTOCUTLIST=1
button = Menu
 
repeat = 3
 
config = M
 
end
 
  
begin
+
MYTHCFG=""
prog = mythtv
+
# mythbackend in Fedora packages has $HOME=/etc/mythtv
button = VolumeUp
+
if [ -e $HOME/mysql.txt ]; then
repeat = 3
+
MYTHCFG="$HOME/mysql.txt"
config = )
+
fi
end
 
  
begin
 
prog = mythtv
 
button = VolumeDown
 
repeat = 3
 
config = (
 
end
 
  
# Bring up OSD info
+
if [ -e $HOME/.mythtv/mysql.txt ]; then
begin
+
MYTHCFG="$HOME/.mythtv/mysql.txt"
prog = mythtv
+
fi
button = Go
+
if [ "$MYTHCFG" = "" ]; then
repeat = 3
+
echo >>$LOGFILE "No mysql.txt found in $HOME or $HOME/.mythtv - exiting!"
config = I
+
exit 1
end
+
fi
  
# Change display aspect ratio
+
MAH=`which mytharchivehelper`
begin
+
if [ "$MAH" = "" ]; then
prog = mythtv
+
echo "mytharchivehelper not found in $PATH - exiting!"
button = Prev-Ch
+
exit 1
repeat = 3
+
fi
config = W
+
end
+
# DB username and password
 +
MYTHHOST=`grep DBHostName <$MYTHCFG | awk -F= '{print $2}'`
 +
MYTHUSER=`grep DBUserName <$MYTHCFG | awk -F= '{print $2}'`
 +
MYTHPASS=`grep DBPassword <$MYTHCFG | awk -F= '{print $2}'`
 +
MYTHDB=`grep DBName <$MYTHCFG | awk -F= '{print $2}'`
 +
#echo >>$LOGFILE "[$MYTHHOST] [$MYTHUSER] [$MYTHPASS] [$MYTHDB]"
  
# was J -double speed watch
+
# root of MythTV recordings
# changed to i 20100918 - info
+
RECORDINGSROOT=`mysql -h${MYTHHOST} -u${MYTHUSER} -p${MYTHPASS} -e "select dirname from storagegroup;" $MYTHDB | tail -n +2 | sort | uniq | tr '\n' ' '`
begin
 
prog = mythtv
 
button = Yellow
 
repeat = 3
 
config = i
 
end
 
  
# change tuners
 
begin
 
prog = mythtv
 
button = Hash
 
repeat = 3
 
config = Y
 
end
 
  
# Bring up Time stretch
+
echo >>$LOGFILE "$0 run with [$*] at `date` by `whoami`"
begin
+
echo >>$LOGFILE "RECORDINGSROOT=$RECORDINGSROOT"
prog = mythtv
+
#export >>$LOGFILE
button = Blue
 
repeat = 3
 
config = A
 
end
 
  
# Numbers 0-9
+
#/usr/bin/mythcommflag run with [-j 584 -V 8213] at Sat Jan 29 17:26:58 GMT 2011 by root
 +
#select recorded.basename from recorded join jobqueue where jobqueue.id=584 and jobqueue.chanid=recorded.chanid and jobqueue.starttime=recorded.starttime;
  
begin
+
silence_detect() {
prog = mythtv
+
local filename=$1
button = 0
+
repeat = 3
+
TMPDIR=`mktemp -d /tmp/mythcommflag.XXXXXX` || exit 1
config = 0
+
end
+
# get frame count, less 3 seconds (75 frames) fudge factor
 +
let FRAMES=`mytharchivehelper -i $filename $TMPDIR/streaminfo.xml 1 2>&1 | grep " frames = " | awk -F"= " '{print $2}'`-${ENDFUDGEFRAMES}
 +
echo >>$LOGFILE "total frames = $FRAMES (+/- 75)"
  
begin
+
# From <http://www.mythtv.org/wiki/Silence-detect.sh>
prog = mythtv
 
button = 1
 
repeat = 3
 
config = 1
 
end
 
  
begin
+
# AJB20110129 Have already checked for pre-existing cutlist, and this check doesn't work properly after --clearcutlist anyway
prog = mythtv
+
# [[ "Cutlist: "  == `mythcommflag.fedora --getcutlist -f $filename  |grep Cutlist` ]] \
button = 2
+
#     || { echo already has cutlist && exit 1; }
repeat = 3
 
config = 2
 
end
 
  
begin
+
cd $TMPDIR
prog = mythtv
+
touch `basename $filename`.touch
button = 3
+
ionice -c3 nice ffmpeg -i $filename -acodec copy sound.mp3
repeat = 3
+
ionice -c3 nice mp3splt -s -p $MP3SPLT_OPTS sound.mp3
config = 3
 
end
 
  
begin
+
#AJB20110129 add '$FRAMES' because mythcommflag now requires *pairs* of frames
prog = mythtv
+
CUTLIST=`tail --lines=+3 mp3splt.log|sort -g |\
button = 4
+
      awk 'BEGIN{start=0;ORS=","}{if($2-start<'$MAXCOMMBREAKSECS')
repeat = 3
+
      {finish=$2} else {print int(start*25+1)"-"int(finish*25-25);
config = 4
+
      start=$1; finish=$2;}}END{print int(start*25+1)"-"'$FRAMES'}'`
end
+
echo >>$LOGFILE "silence-detect has generated cutlist: $CUTLIST"
  
begin
+
echo >>$LOGFILE "silence-detect(): CHANID=$CHANID, STARTTIME=$STARTTIME, FRAMES=$FRAMES"
prog = mythtv
+
CUTLIST=`tail --lines=+3 mp3splt.log|sort -g |\
button = 5
+
awk 'BEGIN{start=0;ORS="\n"}{if($2-start<'$MAXCOMMBREAKSECS') {finish=$2} else {print "INSERT INTO recordedmarkup (chanid,starttime,mark,type) VALUES ('$CHANID',\"'"$STARTTIME"'\","int(start*25+1)",4);\nINSERT INTO recordedmarkup (chanid,starttime,mark,type) VALUES ('$CHANID',\"'"$STARTTIME"'\","int(finish*25-25)",5);"; start=$1; finish=$2;}}END{print "INSERT INTO recordedmarkup (chanid,starttime,mark,type) VALUES ('$CHANID',\"'"$STARTTIME"'\","int(start*25+1)",4);\nINSERT INTO recordedmarkup (chanid,starttime,mark,type) VALUES ('$CHANID',\"'"$STARTTIME"'\",'$FRAMES',5);"}' | sed 's/\"/'\''/g'`
repeat = 3
+
RC=$?
config = 5
+
# echo >>$LOGFILE "silence-detect SQLgen returned with $RC, generated SQL skipist: $CUTLIST"
end
 
  
begin
+
# CUTLIST="USE $MYTHDB; $CUTLIST"
prog = mythtv
 
button = 6
 
repeat = 3
 
config = 6
 
end
 
  
begin
+
rm -rf $TMPDIR
prog = mythtv
+
}
button = 7
 
repeat = 3
 
config = 7
 
end
 
  
begin
 
prog = mythtv
 
button = 8
 
repeat = 3
 
config = 8
 
end
 
  
begin
+
if [ $# -eq 0 ]; then
prog = mythtv
+
# run with no parameters, flag every unflagged recording
button = 9
+
exec mythcommflag.fedora
repeat = 3
+
exit $?
config = 9
+
else
end
+
if [ $# -eq 4 -a "$1" = "-j" -a "$3" = "-V" ]; then
 
+
# this is a manual flag job
 
+
# TODO AJB20110129 generate a filelist from recorded table where commflagged=0 and cutlist=0
### MPlayer lirc setup
+
# then run silence_detect over each filename
 
+
JOB=$2
 
+
else
 
+
# we're being used in some other way, run the real mythcommmflag
# Show OSD
+
echo >>$LOGFILE "running mythcommflag.fedora $*"
begin
+
exec mythcommflag.fedora $*
prog = mplayer
+
exit $?
button = Menu
+
fi
repeat = 3
+
echo >>$LOGFILE "running job $JOB"
config = osd
+
HASCUTLIST=`mysql -h${MYTHHOST} -u${MYTHUSER} -p${MYTHPASS} -e "select recorded.cutlist from recorded join jobqueue where jobqueue.id=$JOB and jobqueue.chanid=recorded.chanid and jobqueue.starttime=recorded.starttime;" $MYTHDB | tail -n +2`
end
+
if [ "$HASCUTLIST" = "1" ]; then
 +
echo >>$LOGFILE "program already has (manual?) cutlist, exiting"
 +
exit 0
 +
fi
 +
CALLSIGN=`mysql -h${MYTHHOST} -u${MYTHUSER} -p${MYTHPASS} -e "select channel.callsign from channel join jobqueue where jobqueue.id=$JOB and jobqueue.chanid=channel.chanid;" $MYTHDB | tail -n +2`
 +
CHANID=`mysql -h${MYTHHOST} -u${MYTHUSER} -p${MYTHPASS} -e "select chanid from jobqueue where jobqueue.id=$JOB;" $MYTHDB | tail -n +2`
 +
STARTTIME=`mysql -h${MYTHHOST} -u${MYTHUSER} -p${MYTHPASS} -e "select starttime from jobqueue where jobqueue.id=$JOB;" $MYTHDB | tail -n +2`
 +
echo >>$LOGFILE "channel callsign is $CALLSIGN"
 +
echo >>$LOGFILE "chanid=$CHANID STARTTIME=$STARTTIME"
 +
BASENAME=`mysql -h${MYTHHOST} -u${MYTHUSER} -p${MYTHPASS} -e "select recorded.basename from recorded join jobqueue where jobqueue.id=$JOB and jobqueue.chanid=recorded.chanid and jobqueue.starttime=recorded.starttime;" $MYTHDB | tail -n +2`
 +
echo >>$LOGFILE "basename is $BASENAME"
 +
FILENAME=`ionice -c3 nice find ${RECORDINGSROOT} -name $BASENAME`
 +
echo >>$LOGFILE "filename is $FILENAME"
  
# Pause playback
+
#safe list
begin
+
# if [ "$CALLSIGN" = "Film4" -o "$CALLSIGN" = "ITV1" -o "$CALLSIGN" = "ITV1 +1" -o "$CALLSIGN" = "ITV2" -o "$CALLSIGN" = "ITV2 +1" -o "$CALLSIGN" = "ITV3" -o "$CALLSIGN" = "ITV4" -o "$CALLSIGN" = "Dave" -o "$CALLSIGN" = "Dave ja vu" ]; then
prog = mplayer
+
# Channel 4 channels seem to work too, but sometimes last cut is too long?
button = Pause
+
# if [ "$CALLSIGN" = "Channel 4" -o "$CALLSIGN" = "Channel 4+1" -o "$CALLSIGN" = "More 4" -o "$CALLSIGN" = "E4" -o "$CALLSIGN" = "E4+1" -o "$CALLSIGN" = "Film4" -o "$CALLSIGN" = "ITV1" -o "$CALLSIGN" = "ITV1 +1" -o "$CALLSIGN" = "ITV2" -o "$CALLSIGN" = "ITV2 +1" -o "$CALLSIGN" = "ITV3" -o "$CALLSIGN" = "ITV4" -o "$CALLSIGN" = "Dave" -o "$CALLSIGN" = "Dave ja vu" ]; then
repeat = 3
+
# if [ "$CALLSIGN" = "FIVE USA" -o "$CALLSIGN" = "FIVER" -o "$CALLSIGN" = "FIVE" -o "$CALLSIGN" = "Channel 4" -o "$CALLSIGN" = "Channel 4+1" -o "$CALLSIGN" = "More 4" -o "$CALLSIGN" = "E4" -o "$CALLSIGN" = "E4+1" -o "$CALLSIGN" = "Film4" -o "$CALLSIGN" = "ITV1" -o "$CALLSIGN" = "ITV1 +1" -o "$CALLSIGN" = "ITV2" -o "$CALLSIGN" = "ITV2 +1" -o "$CALLSIGN" = "ITV3" -o "$CALLSIGN" = "ITV4" -o "$CALLSIGN" = "Dave" -o "$CALLSIGN" = "Dave ja vu" ]; then
config = pause
+
# Fails on FIVER and cuts almost entire recording. Works for other FIVE channels with caveat that they include news bulletins which are't cut
end
+
if [ "$CALLSIGN" = "QUEST" -o "$CALLSIGN" = "FIVE USA" -o "$CALLSIGN" = "FIVE" -o "$CALLSIGN" = "Channel 4" -o "$CALLSIGN" = "Channel 4+1" -o "$CALLSIGN" = "More 4" -o "$CALLSIGN" = "E4" -o "$CALLSIGN" = "E4+1" -o "$CALLSIGN" = "Film4" -o "$CALLSIGN" = "ITV1" -o "$CALLSIGN" = "ITV1 +1" -o "$CALLSIGN" = "ITV2" -o "$CALLSIGN" = "ITV2 +1" -o "$CALLSIGN" = "ITV3" -o "$CALLSIGN" = "ITV4" -o "$CALLSIGN" = "Dave" -o "$CALLSIGN" = "Dave ja vu" ]; then
 
+
echo >>$LOGFILE "Callsign in whitelist - will run silence_detect"
# Skip ahead a minute if playing
+
mysql -h${MYTHHOST} -u${MYTHUSER} -p${MYTHPASS} -e "update recorded set commflagged=2 where chanid=$CHANID and starttime='${STARTTIME}';" $MYTHDB
# If paused, resume playing
+
CUTLIST=""
begin
+
echo >>$LOGFILE "silence_detect $FILENAME"
prog = mplayer
+
silence_detect $FILENAME
button = Play
+
echo >>$LOGFILE "silect_detect() set CUTLIST to $CUTLIST"
repeat = 3
+
let BREAKS=`echo "$CUTLIST"|wc -l`/2
config = seek +1
+
echo >>$LOGFILE "$BREAKS break(s) found."
end
+
# mythcommflag --setcutlist $CUTLIST -f $FILENAME
 +
mysql -h${MYTHHOST} -u${MYTHUSER} -p${MYTHPASS} -e "$CUTLIST" $MYTHDB
 +
RC=$?
 +
# echo "mythcommflag --setcutlist returned $RC"
 +
echo >>$LOGFILE "mysql setskiplist returned $RC"
 +
if [ $RC -eq 0 ]; then
 +
mysql -h${MYTHHOST} -u${MYTHUSER} -p${MYTHPASS} -e "update recorded set commflagged=1 where chanid=$CHANID and starttime='${STARTTIME}';" ${MYTHDB}
 +
mysql -h${MYTHHOST} -u${MYTHUSER} -p${MYTHPASS} -e "update jobqueue set status=272, comment='Finished, $BREAKS break(s) found.' where id=$JOB;" ${MYTHDB}
 +
if [ $COPYTOCUTLIST -eq 1 ]; then
 +
mythcommflag --gencutlist -f $FILENAME
 +
RC=$?
 +
if [ $RC -eq 0 ]; then
 +
echo >>$LOGFILE "mythcommflag --gencutlist successfully copied skip list to cut list"
 +
else
 +
echo >>$LOGFILE "mythcommflag --gencutlist failed, returned $RC"
 +
fi
 +
fi
 +
else
 +
echo >>$LOGFILE "mythcommflag failed; returned $RC"
 +
mysql -h${MYTHHOST} -u${MYTHUSER} -p${MYTHPASS} -e "update recorded set commflagged=0 where chanid=$CHANID and starttime='${STARTTIME}';" ${MYTHDB}
 +
fi
 +
else
 +
# Not a whitelisted channel for silence_detect
 +
echo >>$LOGFILE "won't run silence-detect, running mythcommflag.fedora $*"
 +
exec mythcommflag.fedora $*
 +
exit $?
 +
fi
 +
fi
 +
echo >>$LOGFILE
 +
</pre></code>
  
# Stop playback and exit
+
The maintained version of this script can be found at [http://www.mythtv.org/wiki/Mythcommflag-wrapper]. It uses silence detection to perform commflagging, which works quite well for certain UK stations.
begin
 
prog = mplayer
 
button = Stop
 
repeat = 3
 
config = quit
 
end
 
  
# Mute
+
==== Patch MythArchive's mythburn.py script ====
begin
+
<code><pre>
prog = mplayer
+
--- /usr/share/mythtv/mytharchive.fedora-0.24-ajb3.fc14-20110126/scripts/mythburn.py 2011-01-12 23:34:28.000000000 +0000
button = Mute
+
+++ /usr/share/mythtv/mytharchive/scripts/mythburn.py 2011-02-12 19:56:44.000000000 +0000
repeat = 3
+
@@ -54,7 +54,8 @@
config = mute
+
debug_secondrunthrough = False
end
+
 
+
# default encoding profile to use
begin
+
-defaultEncodingProfile = "SP"
button = ChannelUp
+
+# defaultEncodingProfile = "SP"
prog = mplayer
+
+defaultEncodingProfile = "NONE"
config = seek_chapter +1
+
end
+
# add audio sync offset when re-muxing
 
+
useSyncOffset = True
begin
+
@@ -485,19 +486,22 @@
button = ChannelDown
+
prog = mplayer
+
    totalframes=int(musiclength * framespersecond)
config = seek_chapter -1
+
end
+
-    command = path_jpeg2yuv[0] + " -n %s -v0 -I p -f %s -j '%s' | %s -b 5000 -a %s -v 1 -f 8 -o '%s'" \
 
+
+    command = "ionice -c3 nice "
# Seek back 10 seconds
+
+    command += path_jpeg2yuv[0] + " -n %s -v0 -I p -f %s -j '%s' | %s -b 5000 -a %s -v 1 -f 8 -o '%s'" \
begin
+
              % (totalframes, framespersecond, background, path_mpeg2enc[0], aspectratio, tempvideo)
prog = mplayer
+
    result = runCommand(command)
button = Replay
+
    if result<>0:
repeat = 3
+
        fatalError("Failed while running jpeg2yuv - %s" % command)
config = seek -10
+
end
+
-    command = path_mplex[0] + " -f 8 -v 0 -o '%s' '%s' '%s'" % (tempmovie, tempvideo, music)
 
+
+    command = "ionice -c3 nice "
# Seek forward 30 seconds
+
+    command += path_mplex[0] + " -f 8 -v 0 -o '%s' '%s' '%s'" % (tempmovie, tempvideo, music)
begin
+
    result = runCommand(command)
prog = mplayer
+
    if result<>0:
button = Skip
+
        fatalError("Failed while running mplex - %s" % command)
repeat = 3
+
config = seek +30
+
    if xmlfile != "":
end
+
-        command = path_spumux[0] + " -m dvd -s 0 '%s' < '%s' > '%s'" % (xmlfile, tempmovie, finaloutput)
 
+
+        command = "ionice -c3 nice "
# Quit
+
+        command += path_spumux[0] + " -m dvd -s 0 '%s' < '%s' > '%s'" % (xmlfile, tempmovie, finaloutput)
begin
+
        result = runCommand(command)
prog = mplayer
+
        if result<>0:
button = Back
+
            fatalError("Failed while running spumux - %s" % command)
repeat = 3
+
@@ -1877,7 +1881,8 @@
config = quit
+
        result=os.spawnlp(mode, path_mplex[0], path_mplex[1],
end
+
                    '-M',
 
+
                    '-f', '8',
# Seek forward 10 minutes
+
-                    '-v', '0',
begin
+
+                    '-v', '1',
prog = mplayer
+
+                    '-b', '500', '-r', '16000',
button = NextTrack
+
                    '--sync-offset', '%sms' % syncOffset,
repeat = 3
+
                    '-o', destination,
config = seek +600
+
                    video,
end
+
@@ -1887,7 +1892,8 @@
 
+
        result=os.spawnlp(mode, path_mplex[0], path_mplex[1],
# Seek backward 10 minutes
+
                    '-M',
begin
+
                    '-f', '8',
prog = mplayer
+
-                    '-v', '0',
button = PreviousTrack
+
+                    '-v', '1',
repeat = 3
+
+                   '-b', '500', '-r', '16000',
config = seek -600
+
                    '--sync-offset', '%sms' % syncOffset,
end
+
                    '-o', destination,
 
+
                    video,
# Toggle full-screen
+
@@ -1910,7 +1916,8 @@
begin
+
            fatalError("Failed while running testsubtitlepngs.sh - %s" % command)
prog = mplayer
+
button = Red
+
        write("Running spumux to add subtitles")
repeat = 3
+
-        command = path_spumux[0] + " -P %s/stream.d/spumux.xml <%s >%s" % (os.path.dirname(destination), destination, os.path.splitext(destination)[0] + "-sub.mpg")
config = vo_fullscreen
+
+        command = "ionice -c3 nice "       
end
+
+        command += path_spumux[0] + " -P %s/stream.d/spumux.xml <%s >%s" % (os.path.dirname(destination), destination, os.path.splitext(destination)[0] + "-sub.mpg")
 
+
        result = runCommand(command)
begin
+
        if result<>0:
    button = Volumeup
+
            nonfatalError("Failed while running spumux.\n"
     prog = mplayer
+
@@ -1929,7 +1936,8 @@
    config = volume 1
+
def getStreamInformation(filename, xmlFilename, lenMethod):
    repeat = 1
+
    """create a stream.xml file for filename"""
end
+
    filename = quoteFilename(filename)
 
+
-    command = "mytharchivehelper -i %s %s %d" % (filename, xmlFilename, lenMethod)
begin
+
+    command = "ionice -c3 nice "   
    button = VolumeDown
+
+    command += "mytharchivehelper -i %s %s %d" % (filename, xmlFilename, lenMethod)
    prog = mplayer
+
    config = volume -1
+
    result = runCommand(command)
    repeat = 1
+
end
+
@@ -1972,15 +1980,16 @@
 
+
begin
+
     if localfile != "":
    button = ChannelUp
+
        localfile = quoteFilename(localfile)
     prog = mplayer
+
-        if usecutlist == True:
    config = pt_step 1
+
-            command = "mythtranscode --mpeg2 --honorcutlist -i %s -o %s" % (localfile, destination)
end
+
+        command = "ionice -c3 nice "       
begin
+
+        if usecutlist == True:       
    button = ChannelDown
+
+            command += "mythtranscode --mpeg2 --honorcutlist -i %s -o %s" % (localfile, destination)
    prog = mplayer
+
        else:
     config = pt_step -1
+
-            command = "mythtranscode --mpeg2 -i %s -o %s" % (localfile, destination)
end
+
+            command += "mythtranscode --mpeg2 -i %s -o %s" % (localfile, destination)
 
+
     else:
begin
+
        if usecutlist == True:
     button = Yellow
+
-            command = "mythtranscode --mpeg2 --honorcutlist -c %s -s %s -o %s" % (chanid, starttime, destination)
     prog = mplayer
+
+            command += "mythtranscode --mpeg2 --honorcutlist -c %s -s %s -o %s" % (chanid, starttime, destination)
    config = audio_delay +0.1
+
        else:
end
+
-            command = "mythtranscode --mpeg2 -c %s -s %s -o %s" % (chanid, starttime, destination)
begin
+
+            command += "mythtranscode --mpeg2 -c %s -s %s -o %s" % (chanid, starttime, destination)
    button = Green
+
    prog = mplayer
+
     result = runCommand(command)
    config = audio_delay -0.1
+
end
+
@@ -1995,7 +2004,7 @@
 
+
#############################################################
begin
+
# Create a projectX cut list for a recording
button=Subtitles
+
prog=mplayer
+
-def generateProjectXCutlist(chanid, starttime, folder):
config = sub_visibility
+
+def originalgenerateProjectXCutlist(chanid, starttime, folder):
end
+
     """generate cutlist_x.txt for ProjectX"""
 
+
begin
+
     sqlstatement  = """SELECT mark FROM recordedmarkup
button=Text
+
@@ -2031,6 +2040,59 @@
prog=mplayer
+
config=sub_select
+
    return True
end
+
 
+
+# AJB modified using
begin
+
+# http://code.mythtv.org/trac/raw-attachment/ticket/9389/cutlisttrans.txt
        button=Blue
+
+# for 0.24-fixes
        prog=mplayer
+
+def generateProjectXCutlist(chanid, starttime, folder):
        config=switch_audio
+
+    """generate cutlist_x.txt for ProjectX"""
end
+
+
 
+
+    sqlstatement  = """SELECT mark FROM recordedmarkup
begin
+
+                    WHERE chanid = '%s' AND starttime = '%s'
button = up
+
+                    AND type IN (0,1) ORDER BY mark""" % (chanid, starttime)
prog = mplayer
+
+
config = dvdnav 1
+
+    db = getDatabaseConnection()
end
+
+    cursor = db.cursor()
 
+
+    cursor.execute(sqlstatement)
begin
+
+    result = cursor.fetchall()
button = left
+
+    numrows = int(cursor.rowcount)
prog = mplayer
+
+
config = dvdnav 3
+
+    #We must have at least one row returned for this recording
end
+
+    if numrows==0:
 
+
+        write("No cutlist in the DB for chanid %s, starttime %s" % chanid, starttime)
begin
+
+        db.close()
button = ok
+
+        del db
prog = mplayer
+
+        del cursor
config = dvdnav 6
+
+        return False 
end
+
+
 
+
+    sqlstatement  = """SELECT mark FROM recordedmarkup
begin
+
+                    WHERE chanid = '%s' AND starttime = '%s'
button = right
+
+                    AND type=1 ORDER BY mark LIMIT 1 """ % (chanid, starttime)
prog = mplayer
+
+
config = dvdnav4
+
+    cursor.execute(sqlstatement)
end
+
+    firstcut = cursor.fetchall() 
 
+
+
begin
+
+    sqlstatement  = """SELECT mark FROM recordedmarkup
button = down
+
+                    WHERE chanid = '%s' AND starttime = '%s'
prog = mplayer
+
+                    AND type IN (0,1) ORDER BY mark LIMIT 1 """ % (chanid, starttime)
config = dvdnav 2
+
+
end
+
+    cursor.execute(sqlstatement)
 
+
+    firstedit = cursor.fetchall()
 
+
+
 
+
+    cutlist_f=open(os.path.join(folder, "cutlist_x.txt"), 'w')
### Xine lirc setup
+
+    cutlist_f.write("CollectionPanel.CutMode=2\n")
 
+
+
begin
+
+    if firstcut == firstedit:
prog = xine
+
+        cutlist_f.write("0\n")
button = Play
+
+
repeat = 3
+
+    # iterate through resultset
config = Play
+
+    for i in range(len(result)):
end
+
+        if result[i][0] != "" and result[i][0] <> 0:
 
+
+            cutlist_f.write("%d\n" % result[i])
begin
+
+
prog = xine
+
+    cutlist_f.close()
button = Stop
+
+
repeat = 3
+
+    return True
config = Stop
+
+
end
+
 
+
#############################################################
begin
+
# Use Project-X to cut commercials and/or demux an mpeg2 file
prog = xine
+
@@ -2055,7 +2117,8 @@
button = Power
+
    qfile = quoteFilename(file)
repeat = 3
+
    qcutlist = os.path.join(folder, "cutlist_x.txt")
config = Quit
+
end
+
-    command = path_projectx[0] + " -id %s" % getStreamList(folder)
 
+
+    command = "ionice -c3 nice "
begin
+
+    command += path_projectx[0] + " -id %s" % getStreamList(folder)
prog = xine
+
    if usecutlist == True:
button = Pause
+
        command += " -cut %s -out %s -name %s %s" % (qcutlist, qdestdir, qpxbasename, qfile)
repeat = 3
+
    else:
config = Pause
+
@@ -2080,7 +2143,8 @@
end
+
        if (os.path.exists(os.path.join(folder, "stream.sup")) and
 
+
            os.path.exists(os.path.join(folder, "stream.sup.IFO"))):
begin
+
            write("Found DVB subtitles converting to DVD subtitles")
prog = xine
+
-            command = "mytharchivehelper --sup2dast "
button = ChannelUp
+
+            command = "ionice -c3 nice "
repeat = 3
+
+            command += "mytharchivehelper --sup2dast "
config = EventUp
+
            command += " %s %s 0" % (os.path.join(folder, "stream.sup"), os.path.join(folder, "stream.sup.IFO"))
end
+
 
+
            result = runCommand(command)
begin
+
@@ -2289,7 +2353,8 @@
prog = xine
+
button = ChannelDown
+
        source = quoteFilename(source)
repeat = 3
+
config = EventDown
+
-        command = "mytharchivehelper -t  %s '%s' %s" % (source, seconds, destination)
end
+
+        command = "ionice -c3 nice "
 
+
+        command += "mytharchivehelper -t  %s '%s' %s" % (source, seconds, destination)
begin
+
        result = runCommand(command)
prog = xine
+
        if result <> 0:
button = VolumeDown
+
            fatalError("Failed while running mytharchivehelper to get thumbnails.\n"
repeat = 3
+
@@ -2314,7 +2379,8 @@
config = EventLeft
+
end
+
    source = quoteFilename(source)
 
+
begin
+
-    command = "mytharchivehelper -v important -t %s '%s' %s" % (source, thumbList, destination)
prog = xine
+
+    command = "ionice -c3 nice "
button = VolumeUp
+
+    command += "mytharchivehelper -v important -t %s '%s' %s" % (source, thumbList, destination)
repeat = 3
+
    result = runCommand(command)
config = EventRight
+
    if result <> 0:
end
+
        fatalError("Failed while running mytharchivehelper to get thumbnails")
 
+
@@ -2329,7 +2395,8 @@
begin
+
prog = xine
+
    passes = int(getText(profileNode.getElementsByTagName("passes")[0]))
button = OK
+
repeat = 3
+
-    command = path_ffmpeg[0]
config = EventSelect
+
+    command = "ionice -c3 nice "
end
+
+    command += path_ffmpeg[0]
 
+
begin
+
    if cpuCount > 1:
prog = xine
+
        command += " -threads %d" % cpuCount
button = Back
+
@@ -2515,7 +2582,8 @@
repeat = 3
+
    samplerate, channels = getAudioParams(folder)
config = Menu
+
    videores, fps, aspectratio = getVideoParams(folder)
end
+
 
+
-    command = path_ffmpeg[0] + " -y "
begin
+
+    command = "ionice -c3 nice "
prog = xine
+
+    command +=  path_ffmpeg[0] + " -y "
button = Skip
+
repeat = 3
+
    if cpuCount > 1:
#config = SpeedFaster
+
        command += "-threads %d " % cpuCount
config = SeekRelative+60
+
@@ -2567,7 +2635,8 @@
end
+
def CreateDVDISO(title):
 
+
    write("Creating ISO image")
begin
+
    checkCancelFlag()
prog = xine
+
-    command = path_mkisofs[0] + ' -dvd-video '
button = Replay
+
+    command = "ionice -c3 nice "
repeat = 3
+
+    command += path_mkisofs[0] + ' -dvd-video '
#config = SpeedSlower
+
    command += ' -V ' + quoteFilename(title)
config = SeekRelative-60
+
    command += ' -o ' + os.path.join(getTempPath(), 'mythburn.iso')
end
+
    command += " " + os.path.join(getTempPath(),'dvd')
 
+
@@ -2669,7 +2738,8 @@
begin
+
def deMultiplexMPEG2File(folder, mediafile, video, audio1, audio2):
prog = xine
+
button = VolumeUp
+
    if getFileType(folder) == "mpegts":
repeat = 3
+
-        command = "mythreplex --demux --fix_sync -t TS -o %s " % (folder + "/stream")
config = Volume+
+
+        command = "ionice -c3 nice "   
end
+
+        command += "mythreplex --demux --fix_sync -t TS -o %s " % (folder + "/stream")
 
+
        command += "-v %d " % (video[VIDEO_ID])
begin
+
prog = xine
+
        if audio1[AUDIO_ID] != -1:
button = VolumeDown
+
@@ -2689,7 +2759,8 @@
repeat = 3
+
                command += "-c %d " % (audio2[AUDIO_ID])
config = Volume-
+
end
+
    else:
 +
-        command = "mythreplex --demux --fix_sync -o %s " % (folder + "/stream")
 +
+        command = "ionice -c3 nice "   
 +
+        command += "mythreplex --demux --fix_sync -o %s " % (folder + "/stream")
 +
        command += "-v %d " % (video[VIDEO_ID] & 255)
 +
 +
        if audio1[AUDIO_ID] != -1:
 +
@@ -2726,7 +2797,8 @@
 +
    M2Vsize0 = os.path.getsize(source)
 +
    write("Initial M2Vsize is %.2f Mb , target is %.2f Mb" % ( (float(M2Vsize0)/mega), (float(M2Vsize0)/(factor*mega)) ))
 +
 +
-    command = path_M2VRequantiser[0] 
 +
+    command = "ionice -c3 nice "
 +
+    command += path_M2VRequantiser[0] 
 +
    command += " %.5f "  % factor
 +
    command += " %s "  % M2Vsize0
 +
    command += " <  %s " % source
 +
@@ -3501,7 +3573,8 @@
 +
                height = getScaledAttribute(node, "h")
 +
                frames = int(secondsToFrames(menulength))
 +
 +
-                command = "mytharchivehelper -t  %s '%s' '%s' %d" % (inputfile, starttime, outputfile, frames)
 +
+                command = "ionice -c3 nice "
 +
+                command += "mytharchivehelper -t  %s '%s' '%s' %d" % (inputfile, starttime, outputfile, frames)
 +
                result = runCommand(command)
 +
                if (result != 0):
 +
                    write( "mytharchivehelper failed with code %d. Command = %s" % (result, command) )
 +
</pre></code>
 +
 
 +
These changes fix some bugs in the MythArchive script as shipped with the snapshot of 0.24-fixes that I use, and runs IO intensive processes in the idle IO scheduling class so as not to disrupt recording or playback.
 +
 
 +
==== Enable authentication and https for MythWeb ====
  
begin
+
===== /etc/httpd/conf.d/mythweb.conf =====
prog = xine
+
<code><pre>
button = Mute
+
<VirtualHost your.host.here.co.uk:80 >
repeat = 3
+
<IfModule mod_rewrite.c>
config = Mute
+
#Now that stream.php isn't redirected to rewritten https://...
end
+
#          RewriteLog "/var/log/httpd/rewrite.log"
 +
#          RewriteLogLevel 9
 +
          RewriteEngine on
 +
          RewriteCond %{HTTPS} !=on
 +
#AJB20110114 attempt to fix mythweb music streaming
 +
#from /music/stream.php>
 +
#https rewrite if request includes music/stream
 +
  RewriteCond %{REQUEST_URI} !^/mythweb/music/stream.*$
 +
  RewriteCond %{REQUEST_URI} !^/mythweb/music/stream.php.*$
 +
  RewriteCond %{REQUEST_URI} !^/mythweb/pl/stream.*$
 +
          RewriteCond %{REQUEST_URI} !^/mythweb/mythweb.php/music/stream.*$
 +
  RewriteCond %{REQUEST_URI} !^/mythweb/mythweb.pl/pl/stream.*$
 +
          RewriteRule ^.*$ https://%{HTTP_HOST}%{REQUEST_URI} [R=permanent]
 +
</IfModule>
 +
</VirtualHost>
  
begin
 
prog = xine
 
button = Menu
 
repeat = 3
 
config = RootMenu
 
end
 
  
begin
+
#
prog = xine
+
# Apache configuration directives for MythWeb.  Please read INSTALL for setup
button = NextTrack
+
# requirements and troubleshooting, along with the comments in this file.
repeat = 3
+
#
config = EventNext
+
 
end
+
#
 +
# CHANGE THIS PATH TO MATCH YOUR MYTHWEB INSTALLATION DIRECTORY!  e.g.
 +
#
 +
#    /var/www
 +
#    /home/www/htdocs
 +
#    /var/www/html/mythweb
 +
#    /srv/www/htdocs/mythweb
 +
#
 +
Alias /mythweb/ "/usr/share/mythweb/"
 +
Alias /mythweb "/usr/share/mythweb/"
 +
 
 +
<Directory "/usr/share/mythweb">
 +
 
 +
    ############################################################################
 +
    # I *strongly* urge you to turn on authentication for MythWeb.  It is disabled
 +
    # by default because it requires you to set up your own password file.  Please
 +
    # see the man page for htdigest and then configure the folowing four directives
 +
    # to suit your authentication needs.
 +
    #
 +
    #    AuthType          Digest
 +
    #    AuthName          "MythWeb"
 +
    #    AuthUserFile      /etc/httpd/conf.d/mythweb-htdigest
 +
    #    Require            valid-user
 +
    #    BrowserMatch      "MSIE"      AuthDigestEnableQueryStringHack=On
 +
    #    Order              allow,deny
 +
    #    Satisfy            any
 +
    #
 +
    #  * If you're running Apache earlier than 2.2, you will need to use
 +
    #    the AuthDigestFile command instead of AuthUserFile (3rd line above).
 +
    #
 +
 
 +
AuthType          Digest     
 +
AuthName          "MythWeb"   
 +
AuthUserFile      /etc/httpd/conf/httpd-passwords
 +
Require            valid-user   
 +
BrowserMatch      "MSIE"      AuthDigestEnableQueryStringHack=On   
 +
Order              allow,deny   
 +
Satisfy            any   
 +
 
 +
    ############################################################################
 +
    # Some special instructions for the MythWeb controller files
 +
    #
 +
        <Files mythweb.*>
 +
 
 +
        #
 +
        # Use the following environment settings to tell MythWeb where you want it to
 +
        # look to connect to the database, the name of the database to connect to, and
 +
        # the authentication info to use to connect.  The defaults will usually work
 +
        # fine unless you've changed mythtv's mysql.txt file, or are running MythWeb on
 +
        # a different server from your main backend.  Make sure you have mod_env enabled.
 +
        #
 +
            setenv db_server        "localhost"
 +
            setenv db_name          "mythconverg"
 +
            setenv db_login        "MYTHUSERNAME"
 +
            setenv db_password      "MYTHPASSWORD"
 +
 
 +
        #
 +
        # By default, MythWeb uses the hostname program to look up the hostname of the
 +
        # machine it runs on.  If this reports incorrect data, or you run MythWeb on a
 +
        # machine without the hostname program, set this to your current hostname.
 +
        #
 +
          setenv hostname        "your.host.here.co.uk"
 +
        #
 +
 
 +
        # By default, php will always search the current directory for include files,
 +
        # but if you wish to install these directories outside of the current path
 +
        # (eg. for security reasons), set this variable to the directory that
 +
        # contains the directories like languages and templates.  eg.
 +
        #
 +
        #  setenv include_path      "/usr/share/mythweb"
  
begin
+
        # If you want MythWeb to email php/database errors (and a backtrace) to you,
prog = xine
+
        # uncomment and set the email address below.
button = PreviousTrack
+
        #
repeat = 3
+
        #  setenv error_email      "mythweb_errors@example.com"
config = EventPrior
+
        #
end
 
  
begin
+
        # If your local file system is something other than UTF-8, set this variable
prog = xine
+
        # so that the music and video portions of MythWeb can provide proper links
button = Go
+
        # to your downloadable files.
repeat = 3
+
        #
config = OSDStreamInfos
+
        #  setenv fs_encoding      "ISO-8859-1"
end
 
  
begin
+
        </Files>
prog = xine
 
button = Red
 
repeat = 3
 
config = Quit
 
end
 
  
</pre></code>
+
    ############################################################################
 +
    # The following settings relate to PHP config.
 +
    #
  
I no longer have a symlink from $HOME/.mythtv/lircrc to this file.
+
        <Files *.php>
  
===== /usr/local/bin/mythpowerbutton.sh =====
+
        #  These settings are intended for apache 2.x.  If your version of apache
<code><pre>
+
        #  doesn't support php_value, or things like memory_limit aren't working
#!/bin/bash
+
        # as expected, then use these settings as examples for your own php.ini
PROG=mythfrontend
+
        # files.
#PROG=gnome-session
+
            php_value safe_mode                    0
STATUS=`ps -e | grep $PROG | grep -v grep | wc -l | awk '{print $1}'`
 
  
if [ `echo $DISPLAY | grep -c ":0"` -ge 1 ]
+
            php_value memory_limit                  512M
then
+
 
    if [ $STATUS -eq 0 ]
+
            php_value register_globals              0
    then
+
            php_value magic_quotes_gpc              0
        echo "use mythconverg; update cardinput set startchan=1;" | mysql -u root --password=root   
+
            php_value file_uploads                  0
# xrandr -s 768x576
+
            php_value allow_url_fopen              On
xrandr -s 1024x576 # AJB 20071104
 
# xrandr -s 1280x576 # AJB 20071231 - doesn't really work out!
 
        #( $PROG & )
 
# add ionice -c 2 -n 0 AJB20110120
 
        ( ionice -c 2 -n 0 $PROG >/dev/null 2>&1 & )
 
    else
 
        killall $PROG
 
        echo "use mythconverg; update cardinput set startchan=1;" | mysql -u root --password=root
 
    fi
 
fi
 
exit 0
 
# try to fix problems with MythArchive mythtranscode sometimes failing
 
rm -f ~mythtv/.ICEauthority
 
</pre></code>
 
  
==== Sound ====
+
            php_value zlib.output_handler          Off
===== /home/mythtv/.asoundrc =====
+
            php_value output_handler                NULL
<code><pre>
 
# Do not use this directly--it requires specific rate, channels, and format
 
pcm.dmix-digital {
 
  type dmix
 
  ipc_key 1235
 
  slave {
 
    pcm "digital-hw"
 
    period_time 0
 
    period_size 1024
 
    buffer_size 4096
 
    rate 48000
 
  }
 
}
 
  
# Control device (mixer, etc.) for the card
+
        # Note: php_flag does not work in older versions of php
ctl.dmix-digital {
+
            php_flag output_handler                "NULL"
  type hw
 
  card 0
 
}
 
  
pcm.!default {
+
        </Files>
  type plug
 
  slave {
 
    pcm multi
 
    rate 48000
 
  }
 
  hint {
 
    show on
 
    description "Multiple Output - Use analog and digital outputs simultaneously"
 
  }
 
  ttable.0.0 1.0
 
  ttable.1.1 1.0
 
  ttable.0.2 1.0
 
  ttable.1.3 1.0
 
}
 
  
pcm.ajb {
+
    ############################################################################
  type plug
+
    # The settings below relate specifically to mod_rewrite and the rewrite
  slave {
+
    # engine used to make the MythWeb user experience a little easier to deal
     pcm multi
+
    # with by simplifying the URLs needed to access the various sections. Do
     rate 48000
+
    # not touch these settings unless you really know what you're doing..
  }
+
    #
  hint {
+
 
     show on
+
    # Turn on the rewrite engine
     description "AJB Multiple Output - Use analog and digital outputs simultaneously"
+
        RewriteEngine  on
  }
+
 
  ttable.0.0 1.0
+
    # If MythWeb is installed outside of the document root (eg. using Alias) then
  ttable.1.1 1.0
+
     # you will need to set this directive to the base URL that MythWeb is visible
  ttable.0.2 1.0
+
     # from externally.  If you do not, the web server will return 'not found'.
  ttable.1.3 1.0
+
        RewriteBase    /mythweb
}
+
 
 +
     # Skip out early if we've already been through rewrites,
 +
     # or if this is a /css/, /js/ or /cache/ directory request.
 +
        RewriteRule    ^(css|data|images|js|themes|skins|[a-z_]+\.(php|pl))(/|$)    -    [L]
 +
 
 +
    # Redirect /pl/ requests to the perl cgi handler.
 +
        RewriteRule    ^(pl(/.*)?)$            mythweb.pl/$1               [QSA,L]
 +
 
 +
    # Redirect most of the remaining URL requests to the main mythweb script.
 +
    # It will then handle any requests given to it.
 +
        RewriteRule    ^(.+)$                  mythweb.php/$1             [QSA,L]
 +
 
 +
    # If you're experiencing trouble with the previous two lines in your copy of
 +
    # apache, you could instead use something like:
 +
    #    RewriteRule    ^(pl(/.*)?)$          mythweb.pl?PATH_INFO=/$1   [L,QSA]
 +
    #    RewriteRule    ^(.+)$                mythweb.php?PATH_INFO=/$1   [L,QSA]
 +
 
 +
    # Catch anything else that comes through and send it to mythweb.php with no parameters.
 +
        RewriteRule    ^(.*)$                  mythweb.php                [QSA,L]
 +
 
 +
    ############################################################################
 +
    # You really shouldn't need to edit anything below this line, so please
 +
    # don't unless you know what you're doing.
 +
    #
  
pcm.stereo {
+
     # Allow .htaccess to override whatever it wants from the server config.
  type plug
+
        AllowOverride   All
  slave {
 
    pcm multi
 
    rate 48000
 
  }
 
  hint {
 
     show on
 
    description "Multiple Stereo Output - Use analog and digital outputs simultaneously"
 
  }
 
  ttable.0.0 1.0
 
   ttable.1.1 1.0
 
  ttable.0.2 1.0
 
  ttable.1.3 1.0
 
}
 
  
ctl.stereo {
+
    # Allow browsers to follow symlinks that point outside of the web document
  type hw
+
    # tree.  This is how we access music, videos, etc.
  card 0
+
        Options        FollowSymLinks
}
 
  
pcm.multi {
+
    # MythTV now uses the correct file suffix for mpeg files, so all .nuv files
  type multi
+
    # should actually be NuppleVideo. However, apache probably doesn't know what
  slaves.a.pcm "analog-hw"
+
    # those are, so we should tell it.
  slaves.a.channels 2
+
        AddType video/nuppelvideo   .nuv
  slaves.b.pcm "digital-hw"
 
  slaves.b.channels 2
 
  bindings.0.slave a
 
  bindings.0.channel 0
 
   bindings.1.slave a
 
  bindings.1.channel 1
 
  bindings.2.slave b
 
  bindings.2.channel 0
 
  bindings.3.slave b
 
  bindings.3.channel 1
 
  hint {
 
    show on
 
    description "Multiple Output - Use analog and digital outputs simultaneously"
 
  }
 
}
 
  
ctl.multi {
+
    # Specify the MIME type for favicon.ico in case the server configuration
  type hw
+
    # doesn't or in case the server configuration uses the IANA-approved MIME type
  card 0
+
    # (image/vnd.microsoft.icon)--which most browsers won't recognize.
}
+
        AddType image/x-icon        .ico
</pre></code>
 
  
===== MythTV configuration =====
+
    # Enable mod_deflate.  This works MUCH more reliably than PHP's built-in
<pre>
+
    # gzip/Zlib compressors.  It is disabled here because many distros seem not
AudioOutputDevice = ALSA:ajb # IMPORTANT - makes MythTV output simultaneously to front (analog) and S/PDIF (digital) outputs, albeit in Stereo only.
+
    # to enable mod_deflate by default, but I strongly recommend that you
MusicAudioDevice = ALSA:ajb
+
    # enable this section.
PassThruOutputDevice = ALSA:iec958:AES0=6 # digital output
+
    #
PassThruDeviceOverride = 1 # Separate digital output = enabled
+
        BrowserMatch ^Mozilla/4 gzip-only-text/html
AC3PassThru = 0 # Dolby Digital = disabled
+
        BrowserMatch ^Mozilla/4\.0[678] no-gzip
DTSPassThru = 0 # DTS = disabled
+
        BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
MixerDevice = ALSA:default
+
    #
MixerControl = PCM
+
        AddOutputFilterByType DEFLATE text/html
MasterMixerVolume = 100
+
        AddOutputFilterByType DEFLATE text/css
PCMMixerVolume = 94
+
        AddOutputFilterByType DEFLATE application/x-javascript
AudioDefaultUpmix = 0 # Upconvert stereo to 5.1 surround = disabled
 
AudioUpmixType = 0 # Upmix quality?
 
Audio48kOverride = 0 # Force audio device output to 48kHz = disabled
 
AdvancedAudioSettings = 1 # Advanced Audio Configuration = enabled
 
DecodeExtraAudio = 1
 
SRCQualityOverride = 0 # Override SRC quality = disabled
 
SRCQuality = 1
 
Speaker
 
</pre>
 
  
Note that if MythTV only has a single audio path. A side effect of this is that it cannot be configured both to pass through multi-channel (e.g. 5.1) digital audio and to output stereo analogue audio simultaneously. If you try, you will end up hearing ugly compressed digital noise through your analogue output.
+
    # This is helpful for mod_deflate -- it prevents proxies from changing
 +
    # the user agent to/from this server, which can prevent compression from
 +
    # being enabled. It is disabled here because many distros seem not to
 +
    # enable mod_headers by default, but I recommend that you enable it.
 +
    #
 +
        Header append Vary User-Agent env=!dont-vary
  
Configured like this, I get stereo audio on both the analogue and digital S/PDIF outputs. I usually watch MythTV recordings with only my TV's speakers enabled, but if I mute my TV and switch on my AV receiver, this is adequate. I have a cheap DVD player if I want to hear a 5.1 DVD. If more UK Freeview broadcasts were > 2.0 audio, I might reconsider this configuration.
+
    # Set up the perl handler so we can stream properly.
 +
    #
 +
    # IMPORTANT!!  Please see the note in INSTALL section 5.1 that explains why
 +
    # this may not always properly detect mod_perl.
 +
    #
 +
        <Files *.pl>
 +
            <IfModule mod_perl.c>
 +
                SetHandler perl-script
 +
                PerlResponseHandler ModPerl::Registry
 +
                PerlOptions +ParseHeaders
 +
            </IfModule>
 +
            <IfModule !mod_perl.c>
 +
                SetHandler cgi-script
 +
            </IfModule>
 +
            Options +ExecCGI
 +
        </Files>
  
=== MythTV configuration ===
+
</Directory>
  
==== MythTV Playback Settings ====
+
<Directory "/usr/share/mythweb/data">
* Enable realtime priority threads
+
    Options -All +FollowSymLinks +IncludesNoExec
* Extra audio buffering
+
</Directory>
* Custom Video Playback Profile: Decoder=Standard (ffmpeg), Max CPUs=1, Deblocking filter=enabled, Video renderer=xv-blit, OSD renderer=chromakey, OSD fade=disabled, Primary deinterlacer=Bob (2x), Fallback deinterlacer=None
 
* OpenGL vsync setting is no longer present
 
* Enable SyncToVBlank=1, XVideoTextureSyncToVBlank=1, XVideoBlitterSyncToVBlank=1 and XVideoSyncToDisplay=1 in <code>$HOME/.nvidia-settings-rc</code>
 
* Use 1024x576 for UI, 720x576pali for playback
 
  
The bug that resulted in XVideo regions displayed on interlaced displays being scandoubled appears to no longer be present with the combination of 7600GS/GT hardware, nVidia driver version 256.53 and MythTV 0.24-fixes. Output is full vertical resolution, jitter free and scrolling credits are smooth.
+
#AJB 20110115 fix mythweb weather
 +
<Directory "/usr/share/mythweb/skins/default/img/weather/">
 +
    Options +Indexes
 +
</Directory>
  
For belt-and-braces, I use <code>ionice</code> to run <code>mythfrontend</code> and <code>mythbackend</code> with the highest priority (0) in the best-effort (class=2) IO scheduling class. The MySQL daemon is run with priority slightly lower at 1 (still within the 'best-effort' IO scheduling class). IO-intensive background processes (e.g. mirroring using rsync, certain elements of MythArchive) are run only within the idle (class=3) IO scheduling class. Generally, the only playback disruption I experience is coincident with the flurry of database activity at the start and end of recording. There is scope for running mythfrontend within the realtime (class=1) IO scheduling class, but I have not yet experimented with this.
 
  
==== Wrap mythfilldatabase ====
+
# You will probably also want to uncomment the following rules, which
<code><pre>
+
# disable authentication for MythWeb's download URLs so you can properly
#!/bin/sh
+
# stream to media players that don't work with authenticated servers.
echo "mythfilldatabase started `date`" >>/var/lib/mythtv/mythfilldatabase.log
+
#
echo "Parameters:" >>/var/lib/mythtv/mythfilldatabase.log
+
<LocationMatch .*/pl/stream/[0-9]+/[0-9]+>
for i in $*
+
    Allow from all
do
+
 
/bin/echo -n "<$i> " >>/var/lib/mythtv/mythfilldatabase.log
+
#AJB201101014
done
+
    Satisfy any
echo "User: `whoami`" >>/var/lib/mythtv/mythfilldatabase.log
+
 
echo "Groups: `groups`" >>/var/lib/mythtv/mythfilldatabase.log
+
</LocationMatch>
echo "PWD: `pwd`" >>/var/lib/mythtv/mythfilldatabase.log
+
 
echo "Environment: " >>/var/lib/mythtv/mythfilldatabase.log
 
#export XMLTV_SUPPLEMENT="http://supplement.xmltv.org"
 
export XMLTV_SUPPLEMENT="/etc/mythtv/.xmltv/supplement/"
 
export XMLTV_SUPPLEMENT_VERBOSE=1
 
export >>/var/lib/mythtv/mythfilldatabase.log
 
#rm -rf $HOME/.xmltv/supplement/tv_grab_uk_rt/*
 
cd $HOME/.xmltv/supplement/tv_grab_uk_rt/
 
wget -N -nv http://supplement.xmltv.org/tv_grab_uk_rt/channel_ids
 
wget -N -nv http://supplement.xmltv.org/tv_grab_uk_rt/prog_titles_to_process
 
wget -N -nv http://supplement.xmltv.org/tv_grab_uk_rt/utf8_fixups
 
cd $HOME
 
#echo "waiting 10s"
 
#sleep 10s
 
  
su -c "ionice -c 3 nice /usr/bin/mythfilldatabase $*" mythtv
+
<LocationMatch .*/music/stream.*>
</pre></code>
+
    Allow from all
  
This script sets xmltv to use updated (aka supplement) channel data files, downloading them automatically if they have changed. It also runs <code>mythfilldatabase</code> in the 'idle' IO scheduling class. Configure MythTV to use this script using mythtv-setup.
+
#AJB20110114 try disable authentication for this part
 +
    Satisfy any
  
==== Wrap /usr/bin/mythcommflag ====
+
</LocationMatch>
 +
</pre></code>
  
<code>mv /usr/bin/mythcommflag /usr/bin/mythcommflag.fedora</code>, then put this script in its place:
+
Use the <code>htdigest</code> command to create and maintain the password file, <code>/etc/httpd/conf/httpd-passwords</code>.
  
 +
===== Patch MythWeb to enable unauthenticated http streaming =====
 
<code><pre>
 
<code><pre>
#!/bin/bash
+
diff -ur mythweb.fedora-0.24-fixes-20110113/modules/music/handler.php mythweb/modules/music/handler.php
 +
--- mythweb.fedora-0.24-fixes-20110113/modules/music/handler.php 2011-01-12 23:39:28.000000000 +0000
 +
+++ mythweb/modules/music/handler.php 2011-02-12 19:56:44.000000000 +0000
 +
@@ -42,5 +42,7 @@
 +
  * couple of different files called above.
 +
/**/
 +
    function stream_url() {
 +
-        return root_auth_url.'music/';
 +
+#AJB20110114 remove https from root_auth_url
 +
+#        return root_auth_url.'music/';
 +
+        return str_replace("https","http",root_auth_url).'music/';
 +
    }
 +
Only in mythweb/modules/music: handler.php.HTTPstreaming
 +
diff -ur mythweb.fedora-0.24-fixes-20110113/modules/stream/stream_asx.pl mythweb/modules/stream/stream_asx.pl
 +
--- mythweb.fedora-0.24-fixes-20110113/modules/stream/stream_asx.pl 2011-01-12 23:39:28.000000000 +0000
 +
+++ mythweb/modules/stream/stream_asx.pl 2011-02-12 19:56:44.000000000 +0000
 +
@@ -10,13 +10,17 @@
 +
 +
# URI back to this file?  We just need to take the current URI and strip
 +
# off the .asx suffix.
 +
-    my $uri = ($ENV{'HTTPS'} || $ENV{'SERVER_PORT'} == 443)
 +
-                ? 'https'
 +
-                : 'http';
 +
+# AJB 20110117 http only for streaming
 +
+#    my $uri = ($ENV{'HTTPS'} || $ENV{'SERVER_PORT'} == 443)
 +
+#                ? 'https'
 +
+#                : 'http';
 +
+    my $uri = 'http';
 +
    my $serverAddr = $ENV{'HTTP_X_FORWARDED_HOST'} || $ENV{'SERVER_NAME'} || $ENV{'SERVER_ADDR'};
 +
# Attempt to remove the port out of the serverAddr if it's in there
 +
    $serverAddr =~ tr/:[0-9]+//;
 +
-    my $serverPort = $ENV{'HTTP_X_FORWARDED_PORT'} || $ENV{'SERVER_PORT'};
 +
+# AJB 20110117 http only for streaming
 +
+#    my $serverPort = $ENV{'HTTP_X_FORWARDED_PORT'} || $ENV{'SERVER_PORT'};
 +
+    my $serverPort = 80;
 +
    $uri .= '://'.$serverAddr.':'.$serverPort
 +
            .$ENV{'REQUEST_URI'};
 +
 +
</pre></code>
 +
 
 +
This patch works in combination with the above configuration file for the Apache http server.
  
 +
==== Patch default Theme ====
  
# edit/tune these #
+
<code><pre>
# Allow ad breaks to be upto 400s long by coalescing non-silence
+
diff -ur /usr/share/mythtv/themes/default.fedora-0.24-20110125/browser-ui.xml /usr/share/mythtv/themes/default/browser-ui.xml
MAXCOMMBREAKSECS=400
+
--- /usr/share/mythtv/themes/default.fedora-0.24-20110125/browser-ui.xml 2011-01-12 23:34:28.000000000 +0000
# mytharchivehelper isn't frame-accurate, and mythcommflag won't add final cut pair if the end of the cut is greater
+
+++ /usr/share/mythtv/themes/default/browser-ui.xml 2011-02-12 12:27:58.000000000 +0000
# than the actual final frame, so subtract $ENDFUDGEFRAMES from the value mytharchivehelper returns
+
@@ -53,9 +53,8 @@
ENDFUDGEFRAMES=75
+
            <statetype name="buttonitem">
# -70dB and minimum of 0.15s to be considered 'silent'
+
                <area>0,0,180,40</area>
MP3SPLT_OPTS="th=-70,min=0.15"
+
                <state name="active">
# Log file
+
-                   <imagetype name="buttonbackground">
LOGFILE="/var/log/mythtv/mythcommflag-wrapper"
+
-                        <filename>horiz_selector.png</filename>
# Copy commercial skiplist to cutlist automatically? 1=Enabled
+
-                    </imagetype>
COPYTOCUTLIST=1
+
+                    <area>0,0,180,40</area>
 +
+                    <shape name="background" from="basewidgetshape" />
 +
                    <textarea name="buttontext" from="basetextarea">
 +
                        <area>0,0,180,40</area>
 +
                        <font>basesmall</font>
 +
@@ -63,14 +62,12 @@
 +
                    </textarea>
 +
                </state>
 +
                <state name="selectedactive" from="active">
 +
-                    <imagetype name="buttonbackground">
 +
-                        <filename>horiz_selector_selected.png</filename>
 +
-                    </imagetype>
 +
+                    <shape name="background" from="baseselectedwidgetshape" />
 +
                </state>
 +
                <state name="selectedinactive" from="active">
 +
-                   <imagetype name="buttonbackground">
 +
-                        <filename>horiz_selector_inactive.png</filename>
 +
-                    </imagetype>
 +
+                  <textarea name="buttontext">
 +
+                        <font>basesmallgrey</font>
 +
+                    </textarea>
 +
                </state>
 +
            </statetype>
 +
            <statetype name="downscrollarrow">
 +
</pre></code>
  
MYTHCFG=""
+
These changes fix the bookmark highlighting in MythBrowser in the snapshot of 0.24-fixes that I use. These changes have been applied upstream, and are no longer necessary in later versions.
# mythbackend in Fedora packages has $HOME=/etc/mythtv
 
if [ -e $HOME/mysql.txt ]; then
 
MYTHCFG="$HOME/mysql.txt"
 
fi
 
  
 +
==== Patch default-wide theme ====
 +
<code><pre>
 +
diff -ur /usr/share/mythtv/themes/default-wide.fedora-0.24-20110125/browser-ui.xml /usr/share/mythtv/themes/default-wide/browser-ui.xml
 +
--- /usr/share/mythtv/themes/default-wide.fedora-0.24-20110125/browser-ui.xml 2011-01-12 23:34:28.000000000 +0000
 +
+++ /usr/share/mythtv/themes/default-wide/browser-ui.xml 2011-02-12 12:27:58.000000000 +0000
 +
@@ -61,9 +61,8 @@
 +
            <statetype name="buttonitem">
 +
                <area>0,0,180,40</area>
 +
                <state name="active">
 +
-                    <imagetype name="buttonbackground">
 +
-                        <filename>horiz_selector.png</filename>
 +
-                    </imagetype>
 +
+                    <area>0,0,180,40</area>
 +
+                    <shape name="background" from="basewidgetshape" />
 +
                    <textarea name="buttontext" from="basetextarea">
 +
                        <area>0,0,180,40</area>
 +
                        <font>basesmall</font>
 +
@@ -73,14 +72,12 @@
 +
                    </textarea>
 +
                </state>
 +
                <state name="selectedactive" from="active">
 +
-                    <imagetype name="buttonbackground">
 +
-                        <filename>horiz_selector_selected.png</filename>
 +
-                    </imagetype>
 +
+                    <shape name="background" from="baseselectedwidgetshape" />
 +
                </state>
 +
                <state name="selectedinactive" from="active">
 +
-                    <imagetype name="buttonbackground">
 +
-                        <filename>horiz_selector_inactive.png</filename>
 +
-                    </imagetype>
 +
+                  <textarea name="buttontext">
 +
+                        <font>basesmallgrey</font>
 +
+                    </textarea>
 +
                </state>
 +
            </statetype>
 +
            <statetype name="downscrollarrow">
 +
</pre></code>
 +
 +
As above, but for the default-wide theme, and themes dependent upon it.
 +
 +
==== Create tweaked MythCenter-wide theme ====
  
if [ -e $HOME/.mythtv/mysql.txt ]; then
+
copy <code>/usr/share/mythtv/themes/MythCenter-wide</code> to <code>/usr/share/mythtv/themes/ajb-MythCenter-wide</code>, then apply this patch for smaller fonts and better contrast for text, so that the UI is usable on a 28" widescreen CRT at 6' or so.
MYTHCFG="$HOME/.mythtv/mysql.txt"
 
fi
 
if [ "$MYTHCFG" = "" ]; then
 
echo >>$LOGFILE "No mysql.txt found in $HOME or $HOME/.mythtv - exiting!"
 
exit 1
 
fi
 
 
 
MAH=`which mytharchivehelper`
 
if [ "$MAH" = "" ]; then
 
echo "mytharchivehelper not found in $PATH - exiting!"
 
exit 1
 
fi
 
 
# DB username and password
 
MYTHHOST=`grep DBHostName <$MYTHCFG | awk -F= '{print $2}'`
 
MYTHUSER=`grep DBUserName <$MYTHCFG | awk -F= '{print $2}'`
 
MYTHPASS=`grep DBPassword <$MYTHCFG | awk -F= '{print $2}'`
 
MYTHDB=`grep DBName <$MYTHCFG | awk -F= '{print $2}'`
 
#echo >>$LOGFILE "[$MYTHHOST] [$MYTHUSER] [$MYTHPASS] [$MYTHDB]"
 
  
# root of MythTV recordings
+
<code><pre>
RECORDINGSROOT=`mysql -h${MYTHHOST} -u${MYTHUSER} -p${MYTHPASS} -e "select dirname from storagegroup;" $MYTHDB | tail -n +2 | sort | uniq | tr '\n' ' '`
+
diff -ur MythCenter-wide.fedora/base.xml ajb-MythCenter-wide/base.xml
 
+
--- MythCenter-wide.fedora/base.xml 2011-01-12 23:34:29.000000000 +0000
 
+
+++ ajb-MythCenter-wide/base.xml 2011-01-16 20:23:35.000000000 +0000
echo >>$LOGFILE "$0 run with [$*] at `date` by `whoami`"
+
@@ -4,13 +4,13 @@
echo >>$LOGFILE "RECORDINGSROOT=$RECORDINGSROOT"
+
#export >>$LOGFILE
+
    <!-- Base Font Definitions -->
 
+
    <fontdef name="basesmall" face="Droid Sans">
#/usr/bin/mythcommflag run with [-j 584 -V 8213] at Sat Jan 29 17:26:58 GMT 2011 by root
+
-       <pixelsize>22</pixelsize>
#select recorded.basename from recorded join jobqueue where jobqueue.id=584 and jobqueue.chanid=recorded.chanid and jobqueue.starttime=recorded.starttime;
+
+       <pixelsize>20</pixelsize> <!-- AJB 20110116 originally 22 -->
 
+
        <color>#EEEEEE</color>
silence_detect() {
+
        <weight>bold</weight>
local filename=$1
+
    </fontdef>
+
TMPDIR=`mktemp -d /tmp/mythcommflag.XXXXXX` || exit 1
+
    <fontdef name="basesmaller" from="basesmall">
+
-       <pixelsize>18</pixelsize>
# get frame count, less 3 seconds (75 frames) fudge factor
+
+       <pixelsize>16</pixelsize>
let FRAMES=`mytharchivehelper -i $filename $TMPDIR/streaminfo.xml 1 2>&1 | grep " frames = " | awk -F"= " '{print $2}'`-${ENDFUDGEFRAMES}
+
    </fontdef>
echo >>$LOGFILE "total frames = $FRAMES (+/- 75)"
+
 
+
    <fontdef name="basesmallbold" from="basesmall">
# From <http://www.mythtv.org/wiki/Silence-detect.sh>
+
@@ -24,16 +24,16 @@
 
+
    </fontdef>
# AJB20110129 Have already checked for pre-existing cutlist, and this check doesn't work properly after --clearcutlist anyway
+
# [[ "Cutlist: "  == `mythcommflag.fedora --getcutlist -f $filename  |grep Cutlist` ]] \
+
    <fontdef name="basemedium" from="basesmall" face="Liberation Sans">
#     || { echo already has cutlist && exit 1; }
+
-        <pixelsize>26</pixelsize>
 
+
+        <pixelsize>23</pixelsize>
cd $TMPDIR
+
    </fontdef>
touch `basename $filename`.touch
+
ionice -c3 nice ffmpeg -i $filename -acodec copy sound.mp3
+
    <fontdef name="basemediumbold" from="basemedium">
ionice -c3 nice mp3splt -s -p $MP3SPLT_OPTS sound.mp3
+
-       <pixelsize>26</pixelsize>
 
+
+       <pixelsize>23</pixelsize>
#AJB20110129 add '$FRAMES' because mythcommflag now requires *pairs* of frames
+
        <weight>bold</weight>
CUTLIST=`tail --lines=+3 mp3splt.log|sort -g |\
+
    </fontdef>
      awk 'BEGIN{start=0;ORS=","}{if($2-start<'$MAXCOMMBREAKSECS')
+
      {finish=$2} else {print int(start*25+1)"-"int(finish*25-25);
+
    <fontdef name="baselarge" from="basemedium">
      start=$1; finish=$2;}}END{print int(start*25+1)"-"'$FRAMES'}'`
+
-       <pixelsize>30</pixelsize>
echo >>$LOGFILE "silence-detect has generated cutlist: $CUTLIST"
+
+       <pixelsize>26</pixelsize>
 
+
        <shadowcolor>#000000</shadowcolor>
echo >>$LOGFILE "silence-detect(): CHANID=$CHANID, STARTTIME=$STARTTIME, FRAMES=$FRAMES"
+
        <shadowoffset>4,4</shadowoffset>
CUTLIST=`tail --lines=+3 mp3splt.log|sort -g |\
+
        <shadowalpha>64</shadowalpha>
awk 'BEGIN{start=0;ORS="\n"}{if($2-start<'$MAXCOMMBREAKSECS') {finish=$2} else {print "INSERT INTO recordedmarkup (chanid,starttime,mark,type) VALUES ('$CHANID',\"'"$STARTTIME"'\","int(start*25+1)",4);\nINSERT INTO recordedmarkup (chanid,starttime,mark,type) VALUES ('$CHANID',\"'"$STARTTIME"'\","int(finish*25-25)",5);"; start=$1; finish=$2;}}END{print "INSERT INTO recordedmarkup (chanid,starttime,mark,type) VALUES ('$CHANID',\"'"$STARTTIME"'\","int(start*25+1)",4);\nINSERT INTO recordedmarkup (chanid,starttime,mark,type) VALUES ('$CHANID',\"'"$STARTTIME"'\",'$FRAMES',5);"}' | sed 's/\"/'\''/g'`
+
@@ -45,7 +45,7 @@
RC=$?
+
    </fontdef>
# echo >>$LOGFILE "silence-detect SQLgen returned with $RC, generated SQL skipist: $CUTLIST"
+
 
+
    <fontdef name="baseextralarge" from="baselarge">
# CUTLIST="USE $MYTHDB; $CUTLIST"
+
-       <pixelsize>34</pixelsize>
 
+
+       <pixelsize>28</pixelsize>
rm -rf $TMPDIR
+
        <shadowcolor>#000000</shadowcolor>
}
+
        <shadowoffset>4,4</shadowoffset>
 
+
        <shadowalpha>64</shadowalpha>
 
+
@@ -57,10 +57,10 @@
if [ $# -eq 0 ]; then
+
        <color>#FFFFFF</color>
# run with no parameters, flag every unflagged recording
+
    </fontdef>
exec mythcommflag.fedora
+
    <fontdef name="basesmall_normal" from="basesmall">
exit $?
+
-       <color>#9999cc</color>
else
+
+       <color>#ccccff</color>
if [ $# -eq 4 -a "$1" = "-j" -a "$3" = "-V" ]; then
+
    </fontdef>
# this is a manual flag job
+
    <fontdef name="basesmall_normal_inactive" from="basesmall">
# TODO AJB20110129 generate a filelist from recorded table where commflagged=0 and cutlist=0
+
-       <color>#666666</color>
# then run silence_detect over each filename
+
+       <color>#888888</color>
JOB=$2
+
    </fontdef>
else
+
    <fontdef name="basesmall_warning_selected" from="basesmallbold">
# we're being used in some other way, run the real mythcommmflag
+
        <color>#dddd44</color>
echo >>$LOGFILE "running mythcommflag.fedora $*"
+
@@ -75,7 +75,7 @@
exec mythcommflag.fedora $*
+
        <color>#bbbb33</color>
exit $?
+
    </fontdef>
fi
+
    <fontdef name="basesmall_favourite_unavailable" from="basesmall">
echo >>$LOGFILE "running job $JOB"
+
-       <color>#9999cc</color>
HASCUTLIST=`mysql -h${MYTHHOST} -u${MYTHUSER} -p${MYTHPASS} -e "select recorded.cutlist from recorded join jobqueue where jobqueue.id=$JOB and jobqueue.chanid=recorded.chanid and jobqueue.starttime=recorded.starttime;" $MYTHDB | tail -n +2`
+
+       <color>#ccccff</color>
if [ "$HASCUTLIST" = "1" ]; then
+
    </fontdef>
echo >>$LOGFILE "program already has (manual?) cutlist, exiting"
+
    <fontdef name="basesmall_error_selected" from="basesmallbold">
exit 0
+
        <color>#900800</color>
fi
+
@@ -84,10 +84,10 @@
CALLSIGN=`mysql -h${MYTHHOST} -u${MYTHUSER} -p${MYTHPASS} -e "select channel.callsign from channel join jobqueue where jobqueue.id=$JOB and jobqueue.chanid=channel.chanid;" $MYTHDB | tail -n +2`
+
        <color>#700700</color>
CHANID=`mysql -h${MYTHHOST} -u${MYTHUSER} -p${MYTHPASS} -e "select chanid from jobqueue where jobqueue.id=$JOB;" $MYTHDB | tail -n +2`
+
    </fontdef>
STARTTIME=`mysql -h${MYTHHOST} -u${MYTHUSER} -p${MYTHPASS} -e "select starttime from jobqueue where jobqueue.id=$JOB;" $MYTHDB | tail -n +2`
+
    <fontdef name="basesmall_disabled_selected" from="basesmallbold">
echo >>$LOGFILE "channel callsign is $CALLSIGN"
+
-       <color>#888888</color>
echo >>$LOGFILE "chanid=$CHANID STARTTIME=$STARTTIME"
+
+        <color>#aaaaaa</color>
BASENAME=`mysql -h${MYTHHOST} -u${MYTHUSER} -p${MYTHPASS} -e "select recorded.basename from recorded join jobqueue where jobqueue.id=$JOB and jobqueue.chanid=recorded.chanid and jobqueue.starttime=recorded.starttime;" $MYTHDB | tail -n +2`
+
    </fontdef>
echo >>$LOGFILE "basename is $BASENAME"
+
    <fontdef name="basesmall_disabled" from="basesmall">
FILENAME=`ionice -c3 nice find ${RECORDINGSROOT} -name $BASENAME`
+
-       <color>#666666</color>
echo >>$LOGFILE "filename is $FILENAME"
+
+       <color>#888888</color>
 
+
    </fontdef>
#safe list
+
    <fontdef name="basesmall_running_selected" from="basesmallbold">
# if [ "$CALLSIGN" = "Film4" -o "$CALLSIGN" = "ITV1" -o "$CALLSIGN" = "ITV1 +1" -o "$CALLSIGN" = "ITV2" -o "$CALLSIGN" = "ITV2 +1" -o "$CALLSIGN" = "ITV3" -o "$CALLSIGN" = "ITV4" -o "$CALLSIGN" = "Dave" -o "$CALLSIGN" = "Dave ja vu" ]; then
+
        <color>#00FF00</color>
# Channel 4 channels seem to work too, but sometimes last cut is too long?
+
@@ -105,17 +105,17 @@
# if [ "$CALLSIGN" = "Channel 4" -o "$CALLSIGN" = "Channel 4+1" -o "$CALLSIGN" = "More 4" -o "$CALLSIGN" = "E4" -o "$CALLSIGN" = "E4+1" -o "$CALLSIGN" = "Film4" -o "$CALLSIGN" = "ITV1" -o "$CALLSIGN" = "ITV1 +1" -o "$CALLSIGN" = "ITV2" -o "$CALLSIGN" = "ITV2 +1" -o "$CALLSIGN" = "ITV3" -o "$CALLSIGN" = "ITV4" -o "$CALLSIGN" = "Dave" -o "$CALLSIGN" = "Dave ja vu" ]; then
+
        <color>#FFFFFF</color>
# if [ "$CALLSIGN" = "FIVE USA" -o "$CALLSIGN" = "FIVER" -o "$CALLSIGN" = "FIVE" -o "$CALLSIGN" = "Channel 4" -o "$CALLSIGN" = "Channel 4+1" -o "$CALLSIGN" = "More 4" -o "$CALLSIGN" = "E4" -o "$CALLSIGN" = "E4+1" -o "$CALLSIGN" = "Film4" -o "$CALLSIGN" = "ITV1" -o "$CALLSIGN" = "ITV1 +1" -o "$CALLSIGN" = "ITV2" -o "$CALLSIGN" = "ITV2 +1" -o "$CALLSIGN" = "ITV3" -o "$CALLSIGN" = "ITV4" -o "$CALLSIGN" = "Dave" -o "$CALLSIGN" = "Dave ja vu" ]; then
+
    </fontdef>
# Fails on FIVER and cuts almost entire recording. Works for other FIVE channels with caveat that they include news bulletins which are't cut
+
    <fontdef name="basesmall_disabled_button" from="basesmallbold">
if [ "$CALLSIGN" = "QUEST" -o "$CALLSIGN" = "FIVE USA" -o "$CALLSIGN" = "FIVE" -o "$CALLSIGN" = "Channel 4" -o "$CALLSIGN" = "Channel 4+1" -o "$CALLSIGN" = "More 4" -o "$CALLSIGN" = "E4" -o "$CALLSIGN" = "E4+1" -o "$CALLSIGN" = "Film4" -o "$CALLSIGN" = "ITV1" -o "$CALLSIGN" = "ITV1 +1" -o "$CALLSIGN" = "ITV2" -o "$CALLSIGN" = "ITV2 +1" -o "$CALLSIGN" = "ITV3" -o "$CALLSIGN" = "ITV4" -o "$CALLSIGN" = "Dave" -o "$CALLSIGN" = "Dave ja vu" ]; then
+
-       <color>#9999cc</color>
echo >>$LOGFILE "Callsign in whitelist - will run silence_detect"
+
+       <color>#ccccff</color>
mysql -h${MYTHHOST} -u${MYTHUSER} -p${MYTHPASS} -e "update recorded set commflagged=2 where chanid=$CHANID and starttime='${STARTTIME}';" $MYTHDB
+
    </fontdef>
CUTLIST=""
+
    <!-- State variations on medium font -->
echo >>$LOGFILE "silence_detect $FILENAME"
+
    <fontdef name="basemedium_normal" from="basemediumbold">
silence_detect $FILENAME
+
-       <color>#9999cc</color>
echo >>$LOGFILE "silect_detect() set CUTLIST to $CUTLIST"
+
+        <color>#ccccff</color>
let BREAKS=`echo "$CUTLIST"|wc -l`/2
+
    </fontdef>
echo >>$LOGFILE "$BREAKS break(s) found."
+
    <fontdef name="basemedium_normal_selected" from="basemedium">
# mythcommflag --setcutlist $CUTLIST -f $FILENAME
+
        <color>#FFFFFF</color>
mysql -h${MYTHHOST} -u${MYTHUSER} -p${MYTHPASS} -e "$CUTLIST" $MYTHDB
+
    </fontdef>
RC=$?
+
    <fontdef name="basemedium_disabled" from="basemedium">
# echo "mythcommflag --setcutlist returned $RC"
+
-       <color>#666666</color>
echo >>$LOGFILE "mysql setskiplist returned $RC"
+
+        <color>#888888</color>
if [ $RC -eq 0 ]; then
+
    </fontdef>
mysql -h${MYTHHOST} -u${MYTHUSER} -p${MYTHPASS} -e "update recorded set commflagged=1 where chanid=$CHANID and starttime='${STARTTIME}';" ${MYTHDB}
+
    <fontdef name="basemedium_highlight" from="basemediumbold">
mysql -h${MYTHHOST} -u${MYTHUSER} -p${MYTHPASS} -e "update jobqueue set status=272, comment='Finished, $BREAKS break(s) found.' where id=$JOB;" ${MYTHDB}
+
        <color>#FFFF33</color>
if [ $COPYTOCUTLIST -eq 1 ]; then
+
@@ -127,17 +127,17 @@
mythcommflag --gencutlist -f $FILENAME
+
        <color>#FFFFFF</color>
RC=$?
+
    </fontdef>
if [ $RC -eq 0 ]; then
+
    <fontdef name="basemedium_disabled_button" from="basemediumbold">
echo >>$LOGFILE "mythcommflag --gencutlist successfully copied skip list to cut list"
+
-       <color>#9999cc</color>
else
+
+        <color>#ccccff</color>
echo >>$LOGFILE "mythcommflag --gencutlist failed, returned $RC"
+
    </fontdef>
fi
+
fi
+
    <!-- Fonts for specific screens -->
else
+
    <fontdef name="deleterecordings_filesize_font" from="basemedium">
echo >>$LOGFILE "mythcommflag failed; returned $RC"
+
-        <pixelsize>40</pixelsize>
mysql -h${MYTHHOST} -u${MYTHUSER} -p${MYTHPASS} -e "update recorded set commflagged=0 where chanid=$CHANID and starttime='${STARTTIME}';" ${MYTHDB}
+
+        <pixelsize>34</pixelsize>
fi
+
        <color>#bbbb33</color>
else
+
        <weight>bold</weight>
# Not a whitelisted channel for silence_detect
+
    </fontdef>
echo >>$LOGFILE "won't run silence-detect, running mythcommflag.fedora $*"
+
    <fontdef name="baseguide" from="basesmall">
exec mythcommflag.fedora $*
+
-        <pixelsize>20</pixelsize>
exit $?
+
+        <pixelsize>18</pixelsize>
fi
+
        <weight>normal</weight>
fi
+
    </fontdef>
echo >>$LOGFILE
 
</pre></code>
 
 
 
The maintained version of this script can be found at [http://www.mythtv.org/wiki/Mythcommflag-wrapper]. It uses silence detection to perform commflagging, which works quite well for certain UK stations.
 
 
 
==== Patch MythArchive's mythburn.py script ====
 
<code><pre>
 
--- /usr/share/mythtv/mytharchive.fedora-0.24-ajb3.fc14-20110126/scripts/mythburn.py 2011-01-12 23:34:28.000000000 +0000
 
+++ /usr/share/mythtv/mytharchive/scripts/mythburn.py 2011-02-12 19:56:44.000000000 +0000
 
@@ -54,7 +54,8 @@
 
debug_secondrunthrough = False
 
 
   
 
   
# default encoding profile to use
+
@@ -1063,7 +1063,7 @@
-defaultEncodingProfile = "SP"
+
                    <shape name="background">
+# defaultEncodingProfile = "SP"
+
                        <area>0,0,166,106</area>
+defaultEncodingProfile = "NONE"
+
                        <fill style="gradient">
 +
-                           <gradient start="#999999" end="#666666" alpha="220" />
 +
+                           <gradient start="#999999" end="#888888" alpha="220" />
 +
                        </fill>
 +
                    </shape>
 +
                </state>
 +
@@ -1126,19 +1126,19 @@
 
   
 
   
# add audio sync offset when re-muxing
+
        <fontdef name="medium" face="Droid Sans">
useSyncOffset = True
+
            <color>#FFFFFF</color>
@@ -485,19 +486,22 @@
+
-           <pixelsize>26</pixelsize>
 +
+            <pixelsize>23</pixelsize>
 +
            <weight>bold</weight>
 +
        </fontdef>
 
   
 
   
     totalframes=int(musiclength * framespersecond)
+
        <fontdef name="large" face="Liberation Sans">
 +
              <color>#FFFFFF</color>
 +
-            <pixelsize>28</pixelsize>
 +
+            <pixelsize>25</pixelsize>
 +
              <weight>bold</weight>
 +
        </fontdef>
 +
 +
        <fontdef name="clock" face="Liberation Sans">
 +
              <color>#FFFFFF</color>
 +
-            <pixelsize>26</pixelsize>
 +
+            <pixelsize>23</pixelsize>
 +
              <weight>bold</weight>
 +
        </fontdef>
 +
     </window>
 +
diff -ur MythCenter-wide.fedora/menu-ui.xml ajb-MythCenter-wide/menu-ui.xml
 +
--- MythCenter-wide.fedora/menu-ui.xml 2011-01-12 23:35:27.000000000 +0000
 +
+++ ajb-MythCenter-wide/menu-ui.xml 2011-01-16 20:15:46.000000000 +0000
 +
@@ -7,7 +7,7 @@
 
   
 
   
-    command = path_jpeg2yuv[0] + " -n %s -v0 -I p -f %s -j '%s' | %s -b 5000 -a %s -v 1 -f 8 -o '%s'" \
+
        <fontdef name="menufont" face="Liberation Sans">
+    command = "ionice -c3 nice "
+
            <color>#FFFFFF</color>
+   command += path_jpeg2yuv[0] + " -n %s -v0 -I p -f %s -j '%s' | %s -b 5000 -a %s -v 1 -f 8 -o '%s'" \
+
-           <pixelsize>30</pixelsize>
              % (totalframes, framespersecond, background, path_mpeg2enc[0], aspectratio, tempvideo)
+
+           <pixelsize>26</pixelsize>
    result = runCommand(command)
+
            <weight>bold</weight>
    if result<>0:
+
            <shadowcolor>#000000</shadowcolor>
        fatalError("Failed while running jpeg2yuv - %s" % command)
+
            <shadowoffset>2,2</shadowoffset>
 +
@@ -15,7 +15,7 @@
 +
        </fontdef>
 
   
 
   
-    command = path_mplex[0] + " -f 8 -v 0 -o '%s' '%s' '%s'" % (tempmovie, tempvideo, music)
+
        <fontdef name="clock" from="small">
+    command = "ionice -c3 nice "
+
-           <pixelsize>28</pixelsize>
+    command += path_mplex[0] + " -f 8 -v 0 -o '%s' '%s' '%s'" % (tempmovie, tempvideo, music)
+
+            <pixelsize>25</pixelsize>
    result = runCommand(command)
+
         </fontdef>
    if result<>0:
 
         fatalError("Failed while running mplex - %s" % command)
 
 
   
 
   
    if xmlfile != "":
+
        <clock name="clock">
-        command = path_spumux[0] + " -m dvd -s 0 '%s' < '%s' > '%s'" % (xmlfile, tempmovie, finaloutput)
+
diff -ur MythCenter-wide.fedora/osd.xml ajb-MythCenter-wide/osd.xml
+        command = "ionice -c3 nice "
+
--- MythCenter-wide.fedora/osd.xml 2011-01-12 23:34:29.000000000 +0000
+        command += path_spumux[0] + " -m dvd -s 0 '%s' < '%s' > '%s'" % (xmlfile, tempmovie, finaloutput)
+
+++ ajb-MythCenter-wide/osd.xml 2011-01-16 20:15:46.000000000 +0000
        result = runCommand(command)
+
@@ -5,14 +5,14 @@
        if result<>0:
 
            fatalError("Failed while running spumux - %s" % command)
 
@@ -1877,7 +1881,8 @@
 
        result=os.spawnlp(mode, path_mplex[0], path_mplex[1],
 
                    '-M',
 
                    '-f', '8',
 
-                   '-v', '0',
 
+                    '-v', '1',
 
+                    '-b', '500', '-r', '16000',
 
                    '--sync-offset', '%sms' % syncOffset,
 
                    '-o', destination,
 
                    video,
 
@@ -1887,7 +1892,8 @@
 
        result=os.spawnlp(mode, path_mplex[0], path_mplex[1],
 
                    '-M',
 
                    '-f', '8',
 
-                    '-v', '0',
 
+                   '-v', '1',
 
+                   '-b', '500', '-r', '16000',
 
                    '--sync-offset', '%sms' % syncOffset,
 
                    '-o', destination,
 
                    video,
 
@@ -1910,7 +1916,8 @@
 
            fatalError("Failed while running testsubtitlepngs.sh - %s" % command)
 
 
   
 
   
         write("Running spumux to add subtitles")
+
    <window name="program_info">
-       command = path_spumux[0] + " -P %s/stream.d/spumux.xml <%s >%s" % (os.path.dirname(destination), destination, os.path.splitext(destination)[0] + "-sub.mpg")
+
         <fontdef name="small" face="Droid Sans">
+       command = "ionice -c3 nice "      
+
-           <pixelsize>22</pixelsize>
+        command += path_spumux[0] + " -P %s/stream.d/spumux.xml <%s >%s" % (os.path.dirname(destination), destination, os.path.splitext(destination)[0] + "-sub.mpg")
+
+           <pixelsize>20</pixelsize>
         result = runCommand(command)
+
            <color>#EEEEEE</color>
         if result<>0:
+
        </fontdef>
            nonfatalError("Failed while running spumux.\n"
+
        <fontdef name="medium" from="small">
@@ -1929,7 +1936,8 @@
+
-           <pixelsize>28</pixelsize>
def getStreamInformation(filename, xmlFilename, lenMethod):
+
+           <pixelsize>25</pixelsize>
    """create a stream.xml file for filename"""
+
        </fontdef>
    filename = quoteFilename(filename)
+
        <fontdef name="large" from="small">
-    command = "mytharchivehelper -i %s %s %d" % (filename, xmlFilename, lenMethod)
+
-           <pixelsize>34</pixelsize>
+    command = "ionice -c3 nice "   
+
+            <pixelsize>28</pixelsize>
+    command += "mytharchivehelper -i %s %s %d" % (filename, xmlFilename, lenMethod)
+
            <weight>bold</weight>
 +
         </fontdef>
 +
         <area>50,0,1180,720</area>
 +
@@ -130,7 +130,7 @@
 
   
 
   
     result = runCommand(command)
+
     <window name="osd_status">
 +
        <fontdef name="medium" face="Droid Sans">
 +
-            <pixelsize>28</pixelsize>
 +
+            <pixelsize>25</pixelsize>
 +
            <color>#EEEEEE</color>
 +
            <weight>bold</weight>
 +
        </fontdef>
 +
@@ -177,15 +177,15 @@
 
   
 
   
@@ -1972,15 +1980,16 @@
+
    <window name="browse_info">
 +
        <fontdef name="small" face="Droid Sans">
 +
-            <pixelsize>22</pixelsize>
 +
+            <pixelsize>20</pixelsize>
 +
            <color>#EEEEEE</color>
 +
        </fontdef>
 +
        <fontdef name="medium" from="small">
 +
-            <pixelsize>28</pixelsize>
 +
+            <pixelsize>25</pixelsize>
 +
            <weight>bold</weight>
 +
        </fontdef>
 +
        <fontdef name="large" from="medium">
 +
-            <pixelsize>34</pixelsize>
 +
+            <pixelsize>28</pixelsize>
 +
        </fontdef>
 +
        <area>50,520,1180,100</area>
 +
        <imagetype name="background1">
 +
@@ -226,7 +226,7 @@
 
   
 
   
     if localfile != "":
+
     <window name="osd_input">
         localfile = quoteFilename(localfile)
+
         <fontdef name="medium" face="Droid Sans">
-        if usecutlist == True:
+
-            <pixelsize>28</pixelsize>
-            command = "mythtranscode --mpeg2 --honorcutlist -i %s -o %s" % (localfile, destination)
+
+            <pixelsize>25</pixelsize>
+        command = "ionice -c3 nice "      
+
            <color>#EEEEEE</color>
+        if usecutlist == True:       
+
            <weight>bold</weight>
+            command += "mythtranscode --mpeg2 --honorcutlist -i %s -o %s" % (localfile, destination)
+
         </fontdef>
        else:
+
@@ -244,7 +244,7 @@
-            command = "mythtranscode --mpeg2 -i %s -o %s" % (localfile, destination)
 
+            command += "mythtranscode --mpeg2 -i %s -o %s" % (localfile, destination)
 
    else:
 
        if usecutlist == True:
 
-            command = "mythtranscode --mpeg2 --honorcutlist -c %s -s %s -o %s" % (chanid, starttime, destination)
 
+            command += "mythtranscode --mpeg2 --honorcutlist -c %s -s %s -o %s" % (chanid, starttime, destination)
 
         else:
 
-           command = "mythtranscode --mpeg2 -c %s -s %s -o %s" % (chanid, starttime, destination)
 
+            command += "mythtranscode --mpeg2 -c %s -s %s -o %s" % (chanid, starttime, destination)
 
 
   
 
   
     result = runCommand(command)
+
     <window name="osd_message">
 +
        <fontdef name="medium" face="Droid Sans">
 +
-            <pixelsize>28</pixelsize>
 +
+            <pixelsize>25</pixelsize>
 +
            <color>#EEEEEE</color>
 +
            <weight>bold</weight>
 +
        </fontdef>
 +
@@ -262,7 +262,7 @@
 
   
 
   
@@ -1995,7 +2004,7 @@
+
    <window name="MythPopupBox">
#############################################################
+
        <fontdef name="basesmall" face="Droid Sans">
# Create a projectX cut list for a recording
+
-            <pixelsize>22</pixelsize>
 +
+            <pixelsize>20</pixelsize>
 +
            <color>#EEEEEE</color>
 +
            <weight>bold</weight>
 +
        </fontdef>
 +
@@ -384,7 +384,7 @@
 
   
 
   
-def generateProjectXCutlist(chanid, starttime, folder):
+
     <window name="osd_program_editor">
+def originalgenerateProjectXCutlist(chanid, starttime, folder):
+
        <fontdef name="medium" face="Droid Sans">
     """generate cutlist_x.txt for ProjectX"""
+
-            <pixelsize>28</pixelsize>
 +
+            <pixelsize>25</pixelsize>
 +
            <color>#EEEEEE</color>
 +
            <weight>bold</weight>
 +
        </fontdef>
 +
@@ -450,7 +450,7 @@
 
   
 
   
     sqlstatement = """SELECT mark FROM recordedmarkup
+
     <window name="ChannelEditor">
@@ -2031,6 +2040,59 @@
+
        <fontdef name="basesmall" face="Droid Sans">
 +
-            <pixelsize>22</pixelsize>
 +
+            <pixelsize>20</pixelsize>
 +
            <color>#EEEEEE</color>
 +
            <weight>bold</weight>
 +
        </fontdef>
 +
diff -ur MythCenter-wide.fedora/themeinfo.xml ajb-MythCenter-wide/themeinfo.xml
 +
--- MythCenter-wide.fedora/themeinfo.xml 2011-01-12 23:34:29.000000000 +0000
 +
+++ ajb-MythCenter-wide/themeinfo.xml 2011-01-16 20:15:46.000000000 +0000
 +
@@ -1,7 +1,7 @@
 +
<?xml version="1.0" encoding="utf-8"?>
 +
<themeinfo>
 +
    <!-- The Theme Name (Required) -->
 +
-    <name>MythCenter-wide</name>
 +
+    <name>ajb-MythCenter-wide</name>
 +
   
 +
    <!-- The Theme Types (Required) -->
 +
    <types>
 +
diff -ur MythCenter-wide.fedora/welcome-ui.xml ajb-MythCenter-wide/welcome-ui.xml
 +
--- MythCenter-wide.fedora/welcome-ui.xml 2011-01-12 23:34:29.000000000 +0000
 +
+++ ajb-MythCenter-wide/welcome-ui.xml 2011-01-16 20:15:46.000000000 +0000
 +
@@ -9,7 +9,7 @@
 +
        -->
 +
        <fontdef name="title" from="baselarge">
 +
            <color>#ffff00</color>
 +
-            <pixelsize>34</pixelsize>
 +
+            <pixelsize>28</pixelsize>
 +
            <shadowcolor>#000000</shadowcolor>
 +
            <shadowoffset>2,2</shadowoffset>
 +
            <weight>bold</weight>
 +
@@ -17,13 +17,13 @@
 
   
 
   
    return True
+
        <fontdef name="time" from="basesmall">
 +
            <color>#9999cc</color>
 +
-            <pixelsize>20</pixelsize>
 +
+            <pixelsize>18</pixelsize>
 +
            <weight>bold</weight>
 +
        </fontdef>
 
   
 
   
+# AJB modified using
+
        <fontdef name="label" from="basesmall">
+# http://code.mythtv.org/trac/raw-attachment/ticket/9389/cutlisttrans.txt
+
            <color>#ffff00</color>
+# for 0.24-fixes
+
-           <pixelsize>26</pixelsize>
+def generateProjectXCutlist(chanid, starttime, folder):
+
+            <pixelsize>23</pixelsize>
+    """generate cutlist_x.txt for ProjectX"""
+
            <shadowcolor>#000000</shadowcolor>
+
+
            <shadowoffset>2,2</shadowoffset>
+    sqlstatement = """SELECT mark FROM recordedmarkup
+
            <weight>bold</weight>
+                    WHERE chanid = '%s' AND starttime = '%s'
+
@@ -31,13 +31,13 @@
+                    AND type IN (0,1) ORDER BY mark""" % (chanid, starttime)
+
   
+
+
        <fontdef name="info" from="basesmall">
+    db = getDatabaseConnection()
+
            <color>#ffffff</color>
+   cursor = db.cursor()
+
-            <pixelsize>22</pixelsize>
+    cursor.execute(sqlstatement)
+
+           <pixelsize>20</pixelsize>
+    result = cursor.fetchall()
+
            <weight>bold</weight>
+    numrows = int(cursor.rowcount)
+
        </fontdef>
+
+
+    #We must have at least one row returned for this recording
+
        <fontdef name="warning" from="basesmall">
+    if numrows==0:
+
            <color>#ff0000</color>
+        write("No cutlist in the DB for chanid %s, starttime %s" % chanid, starttime)
+
-            <pixelsize>22</pixelsize>
+       db.close()
+
+           <pixelsize>20</pixelsize>
+        del db
+
            <shadowcolor>#000000</shadowcolor>
+        del cursor
+
            <shadowoffset>2,2</shadowoffset>
+        return False 
+
            <weight>bold</weight>
+
+
@@ -45,7 +45,7 @@
+    sqlstatement = """SELECT mark FROM recordedmarkup
+
   
+                    WHERE chanid = '%s' AND starttime = '%s'
+
        <fontdef name="buttons" from="basesmall">
+                    AND type=1 ORDER BY mark LIMIT 1 """ % (chanid, starttime)
+
            <color>#ffff00</color>
+
+
-            <pixelsize>20</pixelsize>
+    cursor.execute(sqlstatement)
+
+           <pixelsize>18</pixelsize>
+    firstcut = cursor.fetchall() 
+
            <weight>bold</weight>
+
+
        </fontdef>
+    sqlstatement  = """SELECT mark FROM recordedmarkup
+
+                    WHERE chanid = '%s' AND starttime = '%s'
+
diff -ur MythCenter-wide.fedora/zoneminder-ui.xml ajb-MythCenter-wide/zoneminder-ui.xml
+                    AND type IN (0,1) ORDER BY mark LIMIT 1 """ % (chanid, starttime)
+
--- MythCenter-wide.fedora/zoneminder-ui.xml 2011-01-12 23:35:27.000000000 +0000
+
+
+++ ajb-MythCenter-wide/zoneminder-ui.xml 2011-01-16 20:15:46.000000000 +0000
+    cursor.execute(sqlstatement)
+
@@ -56,7 +56,7 @@
+    firstedit = cursor.fetchall()
 
+
 
+    cutlist_f=open(os.path.join(folder, "cutlist_x.txt"), 'w')
 
+    cutlist_f.write("CollectionPanel.CutMode=2\n")
 
+
 
+    if firstcut == firstedit:
 
+         cutlist_f.write("0\n")
 
+
 
+   # iterate through resultset
 
+   for i in range(len(result)):
 
+        if result[i][0] != "" and result[i][0] <> 0:
 
+            cutlist_f.write("%d\n" % result[i])
 
+
 
+    cutlist_f.close()
 
+
 
+   return True
 
+
 
 
   
 
   
#############################################################
+
        <fontdef name="running" from="basesmall">
# Use Project-X to cut commercials and/or demux an mpeg2 file
+
            <color>#00ff00</color>
@@ -2055,7 +2117,8 @@
+
-           <size>16</size>
    qfile = quoteFilename(file)
+
+           <size>17</size>
    qcutlist = os.path.join(folder, "cutlist_x.txt")
+
        </fontdef>
 
   
 
   
-    command = path_projectx[0] + " -id %s" % getStreamList(folder)
+
        <fontdef name="stopped" from="running">
+    command = "ionice -c3 nice "
+
@@ -65,7 +65,7 @@
+    command += path_projectx[0] + " -id %s" % getStreamList(folder)
 
    if usecutlist == True:
 
        command += " -cut %s -out %s -name %s %s" % (qcutlist, qdestdir, qpxbasename, qfile)
 
    else:
 
@@ -2080,7 +2143,8 @@
 
        if (os.path.exists(os.path.join(folder, "stream.sup")) and
 
            os.path.exists(os.path.join(folder, "stream.sup.IFO"))):
 
            write("Found DVB subtitles converting to DVD subtitles")
 
-            command = "mytharchivehelper --sup2dast "
 
+            command = "ionice -c3 nice "
 
+            command += "mytharchivehelper --sup2dast "
 
            command += " %s %s 0" % (os.path.join(folder, "stream.sup"), os.path.join(folder, "stream.sup.IFO"))
 
 
   
 
   
             result = runCommand(command)
+
        <fontdef name="footer" from="basesmall">
@@ -2289,7 +2353,8 @@
+
             <color>#ffffff</color>
 +
-           <size>16</size>
 +
+           <size>17</size>
 +
        </fontdef>
 
   
 
   
         source = quoteFilename(source)
+
         <fontdef name="info" from="basesmall">
 +
@@ -249,19 +249,19 @@
 
   
 
   
-        command = "mytharchivehelper -t  %s '%s' %s" % (source, seconds, destination)
+
        <fontdef name="active" from="basesmall">
+        command = "ionice -c3 nice "
+
            <color>#ffffff</color>
+        command += "mytharchivehelper -t  %s '%s' %s" % (source, seconds, destination)
+
-           <size>18</size>
        result = runCommand(command)
+
+            <size>17</size>
        if result <> 0:
+
             <weight>bold</weight>
             fatalError("Failed while running mytharchivehelper to get thumbnails.\n"
+
        </fontdef>
@@ -2314,7 +2379,8 @@
 
 
   
 
   
    source = quoteFilename(source)
+
        <fontdef name="inactive" from="basesmall">
 +
            <color>#9999cc</color>
 +
-            <size>18</size>
 +
+            <size>17</size>
 +
            <weight>bold</weight>
 +
        </fontdef>
 
   
 
   
-    command = "mytharchivehelper -v important -t %s '%s' %s" % (source, thumbList, destination)
+
        <fontdef name="selected" from="basesmall">
+    command = "ionice -c3 nice "
+
            <color>#00ff00</color>
+    command += "mytharchivehelper -v important -t %s '%s' %s" % (source, thumbList, destination)
+
-           <size>18</size>
    result = runCommand(command)
+
+            <size>17</size>
    if result <> 0:
+
            <weight>bold</weight>
         fatalError("Failed while running mytharchivehelper to get thumbnails")
+
         </fontdef>
@@ -2329,7 +2395,8 @@
 
 
   
 
   
    passes = int(getText(profileNode.getElementsByTagName("passes")[0]))
+
@@ -272,12 +272,12 @@
 +
 +
        <fontdef name="description" from="basesmall">
 +
            <color>#ffffff</color>
 +
-            <size>18</size>
 +
+            <size>17</size>
 +
        </fontdef>
 
   
 
   
-    command = path_ffmpeg[0]
+
        <fontdef name="label" from="basesmall">
+    command = "ionice -c3 nice "
+
            <color>#ffff00</color>
+   command += path_ffmpeg[0]
+
-           <size>16</size>
 +
+           <size>17</size>
 +
            <weight>bold</weight>
 +
        </fontdef>
 
   
 
   
    if cpuCount > 1:
+
@@ -654,7 +654,7 @@
        command += " -threads %d" % cpuCount
 
@@ -2515,7 +2582,8 @@
 
    samplerate, channels = getAudioParams(folder)
 
    videores, fps, aspectratio = getVideoParams(folder)
 
 
   
 
   
-    command = path_ffmpeg[0] + " -y "
+
        <font name="label" from="basesmall">
+    command = "ionice -c3 nice "
+
            <color>#ffff00</color>
+   command +=  path_ffmpeg[0] + " -y "
+
-           <size>16</size>
 +
+           <size>17</size>
 +
            <weight>bold</weight>
 +
        </font>
 
   
 
   
    if cpuCount > 1:
+
@@ -776,22 +776,22 @@
        command += "-threads %d " % cpuCount
 
@@ -2567,7 +2635,8 @@
 
def CreateDVDISO(title):
 
    write("Creating ISO image")
 
    checkCancelFlag()
 
-    command = path_mkisofs[0] + ' -dvd-video '
 
+    command = "ionice -c3 nice "
 
+    command += path_mkisofs[0] + ' -dvd-video '
 
    command += ' -V ' + quoteFilename(title)
 
    command += ' -o ' + os.path.join(getTempPath(), 'mythburn.iso')
 
    command += " " + os.path.join(getTempPath(),'dvd')
 
@@ -2669,7 +2738,8 @@
 
def deMultiplexMPEG2File(folder, mediafile, video, audio1, audio2):
 
 
   
 
   
    if getFileType(folder) == "mpegts":
+
        <fontdef name="monitor" from="basesmall">
-        command = "mythreplex --demux --fix_sync -t TS -o %s " % (folder + "/stream")
+
            <color>#ffff00</color>
+        command = "ionice -c3 nice "   
+
-           <size>16</size>
+       command += "mythreplex --demux --fix_sync -t TS -o %s " % (folder + "/stream")
+
+           <size>17</size>
         command += "-v %d " % (video[VIDEO_ID])
+
         </fontdef>
 
   
 
   
         if audio1[AUDIO_ID] != -1:
+
         <fontdef name="idle" from="basesmall">
@@ -2689,7 +2759,8 @@
+
            <color>#ffff00</color>
                command += "-c %d " % (audio2[AUDIO_ID])
+
-           <size>16</size>
 +
+           <size>17</size>
 +
        </fontdef>
 
   
 
   
    else:
+
        <fontdef name="alarm" from="basesmall">
-        command = "mythreplex --demux --fix_sync -o %s " % (folder + "/stream")
+
            <color>#ff0000</color>
+        command = "ionice -c3 nice "   
+
-           <size>16</size>
+       command += "mythreplex --demux --fix_sync -o %s " % (folder + "/stream")
+
+           <size>17</size>
         command += "-v %d " % (video[VIDEO_ID] & 255)
+
         </fontdef>
 
   
 
   
         if audio1[AUDIO_ID] != -1:
+
         <fontdef name="alert" from="basesmall">
@@ -2726,7 +2797,8 @@
+
            <color>#ffa500</color>
    M2Vsize0 = os.path.getsize(source)
+
-           <size>16</size>
    write("Initial M2Vsize is %.2f Mb , target is %.2f Mb" % ( (float(M2Vsize0)/mega), (float(M2Vsize0)/(factor*mega)) ))
+
+           <size>17</size>
 +
        </fontdef>
 
   
 
   
-    command = path_M2VRequantiser[0] 
+
        <textarea name="pagetitle" from="basetextarea">
+    command = "ionice -c3 nice "
+
</pre></code>
+    command += path_M2VRequantiser[0]  
+
 
    command += " %.5f "  % factor
+
=== dgen-SDL joystick patch ===
    command += " %s "  % M2Vsize0
+
This patch (originally from [http://jedi.3322.org/jedi/EMUGAME-HOWTO/dgen-sdl-1.23-jsmap.patch http://jedi.3322.org/jedi/EMUGAME-HOWTO/dgen-sdl-1.23-jsmap.patch] - archived by the Wayback Machine [http://web.archive.org/web/20050411234354/http://jedi.3322.org/jedi/EMUGAME-HOWTO/dgen-sdl-1.23-jsmap.patch here]) allows dgen-SDL to use joysticks, with configurable mappings:
    command += " <  %s " % source
+
 
@@ -3501,7 +3573,8 @@
+
<code><pre>
                height = getScaledAttribute(node, "h")
+
diff -ruN dgen-sdl-1.23/rc.cpp dgen-sdl-1.23-new/rc.cpp
                frames = int(secondsToFrames(menulength))
+
--- dgen-sdl-1.23/rc.cpp 2001-07-03 03:59:39.000000000 +0800
 +
+++ dgen-sdl-1.23-new/rc.cpp 2003-06-27 19:09:55.000000000 +0800
 +
@@ -166,6 +166,7 @@
 +
/* Define all the external RC variables */
 +
#include "rc-vars.h"
 
   
 
   
-               command = "mytharchivehelper -t  %s '%s' '%s' %d" % (inputfile, starttime, outputfile, frames)
+
+/*
+               command = "ionice -c3 nice "
+
long js_map_button[2][16] = {
+               command += "mytharchivehelper -t %s '%s' '%s' %d" % (inputfile, starttime, outputfile, frames)
+
    {
                result = runCommand(command)
+
MD_A_MASK, MD_C_MASK, MD_A_MASK,
                if (result != 0):
+
@@ -180,6 +181,7 @@
                    write( "mytharchivehelper failed with code %d. Command = %s" % (result, command) )
+
MD_MODE_MASK, 0, 0, 0, 0, 0, 0
 +
    }
 +
};
 +
+*/
 +
 +
/* Parse a keysym.
 +
  * If the string matches one of the strings in the keysym table above,
 +
@@ -236,6 +238,7 @@
 +
 +
// Made GCC happy about unused things when we don't want a joystick.  :) [PKH]
 +
  // Cheesy hack to set joystick mappings from the RC file. [PKH]
 +
+/*
 +
static long jsmap(const char *value) {
 +
  if(!strcasecmp(value, "mode"))
 +
    snprintf((char*)value, 2, "%c", 'm');
 +
@@ -278,6 +281,41 @@
 +
    return(0);
 +
    }
 +
}
 +
+*/
 +
+
 +
+/**
 +
+  Jedi change the joystick axis/button mapping format in RC file.
 +
+  I'v try my best to fit joy-event with long return value.
 +
+*/
 +
+
 +
+static long joyaxisval (const char *value)
 +
+{
 +
+ JoyAxisValue jav;
 +
+ int j,a,v;
 +
+
 +
+ if (sscanf (value, "j%da%d(%d)", &j, &a, &v) != 3) {
 +
+ return -1;
 +
+ } else {
 +
+ jav.jae.which = j;
 +
+ jav.jae.axis = a;
 +
+ jav.jae.value = v;
 +
+ return jav.lv;
 +
+ }
 +
+}
 +
+
 +
+static long joybtnval (const char *value)
 +
+{
 +
+ JoyButtonValue jbv;
 +
+ int j,b;
 +
+
 +
+ if (sscanf (value, "j%db%d", &j, &b) != 2) {
 +
+ return -1;
 +
+ } else {
 +
+ jbv.jbe.which = j;
 +
+ jbv.jbe.button = b;
 +
+ return jbv.lv;
 +
+ }
 +
+}
 +
 +
/* Parse the CTV type. As new CTV filters get submitted expect this to grow ;)
 +
  * Current values are:
 +
@@ -366,6 +404,31 @@
 +
  { "int_opengl_width", number, &dgen_opengl_width },
 +
  { "int_opengl_height", number, &dgen_opengl_height },
 +
  { "bool_joystick", boolean, &dgen_joystick },
 +
+  { "joy_pad1_up", joyaxisval, &(joypad1_up.lv)},
 +
+  { "joy_pad1_down", joyaxisval, &(joypad1_down.lv)},
 +
+  { "joy_pad1_left", joyaxisval, &(joypad1_left.lv)},
 +
+  { "joy_pad1_right", joyaxisval, &(joypad1_right.lv)},
 +
+  { "joy_pad1_a", joybtnval, &(joypad1_a.lv)},
 +
+  { "joy_pad1_b", joybtnval, &(joypad1_b.lv)},
 +
+  { "joy_pad1_c", joybtnval, &(joypad1_c.lv)},
 +
+  { "joy_pad1_x", joybtnval, &(joypad1_x.lv)},
 +
+  { "joy_pad1_y", joybtnval, &(joypad1_y.lv)},
 +
+  { "joy_pad1_z", joybtnval, &(joypad1_z.lv)},
 +
+  { "joy_pad1_mode", joybtnval, &(joypad1_mode.lv)},
 +
+  { "joy_pad1_start", joybtnval, &(joypad1_start.lv)},
 +
+  { "joy_pad2_up", joyaxisval, &(joypad2_up.lv)},
 +
+  { "joy_pad2_down", joyaxisval, &(joypad2_down.lv)},
 +
+  { "joy_pad2_left", joyaxisval, &(joypad2_left.lv)},
 +
+ { "joy_pad2_right", joyaxisval, &(joypad2_right.lv)},
 +
+  { "joy_pad2_a", joybtnval, &(joypad2_a.lv)},
 +
+  { "joy_pad2_b", joybtnval, &(joypad2_b.lv)},
 +
+  { "joy_pad2_c", joybtnval, &(joypad2_c.lv)},
 +
+  { "joy_pad2_x", joybtnval, &(joypad2_x.lv)},
 +
+  { "joy_pad2_y", joybtnval, &(joypad2_y.lv)},
 +
+  { "joy_pad2_z", joybtnval, &(joypad2_z.lv)},
 +
+  { "joy_pad2_mode", joybtnval, &(joypad2_mode.lv)},
 +
+ { "joy_pad2_start", joybtnval, &(joypad2_start.lv)},
 +
+/*
 +
  { "joypad1_b0", jsmap, &js_map_button[0][0] },
 +
  { "joypad1_b1", jsmap, &js_map_button[0][1] },
 +
  { "joypad1_b2", jsmap, &js_map_button[0][2] },
 +
@@ -398,6 +461,7 @@
 +
  { "joypad2_b13", jsmap, &js_map_button[1][13] },
 +
  { "joypad2_b14", jsmap, &js_map_button[1][14] },
 +
  { "joypad2_b15", jsmap, &js_map_button[1][15] },
 +
+*/
 +
  { NULL, NULL, NULL } // Terminator
 +
};
 +
   
 +
@@ -444,7 +508,7 @@
 +
      do {
 +
if(!strcasecmp(s->fieldname, field))
 +
  {
 +
-     int potential;
 +
+     long potential;
 +
    potential = (*(s->parser))(value);
 +
    /* If we got a bad value, discard and warn user */
 +
    if(potential == -1)
 +
diff -ruN dgen-sdl-1.23/rc-vars.h dgen-sdl-1.23-new/rc-vars.h
 +
--- dgen-sdl-1.23/rc-vars.h 2001-07-03 03:20:30.000000000 +0800
 +
+++ dgen-sdl-1.23-new/rc-vars.h 2003-06-27 19:09:59.000000000 +0800
 +
@@ -10,8 +10,12 @@
 +
// Otherwise, we just declare them as externs
 +
#ifdef IS_MAIN_CPP
 +
#define RCVAR(name, def) long name = def
 +
+#define RCJAV(name, which, axis, value) JoyAxisValue name = {which, axis, value}
 +
+#define RCJBV(name, which, button) JoyButtonValue name = {which, button}
 +
#else
 +
#define RCVAR(name, def) extern long name
 +
+#define RCJAV(name, which, axis, value) extern JoyAxisValue name
 +
+#define RCJBV(name, which, button) extern JoyButtonValue name
 +
#endif
 +
 +
RCVAR(pad1_up, PDK_UP);
 +
@@ -84,4 +88,53 @@
 +
RCVAR(dgen_opengl_width, 640);
 +
RCVAR(dgen_opengl_height, 480);
 +
 +
+typedef struct {
 +
+ char which;
 +
+ char axis;
 +
+ signed short value;
 +
+} JoyAxisEvent;
 +
+
 +
+typedef union {
 +
+ JoyAxisEvent jae;
 +
+ long lv;
 +
+} JoyAxisValue;
 +
+
 +
+RCJAV(joypad1_up, 0, 1, -1);
 +
+RCJAV(joypad1_down, 0, 1, 1);
 +
+RCJAV(joypad1_left, 0, 0, -1);
 +
+RCJAV(joypad1_right, 0, 0, 1);
 +
+
 +
+RCJAV(joypad2_up, 1, 1, -1);
 +
+RCJAV(joypad2_down, 1, 1, 1);
 +
+RCJAV(joypad2_left, 1, 0, -1);
 +
+RCJAV(joypad2_right, 1,0,1);
 +
+
 +
+typedef struct {
 +
+ char which;
 +
+ char button;
 +
+} JoyButtonEvent;
 +
+
 +
+typedef union {
 +
+ JoyButtonEvent jbe;
 +
+ long lv;
 +
+} JoyButtonValue;
 +
+
 +
+RCJBV(joypad1_a, 0, 0);
 +
+RCJBV(joypad1_b, 0, 1);
 +
+RCJBV(joypad1_c, 0, 2);
 +
+RCJBV(joypad1_x, 0, 3);
 +
+RCJBV(joypad1_y, 0, 4);
 +
+RCJBV(joypad1_z, 0, 5);
 +
+RCJBV(joypad1_mode, 0, 6);
 +
+RCJBV(joypad1_start, 0, 7);
 +
+
 +
+RCJBV(joypad2_a, 1, 0);
 +
+RCJBV(joypad2_b, 1, 1);
 +
+RCJBV(joypad2_c, 1, 2);
 +
+RCJBV(joypad2_x, 1, 3);
 +
+RCJBV(joypad2_y, 1, 4);
 +
+RCJBV(joypad2_z, 1, 5);
 +
+RCJBV(joypad2_mode, 1, 6);
 +
+RCJBV(joypad2_start, 1, 7);
 +
+
 +
#endif // __RC_VARS_H__
 +
diff -ruN dgen-sdl-1.23/sample.dgenrc dgen-sdl-1.23-new/sample.dgenrc
 +
--- dgen-sdl-1.23/sample.dgenrc 2001-07-03 03:18:14.000000000 +0800
 +
+++ dgen-sdl-1.23-new/sample.dgenrc 2003-06-27 19:09:51.000000000 +0800
 +
@@ -36,6 +36,42 @@
 +
key_pad1_mode = backspace
 +
key_pad1_start = return
 +
 +
+# There are the new format joypad controls defination
 +
+# Joystick axis defination:
 +
+# j0a3(-16384)
 +
+#  | | ||
 +
+#  | | |+- joystick axis event filter value (from 1 to 32767).
 +
+#  | | +-- axis heading (positive/negative).
 +
+#  | +---- axis index (from 0 to 255).
 +
+#  +------ joystick index (from 0 to 255).
 +
+
 +
+# About the joystick axis event filter value:
 +
+                                                                               
 +
+# Usually, the joystick device has noise signals on axis buttons. The noise
 +
+# signals will disturb your normal play.To avoid this fucking story, you must
 +
+# set a value to the filter. Then if the absolute value of a event is not
 +
+# bigger than the filter, the engine will leave along this event.The value
 +
+# range you could set is from 1 to 32767.
 +
+
 +
+# Joystick button defination
 +
+# j0b3
 +
+#  | |
 +
+#  | +- button index (from 0 to 255).
 +
+#  +--- joystick index (from 0 to 255).
 +
+
 +
+joy_pad1_up = j0a1(-16384)
 +
+joy_pad1_down = j0a1(+16384)
 +
+joy_pad1_left = j0a0(-16384)
 +
+joy_pad1_right = j0a0(+16384)
 +
+joy_pad1_a = j0b3
 +
+joy_pad1_b = j0b0
 +
+joy_pad1_c = j0b1
 +
+joy_pad1_x = j0b2
 +
+joy_pad1_y = j0b6
 +
+joy_pad1_z = j0b7
 +
+joy_pad1_mode =j0b9
 +
+joy_pad1_start = j0b8
 +
+
 +
# The same for pad 2
 +
# Yes, I KNOW the default player 2 keys are awful. Pick your own!
 +
key_pad2_up = kp_up
 +
@@ -51,6 +87,19 @@
 +
key_pad2_mode = kp_plus
 +
key_pad2_start = kp_enter
 +
 +
+joy_pad2_up = j0a3(-16384)
 +
+joy_pad2_down = j0a3(+16384)
 +
+joy_pad2_left = j0a2(-16384)
 +
+joy_pad2_right = j0a2(+16384)
 +
+joy_pad2_a = j0b13
 +
+joy_pad2_b = j0b10
 +
+joy_pad2_c = j0b11
 +
+joy_pad2_x = j0b12
 +
+joy_pad2_y = j0b16
 +
+joy_pad2_z = j0b17
 +
+joy_pad2_mode =j0b19
 +
+joy_pad2_start = j0b18
 +
+
 +
# Fix checksum, needed by some games with Game Genie codes
 +
key_fix_checksum = f1
 +
 +
diff -ruN dgen-sdl-1.23/sdl/sdl.cpp dgen-sdl-1.23-new/sdl/sdl.cpp
 +
--- dgen-sdl-1.23/sdl/sdl.cpp 2001-07-03 05:36:49.000000000 +0800
 +
+++ dgen-sdl-1.23-new/sdl/sdl.cpp 2003-06-27 19:10:10.000000000 +0800
 +
@@ -749,6 +749,25 @@
 +
  return 1;
 +
}
 +
 +
+// JoyAxisEnent check, return 1 when it was the just event we expected
 +
+// and -1 means joystick-CENTER event, 0 means not match.
 +
+int jaeq (SDL_JoyAxisEvent sjae, JoyAxisValue jav)
 +
+{
 +
+ if (sjae.which == jav.jae.which
 +
+ && sjae.axis == jav.jae.axis
 +
+ && (sjae.value^jav.jae.value) >= 0) {
 +
+ return abs(sjae.value) >= abs(jav.jae.value) ? 1 : -1;
 +
+ } else {
 +
+ return 0;
 +
+ }
 +
+}
 +
+
 +
+int jbeq (SDL_JoyButtonEvent sjbe, JoyButtonValue jbv)
 +
+{
 +
+ return (sjbe.which == jbv.jbe.which
 +
+ && sjbe.button == jbv.jbe.button);
 +
+}
 +
+
 +
// The massive event handler!
 +
// I know this is an ugly beast, but please don't be discouraged. If you need
 +
// help, don't be afraid to ask me how something works. Basically, just handle
 +
@@ -772,6 +791,26 @@
 +
{
 +
#if SDL_JOYSTICK_SUPPORT
 +
        case SDL_JOYAXISMOTION:
 +
+        int baxis;
 +
+        if ((baxis=jaeq(event.jaxis, joypad1_up)) != 0) {
 +
+          baxis>0 ? (megad.pad[0] &= ~0x01,megad.pad[0] |=  0x02) : megad.pad[0] |= 0x3;
 +
+        } else if ((baxis=jaeq(event.jaxis, joypad1_down)) != 0) {
 +
+          baxis>0 ? (megad.pad[0] |=  0x01,megad.pad[0] &= ~0x02) : megad.pad[0] |= 0x3;
 +
+        } else if ((baxis=jaeq(event.jaxis, joypad1_left)) != 0) {
 +
+          baxis>0 ? (megad.pad[0] &= ~0x04,megad.pad[0] |=  0x08) : megad.pad[0] |= 0xC;
 +
+        } else if ((baxis=jaeq(event.jaxis, joypad1_right)) != 0) {
 +
+          baxis>0 ? (megad.pad[0] |=  0x04,megad.pad[0] &= ~0x08) : megad.pad[0] |= 0xC;
 +
+        } else if ((baxis=jaeq(event.jaxis, joypad2_up)) != 0) {
 +
+          baxis>0 ? (megad.pad[1] &= ~0x01,megad.pad[1] |=  0x02) : megad.pad[1] |= 0x3;
 +
+        } else if ((baxis=jaeq(event.jaxis, joypad2_down)) != 0) {
 +
+          baxis>0 ? (megad.pad[1] |=  0x01,megad.pad[1] &= ~0x02) : megad.pad[1] |= 0x3;
 +
+        } else if ((baxis=jaeq(event.jaxis, joypad2_left)) != 0) {
 +
+          baxis>0 ? (megad.pad[1] &= ~0x04,megad.pad[1] |=  0x08) : megad.pad[1] |= 0xC;
 +
+        } else if ((baxis=jaeq(event.jaxis, joypad2_right)) != 0) {
 +
+          baxis>0 ? (megad.pad[1] |=  0x04,megad.pad[1] &= ~0x08) : megad.pad[1] |= 0xC;
 +
+        }
 +
+        break;
 +
+/*
 +
          // x-axis
 +
          if(event.jaxis.axis == 0)
 +
            {
 +
@@ -809,18 +848,91 @@
 +
              break;
 +
            }
 +
          break;
 +
+*/
 +
        case SDL_JOYBUTTONDOWN:
 +
+        if (jbeq(event.jbutton, joypad1_a)) {
 +
+          megad.pad[0] &= ~0x1000;
 +
+        } else if (jbeq(event.jbutton, joypad1_b)) {
 +
+          megad.pad[0] &= ~0x10;
 +
+        } else if (jbeq(event.jbutton, joypad1_c)) {
 +
+          megad.pad[0] &= ~0x20;
 +
+        } else if (jbeq(event.jbutton, joypad1_x)) {
 +
+          megad.pad[0] &= ~0x40000;
 +
+        } else if (jbeq(event.jbutton, joypad1_y)) {
 +
+          megad.pad[0] &= ~0x20000;
 +
+        } else if (jbeq(event.jbutton, joypad1_z)) {
 +
+          megad.pad[0] &= ~0x10000;
 +
+        } else if (jbeq(event.jbutton, joypad1_mode)) {
 +
+          megad.pad[0] &= ~0x80000;
 +
+        } else if (jbeq(event.jbutton, joypad1_start)) {
 +
+          megad.pad[0] &= ~0x2000;
 +
+        } else if (jbeq(event.jbutton, joypad2_a)) {
 +
+          megad.pad[1] &= ~0x1000;
 +
+        } else if (jbeq(event.jbutton, joypad2_b)) {
 +
+          megad.pad[1] &= ~0x10;
 +
+        } else if (jbeq(event.jbutton, joypad2_c)) {
 +
+          megad.pad[1] &= ~0x20;
 +
+        } else if (jbeq(event.jbutton, joypad2_x)) {
 +
+          megad.pad[1] &= ~0x40000;
 +
+        } else if (jbeq(event.jbutton, joypad2_y)) {
 +
+          megad.pad[1] &= ~0x20000;
 +
+        } else if (jbeq(event.jbutton, joypad2_z)) {
 +
+          megad.pad[1] &= ~0x10000;
 +
+        } else if (jbeq(event.jbutton, joypad2_mode)) {
 +
+          megad.pad[1] &= ~0x80000;
 +
+        } else if (jbeq(event.jbutton, joypad2_start)) {
 +
+          megad.pad[1] &= ~0x2000;
 +
+        }
 +
+        break;
 +
+/*
 +
          // Ignore more than 16 buttons (a reasonable limit :)
 +
          if(event.jbutton.button > 15) break;
 +
          megad.pad[event.jbutton.which] &= ~js_map_button[event.jbutton.which]
 +
                                                          [event.jbutton.button];
 +
          break;
 +
+*/
 +
        case SDL_JOYBUTTONUP:
 +
+        if (jbeq(event.jbutton, joypad1_a)) {
 +
+          megad.pad[0] |= 0x1000;
 +
+        } else if (jbeq(event.jbutton, joypad1_b)) {
 +
+          megad.pad[0] |= 0x10;
 +
+        } else if (jbeq(event.jbutton, joypad1_c)) {
 +
+          megad.pad[0] |= 0x20;
 +
+        } else if (jbeq(event.jbutton, joypad1_x)) {
 +
+          megad.pad[0] |= 0x40000;
 +
+        } else if (jbeq(event.jbutton, joypad1_y)) {
 +
+          megad.pad[0] |= 0x20000;
 +
+        } else if (jbeq(event.jbutton, joypad1_z)) {
 +
+          megad.pad[0] |= 0x10000;
 +
+        } else if (jbeq(event.jbutton, joypad1_mode)) {
 +
+          megad.pad[0] |= 0x80000;
 +
+        } else if (jbeq(event.jbutton, joypad1_start)) {
 +
+          megad.pad[0] |= 0x2000;
 +
+        } else if (jbeq(event.jbutton, joypad2_a)) {
 +
+          megad.pad[1] |= 0x1000;
 +
+        } else if (jbeq(event.jbutton, joypad2_b)) {
 +
+          megad.pad[1] |= 0x10;
 +
+        } else if (jbeq(event.jbutton, joypad2_c)) {
 +
+          megad.pad[1] |= 0x20;
 +
+        } else if (jbeq(event.jbutton, joypad2_x)) {
 +
+          megad.pad[1] |= 0x40000;
 +
+        } else if (jbeq(event.jbutton, joypad2_y)) {
 +
+          megad.pad[1] |= 0x20000;
 +
+        } else if (jbeq(event.jbutton, joypad2_z)) {
 +
+          megad.pad[1] |= 0x10000;
 +
+        } else if (jbeq(event.jbutton, joypad2_mode)) {
 +
+          megad.pad[1] |= 0x80000;
 +
+        } else if (jbeq(event.jbutton, joypad2_start)) {
 +
+          megad.pad[1] |= 0x2000;
 +
+        }
 +
+        break;
 +
+/*
 +
          // Ignore more than 16 buttons (a reasonable limit :)
 +
          if(event.jbutton.button > 15) break;
 +
          megad.pad[event.jbutton.which] |= js_map_button[event.jbutton.which]
 +
                                                        [event.jbutton.button];
 +
          break;
 +
+*/
 +
#endif // SDL_JOYSTICK_SUPPORT
 +
case SDL_KEYDOWN:
 +
  ksym = event.key.keysym.sym;
 
</pre></code>
 
</pre></code>
  
These changes fix some bugs in the MythArchive script as shipped with the snapshot of 0.24-fixes that I use, and runs IO intensive processes in the idle IO scheduling class so as not to disrupt recording or playback.
+
I use it with the following <code>$HOME/.dgen/dgenrc</code>:
 +
<code><pre>
 +
# This is a sample .dgenrc file
 +
# It simply sets everything to their default values
 +
# Lines that BEGIN with a hash (#) (i.e. NOTHING before it) are comments.
 +
# Also, everything after the "field = value" is ignored (but don't count on it)
 +
 
 +
# Note that your own RC file doesn't need to include every field like this
 +
# one does, any ones you exclude simply have their compiled-in default values.
 +
 
 +
# Also, you can have multiple RC files, and use the -r option to dgen
 +
# to pick the rc you want to load.
 +
 
 +
# Fields beginning with "key_" take key names. The valid key names are listed
 +
# in the dgenrc(5) manpage.
 +
 
 +
# Fields beginning with "bool_" are boolean, i.e. they take a true or false
 +
# value:
 +
#  "true", "yes", any number except 0: true
 +
#  "false", "no", "0"                : false
 +
 
 +
# Fields beginning with "int_" take a _positive_ integer. Simple enough, huh? ;)
 +
 
 +
# The syntax and fields of this file are documented in a bit more detail in the
 +
# dgenrc(5) manpage.
  
==== Patch default Theme ====
+
# These are the controls for pad 1
 +
key_pad1_up = up
 +
key_pad1_down = down
 +
key_pad1_left = left
 +
key_pad1_right = right
 +
key_pad1_a = a
 +
key_pad1_b = s
 +
key_pad1_c = d
 +
key_pad1_x = q
 +
key_pad1_y = w
 +
key_pad1_z = e
 +
key_pad1_mode = backspace
 +
key_pad1_start = return
  
<code><pre>
+
# The same for pad 2
diff -ur /usr/share/mythtv/themes/default.fedora-0.24-20110125/browser-ui.xml /usr/share/mythtv/themes/default/browser-ui.xml
+
# Yes, I KNOW the default player 2 keys are awful. Pick your own!
--- /usr/share/mythtv/themes/default.fedora-0.24-20110125/browser-ui.xml 2011-01-12 23:34:28.000000000 +0000
+
key_pad2_up = kp_up
+++ /usr/share/mythtv/themes/default/browser-ui.xml 2011-02-12 12:27:58.000000000 +0000
+
key_pad2_down = kp_down
@@ -53,9 +53,8 @@
+
key_pad2_left = kp_left
            <statetype name="buttonitem">
+
key_pad2_right = kp_right
                <area>0,0,180,40</area>
+
key_pad2_a = delete
                <state name="active">
+
key_pad2_b = end
-                   <imagetype name="buttonbackground">
+
key_pad2_c = page_down
-                       <filename>horiz_selector.png</filename>
+
key_pad2_x = insert
-                    </imagetype>
+
key_pad2_y = home
+                    <area>0,0,180,40</area>
+
key_pad2_z = page_up
+                    <shape name="background" from="basewidgetshape" />
+
key_pad2_mode = kp_plus
                    <textarea name="buttontext" from="basetextarea">
+
key_pad2_start = kp_enter
                        <area>0,0,180,40</area>
+
 
                        <font>basesmall</font>
+
# Fix checksum, needed by some games with Game Genie codes
@@ -63,14 +62,12 @@
+
key_fix_checksum = f1
                    </textarea>
+
 
                </state>
+
# Quit dgen
                <state name="selectedactive" from="active">
+
key_quit = escape
-                   <imagetype name="buttonbackground">
+
# Toggle split screen and crap-tv
-                       <filename>horiz_selector_selected.png</filename>
+
key_splitscreen_toggle = f4
-                   </imagetype>
+
key_craptv_toggle = f5
+                    <shape name="background" from="baseselectedwidgetshape" />
+
# Screenshot
                </state>
+
key_screenshot = f12
                <state name="selectedinactive" from="active">
+
# Reset Genesis
-                    <imagetype name="buttonbackground">
+
key_reset = tab
-                       <filename>horiz_selector_inactive.png</filename>
+
# Toggle fullscreen mode
-                   </imagetype>
+
key_fullscreen_toggle = alt-enter
+                  <textarea name="buttontext">
+
 
+                        <font>basesmallgrey</font>
+
# Use this to toggle which CPU core to use, no need to reset!  :)
+                    </textarea>
+
# If you don't have multiple CPU cores, it won't do anything!
                </state>
+
key_cpu_toggle = f11
            </statetype>
+
 
            <statetype name="downscrollarrow">
+
# This pauses emulation :)
</pre></code>
+
key_stop = z
 +
 
 +
# Pick save slot
 +
key_slot_0 = 0
 +
key_slot_1 = 1
 +
key_slot_2 = 2
 +
key_slot_3 = 3
 +
key_slot_4 = 4
 +
key_slot_5 = 5
 +
key_slot_6 = 6
 +
key_slot_7 = 7
 +
key_slot_8 = 8
 +
key_slot_9 = 9
 +
# Save/load game to current slot
 +
key_save = f2
 +
key_load = f3
 +
 
 +
# This sets whether split-screen and crap-tv should be enabled on startup.
 +
bool_splitscreen_startup = no
 +
# There are now multiple CTV effects to try. Pick your favorite:
 +
#  off      - No CTV
 +
#  blur      - Blur bitmap (this is the CTV from older versions)
 +
#  scanline  - Attenuate every other scanline, by Phillip K. Hornung <redx@pknet.com>
 +
#  interlace - Unstable crappy television (I had one that looked like this ;), by me!
 +
ctv_craptv_startup = off
 +
 
 +
# These decide whether DGen should automatically load slot 0 on startup,
 +
# and/or autosave to slot 0 on exit.
 +
bool_autoload = no
 +
bool_autosave = no
 +
 
 +
# Skip frames to keep time? (faster, but can make things look bad)
 +
# This doesn't matter if you have sound enabled, since the sound code has its
 +
# own frameskipping
 +
bool_frameskip = yes
 +
# Show cartridge header info at startup, like Snes9X? Causes a 3-second pause,
 +
# but might be interesting to hackers or other curious people (like me :)
 +
bool_show_carthead = no
 +
 
 +
# Sound?
 +
bool_sound = yes
 +
# The sound rate to use.
 +
int_soundrate = 22050
 +
# Leave this true for 16-bit sound, but if you're unfortunate enough to have
 +
# an old 8-bit card make it false.
 +
bool_16bit = yes
 +
# Number of sound segments for buffering.  Lower values yield faster
 +
# speed, and less latency in controls and sound, but at the cost of CPU
 +
# Values can be 4, 8, 16, or 32 (frames)
 +
int_soundsegs = 8
  
These changes fix the bookmark highlighting in MythBrowser in the snapshot of 0.24-fixes that I use. These changes have been applied upstream, and are no longer necessary in later versions.
+
# This is how many microseconds DGen should sleep every frame. Even little
 +
# amounts can decrease CPU overhead significantly, and the default of 20
 +
# doesn't hurt performance terribly. Of course, set it to 0 if you don't
 +
# mind DGen eating all your CPU (like me ;)
 +
int_nice = 0
  
==== Patch default-wide theme ====
+
# Run fullscreen?
<code><pre>
+
bool_fullscreen = yes
diff -ur /usr/share/mythtv/themes/default-wide.fedora-0.24-20110125/browser-ui.xml /usr/share/mythtv/themes/default-wide/browser-ui.xml
+
 
--- /usr/share/mythtv/themes/default-wide.fedora-0.24-20110125/browser-ui.xml 2011-01-12 23:34:28.000000000 +0000
+
# If you want to increase the size of the window, increase this value.
+++ /usr/share/mythtv/themes/default-wide/browser-ui.xml 2011-02-12 12:27:58.000000000 +0000
+
# It currently must be a whole number.
@@ -61,9 +61,8 @@
+
int_scale = 2
            <statetype name="buttonitem">
+
 
                <area>0,0,180,40</area>
+
# Use a joystick?
                <state name="active">
+
bool_joystick = yes
-                    <imagetype name="buttonbackground">
+
 
-                        <filename>horiz_selector.png</filename>
+
# Use OpenGL mode?
-                    </imagetype>
+
bool_opengl = no
+                   <area>0,0,180,40</area>
+
# Set these to the resolution you want to run OpenGL mode in.
+                   <shape name="background" from="basewidgetshape" />
+
int_opengl_width = 640
                    <textarea name="buttontext" from="basetextarea">
+
int_opengl_height = 480
                        <area>0,0,180,40</area>
+
 
                        <font>basesmall</font>
+
# There are the new format joypad controls defination
@@ -73,14 +72,12 @@
+
# Joystick axis defination:
                    </textarea>
+
# j0a3(-16384)
                </state>
+
#  | | ||
                <state name="selectedactive" from="active">
+
#  | | |+- joystick axis event filter value (from 1 to 32767).
-                    <imagetype name="buttonbackground">
+
#  | | +-- axis heading (positive/negative).
-                        <filename>horiz_selector_selected.png</filename>
+
#  | +---- axis index (from 0 to 255).
-                    </imagetype>
+
#  +------ joystick index (from 0 to 255).
+                    <shape name="background" from="baseselectedwidgetshape" />
+
 
                </state>
+
# About the joystick axis event filter value:
                <state name="selectedinactive" from="active">
+
                                                                               
-                   <imagetype name="buttonbackground">
+
# Usually, the joystick device has noise signals on axis buttons. The noise
-                        <filename>horiz_selector_inactive.png</filename>
+
# signals will disturb your normal play.To avoid this fucking story, you must
-                    </imagetype>
+
# set a value to the filter. Then if the absolute value of a event is not
+                  <textarea name="buttontext">
+
# bigger than the filter, the engine will leave along this event.The value
+                        <font>basesmallgrey</font>
+
# range you could set is from 1 to 32767.
+                    </textarea>
+
 
                </state>
+
# Joystick button defination
            </statetype>
+
# j0b3
            <statetype name="downscrollarrow">
+
#  | |
 +
#  | +- button index (from 0 to 255).
 +
+--- joystick index (from 0 to 255).
 +
 
 +
joy_pad1_up = j0a1(-16384)
 +
joy_pad1_down = j0a1(+16384)
 +
joy_pad1_left = j0a0(-16384)
 +
joy_pad1_right = j0a0(+16384)
 +
joy_pad1_a = j0b2
 +
joy_pad1_b = j0b0
 +
joy_pad1_c = j0b1
 +
joy_pad1_x = j0b4
 +
joy_pad1_y = j0b3
 +
joy_pad1_z = j0b5
 +
joy_pad1_mode =j0b8
 +
joy_pad1_start = j0b9
 +
 
 +
joy_pad2_up = j1a1(-16384)
 +
joy_pad2_down = j1a1(+16384)
 +
joy_pad2_left = j1a0(-16384)
 +
joy_pad2_right = j1a0(+16384)
 +
joy_pad2_a = j1b2
 +
joy_pad2_b = j1b0
 +
joy_pad2_c = j1b1
 +
joy_pad2_x = j1b4
 +
joy_pad2_y = j1b3
 +
joy_pad2_z = j1b5
 +
joy_pad2_mode =j1b8
 +
joy_pad2_start = j1b9
 
</pre></code>
 
</pre></code>
  
As above, but for the default-wide theme, and themes dependent upon it.
+
=== Hauppauge Nova-T-500 checklist ===
 +
1) Boot kernel with usbcore.autosuspend=-1 to disable suspending of USB
 +
devices (i.e.  the two USB tuners behind the VIA USB/PCI bridge on the
 +
Nova-T-500 PCI card)
  
==== Create tweaked MythCenter-wide theme ====
+
2) Load the dvb_usb kernel module with disable_rc_polling=1 to disable the
 +
IR port on the Nova-T-500. I only use the IR port on the Nova-T, so I can
 +
live with this.
  
copy <code>/usr/share/mythtv/themes/MythCenter-wide</code> to <code>/usr/share/mythtv/themes/ajb-MythCenter-wide</code>, then apply this patch for smaller fonts and better contrast for text, so that the UI is usable on a 28" widescreen CRT at 6' or so.
+
3) Load the dvb-usb-dib0700 module with force_lna_activation=1 to have the
 +
LNA permanently enabled.
  
 +
4) In /etc/rc.d/rc.local:
 
<code><pre>
 
<code><pre>
diff -ur MythCenter-wide.fedora/base.xml ajb-MythCenter-wide/base.xml
+
echo 0 >/sys/module/dvb_core/parameters/dvb_powerdown_on_sleep
--- MythCenter-wide.fedora/base.xml 2011-01-12 23:34:29.000000000 +0000
+
</pre></code>
+++ ajb-MythCenter-wide/base.xml 2011-01-16 20:23:35.000000000 +0000
+
 
@@ -4,13 +4,13 @@
+
and
+
 
    <!-- Base Font Definitions -->
+
<code><pre>
    <fontdef name="basesmall" face="Droid Sans">
+
#for i in `find /sys -name 'level' | grep usb`; do echo "on" >$i; done
-       <pixelsize>22</pixelsize>
+
# AJB20110120 power/level deprecated in favour of power/control
+        <pixelsize>20</pixelsize> <!-- AJB 20110116 originally 22 -->
+
for i in `find /sys -name 'control' | grep usb`; do echo "on" >$i; done
        <color>#EEEEEE</color>
+
for i in `find /sys -name 'control' | grep i2c` ; do echo "on" >$i; done
        <weight>bold</weight>
+
</pre></code>
    </fontdef>
+
 
+
as belt-and-braces to prevent the Nova-T-500 sub-devices being suspended.
    <fontdef name="basesmaller" from="basesmall">
+
 
-       <pixelsize>18</pixelsize>
+
5) Use the 1.20 firmware (MD5: f42f86e2971fd994003186a055813237) file and
+        <pixelsize>16</pixelsize>
+
ensure it's being properly loaded. I've also tried the 1.10 firmware (MD5:
    </fontdef>
+
5878ebfcba2d8deb90b9120eb89b02da) with no apparent improvement.
+
 
    <fontdef name="basesmallbold" from="basesmall">
+
6) Ensure that the machine is cold-booted (thereby forcing a firmware load
@@ -24,16 +24,16 @@
+
onto the Nova-T-500) every time due to reports of warm boots being
    </fontdef>
+
problematic.
+
 
    <fontdef name="basemedium" from="basesmall" face="Liberation Sans">
+
7) Disable EIT scanning by MythTV on both of the two Nova-T-500 tuners. Only
-        <pixelsize>26</pixelsize>
+
leave it enabled on the Nova-T card.
+        <pixelsize>23</pixelsize>
+
 
    </fontdef>
+
8) MythTV is configured to open all the tuner devices when mythbackend
+
starts and keep them open until mythbackend terminates (i.e.
    <fontdef name="basemediumbold" from="basemedium">
+
dvb_on_demand=0), rather than repeated opening and closing of the tuner
-       <pixelsize>26</pixelsize>
+
devices which has also been reported as problematic for some.
+        <pixelsize>23</pixelsize>
+
 
        <weight>bold</weight>
+
9) MythTV signal_timeout=500, channel_timeout=3000, dvb_tuning_delay=0
    </fontdef>
+
(defaults), but I've tried increasing those to 3000, 4000 and 400
+
respectively, as per <http://www.knoppmythwiki.org/index.php?page=NovaT500>
    <fontdef name="baselarge" from="basemedium">
+
with no apparent improvement.
-       <pixelsize>30</pixelsize>
+
 
+        <pixelsize>26</pixelsize>
+
10) MythTV multirec enabled, configured with 2 virtual tuners per physical
        <shadowcolor>#000000</shadowcolor>
+
tuner.
        <shadowoffset>4,4</shadowoffset>
+
 
        <shadowalpha>64</shadowalpha>
+
11) I briefly experimented with setting buggy_sfn_workaround=1 when loading
@@ -45,7 +45,7 @@
+
the dib3000mc and dib7000p modules with no apparent improvement.  As far as
    </fontdef>
+
I can see, though, UK DVB-T broadcasting isn't a single frequency network,
+
so a) this is not relevant here and b) it will impair performace.  As a
    <fontdef name="baseextralarge" from="baselarge">
+
result, I'm NOT using the buggy_sfn_workaround.
-       <pixelsize>34</pixelsize>
+
 
+       <pixelsize>28</pixelsize>
+
I've got debug=1 set for the mt2060, dib3000mc and dib7000p modules,
        <shadowcolor>#000000</shadowcolor>
+
debug=127 for dvb_usb and debug=7 for dvb-usb-dib0700, but I'm not seeing
        <shadowoffset>4,4</shadowoffset>
+
anything obviously bad in my kernel syslog. I've got mythbackend running
        <shadowalpha>64</shadowalpha>
+
with "-v important,record" but all that seems to report is no progress on
@@ -57,10 +57,10 @@
+
failed recordings after "TVRec(_): Successfully set up DVB table
        <color>#FFFFFF</color>
+
monitoring." (where _ is the cardid of the failed tuner).
    </fontdef>
+
 
    <fontdef name="basesmall_normal" from="basesmall">
+
(From my [http://permalink.gmane.org/gmane.linux.drivers.video-input-infrastructure/28366 post] to the video-input-infrastructure mailing list)
-       <color>#9999cc</color>
+
 
+       <color>#ccccff</color>
+
Note that MythTV's channel scanner tries to fill in certain fields of the <code>dtv_multiplex</code> table automatically, which doesn't work well with the Nova-T-500 (the main symptom is loss of one or more of its tuners). My <code>dtv_multiplex</code> table for the uk-Mendip transmitter, as of 7 July 2011, contains:
    </fontdef>
+
 
    <fontdef name="basesmall_normal_inactive" from="basesmall">
+
<code><pre>
-       <color>#666666</color>
+
+---------+----------+-------------+-----------+-----------+-----------+------------+------+----------+------------+-----------+--------------+-------------------+----------------+---------+---------------+-----------+--------------+-----------+---------+------------+----------------+---------------------+-------------------+
+       <color>#888888</color>
+
| mplexid | sourceid | transportid | networkid | frequency | inversion | symbolrate | fec  | polarity | modulation | bandwidth | lp_code_rate | transmission_mode | guard_interval | visible | constellation | hierarchy | hp_code_rate | mod_sys  | rolloff | sistandard | serviceversion | updatetimestamp    | default_authority |
    </fontdef>
+
+---------+----------+-------------+-----------+-----------+-----------+------------+------+----------+------------+-----------+--------------+-------------------+----------------+---------+---------------+-----------+--------------+-----------+---------+------------+----------------+---------------------+-------------------+
    <fontdef name="basesmall_warning_selected" from="basesmallbold">
+
|      15 |        1 |        4161 |      9018 | 794000000 | a        |          0 | auto | v        | qam_64    | 8        | 1/2         | 8                | 1/32          |      0 | qam_64        | n        | 2/3          | UNDEFINED | 0.35    | dvb        |            33 | 2011-01-24 00:41:50 |                  |
        <color>#dddd44</color>
+
|     16 |        1 |        8204 |      9018 | 738000000 | a        |         0 | auto | v        | qam_64    | 8        | 1/2          | 8                | 1/32          |      0 | qam_64        | n        | 2/3          | UNDEFINED | 0.35    | dvb        |            33 | 2011-01-18 01:22:19 |                  |
@@ -75,7 +75,7 @@
+
|      17 |        1 |      12290 |      9018 | 802166670 | a        |         0 | auto | v        | qam_64    | 8        | 1/2         | 2                | 1/32          |      0 | qam_64        | n        | 2/3         | UNDEFINED | 0.35    | dvb        |            33 | 2011-01-18 01:22:19 |                  |
        <color>#bbbb33</color>
+
|      18 |        1 |      20480 |      9018 | 754166670 | a        |         0 | auto | v        | qam_16    | 8        | 3/4         | 2                | 1/32          |      0 | qam_16        | n        | 3/4         | UNDEFINED | 0.35    | dvb        |            33 | 2011-01-18 01:22:19 |                  |
    </fontdef>
+
|      19 |        1 |      24640 |     9018 | 842000000 | a        |         0 | auto | v        | qam_64    | 8        | 1/2          | 8                | 1/32          |      0 | qam_64        | n        | 2/3          | UNDEFINED | 0.35    | dvb        |            33 | 2011-01-24 00:41:50 |                  |
    <fontdef name="basesmall_favourite_unavailable" from="basesmall">
+
+---------+----------+-------------+-----------+-----------+-----------+------------+------+----------+------------+-----------+--------------+-------------------+----------------+---------+---------------+-----------+--------------+-----------+---------+------------+----------------+---------------------+-------------------+
-       <color>#9999cc</color>
+
</pre></code>
+       <color>#ccccff</color>
+
 
    </fontdef>
+
The <code>dtv_multiplex</code> table will need to be changed again on 28 September 2011 and 28 March 2012 to deal with changes to the frequencies and DVB parameters. Details can be found at [http://www.digitaluk.co.uk/postcodechecker/ http://www.digitaluk.co.uk/postcodechecker/] (tick the "I am in the aerial installation trade" checkbox), with contributory information from [http://www.ukfree.tv/ http://www.ukfree.tv/]. Channel frequencies can be determined by using queries like [http://www.ukfree.tv/mapsofsignal.php?c=52&a=1 http://www.ukfree.tv/mapsofsignal.php?c=52&a=1] (e.g. for Channel 52).
    <fontdef name="basesmall_error_selected" from="basesmallbold">
+
 
        <color>#900800</color>
+
=== Comments ===
@@ -84,10 +84,10 @@
+
* The Hauppauge Nova-T-500 needs to be handled quite carefully to ensure that it is reliable. Most significant is to ensure that the kernel does not suspend USB devices, and that the machine is always cold-booted.
        <color>#700700</color>
+
* CPU usage when recording three channels simultaneously is about [unknown]% plus [unknown] system time.
    </fontdef>
+
* Both the Hauppauge Nova-T and Nova-T-500 cards support multirec in MythTV 0.21. CPU usage when recording from six channels simultaneously is about [unknown]% plus about [unknown]% system time.
    <fontdef name="basesmall_disabled_selected" from="basesmallbold">
+
* I currently have configured 4 multirec virtual tuners per physical tuner, giving a total of 12 virtual tuners. Recording and playback are reliable.
-       <color>#888888</color>
+
* CPU usage when playing back a recording is about [unknown]%.
+       <color>#aaaaaa</color>
+
* Commercial Flagging doesn't really work on UK DVB-T broadcasts, apart from the aforementioned silence detection technique.
    </fontdef>
+
* MythWeather doesn't work in 0.20.2. It works again in 0.21 using the BBC grabber.
    <fontdef name="basesmall_disabled" from="basesmall">
+
* Many emulators need to be run with <code>SDL_AUDIODRIVER=esd</code> in order to work with FC8's default PulseAudio configuration. Xmame needs to be run under <code>padsp</code> and use the <code>-dp oss</code> option.
-       <color>#666666</color>
+
 
+       <color>#888888</color>
+
== Old System, pre-January 2011 ==
    </fontdef>
+
 
    <fontdef name="basesmall_running_selected" from="basesmallbold">
+
With an eye on power consumption, I went for a combined frontend/backend implementation. I tried a quick run through with a scratch machine that I was no longer using. Once I'd determined, it'd probably be up for the job, I bought components specially. I mainly used [http://wilsonet.com/mythtv/fcmyth.php Jarod C. Wilson's 'Fedora Myth(TV)ology' document] to configure it, but had to discover some things myself by trial-and-error.
        <color>#00FF00</color>
+
 
@@ -105,17 +105,17 @@
+
=== Hardware Specification ===
        <color>#FFFFFF</color>
+
* Intel Pentium 4 2.53GHz CPU (was Intel Celeron 1.7GHz when CPU usage stats were gathered; the P4 is about 50-100% faster)
    </fontdef>
+
* 768MB RAM (originally 256MB)
    <fontdef name="basesmall_disabled_button" from="basesmallbold">
+
* Gigabyte GA-8PE667 Ultra Motherboard (i845PE)
-       <color>#9999cc</color>
+
* Seagate ST3500630A PATA 500GB disc (OS, database, recordings)
+       <color>#ccccff</color>
+
* Seagate ST3300622A PATA 300GB disc (originally only disc; now music, emulator ROMs)
    </fontdef>
+
* LiteOn/JLMS XJ-HD165H DVD-ROM
    <!-- State variations on medium font -->
+
* NEC ND-4570A DVD+/-RW
    <fontdef name="basemedium_normal" from="basemediumbold">
+
* Codegen ATX-9001 case
-       <color>#9999cc</color>
+
* 1*Hauppauge Nova-T DVB-T tuner (originally 2)
+       <color>#ccccff</color>
+
* 1*Hauppauge Nova-T-500 dual DVB-T tuner with Hauppauge infra-red remote control
    </fontdef>
+
* 1*Pace Bt878 Analogue NICAM/FM tuner (not currently used)
    <fontdef name="basemedium_normal_selected" from="basemedium">
+
* 1*D-Link quad-port NIC
        <color>#FFFFFF</color>
+
* GeForce4 MX 440 AGP 128MB fanless VGA card (bought used to replace failing cheaper nVidia card)
    </fontdef>
+
* home-built [http://www.nexusuk.org/projects/vga2scart/ VGA-to-RGB SCART adaptor] with integrated audio in/out and composite from SCART
    <fontdef name="basemedium_disabled" from="basemedium">
+
* [http://www.maplin.co.uk/Search.aspx?Criteria=A04AT 2*PADIX/Rockfire PX-205 PSX-USB Bridge with two Logic-7 Playstation dual-shock gamepads]
-       <color>#666666</color>
+
* Ruwido/Chicony KB-9820 infra-red PS/2 keyboard/mousepad
+       <color>#888888</color>
+
* Panasonic TX-28DTX11 100Hz DVB-T 16:9 TV
    </fontdef>
+
* [http://www.maplin.co.uk/module.aspx?ModuleNo=33969&doy=12m11 SLx 4-way UHF amplifier]
    <fontdef name="basemedium_highlight" from="basemediumbold">
+
* Yamaha RX-V361 AV Receiver/Surround Decoder, linked via 3m coax
        <color>#FFFF33</color>
+
 
@@ -127,17 +127,17 @@
+
=== Software Specification ===
        <color>#FFFFFF</color>
+
* Fedora Core 8 running 2.6.23.9-85.fc8 kernel (reverted from 2.6.24.3-12.fc8 after problems with 'mt2060 failed to read/write' errors and inability to tune) and standard video4linux drivers. This kernel revision appears to fully support the Nova-T-500, including the remote control, thus completely negating any reason to use out-of-tree v4l drivers from the mercurial repository. Note that previous FC8 kernels supported the Nova-T-500, but with no remote control support. The v4l drivers from the mercurial repository are reputed to be more stable with the Nova-T-500, but I experienced a couple of hard locks when running with a snapshot taken on 17 March 2008.
    </fontdef>
+
* MythTV 21 from ATrpms
    <fontdef name="basemedium_disabled_button" from="basemediumbold">
+
* pdnsd caching DNS server
-       <color>#9999cc</color>
+
* privoxy ad-filtering HTTP proxy
+       <color>#ccccff</color>
+
* DHCP daemon
    </fontdef>
+
* netfilter/iptables firewall
+
* NTP server
    <!-- Fonts for specific screens -->
+
* nVidia 96.43.01 drivers from ATrpms
    <fontdef name="deleterecordings_filesize_font" from="basemedium">
+
* Xmame/Xmess 0.106, fceultra 0.98.12, VisualBoyAdvance 1.7.2, zsnes 1.52, dgen-sdl 1.23
-       <pixelsize>40</pixelsize>
+
* [http://www.wi-bw.tfh-wildau.de/~pboettch/home/linux-dvb-firmware/dvb-usb-dib0700-1.20.fw dvb-usb-dib0700-1.20.fw] firmware for Nova-T-500 (may need symlinks in /lib/firmware named dvb-usb-dib0700-01.fw and dvb-usb-dib0700-1.10.fw)
+       <pixelsize>34</pixelsize>
+
 
        <color>#bbbb33</color>
+
=== OS Configuration ===
        <weight>bold</weight>
+
==== Partitioning ====
    </fontdef>
+
<code><pre>
    <fontdef name="baseguide" from="basesmall">
+
/dev/sda1    2668MiB /          ext3
-       <pixelsize>20</pixelsize>
+
/dev/sda2    2668MiB spare
+       <pixelsize>18</pixelsize>
+
/dev/sda3    2691MiB swap
        <weight>normal</weight>
+
/dev/sda4          - extended
    </fontdef>
+
/dev/sda5 410089MiB /myth/video jfs
+
/dev/sda6  23847MiB /tmp        ext2
@@ -1063,7 +1063,7 @@
+
/dev/sda7    9547MiB /var        ext3
                    <shape name="background">
+
/dev/sda8  19086MiB /usr        ext3
                        <area>0,0,166,106</area>
+
/dev/sda9    6346MiB /home      ext3
                        <fill style="gradient">
+
 
-                           <gradient start="#999999" end="#666666" alpha="220" />
+
/dev/sdb1    2668MiB spare
+                           <gradient start="#999999" end="#888888" alpha="220" />
+
/dev/sdb2    2668MiB spare
                        </fill>
+
/dev/sdb3    2691MiB spare
                    </shape>
+
/dev/sdb4         - extended
                </state>
+
/dev/sdb5  74395MiB spare
@@ -1126,19 +1126,19 @@
+
/dev/sdb6    9547MiB spare
+
/dev/sdb7    1914MiB spare
        <fontdef name="medium" face="Droid Sans">
+
/dev/sdb8  14316MiB spare
            <color>#FFFFFF</color>
+
/dev/sdb9  76301MiB /myth/music    ext2
-           <pixelsize>26</pixelsize>
+
/dev/sdb10 101670MiB /myth/emulators ext2
+           <pixelsize>23</pixelsize>
+
</pre></code>
            <weight>bold</weight>
+
 
        </fontdef>
+
==== /etc/php.ini ====
+
Configure PHP's date.timezone setting to match local timezone, or MythWeb will fail to generate preview thumbnails for recordings that were made whilst DST was in force if DST is not currently in force, and vice versa.
        <fontdef name="large" face="Liberation Sans">
+
 
              <color>#FFFFFF</color>
+
Example:
-             <pixelsize>28</pixelsize>
+
<code><pre>
+             <pixelsize>25</pixelsize>
+
date.timezone = Europe/London
              <weight>bold</weight>
+
</pre></code>
        </fontdef>
+
 
+
==== /etc/my.cnf ====
        <fontdef name="clock" face="Liberation Sans">
+
<code><pre>
              <color>#FFFFFF</color>
+
[mysqld]
-             <pixelsize>26</pixelsize>
+
key_buffer = 16M
+             <pixelsize>23</pixelsize>
+
table_cache = 128
              <weight>bold</weight>
+
sort_buffer_size = 2M
        </fontdef>
+
myisam_sort_buffer_size = 8M
    </window>
+
query_cache_size = 16M
diff -ur MythCenter-wide.fedora/menu-ui.xml ajb-MythCenter-wide/menu-ui.xml
+
datadir=/var/lib/mysql
--- MythCenter-wide.fedora/menu-ui.xml 2011-01-12 23:35:27.000000000 +0000
+
socket=/var/lib/mysql/mysql.sock
+++ ajb-MythCenter-wide/menu-ui.xml 2011-01-16 20:15:46.000000000 +0000
+
user=mysql
@@ -7,7 +7,7 @@
+
# Default to using old password format for compatibility with mysql 3.x
+
# clients (those using the mysqlclient10 compatibility package).
        <fontdef name="menufont" face="Liberation Sans">
+
old_passwords=1
            <color>#FFFFFF</color>
+
 
-           <pixelsize>30</pixelsize>
+
[mysqld_safe]
+           <pixelsize>26</pixelsize>
+
log-error=/var/log/mysqld.log
            <weight>bold</weight>
+
pid-file=/var/run/mysqld/mysqld.pid
            <shadowcolor>#000000</shadowcolor>
+
</pre></code>
            <shadowoffset>2,2</shadowoffset>
+
 
@@ -15,7 +15,7 @@
+
==== /etc/X11/xorg.conf ====
        </fontdef>
+
<code><pre>
+
 
        <fontdef name="clock" from="small">
+
# nvidia-xconfig: X configuration file generated by nvidia-xconfig
-           <pixelsize>28</pixelsize>
+
# nvidia-xconfig:  version 1.0  (buildmeister@builder3)  Wed Dec 14 16:39:22 PST 2005
+           <pixelsize>25</pixelsize>
+
# XFree86 4 configuration created by pyxf86config
        </fontdef>
+
 
+
Section "ServerLayout"
        <clock name="clock">
+
Identifier    "Default Layout"
diff -ur MythCenter-wide.fedora/osd.xml ajb-MythCenter-wide/osd.xml
+
Screen      0  "Screen0" 0 0
--- MythCenter-wide.fedora/osd.xml 2011-01-12 23:34:29.000000000 +0000
+
InputDevice    "Mouse0" "CorePointer"
+++ ajb-MythCenter-wide/osd.xml 2011-01-16 20:15:46.000000000 +0000
+
InputDevice    "Keyboard0" "CoreKeyboard"
@@ -5,14 +5,14 @@
+
EndSection
+
 
    <window name="program_info">
+
# This, combined with disabling syncing in ~/.nvidia-settings-rc makes OpenGL vsync work
        <fontdef name="small" face="Droid Sans">
+
# properly
-           <pixelsize>22</pixelsize>
+
Section "Extensions"
+           <pixelsize>20</pixelsize>
+
        Option      "Composite" "Disable"
            <color>#EEEEEE</color>
+
EndSection
        </fontdef>
+
 
        <fontdef name="medium" from="small">
+
Section "Files"
-           <pixelsize>28</pixelsize>
+
 
+           <pixelsize>25</pixelsize>
+
# RgbPath is the location of the RGB database.  Note, this is the name of the
        </fontdef>
+
# file minus the extension (like ".txt" or ".db").  There is normally
        <fontdef name="large" from="small">
+
# no need to change the default.
-           <pixelsize>34</pixelsize>
+
# Multiple FontPath entries are allowed (they are concatenated together)
+           <pixelsize>28</pixelsize>
+
# By default, Red Hat 6.0 and later now use a font server independent of
            <weight>bold</weight>
+
# the X server to render fonts.
        </fontdef>
+
RgbPath      "/usr/X11R6/lib/X11/rgb"
        <area>50,0,1180,720</area>
+
ModulePath  "/usr/lib/xorg/modules/extensions/nvidia"
@@ -130,7 +130,7 @@
+
ModulePath  "/usr/lib/xorg/modules/extensions"
+
ModulePath  "/usr/lib/xorg/modules"
    <window name="osd_status">
+
ModulePath  "/usr/lib/xorg/modules/"
        <fontdef name="medium" face="Droid Sans">
+
EndSection
-           <pixelsize>28</pixelsize>
+
 
+           <pixelsize>25</pixelsize>
+
Section "ServerFlags"
            <color>#EEEEEE</color>
+
Option     "AllowMouseOpenFail"
            <weight>bold</weight>
+
EndSection
         </fontdef>
+
 
@@ -177,15 +177,15 @@
+
Section "InputDevice"
+
 
     <window name="browse_info">
+
# Specify which keyboard LEDs can be user-controlled (eg, with xset(1))
         <fontdef name="small" face="Droid Sans">
+
# Option "Xleds" "1 2 3"
-            <pixelsize>22</pixelsize>
+
# To disable the XKEYBOARD extension, uncomment XkbDisable.
+            <pixelsize>20</pixelsize>
+
# Option "XkbDisable"
            <color>#EEEEEE</color>
+
# To customise the XKB settings to suit your keyboard, modify the
         </fontdef>
+
# lines below (which are the defaults).  For example, for a non-U.S.
         <fontdef name="medium" from="small">
+
# keyboard, you will probably want to use:
-            <pixelsize>28</pixelsize>
+
# Option "XkbModel" "pc102"
+            <pixelsize>25</pixelsize>
+
# If you have a US Microsoft Natural keyboard, you can use:
            <weight>bold</weight>
+
# Option "XkbModel" "microsoft"
         </fontdef>
+
#
         <fontdef name="large" from="medium">
+
# Then to change the language, change the Layout setting.
-            <pixelsize>34</pixelsize>
+
# For example, a german layout can be obtained with:
+            <pixelsize>28</pixelsize>
+
# Option "XkbLayout" "de"
         </fontdef>
+
# or:
        <area>50,520,1180,100</area>
+
# Option "XkbLayout" "de"
         <imagetype name="background1">
+
# Option "XkbVariant" "nodeadkeys"
@@ -226,7 +226,7 @@
+
#
+
# If you'd like to switch the positions of your capslock and
     <window name="osd_input">
+
# control keys, use:
         <fontdef name="medium" face="Droid Sans">
+
# Option "XkbOptions" "ctrl:swapcaps"
-            <pixelsize>28</pixelsize>
+
# Or if you just want both to be control, use:
+            <pixelsize>25</pixelsize>
+
# Option "XkbOptions" "ctrl:nocaps"
            <color>#EEEEEE</color>
+
#
            <weight>bold</weight>
+
Identifier  "Keyboard0"
        </fontdef>
+
Driver      "kbd"
@@ -244,7 +244,7 @@
+
Option     "XkbModel" "pc105"
+
Option     "XkbLayout" "gb"
    <window name="osd_message">
+
EndSection
        <fontdef name="medium" face="Droid Sans">
+
 
-           <pixelsize>28</pixelsize>
+
Section "InputDevice"
+           <pixelsize>25</pixelsize>
+
Identifier  "Mouse0"
            <color>#EEEEEE</color>
+
Driver      "mouse"
            <weight>bold</weight>
+
Option     "Protocol" "IMPS/2"
        </fontdef>
+
Option     "Device" "/dev/input/mice"
@@ -262,7 +262,7 @@
+
Option     "ZAxisMapping" "4 5"
+
Option     "Emulate3Buttons" "yes"
    <window name="MythPopupBox">
+
EndSection
        <fontdef name="basesmall" face="Droid Sans">
+
 
-           <pixelsize>22</pixelsize>
+
Section "Monitor"
+           <pixelsize>20</pixelsize>
+
 
            <color>#EEEEEE</color>
+
#    HorizSync      31.5 - 37.9
            <weight>bold</weight>
+
#    VertRefresh    50.0 - 70.0
        </fontdef>
+
Identifier  "Monitor0"
@@ -384,7 +384,7 @@
+
VendorName  "Monitor Vendor"
+
ModelName    "Unknown monitor"
    <window name="osd_program_editor">
+
HorizSync    0.0 - 16.0
        <fontdef name="medium" face="Droid Sans">
+
VertRefresh  49.0 - 62.0
-           <pixelsize>28</pixelsize>
+
ModeLine    "800x576pali" 15.4 800 823 895 984 576 580 583 625 -hsync -vsync interlace
+           <pixelsize>25</pixelsize>
+
ModeLine    "800x288pal-half" 15.4 800 823 895 984 288 290 292 313 -hsync -vsync
            <color>#EEEEEE</color>
+
# ModeLine    "768x576pali" 14.8 768 789 858 944 576 581 586 625 -hsync -vsync interlace
            <weight>bold</weight>
+
# 768x576@14.75 is 15.625kHz horiz sync
        </fontdef>
+
ModeLine    "768x576pali" 14.75 768 789 858 944 576 581 586 625 -hsync -vsync interlace
@@ -450,7 +450,7 @@
+
ModeLine    "768x288pal-half" 14.8 768 792 856 944 288 290 292 313 -hsync -vsync
+
# ModeLine    "720x576pali" 13.9 720 744 808 888 576 580 583 625 -hsync -vsync interlace
    <window name="ChannelEditor">
+
 
        <fontdef name="basesmall" face="Droid Sans">
+
# dvb is normally 720x576, 4:3 analogue is normally 768x576
-           <pixelsize>22</pixelsize>
+
# previous best
+           <pixelsize>20</pixelsize>
+
# 720x576 w/ 13.5MHz dotclock is 50.0000Hz, 15.6250kHz, checked with hacked xvidtune
            <color>#EEEEEE</color>
+
# and manually: 864 * 15625 = 13.5M
            <weight>bold</weight>
+
# Good, but a bit too far to the right - AJB 20071110
        </fontdef>
+
# ModeLine    "720x576pali" 13.5 720 722 786 864 576 581 586 625 -hsync -vsync interlace
diff -ur MythCenter-wide.fedora/themeinfo.xml ajb-MythCenter-wide/themeinfo.xml
+
 
--- MythCenter-wide.fedora/themeinfo.xml 2011-01-12 23:34:29.000000000 +0000
+
# ModeLine    "720x576pali" 13.5 720 727 791 864 576 581 586 625 -hsync -vsync interlace
+++ ajb-MythCenter-wide/themeinfo.xml 2011-01-16 20:15:46.000000000 +0000
+
# ModeLine    "720x576pali" 13.5 720 737 801 864 576 581 586 625 -hsync -vsync interlace
@@ -1,7 +1,7 @@
+
ModeLine    "720x576pali" 13.5 720 757 821 864 576 581 586 625 -hsync -vsync interlace
<?xml version="1.0" encoding="utf-8"?>
+
 
<themeinfo>
+
# worth trying if 720x576@13.5 flickers:
    <!-- The Theme Name (Required) -->
+
# from http://www.avforums.com/forums/showthread.php?t=136811&page=33
-   <name>MythCenter-wide</name>
+
# ModeLine "720x576" 15.125 720 762 834 968 576 579 607 625 -hsync -vsync interlace
+   <name>ajb-MythCenter-wide</name>
+
# from http://www.avforums.com/forums/showthread.php?t=136811&page=27
+
ModeLine "1024x576" 19.750 1024 1056 1152 1264 576 581 586 625 -hsync -vsync interlace
    <!-- The Theme Types (Required) -->
+
 
    <types>
+
# ModeLine    "720x288pal-half" 13.9 720 744 808 888 288 290 292 313 -hsync -vsync
diff -ur MythCenter-wide.fedora/welcome-ui.xml ajb-MythCenter-wide/welcome-ui.xml
+
# should be 13.875MHz for 15.625kHz horiz sync
--- MythCenter-wide.fedora/welcome-ui.xml 2011-01-12 23:34:29.000000000 +0000
+
ModeLine    "720x288pal-half" 13.875 720 744 808 888 288 290 292 313 -hsync -vsync
+++ ajb-MythCenter-wide/welcome-ui.xml 2011-01-16 20:15:46.000000000 +0000
+
# previously used for some oddball broadcasts
@@ -9,7 +9,7 @@
+
# 704x576 w/ 13.5MHz dotclock is 50.0000Hz, 15.6250kHz, checked with hacked xvidtune
        -->
+
ModeLine    "704x576pali" 13.5 704 720 784 864 576 580 583 625 -hsync -vsync interlace
        <fontdef name="title" from="baselarge">
+
ModeLine    "704x288pal-half" 13.5 704 720 784 864 288 290 292 313 -hsync -vsync
            <color>#ffff00</color>
+
 
-           <pixelsize>34</pixelsize>
+
# appears to be closest to PAL spec, according to:
+           <pixelsize>28</pixelsize>
+
# http://www.gossamer-threads.com/lists/mythtv/users/191409?search_string=interlace;#191409
            <shadowcolor>#000000</shadowcolor>
+
# http://www.gossamer-threads.com/lists/mythtv/users/100222?search_string=scart;#100222
            <shadowoffset>2,2</shadowoffset>
+
# still flickers occasionally with 8776 drivers
            <weight>bold</weight>
+
# 720x576 w/ 13.875MHz dotclock is 49.98Hz according to xvidtune
@@ -17,13 +17,13 @@
+
# ModeLine    "720x576pali" 13.875 720 744 808 888 576 581 586 625 -hsync -vsync interlace
+
# ModeLine    "720x288pal-half" 13.875 720 744 808 888 288 290 293 313 -hsync -vsync
        <fontdef name="time" from="basesmall">
+
# ModeLine    "704x576pali" 13.6 704 728 792 872 576 581 586 625 -hsync -vsync interlace
            <color>#9999cc</color>
+
# ModeLine    "704x288pal-half" 13.6 704 728 792 872 288 290 293 313 -hsync -vsync
-           <pixelsize>20</pixelsize>
+
 
+           <pixelsize>18</pixelsize>
+
# previously used for some oddball broadcasts
            <weight>bold</weight>
+
# ModeLine    "704x576pali" 13.5 704 720 784 864 576 580 583 625 -hsync -vsync interlace
        </fontdef>
+
# ModeLine    "704x288pal-half" 13.5 704 720 784 864 288 290 292 313 -hsync -vsync
+
 
        <fontdef name="label" from="basesmall">
+
ModeLine    "648x576pali" 12.5 648 664 720 824 576 580 583 625 -hsync -vsync interlace
            <color>#ffff00</color>
+
ModeLine    "648x288pal-half" 12.5 648 664 720 824 288 290 292 313 -hsync -vsync
-           <pixelsize>26</pixelsize>
+
ModeLine    "800x480ntsci" 15.1 800 808 879 960 480 484 487 525 -hsync -vsync interlace
+           <pixelsize>23</pixelsize>
+
ModeLine    "800x240ntsc-half" 15.1 800 808 879 960 240 242 244 263 -hsync -vsync
            <shadowcolor>#000000</shadowcolor>
+
ModeLine    "720x480ntsci" 13.6 720 728 792 864 480 484 487 525 -hsync -vsync interlace
            <shadowoffset>2,2</shadowoffset>
+
ModeLine    "720x240ntsc-half" 13.6 720 728 792 864 240 242 244 263 -hsync -vsync
            <weight>bold</weight>
+
ModeLine    "704x480ntsci" 13.3 704 712 776 848 480 484 487 525 -hsync -vsync interlace
@@ -31,13 +31,13 @@
+
ModeLine    "704x240ntsc-half" 13.3 704 712 776 848 240 242 244 263 -hsync -vsync
+
ModeLine    "657x480ntsci" 12.5 656 664 728 792 480 484 487 525 -hsync -vsync interlace
        <fontdef name="info" from="basesmall">
+
ModeLine    "657x240ntsc-half" 12.5 656 664 728 792 240 242 244 263 -hsync -vsync
            <color>#ffffff</color>
+
ModeLine    "320x256pal" 10.9 320 352 368 400 256 261 264 269 -hsync -vsync doublescan
-           <pixelsize>22</pixelsize>
+
ModeLine    "320x512pali" 5.5 320 352 368 400 512 523 527 539 -hsync -vsync interlace
+           <pixelsize>20</pixelsize>
+
ModeLine    "320x200pal" 8.4 320 352 368 400 200 204 206 211 -hsync -vsync doublescan
            <weight>bold</weight>
+
ModeLine    "320x400pali" 4.2 320 352 360 392 400 409 411 421 -hsync -vsync interlace
        </fontdef>
+
ModeLine    "320x400ntsci" 5.1 320 352 368 400 400 409 411 421 -hsync -vsync interlace
+
ModeLine    "320x200ntsc" 10.2 320 352 368 400 200 204 206 211 -hsync -vsync doublescan
        <fontdef name="warning" from="basesmall">
+
ModeLine    "352x288pald" 13.5 352 392 492 512 288 292 300 304 -hsync -vsync doublescan
            <color>#ff0000</color>
+
ModeLine    "352x288paldi" 13.5 352 392 492 512 288 292 300 304 -hsync -vsync interlace doublescan
-           <pixelsize>22</pixelsize>
+
Option     "dpms"
+           <pixelsize>20</pixelsize>
+
EndSection
            <shadowcolor>#000000</shadowcolor>
+
 
            <shadowoffset>2,2</shadowoffset>
+
Section "Device"
            <weight>bold</weight>
+
 
@@ -45,7 +45,7 @@
+
# next line might make XvMC work
+
# or fix NV WAIT problems
        <fontdef name="buttons" from="basesmall">
+
# ...maybe, but makes picture bounce - AJB 20060403
            <color>#ffff00</color>
+
    Option        "NvAgp" "1"
-            <pixelsize>20</pixelsize>
+
    Option        "UseEvents" "True"
+            <pixelsize>18</pixelsize>
+
# another thing that might help with NV WAIT - AJB 20060403
            <weight>bold</weight>
+
#    Option        "TVStandard" "PAL-I"
        </fontdef>
+
Identifier  "Videocard0"
+
Driver      "nvidia"
diff -ur MythCenter-wide.fedora/zoneminder-ui.xml ajb-MythCenter-wide/zoneminder-ui.xml
+
VendorName  "Videocard vendor"
--- MythCenter-wide.fedora/zoneminder-ui.xml 2011-01-12 23:35:27.000000000 +0000
+
BoardName  "NVIDIA GeForce 4 (generic)"
+++ ajb-MythCenter-wide/zoneminder-ui.xml 2011-01-16 20:15:46.000000000 +0000
+
Option     "RenderAccel" "off"
@@ -56,7 +56,7 @@
+
#    Option        "TVOutFormat" "COMPOSITE"
+
Option     "ConnectedMonitor" "CRT"
        <fontdef name="running" from="basesmall">
+
# attempt to fix occasional judders
            <color>#00ff00</color>
+
        Option      "UseEvents" "true"
-            <size>16</size>
+
EndSection
+            <size>17</size>
+
 
        </fontdef>
+
Section "Screen"
+
Identifier "Screen0"
        <fontdef name="stopped" from="running">
+
Device    "Videocard0"
@@ -65,7 +65,7 @@
+
Monitor    "Monitor0"
+
DefaultDepth    24
        <fontdef name="footer" from="basesmall">
+
SubSection "Display"
            <color>#ffffff</color>
+
Viewport  0 0
-            <size>16</size>
+
Depth    16
+            <size>17</size>
+
Modes    "1024x576" "720x576pali" "720x288pal-half" "704x576pali" "704x288pal-half" "648x576pali" "648x288pal-half"
        </fontdef>
+
# Modes    "720x576pali" "720x288pal-half" "704x576pali" "704x288pal-half" "648x576pali" "648x288pal-half"
+
EndSubSection
        <fontdef name="info" from="basesmall">
+
SubSection "Display"
@@ -249,19 +249,19 @@
+
Viewport  0 0
+
Depth    24
        <fontdef name="active" from="basesmall">
+
Modes    "1024x576" "720x576pali" "720x288pal-half" "704x576pali" "704x288pal-half" "648x576pali" "648x288pal-half"
            <color>#ffffff</color>
+
# Modes    "720x576pali" "720x288pal-half" "704x576pali" "704x288pal-half" "648x576pali" "648x288pal-half"
-           <size>18</size>
+
EndSubSection
+            <size>17</size>
+
EndSection
            <weight>bold</weight>
+
 
        </fontdef>
+
</pre></code>
+
 
        <fontdef name="inactive" from="basesmall">
+
==== /etc/rc.d/rc.local ====
            <color>#9999cc</color>
+
<code><pre>
-           <size>18</size>
+
#!/bin/sh
+            <size>17</size>
+
#
            <weight>bold</weight>
+
# This script will be executed *after* all the other init scripts.
        </fontdef>
+
# You can put your own initialization stuff in here if you don't
+
# want to do the full Sys V style init stuff.
        <fontdef name="selected" from="basesmall">
+
 
            <color>#00ff00</color>
+
touch /var/lock/subsys/local
-           <size>18</size>
+
# mtd needs mysqld to be up, so moved to mythbackend initscript
+            <size>17</size>
+
# AJB 20071106
            <weight>bold</weight>
+
#/usr/bin/mtd --daemon
        </fontdef>
+
setkeycodes e01e 120
+
/sbin/setpci -s 00:1f.1 latency_timer=b0
@@ -272,12 +272,12 @@
+
/sbin/setpci -s 02:0c.0 latency_timer=b0
+
 
        <fontdef name="description" from="basesmall">
+
# nvidia recommended setting as per <http://www.nvnews.net/vbulletin/showpost.php?p=854678&postcount=5>
            <color>#ffffff</color>
+
# - AJB 20060403
-           <size>18</size>
+
/sbin/setpci -s 01:00.0 latency_timer=80
+            <size>17</size>
+
 
        </fontdef>
+
# attempt to fix router disappearing - AJB 20060423
+
# 10M doesn't seem to fix it entirely, but it seems to recover
        <fontdef name="label" from="basesmall">
+
# glitches regularly
            <color>#ffff00</color>
+
# disabled after switching eth0 and eth1 roles around
-           <size>16</size>
+
#/sbin/mii-tool -A 10baseT-HD eth0 # advertise only 10baseT-HD
+            <size>17</size>
+
#/sbin/mii-tool -F 10baseT-HD eth0 # force 10baseT-HD
            <weight>bold</weight>
+
 
        </fontdef>
+
# attempt to fix router disappearing - AJB 20060424
+
# this seems worse than 10M-HD
@@ -654,7 +654,7 @@
+
# sometimes doesn't recover
+
#/sbin/mii-tool -A 100baseTx-HD eth0 # advertise only 10baseT-HD
        <font name="label" from="basesmall">
+
#/sbin/mii-tool -F 100baseTx-HD eth0 # force 10baseT-HD
            <color>#ffff00</color>
+
 
-           <size>16</size>
+
# this seems to be ignored in /etc/sysconfig/harddiskhdg AJB 20060622
+            <size>17</size>
+
# 240*5s=20m
            <weight>bold</weight>
+
#hdparm -S 240 /dev/sdb
        </font>
+
# AJB 20071105 - 2*30m=60m
+
# disabled 20071224 after configuring InstantMirror
@@ -776,22 +776,22 @@
+
# hdparm -S 242 /dev/sdb
   
+
lsmod >/tmp/lsmod-rc.local-pre.txt 2>&1
        <fontdef name="monitor" from="basesmall">
+
#modprobe dvb_usb_dib0700
            <color>#ffff00</color>
+
#lsmod >/tmp/lsmod-rc.local-post.txt 2>&1
-            <size>16</size>
+
 
+            <size>17</size>
+
# Attempt to fix judder AJB 20071114
        </fontdef>
+
blockdev --setra 2048 /dev/sda
+
 
         <fontdef name="idle" from="basesmall">
+
# Disable DVB LNB powerdown, since module option seems to be ignored AJB 20080318
            <color>#ffff00</color>
+
echo 0 >/sys/module/dvb_core/parameters/dvb_powerdown_on_sleep
-            <size>16</size>
+
 
+            <size>17</size>
+
# Fix USB power to on AJB 20081207
        </fontdef>
+
for i in /sys/devices/pci*/*/usb*/power/level /sys/devices/pci*/*/*/usb*/power/level /sys/devices/pci*/*/*/usb*/*/power/level;
+
        do echo "on" >$i
        <fontdef name="alarm" from="basesmall">
+
done
            <color>#ff0000</color>
+
 
-            <size>16</size>
+
 
+            <size>17</size>
+
</pre></code>
        </fontdef>
+
 
+
==== /etc/modprobe.d/options ====
        <fontdef name="alert" from="basesmall">
+
<code><pre>
            <color>#ffa500</color>
+
options dvb-usb-dib0700 force_lna_activation=1
-            <size>16</size>
+
 
+            <size>17</size>
+
# disable IR remote input on Nova-T-500 (and any other USB DVB devices)
        </fontdef>
+
options dvb_usb disable_rc_polling=1
 
        <textarea name="pagetitle" from="basetextarea">
 
</pre></code>
 
  
=== Hauppauge Nova-T-500 checklist ===
+
# may not work, so may need to echo to /sys/... in rc.local
1) Boot kernel with usbcore.autosuspend=-1 to disable suspending of USB
+
options dvb_core dvb_powerdown_on_sleep=0
devices (i.e. the two USB tuners behind the VIA USB/PCI bridge on the
+
options dvb-core dvb_powerdown_on_sleep=0
Nova-T-500 PCI card)
 
  
2) Load the dvb_usb kernel module with disable_rc_polling=1 to disable the
+
options snd-intel8x0 index=0
IR port on the Nova-T-500. I only use the IR port on the Nova-T, so I can
+
install snd-intel8x0 /sbin/modprobe --ignore-install snd-intel8x0 && /usr/sbin/alsactl restore 0 >/dev/null 2>&1 || :
live with this.
 
  
3) Load the dvb-usb-dib0700 module with force_lna_activation=1 to have the
+
# I2C module options
LNA permanently enabled.
+
alias char-major-89 i2c-dev
 +
</pre></code>
  
4) In /etc/rc.d/rc.local:
+
==== /etc/X11/XvMCConfig ====
 +
<code><pre>
 +
libXvMCNVIDIA_dynamic.so.1
 +
</pre></code>
  
echo 0 >/sys/module/dvb_core/parameters/dvb_powerdown_on_sleep
+
==== Add to /etc/security/limits.conf ====
 +
<code><pre>
 +
*              -      rtprio    0
 +
*              -      nice      0
 +
@video          -      rtprio    50
 +
@video          -      nice      0
 +
@mythtv          -      rtprio    50
 +
@mythtv          -      nice      0
 +
</pre></code>
  
and
+
==== $HOME/.Xclients ====
 +
<code><pre>
 +
#!/bin/sh
 +
# Load nVidia driver custom settings
 +
nvidia-settings --load-config-only &
 +
# Restore audio settings
 +
/usr/sbin/alsactl restore
 +
# Launch irexec for myth power button stop/start
 +
IREXECPID=`ps uaxwww | grep irexec$ | awk '{print $2}'`
 +
if [ "$IREXECPID" = "" ]; then
 +
        irexec &
 +
fi
 +
# Disable dynamic power management (screen blanking)
 +
/usr/X11R6/bin/xset -dpms
 +
# Disable screen saver
 +
/usr/X11R6/bin/xset s off
 +
# get rid of blue line at bottom of picture
 +
/usr/bin/xvattr -a XV_COLORKEY -v 66048
 +
# Launch myth frontend
 +
#mythfrontend &
 +
mythfrontend >/dev/null 2>&1 &
 +
gnome-session
 +
</pre></code>
  
#for i in `find /sys -name 'level' | grep usb`; do echo "on" >$i; done
+
==== Hauppauge Infra-Red Remote ====
# AJB20110120 power/level deprecated in favour of power/control
 
for i in `find /sys -name 'control' | grep usb`; do echo "on" >$i; done
 
for i in `find /sys -name 'control' | grep i2c` ; do echo "on" >$i; done
 
  
as belt-and-braces to prevent the Nova-T-500 sub-devices being suspended.
+
The sensor for the remote is connected to the Nova-T. No sensor is connected to the Nova-T-500. When I was using two Nova-Ts, sometimes the /dev nodes would swap around after a reboot or kernel upgrade. Using the by-path /dev/ entries is a bit more stable.
  
5) Use the 1.20 firmware (MD5: f42f86e2971fd994003186a055813237) file and
+
===== /etc/sysconfig/lircd =====
ensure it's being properly loaded. I've also tried the 1.10 firmware (MD5:
+
<code><pre>
5878ebfcba2d8deb90b9120eb89b02da) with no apparent improvement.
+
# Options to lircd
 
+
#LIRCD_OPTIONS="-H dev/input -d /dev/input/by-path/pci-0000:02:03.2--event-ir"
6) Ensure that the machine is cold-booted (thereby forcing a firmware load
+
# path to the device node for the Nova-T sometimes changes between .2 and .0,
onto the Nova-T-500) every time due to reports of warm boots being
+
# so use a wildcard to match, as long as there's only ever one Nova-T present!
problematic.
+
LIRCD_OPTIONS="-H dev/input -d /dev/input/by-path/pci-0000:02:03.?--event-ir"
 +
</pre></code>
  
7) Disable EIT scanning by MythTV on both of the two Nova-T-500 tuners. Only
+
===== /etc/lircd.conf =====
leave it enabled on the Nova-T card.
+
<code><pre>
  
8) MythTV is configured to open all the tuner devices when mythbackend
+
# Please make this file available to others
starts and keep them open until mythbackend terminates (i.e.  
+
# by sending it to <lirc@bartelmus.de>
dvb_on_demand=0), rather than repeated opening and closing of the tuner
+
#
devices which has also been reported as problematic for some.
+
# this config file was automatically generated
 +
# using lirc-0.8.7(devinput) on Sat Jan  8 14:43:26 2011
 +
#
 +
# contributed by
 +
#
 +
# brand:                      /root/irrecord-201101081438.txt
 +
# model no. of remote control:
 +
# devices being controlled by this remote:
 +
#
  
9) MythTV signal_timeout=500, channel_timeout=3000, dvb_tuning_delay=0
+
begin remote
(defaults), but I've tried increasing those to 3000, 4000 and 400
 
respectively, as per <http://www.knoppmythwiki.org/index.php?page=NovaT500>
 
with no apparent improvement.
 
  
10) MythTV multirec enabled, configured with 2 virtual tuners per physical
+
  name  /root/irrecord-201101081438.txt
tuner.
+
  bits            8
 +
  eps            30
 +
  aeps          100
  
11) I briefly experimented with setting buggy_sfn_workaround=1 when loading
+
  one            0    0
the dib3000mc and dib7000p modules with no apparent improvement.  As far as
+
  zero            0    0
I can see, though, UK DVB-T broadcasting isn't a single frequency network,
+
  pre_data_bits  56
so a) this is not relevant here and b) it will impair performace.  As a
+
  pre_data      0x4000400001E
result, I'm NOT using the buggy_sfn_workaround.
+
  gap          111995
 +
  toggle_bit_mask 0x0
  
I've got debug=1 set for the mt2060, dib3000mc and dib7000p modules,
+
      begin codes
debug=127 for dvb_usb and debug=7 for dvb-usb-dib0700, but I'm not seeing
+
          Go                      0x3B
anything obviously bad in my kernel syslog. I've got mythbackend running
+
          Power                    0x3D
with "-v important,record" but all that seems to report is no progress on
+
          TV                      0x1C
failed recordings after "TVRec(_): Successfully set up DVB table
+
          Videos                  0x18
monitoring." (where _ is the cardid of the failed tuner).
+
          Music                    0x19
 
+
          Pictures                0x1A
(From my [http://permalink.gmane.org/gmane.linux.drivers.video-input-infrastructure/28366 post] to the video-input-infrastructure mailing list)
+
          Guide                    0x1B
 
+
          Radio                    0x0C
Note that MythTV's channel scanner tries to fill in certain fields of the <code>dtv_multiplex</code> table automatically, which doesn't work well with the Nova-T-500 (the main symptom is loss of one or more of its tuners). My <code>dtv_multiplex</code> table for the uk-Mendip transmitter, as of 7 July 2011, contains:
+
          UP                      0x14
 
+
          LEFT                    0x16
<code><pre>
+
          RIGHT                    0x17
+---------+----------+-------------+-----------+-----------+-----------+------------+------+----------+------------+-----------+--------------+-------------------+----------------+---------+---------------+-----------+--------------+-----------+---------+------------+----------------+---------------------+-------------------+
+
          DOWN                    0x15
| mplexid | sourceid | transportid | networkid | frequency | inversion | symbolrate | fec  | polarity | modulation | bandwidth | lp_code_rate | transmission_mode | guard_interval | visible | constellation | hierarchy | hp_code_rate | mod_sys  | rolloff | sistandard | serviceversion | updatetimestamp    | default_authority |
+
          OK                      0x25
+---------+----------+-------------+-----------+-----------+-----------+------------+------+----------+------------+-----------+--------------+-------------------+----------------+---------+---------------+-----------+--------------+-----------+---------+------------+----------------+---------------------+-------------------+
+
          Back                    0x1F
|      15 |        1 |        4161 |      9018 | 794000000 | a        |          0 | auto | v        | qam_64    | 8        | 1/2          | 8                 | 1/32           |      0 | qam_64        | n        | 2/3          | UNDEFINED | 0.35    | dvb        |            33 | 2011-01-24 00:41:50 |                   |
+
          Menu                    0x0D
|      16 |        1 |        8204 |      9018 | 738000000 | a        |          0 | auto | v        | qam_64    | 8        | 1/2          | 8                | 1/32           |      0 | qam_64        | n        | 2/3          | UNDEFINED | 0.35    | dvb        |            33 | 2011-01-18 01:22:19 |                  |
+
          VolumeUp                 0x10
|      17 |        1 |      12290 |      9018 | 802166670 | a        |          0 | auto | v        | qam_64    | 8        | 1/2          | 2                | 1/32           |      0 | qam_64        | n        | 2/3          | UNDEFINED | 0.35    | dvb        |            33 | 2011-01-18 01:22:19 |                   |
+
          VolumeDown              0x11
|      18 |        1 |      20480 |      9018 | 754166670 | a        |          0 | auto | v        | qam_16    | 8        | 3/4          | 2                | 1/32           |      0 | qam_16        | n        | 3/4          | UNDEFINED | 0.35    | dvb        |            33 | 2011-01-18 01:22:19 |                  |
+
           Prev-Ch                  0x12
|      19 |        1 |      24640 |      9018 | 842000000 | a        |          0 | auto | v        | qam_64    | 8        | 1/2          | 8                | 1/32           |      0 | qam_64        | n        | 2/3          | UNDEFINED | 0.35    | dvb        |            33 | 2011-01-24 00:41:50 |                  |
+
          ChannelUp                0x20
+---------+----------+-------------+-----------+-----------+-----------+------------+------+----------+------------+-----------+--------------+-------------------+----------------+---------+---------------+-----------+--------------+-----------+---------+------------+----------------+---------------------+-------------------+
+
          ChannelDown              0x21
</pre></code>
+
          Mute                    0x0F
 
+
          Record                   0x37
The <code>dtv_multiplex</code> table will need to be changed again on 28 September 2011 and 28 March 2012 to deal with changes to the frequencies and DVB parameters. Details can be found at [http://www.digitaluk.co.uk/postcodechecker/ http://www.digitaluk.co.uk/postcodechecker/] (tick the "I am in the aerial installation trade" checkbox), with contributory information from [http://www.ukfree.tv/ http://www.ukfree.tv/]. Channel frequencies can be determined by using queries like [http://www.ukfree.tv/mapsofsignal.php?c=52&a=1 http://www.ukfree.tv/mapsofsignal.php?c=52&a=1] (e.g. for Channel 52).
+
           Stop                    0x36
 
+
           Replay                   0x32
=== Comments ===
+
           Play                    0x35
* The Hauppauge Nova-T-500 needs to be handled quite carefully to ensure that it is reliable. Most significant is to ensure that the kernel does not suspend USB devices, and that the machine is always cold-booted.
+
           Skip                    0x34
* CPU usage when recording three channels simultaneously is about 7% plus [unknown] system time.
+
          PreviousTrack            0x24
* Both the Hauppauge Nova-T and Nova-T-500 cards support multirec in MythTV 0.21. CPU usage when recording from six channels simultaneously is about 15-20% plus about 8% system time.
+
          Pause                    0x30
* CPU usage when playing back a recording is about 30-40%.
+
          NextTrack                0x1E
* Sometimes recordings are corrupt and unwatchable. I suspect my signal is very variable, but it might also be http://www.mythtv.org/wiki/index.php/Troubleshooting:Mythfilldatabase_IO_bottleneck
+
          1                       0x01
* Commercial Flagging doesn't really work on UK DVB-T broadcasts.
+
          2                        0x02
* MythWeather doesn't work in 0.20.2. It works again in 0.21 using the BBC grabber.
+
          3                        0x03
* I had a quick go at getting the Bt878 analogue tuner card working in order to help convert some VHS tapes to DVD, but never really got it working properly.
+
          4                        0x04
* Hopefully future nVidia drivers will improve their handling of sync interrupts, so interlaced output doesn't get out-of-sync with the TV display. At this point, the deinterlace option can be disabled.
+
          5                        0x05
* Many emulators need to be run with <code>SDL_AUDIODRIVER=esd</code> in order to work with FC8's default PulseAudio configuration. Xmame needs to be run under <code>padsp</code> and use the <code>-dp oss</code> option.
+
          6                        0x06
* With the upgrade to FC8 and 0.20.2 of MythTV more RAM and/or CPU power might be a good idea. Menu navigation is sometimes a bit slow
+
          7                       0x07
* Sometimes S/PDIF audio output halts when the host is under load. Playback of DTS soundtracks of DVDs is particularly prone to this, but I've experienced it within MythMusic too.
+
          8                       0x08
* I'm now using the MythCenter-wide theme after the glass-wide theme ( http://www.mythtvthemes.co.uk/glasswide.shtml ) stopped working with MythArchive.
+
          9                        0x09
 +
          Asterisk                0x0A
 +
          0                       0x00
 +
          Hash                    0x0E
 +
          Red                      0x0B
 +
          Green                    0x2E
 +
          Yellow                  0x38
 +
          Blue                    0x29
 +
      end codes
  
== Old System, pre-January 2011 ==
+
end remote
 
 
With an eye on power consumption, I went for a combined frontend/backend implementation. I tried a quick run through with a scratch machine that I was no longer using. Once I'd determined, it'd probably be up for the job, I bought components specially. I mainly used [http://wilsonet.com/mythtv/fcmyth.php Jarod C. Wilson's 'Fedora Myth(TV)ology' document] to configure it, but had to discover some things myself by trial-and-error.
 
 
 
=== Hardware Specification ===
 
* Intel Pentium 4 2.53GHz CPU (was Intel Celeron 1.7GHz when CPU usage stats were gathered; the P4 is about 50-100% faster)
 
* 768MB RAM (originally 256MB)
 
* Gigabyte GA-8PE667 Ultra Motherboard (i845PE)
 
* Seagate ST3500630A PATA 500GB disc (OS, database, recordings)
 
* Seagate ST3300622A PATA 300GB disc (originally only disc; now music, emulator ROMs)
 
* LiteOn/JLMS XJ-HD165H DVD-ROM
 
* NEC ND-4570A DVD+/-RW
 
* Codegen ATX-9001 case
 
* 1*Hauppauge Nova-T DVB-T tuner (originally 2)
 
* 1*Hauppauge Nova-T-500 dual DVB-T tuner with Hauppauge infra-red remote control
 
* 1*Pace Bt878 Analogue NICAM/FM tuner (not currently used)
 
* 1*D-Link quad-port NIC
 
* GeForce4 MX 440 AGP 128MB fanless VGA card (bought used to replace failing cheaper nVidia card)
 
* home-built [http://www.nexusuk.org/projects/vga2scart/ VGA-to-RGB SCART adaptor] with integrated audio in/out and composite from SCART
 
* [http://www.maplin.co.uk/Search.aspx?Criteria=A04AT 2*PADIX/Rockfire PX-205 PSX-USB Bridge with two Logic-7 Playstation dual-shock gamepads]
 
* Ruwido/Chicony KB-9820 infra-red PS/2 keyboard/mousepad
 
* Panasonic TX-28DTX11 100Hz DVB-T 16:9 TV
 
* [http://www.maplin.co.uk/module.aspx?ModuleNo=33969&doy=12m11 SLx 4-way UHF amplifier]
 
* Yamaha RX-V361 AV Receiver/Surround Decoder, linked via 3m coax
 
 
 
=== Software Specification ===
 
* Fedora Core 8 running 2.6.23.9-85.fc8 kernel (reverted from 2.6.24.3-12.fc8 after problems with 'mt2060 failed to read/write' errors and inability to tune) and standard video4linux drivers. This kernel revision appears to fully support the Nova-T-500, including the remote control, thus completely negating any reason to use out-of-tree v4l drivers from the mercurial repository. Note that previous FC8 kernels supported the Nova-T-500, but with no remote control support. The v4l drivers from the mercurial repository are reputed to be more stable with the Nova-T-500, but I experienced a couple of hard locks when running with a snapshot taken on 17 March 2008.
 
* MythTV 21 from ATrpms
 
* pdnsd caching DNS server
 
* privoxy ad-filtering HTTP proxy
 
* DHCP daemon
 
* netfilter/iptables firewall
 
* NTP server
 
* nVidia 96.43.01 drivers from ATrpms
 
* Xmame/Xmess 0.106, fceultra 0.98.12, VisualBoyAdvance 1.7.2, zsnes 1.52, dgen-sdl 1.23
 
* [http://www.wi-bw.tfh-wildau.de/~pboettch/home/linux-dvb-firmware/dvb-usb-dib0700-1.20.fw dvb-usb-dib0700-1.20.fw] firmware for Nova-T-500 (may need symlinks in /lib/firmware named dvb-usb-dib0700-01.fw and dvb-usb-dib0700-1.10.fw)
 
 
 
=== OS Configuration ===
 
==== Partitioning ====
 
<code><pre>
 
/dev/sda1    2668MiB /          ext3
 
/dev/sda2    2668MiB spare
 
/dev/sda3    2691MiB swap
 
/dev/sda4          - extended
 
/dev/sda5  410089MiB /myth/video jfs
 
/dev/sda6  23847MiB /tmp        ext2
 
/dev/sda7    9547MiB /var        ext3
 
/dev/sda8  19086MiB /usr        ext3
 
/dev/sda9    6346MiB /home      ext3
 
 
 
/dev/sdb1    2668MiB spare
 
/dev/sdb2    2668MiB spare
 
/dev/sdb3    2691MiB spare
 
/dev/sdb4          - extended
 
/dev/sdb5  74395MiB spare
 
/dev/sdb6    9547MiB spare
 
/dev/sdb7    1914MiB spare
 
/dev/sdb8  14316MiB spare
 
/dev/sdb9  76301MiB /myth/music    ext2
 
/dev/sdb10 101670MiB /myth/emulators ext2
 
</pre></code>
 
 
 
==== /etc/php.ini ====
 
Configure PHP's date.timezone setting to match local timezone, or MythWeb will fail to generate preview thumbnails for recordings that were made whilst DST was in force if DST is not currently in force, and vice versa.
 
 
 
Example:
 
<code><pre>
 
date.timezone = Europe/London
 
</pre></code>
 
 
 
==== /etc/my.cnf ====
 
<code><pre>
 
[mysqld]
 
key_buffer = 16M
 
table_cache = 128
 
sort_buffer_size = 2M
 
myisam_sort_buffer_size = 8M
 
query_cache_size = 16M
 
datadir=/var/lib/mysql
 
socket=/var/lib/mysql/mysql.sock
 
user=mysql
 
# Default to using old password format for compatibility with mysql 3.x
 
# clients (those using the mysqlclient10 compatibility package).
 
old_passwords=1
 
 
 
[mysqld_safe]
 
log-error=/var/log/mysqld.log
 
pid-file=/var/run/mysqld/mysqld.pid
 
</pre></code>
 
 
 
==== /etc/X11/xorg.conf ====
 
<code><pre>
 
 
 
# nvidia-xconfig: X configuration file generated by nvidia-xconfig
 
# nvidia-xconfig:  version 1.0  (buildmeister@builder3)  Wed Dec 14 16:39:22 PST 2005
 
# XFree86 4 configuration created by pyxf86config
 
 
 
Section "ServerLayout"
 
Identifier    "Default Layout"
 
Screen      0  "Screen0" 0 0
 
InputDevice    "Mouse0" "CorePointer"
 
InputDevice    "Keyboard0" "CoreKeyboard"
 
EndSection
 
 
 
# This, combined with disabling syncing in ~/.nvidia-settings-rc makes OpenGL vsync work
 
# properly
 
Section "Extensions"
 
        Option      "Composite" "Disable"
 
EndSection
 
 
 
Section "Files"
 
 
 
# RgbPath is the location of the RGB database.  Note, this is the name of the
 
# file minus the extension (like ".txt" or ".db").  There is normally
 
# no need to change the default.
 
# Multiple FontPath entries are allowed (they are concatenated together)
 
# By default, Red Hat 6.0 and later now use a font server independent of
 
# the X server to render fonts.
 
RgbPath      "/usr/X11R6/lib/X11/rgb"
 
ModulePath  "/usr/lib/xorg/modules/extensions/nvidia"
 
ModulePath  "/usr/lib/xorg/modules/extensions"
 
ModulePath  "/usr/lib/xorg/modules"
 
ModulePath  "/usr/lib/xorg/modules/"
 
EndSection
 
 
 
Section "ServerFlags"
 
Option     "AllowMouseOpenFail"
 
EndSection
 
 
 
Section "InputDevice"
 
 
 
# Specify which keyboard LEDs can be user-controlled (eg, with xset(1))
 
# Option "Xleds" "1 2 3"
 
# To disable the XKEYBOARD extension, uncomment XkbDisable.
 
# Option "XkbDisable"
 
# To customise the XKB settings to suit your keyboard, modify the
 
# lines below (which are the defaults).  For example, for a non-U.S.
 
# keyboard, you will probably want to use:
 
# Option "XkbModel" "pc102"
 
# If you have a US Microsoft Natural keyboard, you can use:
 
# Option "XkbModel" "microsoft"
 
#
 
# Then to change the language, change the Layout setting.
 
# For example, a german layout can be obtained with:
 
# Option "XkbLayout" "de"
 
# or:
 
# Option "XkbLayout" "de"
 
# Option "XkbVariant" "nodeadkeys"
 
#
 
# If you'd like to switch the positions of your capslock and
 
# control keys, use:
 
# Option "XkbOptions" "ctrl:swapcaps"
 
# Or if you just want both to be control, use:
 
# Option "XkbOptions" "ctrl:nocaps"
 
#
 
Identifier  "Keyboard0"
 
Driver      "kbd"
 
Option     "XkbModel" "pc105"
 
Option     "XkbLayout" "gb"
 
EndSection
 
 
 
Section "InputDevice"
 
Identifier  "Mouse0"
 
Driver      "mouse"
 
Option     "Protocol" "IMPS/2"
 
Option     "Device" "/dev/input/mice"
 
Option     "ZAxisMapping" "4 5"
 
Option     "Emulate3Buttons" "yes"
 
EndSection
 
 
 
Section "Monitor"
 
 
 
#    HorizSync      31.5 - 37.9
 
#    VertRefresh    50.0 - 70.0
 
Identifier  "Monitor0"
 
VendorName  "Monitor Vendor"
 
ModelName    "Unknown monitor"
 
HorizSync    0.0 - 16.0
 
VertRefresh  49.0 - 62.0
 
ModeLine    "800x576pali" 15.4 800 823 895 984 576 580 583 625 -hsync -vsync interlace
 
ModeLine    "800x288pal-half" 15.4 800 823 895 984 288 290 292 313 -hsync -vsync
 
# ModeLine    "768x576pali" 14.8 768 789 858 944 576 581 586 625 -hsync -vsync interlace
 
# 768x576@14.75 is 15.625kHz horiz sync
 
ModeLine    "768x576pali" 14.75 768 789 858 944 576 581 586 625 -hsync -vsync interlace
 
ModeLine    "768x288pal-half" 14.8 768 792 856 944 288 290 292 313 -hsync -vsync
 
# ModeLine    "720x576pali" 13.9 720 744 808 888 576 580 583 625 -hsync -vsync interlace
 
 
 
# dvb is normally 720x576, 4:3 analogue is normally 768x576
 
# previous best
 
# 720x576 w/ 13.5MHz dotclock is 50.0000Hz, 15.6250kHz, checked with hacked xvidtune
 
# and manually: 864 * 15625 = 13.5M
 
# Good, but a bit too far to the right - AJB 20071110
 
# ModeLine    "720x576pali" 13.5 720 722 786 864 576 581 586 625 -hsync -vsync interlace
 
 
 
# ModeLine    "720x576pali" 13.5 720 727 791 864 576 581 586 625 -hsync -vsync interlace
 
# ModeLine    "720x576pali" 13.5 720 737 801 864 576 581 586 625 -hsync -vsync interlace
 
ModeLine    "720x576pali" 13.5 720 757 821 864 576 581 586 625 -hsync -vsync interlace
 
 
 
# worth trying if 720x576@13.5 flickers:
 
# from http://www.avforums.com/forums/showthread.php?t=136811&page=33
 
# ModeLine "720x576" 15.125 720 762 834 968 576 579 607 625 -hsync -vsync interlace
 
# from http://www.avforums.com/forums/showthread.php?t=136811&page=27
 
ModeLine "1024x576" 19.750 1024 1056 1152 1264 576 581 586 625 -hsync -vsync interlace
 
 
 
# ModeLine    "720x288pal-half" 13.9 720 744 808 888 288 290 292 313 -hsync -vsync
 
# should be 13.875MHz for 15.625kHz horiz sync
 
ModeLine    "720x288pal-half" 13.875 720 744 808 888 288 290 292 313 -hsync -vsync
 
# previously used for some oddball broadcasts
 
# 704x576 w/ 13.5MHz dotclock is 50.0000Hz, 15.6250kHz, checked with hacked xvidtune
 
ModeLine    "704x576pali" 13.5 704 720 784 864 576 580 583 625 -hsync -vsync interlace
 
ModeLine    "704x288pal-half" 13.5 704 720 784 864 288 290 292 313 -hsync -vsync
 
 
 
# appears to be closest to PAL spec, according to:
 
# http://www.gossamer-threads.com/lists/mythtv/users/191409?search_string=interlace;#191409
 
# http://www.gossamer-threads.com/lists/mythtv/users/100222?search_string=scart;#100222
 
# still flickers occasionally with 8776 drivers
 
# 720x576 w/ 13.875MHz dotclock is 49.98Hz according to xvidtune
 
# ModeLine    "720x576pali" 13.875 720 744 808 888 576 581 586 625 -hsync -vsync interlace
 
# ModeLine    "720x288pal-half" 13.875 720 744 808 888 288 290 293 313 -hsync -vsync
 
# ModeLine    "704x576pali" 13.6 704 728 792 872 576 581 586 625 -hsync -vsync interlace
 
# ModeLine    "704x288pal-half" 13.6 704 728 792 872 288 290 293 313 -hsync -vsync
 
 
 
# previously used for some oddball broadcasts
 
# ModeLine    "704x576pali" 13.5 704 720 784 864 576 580 583 625 -hsync -vsync interlace
 
# ModeLine    "704x288pal-half" 13.5 704 720 784 864 288 290 292 313 -hsync -vsync
 
 
 
ModeLine    "648x576pali" 12.5 648 664 720 824 576 580 583 625 -hsync -vsync interlace
 
ModeLine    "648x288pal-half" 12.5 648 664 720 824 288 290 292 313 -hsync -vsync
 
ModeLine    "800x480ntsci" 15.1 800 808 879 960 480 484 487 525 -hsync -vsync interlace
 
ModeLine    "800x240ntsc-half" 15.1 800 808 879 960 240 242 244 263 -hsync -vsync
 
ModeLine    "720x480ntsci" 13.6 720 728 792 864 480 484 487 525 -hsync -vsync interlace
 
ModeLine    "720x240ntsc-half" 13.6 720 728 792 864 240 242 244 263 -hsync -vsync
 
ModeLine    "704x480ntsci" 13.3 704 712 776 848 480 484 487 525 -hsync -vsync interlace
 
ModeLine    "704x240ntsc-half" 13.3 704 712 776 848 240 242 244 263 -hsync -vsync
 
ModeLine    "657x480ntsci" 12.5 656 664 728 792 480 484 487 525 -hsync -vsync interlace
 
ModeLine    "657x240ntsc-half" 12.5 656 664 728 792 240 242 244 263 -hsync -vsync
 
ModeLine    "320x256pal" 10.9 320 352 368 400 256 261 264 269 -hsync -vsync doublescan
 
ModeLine    "320x512pali" 5.5 320 352 368 400 512 523 527 539 -hsync -vsync interlace
 
ModeLine    "320x200pal" 8.4 320 352 368 400 200 204 206 211 -hsync -vsync doublescan
 
ModeLine    "320x400pali" 4.2 320 352 360 392 400 409 411 421 -hsync -vsync interlace
 
ModeLine    "320x400ntsci" 5.1 320 352 368 400 400 409 411 421 -hsync -vsync interlace
 
ModeLine    "320x200ntsc" 10.2 320 352 368 400 200 204 206 211 -hsync -vsync doublescan
 
ModeLine    "352x288pald" 13.5 352 392 492 512 288 292 300 304 -hsync -vsync doublescan
 
ModeLine    "352x288paldi" 13.5 352 392 492 512 288 292 300 304 -hsync -vsync interlace doublescan
 
Option     "dpms"
 
EndSection
 
 
 
Section "Device"
 
 
 
# next line might make XvMC work
 
# or fix NV WAIT problems
 
# ...maybe, but makes picture bounce - AJB 20060403
 
    Option        "NvAgp" "1"
 
    Option        "UseEvents" "True"
 
# another thing that might help with NV WAIT - AJB 20060403
 
#    Option        "TVStandard" "PAL-I"
 
Identifier  "Videocard0"
 
Driver      "nvidia"
 
VendorName  "Videocard vendor"
 
BoardName  "NVIDIA GeForce 4 (generic)"
 
Option     "RenderAccel" "off"
 
#    Option        "TVOutFormat" "COMPOSITE"
 
Option     "ConnectedMonitor" "CRT"
 
# attempt to fix occasional judders
 
        Option      "UseEvents" "true"
 
EndSection
 
 
 
Section "Screen"
 
Identifier "Screen0"
 
Device    "Videocard0"
 
Monitor    "Monitor0"
 
DefaultDepth    24
 
SubSection "Display"
 
Viewport  0 0
 
Depth    16
 
Modes    "1024x576" "720x576pali" "720x288pal-half" "704x576pali" "704x288pal-half" "648x576pali" "648x288pal-half"
 
# Modes    "720x576pali" "720x288pal-half" "704x576pali" "704x288pal-half" "648x576pali" "648x288pal-half"
 
EndSubSection
 
SubSection "Display"
 
Viewport  0 0
 
Depth    24
 
Modes    "1024x576" "720x576pali" "720x288pal-half" "704x576pali" "704x288pal-half" "648x576pali" "648x288pal-half"
 
# Modes    "720x576pali" "720x288pal-half" "704x576pali" "704x288pal-half" "648x576pali" "648x288pal-half"
 
EndSubSection
 
EndSection
 
 
 
</pre></code>
 
 
 
==== /etc/rc.d/rc.local ====
 
<code><pre>
 
#!/bin/sh
 
#
 
# This script will be executed *after* all the other init scripts.
 
# You can put your own initialization stuff in here if you don't
 
# want to do the full Sys V style init stuff.
 
 
 
touch /var/lock/subsys/local
 
# mtd needs mysqld to be up, so moved to mythbackend initscript
 
# AJB 20071106
 
#/usr/bin/mtd --daemon
 
setkeycodes e01e 120
 
/sbin/setpci -s 00:1f.1 latency_timer=b0
 
/sbin/setpci -s 02:0c.0 latency_timer=b0
 
 
 
# nvidia recommended setting as per <http://www.nvnews.net/vbulletin/showpost.php?p=854678&postcount=5>
 
# - AJB 20060403
 
/sbin/setpci -s 01:00.0 latency_timer=80
 
 
 
# attempt to fix router disappearing - AJB 20060423
 
# 10M doesn't seem to fix it entirely, but it seems to recover
 
# glitches regularly
 
# disabled after switching eth0 and eth1 roles around
 
#/sbin/mii-tool -A 10baseT-HD eth0 # advertise only 10baseT-HD
 
#/sbin/mii-tool -F 10baseT-HD eth0 # force 10baseT-HD
 
 
 
# attempt to fix router disappearing - AJB 20060424
 
# this seems worse than 10M-HD
 
# sometimes doesn't recover
 
#/sbin/mii-tool -A 100baseTx-HD eth0 # advertise only 10baseT-HD
 
#/sbin/mii-tool -F 100baseTx-HD eth0 # force 10baseT-HD
 
 
 
# this seems to be ignored in /etc/sysconfig/harddiskhdg AJB 20060622
 
# 240*5s=20m
 
#hdparm -S 240 /dev/sdb
 
# AJB 20071105 - 2*30m=60m
 
# disabled 20071224 after configuring InstantMirror
 
# hdparm -S 242 /dev/sdb
 
lsmod >/tmp/lsmod-rc.local-pre.txt 2>&1
 
#modprobe dvb_usb_dib0700
 
#lsmod >/tmp/lsmod-rc.local-post.txt 2>&1
 
 
 
# Attempt to fix judder AJB 20071114
 
blockdev --setra 2048 /dev/sda
 
 
 
# Disable DVB LNB powerdown, since module option seems to be ignored AJB 20080318
 
echo 0 >/sys/module/dvb_core/parameters/dvb_powerdown_on_sleep
 
 
 
# Fix USB power to on AJB 20081207
 
for i in /sys/devices/pci*/*/usb*/power/level /sys/devices/pci*/*/*/usb*/power/level /sys/devices/pci*/*/*/usb*/*/power/level;
 
        do echo "on" >$i
 
done
 
 
 
 
 
</pre></code>
 
 
 
==== /etc/modprobe.d/options ====
 
<code><pre>
 
options dvb-usb-dib0700 force_lna_activation=1
 
 
 
# disable IR remote input on Nova-T-500 (and any other USB DVB devices)
 
options dvb_usb disable_rc_polling=1
 
 
 
# may not work, so may need to echo to /sys/... in rc.local
 
options dvb_core dvb_powerdown_on_sleep=0
 
options dvb-core dvb_powerdown_on_sleep=0
 
 
 
options snd-intel8x0 index=0
 
install snd-intel8x0 /sbin/modprobe --ignore-install snd-intel8x0 && /usr/sbin/alsactl restore 0 >/dev/null 2>&1 || :
 
 
 
# I2C module options
 
alias char-major-89 i2c-dev
 
</pre></code>
 
 
 
==== /etc/X11/XvMCConfig ====
 
<code><pre>
 
libXvMCNVIDIA_dynamic.so.1
 
</pre></code>
 
 
 
==== Add to /etc/security/limits.conf ====
 
<code><pre>
 
*              -      rtprio    0
 
*              -      nice      0
 
@video          -      rtprio    50
 
@video          -      nice      0
 
@mythtv          -      rtprio    50
 
@mythtv          -      nice      0
 
</pre></code>
 
 
 
==== $HOME/.Xclients ====
 
<code><pre>
 
#!/bin/sh
 
# Load nVidia driver custom settings
 
nvidia-settings --load-config-only &
 
# Restore audio settings
 
/usr/sbin/alsactl restore
 
# Launch irexec for myth power button stop/start
 
IREXECPID=`ps uaxwww | grep irexec$ | awk '{print $2}'`
 
if [ "$IREXECPID" = "" ]; then
 
        irexec &
 
fi
 
# Disable dynamic power management (screen blanking)
 
/usr/X11R6/bin/xset -dpms
 
# Disable screen saver
 
/usr/X11R6/bin/xset s off
 
# get rid of blue line at bottom of picture
 
/usr/bin/xvattr -a XV_COLORKEY -v 66048
 
# Launch myth frontend
 
#mythfrontend &
 
mythfrontend >/dev/null 2>&1 &
 
gnome-session
 
</pre></code>
 
 
 
==== Hauppauge Infra-Red Remote ====
 
  
The sensor for the remote is connected to the Nova-T. No sensor is connected to the Nova-T-500. When I was using two Nova-Ts, sometimes the /dev nodes would swap around after a reboot or kernel upgrade. Using the by-path /dev/ entries is a bit more stable.
 
  
===== /etc/sysconfig/lircd =====
 
<code><pre>
 
# Options to lircd
 
#LIRCD_OPTIONS="-H dev/input -d /dev/input/by-path/pci-0000:02:03.2--event-ir"
 
# path to the device node for the Nova-T sometimes changes between .2 and .0,
 
# so use a wildcard to match, as long as there's only ever one Nova-T present!
 
LIRCD_OPTIONS="-H dev/input -d /dev/input/by-path/pci-0000:02:03.?--event-ir"
 
</pre></code>
 
 
===== /etc/lircd.conf =====
 
<code><pre>
 
 
# Please make this file available to others
 
# by sending it to <lirc@bartelmus.de>
 
#
 
# this config file was automatically generated
 
# using lirc-0.8.0(userspace) on Sun Mar  5 23:39:07 2006
 
#
 
# contributed by Alex Butcher
 
#
 
# brand: Hauppage Nova-T 909              myconfig.conf
 
# model no. of remote control:
 
# devices being controlled by this remote:
 
#
 
 
begin remote
 
 
  name  myconfig.conf
 
  bits          16
 
  eps            30
 
  aeps          100
 
 
  one            0    0
 
  zero            0    0
 
  pre_data_bits  16
 
  pre_data      0x8001
 
  gap          135678
 
  toggle_bit      0
 
 
 
      begin codes
 
          Go                      0x0161
 
          Power                    0x0074
 
          TV                      0x0179
 
          Videos                  0x0189
 
          Music                    0x0188
 
          Pictures                0x016F
 
          Guide                    0x016D
 
          Radio                    0x0181
 
          UP                      0x0067
 
          LEFT                    0x0069
 
          RIGHT                    0x006A
 
          DOWN                    0x006C
 
          OK                      0x001C
 
          Back                    0x00AE
 
          Menu                    0x008B
 
          VolumeUp                0x0073
 
          VolumeDown              0x0072
 
          Prev-Ch                  0x019C
 
          ChannelUp                0x0192
 
          ChannelDown              0x0193
 
          Mute                    0x0071
 
          Record                  0x00A7
 
          Stop                    0x0080
 
          Replay                  0x00A8
 
          Play                    0x00CF
 
          Skip                    0x00D0
 
          PreviousTrack            0x00A5
 
          Pause                    0x0077
 
          NextTrack                0x00A3
 
          1                        0x0002
 
          2                        0x0003
 
          3                        0x0004
 
          4                        0x0005
 
          5                        0x0006
 
          6                        0x0007
 
          7                        0x0008
 
          8                        0x0009
 
          9                        0x000a
 
          Asterisk                0x0184
 
          0                        0x000b
 
          Hash                    0x0172
 
          Red                      0x018E
 
          Green                    0x018F
 
          Yellow                  0x0190
 
          Blue                    0x0191
 
      end codes
 
 
end remote
 
 
</pre></code>
 
</pre></code>
  
Line 6,288: Line 6,551:
 
</myththeme>
 
</myththeme>
 
</pre></code>
 
</pre></code>
 
==== /usr/share/mythtv/themes/glass-wide/background.png ====
 
 
I modified the original glass-wide background to be a bit darker to improve readability of text superimposed upon it.
 
 
http://www.mythtv.org/wiki/images/d/d2/Modified_glass-wide_Background.png
 
  
 
=== Comments ===
 
=== Comments ===

Latest revision as of 18:42, 3 April 2014

Contents

Cowbutt's MythTV Page

New system, post-January 2011

Based on my successful previous MythTV system I continued to use a combined frontend/backend, though I've since added frontends on my desktop PC and laptop for occasional use over my LAN and WLAN. My goals for my new system were to:

  • Add storage capacity
  • Use RAID for uptime, and some degree of availability
  • Add SATA, as PATA drives are now somewhat hard to buy, and unavailable in sizes over 500GB
  • Improve performance during DVD archiving
  • Improve recording and playback robustness from background tasks (e.g. mirroring, DVD archiving)
  • Provide for future HD capacity
  • Improve aesthetics (case, fan noise)

I don't have a HDTV, so I haven't yet invested in any HD sources (either a DVB-T2 card for FreeviewHD, or a BluRay drive).

I continued to base my configuration on Jarod C. Wilson's 'Fedora Myth(TV)ology' document.

Hardware Specification

  • Intel i5-760 4x2.80GHz CPU
  • 4GB RAM
  • Asus P7H55 Motherboard (iH55 Express)
  • 2xWestern Digital Caviar Black WD2001FASS 2TB discs
  • Sony Optiarc DDU1681S DVD-ROM (This drive is problematic with burnt DVD+Rs; I don't know if this is a problem with my specific drive, a firmware issue, or a hardware design issue. Back to Lite-On next time, I think!)
  • Sony Optiarc AD-7260S DVD+/-RW
  • Antec NSK-6582B case
  • 1*Hauppauge Nova-T DVB-T tuner
  • 1*Hauppauge Nova-T-500 dual DVB-T tuner with Hauppauge infra-red remote control (Note that the Nova-T-500 needs to be configured quite carefully for reliable operation! A configuration checklist is included.)
  • 1*D-Link quad-port NIC
  • Asus 7600GS Silent/HTD 256MB fanless VGA card (originally planned to use an Asus GT240 Silent/DI/1GB DDR3 card, but it can't output a 15kHz VGA signal. I'm using it elsewhere until I have a TV with DVI or HDMI input.)
  • home-built VGA-to-RGB SCART adaptor with integrated audio in/out and composite from SCART
  • 2*PADIX/Rockfire PX-205 PSX-USB Bridge with two Logic-7 Playstation dual-shock gamepads
  • Ruwido/Chicony KB-9820 infra-red PS/2 keyboard/mousepad
  • Panasonic TX-28DTX11 100Hz DVB-T 16:9 TV
  • SLx 4-way UHF amplifier
  • Yamaha RX-V361 AV Receiver/Surround Decoder, linked via 3m TOSlink fibre

Software Specification

  • Fedora 14 running 2.6.35.10-74.fc14.x86_64 kernel and standard video4linux drivers. This kernel revision appears to fully support the Nova-T-500, including the remote control, thus completely negating any reason to use out-of-tree v4l drivers from the mercurial repository. Note that previous Fedora kernels supported the Nova-T-500, but with no remote control support. The v4l drivers from the mercurial repository are reputed to be more stable with the Nova-T-500, but I experienced a couple of hard locks when running with a snapshot taken on 17 March 2008.
  • MythTV 0.24-fixes built as per RPMFusion's packages, but using a GIT snapshot dated January 12 2011.
  • pdnsd caching DNS server
  • privoxy ad-filtering HTTP proxy
  • DHCP daemon
  • netfilter/iptables firewall
  • NTP server
  • nVidia 256.53-1.fc14 drivers built using RPMFusion's src.rpm (later revisions are alleged to have serious problems, especially with VDPAU).
  • Xmame/Xmess 0.106, fceultra 0.98.13-0.7.pre.fc11, VisualBoyAdvance 1.7.2, zsnes 1.51-7, dgen-sdl 1.23
  • dvb-usb-dib0700-1.20.fw firmware for Nova-T-500 (may need symlinks in /lib/firmware named dvb-usb-dib0700-01.fw and dvb-usb-dib0700-1.10.fw)

OS Configuration

Partitioning

/dev/sda1       2GiB /boot       ext4 on md RAID1 with /dev/sdb1
/dev/sda2     430GiB             RAID1 with /dev/sdb2, LVM PVs for / (20GiB, ext4), /home (5GiB, ext4), /srv/myth/emulators (89GiB, ext4), /srv/myth/music (60GiB, ext4), /var (9.9GiB, ext3),
                                  /var/spool (2GiB, ext4)
/dev/sda3      16GiB swap        configured round-robin with /dev/sdb3
/dev/sda4          - extended
/dev/sda5     350GiB             LVM PV for /downloads (135GiB, ext4), /srv/myth/video-filler0 (210GiB, ext4)
/dev/sda6    1065GiB             RAID1 with /dev/sdb6, LVM PVs for /srv/myth/video-R1a, /srv/myth/video-R1b, /srv/myth/video-R1c, /srv/myth/video-R1d, /srv/myth/video-R1e (213GiB each, jfs)

/dev/sda1       2GiB /boot       ext4 on md RAID1 with /dev/sda1
/dev/sda2     430GiB             RAID1 with /dev/sda2, LVM PVs for /, /home, /srv/myth/emulators, /srv/myth/music, /var, /var/spool
/dev/sda3      16GiB swap        configured round-robin with /dev/sda3
/dev/sda4          - extended
/dev/sda5     350GiB             LVM PV for /srv/myth/videos (105GiB, ext4), /tmp (1008MiB, ext4), /var/cache (5GiB, ext4), /var/tmp (1008MiB, ext4), /srv/myth/video-filler1 (210GiB, ext4)
/dev/sda6    1065GiB             RAID1 with /dev/sda6, LVM PVs for /srv/myth/video-R1a, /srv/myth/video-R1b, /srv/myth/video-R1c, /srv/myth/video-R1d, /srv/myth/video-R1e (213GiB each, jfs)

My default storage group uses /srv/myth/video-R1[a-e]. I've created five 213GiB partitions as jfs filesystems cannot be resized to be smaller once they are created. If I need space elsewhere, I can migrate the recordings present in one of the video-R1[a-e] filesystems elsewhere (possibly /dev/null), remove it from the storage group, optionally re-mkfs, and repurpose it.

The /srv/myth/video-filler[0-1] filesystems are intended for filler recordings that I might watch (e.g. The Simpsons, Newsnight, Russia Today etc), but I don't really care if I lose them in the event of a disc failure. I bind these filesystems into a 'filler' storage group, which can be used on a case-by-case basis when setting up a recording rule.

/var is ext3 because that's where the MySQL database lives, and there are reports of performance issues when hosting the MySQL database on ext4 filesystems

If one wanted better reliability, putting swap on a md RAID1 array might be an improvement (if a disc fails, attempts to page in won't fail). I figure swap is rewritten often enough that the disc will reallocate if a sector or three fails. In my experience, my mains electricity fails more often than discs completely die.

/etc/php.ini

Configure PHP's date.timezone setting to match local timezone, or MythWeb will fail to generate preview thumbnails for recordings that were made whilst DST was in force if DST is not currently in force, and vice versa.

Example:

date.timezone = Europe/London

/etc/my.cnf

[mysqld]
key_buffer = 16M
table_cache = 128
sort_buffer_size = 2M
myisam_sort_buffer_size = 8M
query_cache_size = 16M

datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

There's scope for increasing MySQL's various buffers still further.

/etc/grub.conf

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/mapper/WD2TB--R1SYSTEM-WD2TBroot
#          initrd /initrd-[generic-]version.img
#boot=/dev/sda
default=0
timeout=0
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Fedora (2.6.35.10-74.fc14.x86_64)
	root (hd0,0)
	kernel /vmlinuz-2.6.35.10-74.fc14.x86_64 ro root=/dev/mapper/WD2TB--R1SYSTEM-WD2TBroot rd_LVM_LV=WD2TB-R1SYSTEM/WD2TBroot rd_MD_UUID=7ebf6aa5:d19116e9:c02700aa:43184eaf rd_NO_LUKS rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=uk rd_NO_PLYMOUTH nouveau.modeset=0 rdblacklist=nouveau usbcore.autosuspend=-1
	initrd /initramfs-2.6.35.10-74.fc14.x86_64.img
#title Fedora (2.6.35.10-74.fc14.x86_64)
#	root (hd0,0)
#	kernel /vmlinuz-2.6.35.10-74.fc14.x86_64 ro root=/dev/mapper/WD2TB--R1SYSTEM-WD2TBroot rd_LVM_LV=WD2TB-R1SYSTEM/WD2TBroot rd_MD_UUID=7ebf6aa5:d19116e9:c02700aa:43184eaf rd_NO_LUKS rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=uk rhgb quiet nouveau.modeset=0 rdblacklist=nouveau
#	initrd /initramfs-2.6.35.10-74.fc14.x86_64.img

USB autosuspend is disabled, to ensure Nova-T-500 tuner availability.

/etc/udev/rules.d/70-persistent-cd.rules

# This file was automatically generated by the /lib/udev/write_cd_rules
# program, run by the cd-aliases-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and set the $GENERATED variable.

# DVD_RW_AD-7260S (pci-0000:00:1f.2-scsi-4:0:0:0)
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:1f.2-scsi-4:0:0:0", SYMLINK+="cdrom1", ENV{GENERATED}="1"
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:1f.2-scsi-4:0:0:0", SYMLINK+="cdrw", ENV{GENERATED}="1"
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:1f.2-scsi-4:0:0:0", SYMLINK+="dvd1", ENV{GENERATED}="1"
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:1f.2-scsi-4:0:0:0", SYMLINK+="dvdrw", ENV{GENERATED}="1"

# DVD-ROM_DDU1681S (pci-0000:00:1f.2-scsi-3:0:0:0)
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:1f.2-scsi-3:0:0:0", SYMLINK+="cdrom", ENV{GENERATED}="1"
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:1f.2-scsi-3:0:0:0", SYMLINK+="dvd", ENV{GENERATED}="1"

cron jobs

/etc/cron.daily/mythbackup.sh
#!/bin/sh
#Dumps the mythconverg database - daily backup
#Keeps the last 7 days
DAY=($(date +%u))
DUMPFILE="mythbe_"$DAY".sql"
#mysqldump -u mythtv -pmythtv mythconverg -c | gzip >/var/lib/mythtv/$DUMPFILE.gz
# add locking AJB 20060417
mysqldump --opt -u mythtv -pmythtv mythconverg -c | gzip >/var/lib/mythtv/$DUMPFILE.gz
exit 0
/etc/cron.daily/mythrecategorise.sh
#!/bin/sh
echo "update recorded set category='Film' where category='film';" | mysql -u mythtv -pmythtv mythconverg
echo "update recorded set category='Film' where category='Movie';" | mysql -u mythtv -pmythtv mythconverg
echo "update recorded set category='Arts/Culture' where category='arts and culture';" | mysql -u mythtv -pmythtv mythconverg
echo "update recorded set category='Arts/Culture' where category='Arts and culture';" | mysql -u mythtv -pmythtv mythconverg
echo "update recorded set category='Arts/Culture' where category='Music';" | mysql -u mythtv -pmythtv mythconverg
echo "update recorded set category='Arts/Culture' where category='music and arts';" | mysql -u mythtv -pmythtv mythconverg
echo "update recorded set category='News and Current Affairs' where category='news and current affairs';" | mysql -u mythtv -pmythtv mythconverg
echo "update recorded set category='Animation' where category='animation';" | mysql -u mythtv -pmythtv mythconverg
echo "update recorded set category='Comedy' where category='comedy';" | mysql -u mythtv -pmythtv mythconverg
echo "update recorded set category='Debate' where category='discussion/debate';" | mysql -u mythtv -pmythtv mythconverg
echo "update recorded set category='Game show' where category='game show';" | mysql -u mythtv -pmythtv mythconverg
echo "update recorded set category='Documentary' where category='documentary';" | mysql -u mythtv -pmythtv mythconverg
echo "update recorded set category='Documentary' where category='factual';" | mysql -u mythtv -pmythtv mythconverg
echo "update recorded set category='Cookery' where category='food';" | mysql -u mythtv -pmythtv mythconverg
echo "update recorded set category='Sitcoms' where category='sitcom';" | mysql -u mythtv -pmythtv mythconverg
echo "update recorded set category='Science/Nature' where category='science';" | mysql -u mythtv -pmythtv mythconverg
echo "update recorded set category='Science/Nature' where category='Nature';" | mysql -u mythtv -pmythtv mythconverg
echo "update recorded set category='Science/Nature' where category='Science';" | mysql -u mythtv -pmythtv mythconverg


echo "update recordedprogram set category='Film' where category='film';" | mysql -u mythtv -pmythtv mythconverg
echo "update recordedprogram set category='Film' where category='Movie';" | mysql -u mythtv -pmythtv mythconverg
echo "update recordedprogram set category='Arts/Culture' where category='arts and culture';" | mysql -u mythtv -pmythtv mythconverg
echo "update recordedprogram set category='Arts/Culture' where category='Arts and culture';" | mysql -u mythtv -pmythtv mythconverg
echo "update recordedprogram set category='Arts/Culture' where category='Music';" | mysql -u mythtv -pmythtv mythconverg
echo "update recordedprogram set category='Arts/Culture' where category='music and arts';" | mysql -u mythtv -pmythtv mythconverg
echo "update recordedprogram set category='News and Current Affairs' where category='news and current affairs';" | mysql -u mythtv -pmythtv mythconverg
echo "update recordedprogram set category='Animation' where category='animation';" | mysql -u mythtv -pmythtv mythconverg
echo "update recordedprogram set category='Comedy' where category='comedy';" | mysql -u mythtv -pmythtv mythconverg
echo "update recordedprogram set category='Debate' where category='discussion/debate';" | mysql -u mythtv -pmythtv mythconverg
echo "update recordedprogram set category='Game show' where category='game show';" | mysql -u mythtv -pmythtv mythconverg
echo "update recordedprogram set category='Documentary' where category='documentary';" | mysql -u mythtv -pmythtv mythconverg
echo "update recordedprogram set category='Documentary' where category='factual';" | mysql -u mythtv -pmythtv mythconverg
echo "update recordedprogram set category='Cookery' where category='food';" | mysql -u mythtv -pmythtv mythconverg
echo "update recordedprogram set category='Sitcoms' where category='sitcom';" | mysql -u mythtv -pmythtv mythconverg
echo "update recordedprogram set category='Science/Nature' where category='science';" | mysql -u mythtv -pmythtv mythconverg
echo "update recordedprogram set category='Science/Nature' where category='Nature';" | mysql -u mythtv -pmythtv mythconverg
echo "update recordedprogram set category='Science/Nature' where category='Science';" | mysql -u mythtv -pmythtv mythconverg

echo "update recordedprogram set category_type='movie' where category='Film';" | mysql -u mythtv -pmythtv mythconverg
exit 0

EIT (aka EPG) and Radio Times categories do not always match.

/etc/cron.daily/optimize_mythdb.pl
#!/usr/bin/perl -w
#
# Connects to the mythtv database and repairs/optimizes the tables that it
# finds.  Suggested use is to cron it to run once per day.
#
# @url       $URL$
# @date      $Date: 2007-08-04 11:25:32 +0200 (Sat, 04 Aug 2007) $
# @version   $Revision: 14140 $
# @author    $Author: xris $
# @license   GPL
#

# Includes
    use DBI;
    use MythTV;

# Connect to mythbackend
    my $Myth = new MythTV({'connect' => 0});

# Connect to the database
    $dbh = $Myth->{'dbh'};

# Repair and optimize each table
    foreach $table ($dbh->tables) {
        unless ($dbh->do("REPAIR TABLE $table")) {
            print "Skipped:  $table\n";
            next;
        };
        if ($dbh->do("OPTIMIZE TABLE $table")) {
            print "Repaired/Optimized: $table\n";
        }
        if ($dbh->do("ANALYZE TABLE $table")) {
            print "Analyzed: $table\n";
        }
    }

/etc/gdm/custom.conf

Set AutomaticLogin=mythtv in the [daemon] section to configure gdm to auto login as the mythtv user when X starts.

/etc/X11/xorg.conf


# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig:  version 1.0  (buildmeister@builder3)  Wed Dec 14 16:39:22 PST 2005
# XFree86 4 configuration created by pyxf86config

Section "ServerLayout"
	Identifier     "Default Layout"
	Screen      0  "Screen0" 0 0
	InputDevice    "Mouse0" "CorePointer"
	InputDevice    "Keyboard0" "CoreKeyboard"
#AJB20110305 try enabling gnome-screensaver
#	Option         "BlankTime" "0"
        Option         "StandbyTime" "0"
        Option         "SuspendTime" "0"
	Option         "OffTime" "0"
EndSection

Section "Extensions"
# AJB 20110128 enabled for flash
# disable if/when I start using VDPAU!
# See chapter 23 of 
# ftp://download.nvidia.com/XFree86/Linux-x86_64/256.53/README/README.txt
# and
# http://www.mythtv.org/wiki/VDPAU#Tearing.2FStuttering
        Option      "Composite" "Enable"
EndSection

Section "Files"

# RgbPath is the location of the RGB database.  Note, this is the name of the 
# file minus the extension (like ".txt" or ".db").  There is normally
# no need to change the default.
# Multiple FontPath entries are allowed (they are concatenated together)
# By default, Red Hat 6.0 and later now use a font server independent of
# the X server to render fonts.

#Add
# ModulePath "/usr/lib/xorg/modules/extensions/nvidia"
# ModulePath "/usr/lib/xorg/modules/extensions"
# ModulePath "/usr/lib/xorg/modules"
# to `Section "Files"' in the config file and remove/comment the dri module.


# 8776
#	ModulePath   "/usr/X11R6/lib/modules/extensions/nvidia"
#	ModulePath   "/usr/X11R6/lib/modules/extensions"
#	ModulePath   "/usr/X11R6/lib/modules"

#	ModulePath "/usr/lib/xorg/modules/extensions/nvidia"
#	ModulePath "/usr/lib/xorg/modules/extensions"
#	ModulePath "/usr/lib/xorg/modules"
#
#	ModulePath   "/usr/lib/xorg/modules/"

	ModulePath   "/usr/lib64/xorg/modules/extensions/nvidia"
	ModulePath   "/usr/lib64/xorg/modules"
EndSection

Section "ServerFlags"
	Option	    "AllowMouseOpenFail"
EndSection

Section "InputDevice"

# Specify which keyboard LEDs can be user-controlled (eg, with xset(1))
#	Option	"Xleds"		"1 2 3"
# To disable the XKEYBOARD extension, uncomment XkbDisable.
#	Option	"XkbDisable"
# To customise the XKB settings to suit your keyboard, modify the
# lines below (which are the defaults).  For example, for a non-U.S.
# keyboard, you will probably want to use:
#	Option	"XkbModel"	"pc102"
# If you have a US Microsoft Natural keyboard, you can use:
#	Option	"XkbModel"	"microsoft"
#
# Then to change the language, change the Layout setting.
# For example, a german layout can be obtained with:
#	Option	"XkbLayout"	"de"
# or:
#	Option	"XkbLayout"	"de"
#	Option	"XkbVariant"	"nodeadkeys"
#
# If you'd like to switch the positions of your capslock and
# control keys, use:
#	Option	"XkbOptions"	"ctrl:swapcaps"
# Or if you just want both to be control, use:
#	Option	"XkbOptions"	"ctrl:nocaps"
#
	Identifier  "Keyboard0"
	Driver      "kbd"
	Option	    "XkbModel" "pc105"
	Option	    "XkbLayout" "gb"
EndSection

Section "InputDevice"
	Identifier  "Mouse0"
	Driver      "mouse"
	Option	    "Protocol" "IMPS/2"
	Option	    "Device" "/dev/input/mice"
	Option	    "ZAxisMapping" "4 5"
	Option	    "Emulate3Buttons" "yes"
EndSection

Section "Monitor"

#    HorizSync       31.5 - 37.9
#    VertRefresh     50.0 - 70.0

# For 1024x576
	DisplaySize  260 146

# For 1280x576
#        DisplaySize  325 146

	Identifier   "Monitor0"
	VendorName   "Monitor Vendor"
	ModelName    "Unknown monitor"
	Option       "DPMS" "false"
	HorizSync    0.0 - 16.0
	VertRefresh  49.0 - 62.0
	ModeLine     "800x576pali" 15.4 800 823 895 984 576 580 583 625 -hsync -vsync interlace
	ModeLine     "800x288pal-half" 15.4 800 823 895 984 288 290 292 313 -hsync -vsync
#	ModeLine     "768x576pali" 14.8 768 789 858 944 576 581 586 625 -hsync -vsync interlace
# 768x576@14.75 is 15.625kHz horiz sync
	ModeLine     "768x576pali" 14.75 768 789 858 944 576 581 586 625 -hsync -vsync interlace
	ModeLine     "768x288pal-half" 14.8 768 792 856 944 288 290 292 313 -hsync -vsync
#	ModeLine     "720x576pali" 13.9 720 744 808 888 576 580 583 625 -hsync -vsync interlace

# dvb is normally 720x576, 4:3 analogue is normally 768x576
# previous best
# 720x576 w/ 13.5MHz dotclock is 50.0000Hz, 15.6250kHz, checked with hacked xvidtune
# and manually: 864 * 15625 = 13.5M
# Good, but a bit too far to the right - AJB 20071110
#	ModeLine     "720x576pali" 13.5 720 722 786 864 576 581 586 625 -hsync -vsync interlace

#	ModeLine     "720x576pali" 13.5 720 727 791 864 576 581 586 625 -hsync -vsync interlace
#	ModeLine     "720x576pali" 13.5 720 737 801 864 576 581 586 625 -hsync -vsync interlace

# AJB20110108 working, but too far to left and too overscanned
#	ModeLine     "720x576pali" 13.5 720 757 821 864 576 581 586 625 -hsync -vsync interlace
# If HTotal > 872, get flickering or shaking picture. HTotal other than 864 changes H & V sync freq
	ModeLine     "720x576pali" 13.5 720 725 789 864 576 581 586 625 -hsync -vsync interlace

# worth trying if 720x576@13.5 flickers:
# from http://www.avforums.com/forums/showthread.php?t=136811&page=33
# ModeLine "720x576" 15.125 720 762 834 968 576 579 607 625 -hsync -vsync interlace
# from http://www.avforums.com/forums/showthread.php?t=136811&page=27
ModeLine "1024x576" 19.750 1024 1056 1152 1264 576 581 586 625 -hsync -vsync interlace

#ModeLine "1280x576" 21.5625 1280 1320 1440 1380 576 581 586 625 -hsync -vsync interlace
#From http://campus.uab.es/~2106707/vga2tv/resoluc.htm
ModeLine "1280x576" 24.0 1280 1308 1422 1536 576 581 586 625 -hsync -vsync interlace

#	ModeLine     "720x288pal-half" 13.9 720 744 808 888 288 290 292 313 -hsync -vsync
# should be 13.875MHz for 15.625kHz horiz sync
	ModeLine     "720x288pal-half" 13.875 720 744 808 888 288 290 292 313 -hsync -vsync
# previously used for some oddball broadcasts
# 704x576 w/ 13.5MHz dotclock is 50.0000Hz, 15.6250kHz, checked with hacked xvidtune
	ModeLine     "704x576pali" 13.5 704 720 784 864 576 580 583 625 -hsync -vsync interlace
	ModeLine     "704x288pal-half" 13.5 704 720 784 864 288 290 292 313 -hsync -vsync

# appears to be closest to PAL spec, according to:
# http://www.gossamer-threads.com/lists/mythtv/users/191409?search_string=interlace;#191409
# http://www.gossamer-threads.com/lists/mythtv/users/100222?search_string=scart;#100222
# still flickers occasionally with 8776 drivers
# 720x576 w/ 13.875MHz dotclock is 49.98Hz according to xvidtune
#	ModeLine     "720x576pali" 13.875 720 744 808 888 576 581 586 625 -hsync -vsync interlace
#	ModeLine     "720x288pal-half" 13.875 720 744 808 888 288 290 293 313 -hsync -vsync
#	ModeLine     "704x576pali" 13.6 704 728 792 872 576 581 586 625 -hsync -vsync interlace
#	ModeLine     "704x288pal-half" 13.6 704 728 792 872 288 290 293 313 -hsync -vsync

# previously used for some oddball broadcasts
#	ModeLine     "704x576pali" 13.5 704 720 784 864 576 580 583 625 -hsync -vsync interlace
#	ModeLine     "704x288pal-half" 13.5 704 720 784 864 288 290 292 313 -hsync -vsync

	ModeLine     "648x576pali" 12.5 648 664 720 824 576 580 583 625 -hsync -vsync interlace
	ModeLine     "648x288pal-half" 12.5 648 664 720 824 288 290 292 313 -hsync -vsync
	ModeLine     "800x480ntsci" 15.1 800 808 879 960 480 484 487 525 -hsync -vsync interlace
	ModeLine     "800x240ntsc-half" 15.1 800 808 879 960 240 242 244 263 -hsync -vsync
	ModeLine     "720x480ntsci" 13.6 720 728 792 864 480 484 487 525 -hsync -vsync interlace
	ModeLine     "720x240ntsc-half" 13.6 720 728 792 864 240 242 244 263 -hsync -vsync
	ModeLine     "704x480ntsci" 13.3 704 712 776 848 480 484 487 525 -hsync -vsync interlace
	ModeLine     "704x240ntsc-half" 13.3 704 712 776 848 240 242 244 263 -hsync -vsync
	ModeLine     "657x480ntsci" 12.5 656 664 728 792 480 484 487 525 -hsync -vsync interlace
	ModeLine     "657x240ntsc-half" 12.5 656 664 728 792 240 242 244 263 -hsync -vsync
	ModeLine     "320x256pal" 10.9 320 352 368 400 256 261 264 269 -hsync -vsync doublescan
	ModeLine     "320x512pali" 5.5 320 352 368 400 512 523 527 539 -hsync -vsync interlace
	ModeLine     "320x200pal" 8.4 320 352 368 400 200 204 206 211 -hsync -vsync doublescan
	ModeLine     "320x400pali" 4.2 320 352 360 392 400 409 411 421 -hsync -vsync interlace
	ModeLine     "320x400ntsci" 5.1 320 352 368 400 400 409 411 421 -hsync -vsync interlace
	ModeLine     "320x200ntsc" 10.2 320 352 368 400 200 204 206 211 -hsync -vsync doublescan
	ModeLine     "352x288pald" 13.5 352 392 492 512 288 292 300 304 -hsync -vsync doublescan
	ModeLine     "352x288paldi" 13.5 352 392 492 512 288 292 300 304 -hsync -vsync interlace doublescan
	Option	    "dpms"
EndSection

Section "Device"

# next line might make XvMC work
# or fix NV WAIT problems
# ...maybe, but makes picture bounce - AJB 20060403
    Option         "NvAgp" "1"
    Option         "UseEvents" "True"

# for MythTV chromakey OSD
    Option         "XvmcUsesTextures" "false" 

# another thing that might help with NV WAIT - AJB 20060403
#    Option         "TVStandard" "PAL-I"
	Identifier  "Videocard0"
	Driver      "nvidia"
	VendorName  "Videocard vendor"
	BoardName   "NVIDIA GeForce 4 (generic)"
	Option	    "RenderAccel" "off"
#    Option         "TVOutFormat" "COMPOSITE"
	Option	    "ConnectedMonitor" "CRT"
	Option      "UseEdidDpi" "false"
        Option      "UseEdidFreqs" "false"
        Option      "ModeValidation" "NoEdidModes"
	Option      "ModeDebug" "true"
# attempt to fix occasional judders
	Option	    "UseEvents"	"true"

# AJB 20110128 for flash
	Option      "AddARGBGLXVisuals" "true"
#	Option      "RandRRotation "true"
	Option      "UseCompositeWrapper" "true"
        Option      "TripleBuffer" "true"

EndSection

Section "Screen"
	Identifier "Screen0"
	Device     "Videocard0"
	Monitor    "Monitor0"
	DefaultDepth     24
	SubSection "Display"
		Viewport   0 0
		Depth     16
		Modes    "1024x576" "720x576pali" "720x288pal-half" "704x576pali" "704x288pal-half" "648x576pali" "648x288pal-half"
#		Modes    "720x576pali" "720x288pal-half" "704x576pali" "704x288pal-half" "648x576pali" "648x288pal-half"
#		Modes    "704x576pali" "704x288pal-half" "648x576pali" "648x288pal-half"
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     24
		Modes    "1024x576" "720x576pali" "720x288pal-half" "704x576pali" "704x288pal-half" "648x576pali" "648x288pal-half"
#		Modes    "720x576pali" "720x288pal-half" "704x576pali" "704x288pal-half" "648x576pali" "648x288pal-half"
#		Modes    "704x576pali" "704x288pal-half" "648x576pali" "648x288pal-half"
	EndSubSection
EndSection

/etc/rc.d/rc.local

#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local

#AJB 20101231 WD 2TB drives spin down too freequently
/sbin/hdparm -B 254 /dev/sda
/sbin/hdparm -B 254 /dev/sdb

#AJB 20110104 eth0:0 doesn't get started automatically anymore?!?
#/sbin/ifup eth0:0

# below this point copied from old mythtv setup 20110107

# mtd needs mysqld to be up, so moved to mythbackend initscript
# AJB 20071106
#/usr/bin/mtd --daemon
setkeycodes e01e 120

# PCI latency for PATA controllers
#/sbin/setpci -s 00:1f.1 latency_timer=b0 # Intel
#/sbin/setpci -s 02:0c.0 latency_timer=b0 # Promise RAID

# nvidia recommended setting as per <http://www.nvnews.net/vbulletin/showpost.php?p=854678&postcount=5>
# - AJB 20060403
/sbin/setpci -s 01:00.0 latency_timer=80

# attempt to fix router disappearing - AJB 20060423
# 10M doesn't seem to fix it entirely, but it seems to recover
# glitches regularly
# disabled after switching eth0 and eth1 roles around
#/sbin/mii-tool -A 10baseT-HD eth0 # advertise only 10baseT-HD
#/sbin/mii-tool -F 10baseT-HD eth0 # force 10baseT-HD

# attempt to fix router disappearing - AJB 20060424
# this seems worse than 10M-HD
# sometimes doesn't recover
#/sbin/mii-tool -A 100baseTx-HD eth0 # advertise only 10baseT-HD
#/sbin/mii-tool -F 100baseTx-HD eth0 # force 10baseT-HD

# this seems to be ignored in /etc/sysconfig/harddiskhdg AJB 20060622
# 240*5s=20m
#hdparm -S 240 /dev/sdb
# AJB 20071105 - 2*30m=60m
# disabled 20071224 after configuring InstantMirror
# hdparm -S 242 /dev/sdb
lsmod >/tmp/lsmod-rc.local-pre.txt 2>&1
#modprobe dvb_usb_dib0700
#lsmod >/tmp/lsmod-rc.local-post.txt 2>&1

# Attempt to fix judder AJB 20071114
blockdev --setra 2048 /dev/sda
blockdev --setra 2048 /dev/sdb

# Disable DVB LNB powerdown, since module option seems to be ignored AJB 20080318
echo 0 >/sys/module/dvb_core/parameters/dvb_powerdown_on_sleep

# Fix USB power to on AJB 20110119
#for i in `find /sys -name 'level' | grep usb`; do echo "on" >$i; done
# AJB20110120 power/level deprecated in favour of power/control
for i in `find /sys -name 'control' | grep usb`; do echo "on" >$i; done
for i in `find /sys -name 'control' | grep i2c` ; do echo "on" >$i; done

Fixing USB power to 'on' seems to be important for maintaining availability of both Nova-T-500 tuners. Failing to do so results in the kernel sometimes suspending either the tuners themselves, or the VIA USB bridge they sit behind, and being unable to reset and recover them without a power cycle.

/etc/modprobe.d/nova-t-500-buggy_sfn_workaround.conf

#UK Freeview doesn't use Single Frequency Network, so leaving workaround disabled probably results in more robust decoding AJB20110120
#options dib3000mc buggy_sfn_workaround=1 debug=1
#options dib7000p buggy_sfn_workaround=1 debug=1

/etc/modprobe.d/nova-t-500-dib3000-dib7000-debug.conf

options dib3000mc debug=1
options dib7000p debug=1

/etc/modprobe.d/nova-t-500-disable-ir.conf

#options dvb_usb disable_rc_polling=1
options dvb_usb disable_rc_polling=1 debug=127

The Nova-T-500 IR receiver has been implicated in tuner instability, and I only use the Nova-T's IR receiver, so I disable the Nova-T-500's.

/etc/modprobe.d/nova-t-500-force-lna.conf

#options dvb-usb-dib0700 force_lna_activation=1
#options dvb-usb-dib0700 force_lna_activation=1 debug=7
options dvb-usb-dib0700 adapter_nr=1,2 force_lna_activation=1 debug=7

This enables the Low Noise Amplifier on the Nova-T-500, and forces its tuners to take up slots 1 and 2, regardless of whether the driver for it or the Nova-T is loaded first.

/etc/modprobe.d/nova-t-500-mt2060-debug.conf

options mt2060 debug=1

/etc/modprobe.d/nova-t-adapter_nr.conf

options cx88-dvb adapter_nr=0

This forces the Nova-T's tuner to take up slot 0, regardless of whether the driver for it, or the Nova-T-500's tuners is loaded first.

/etc/X11/XvMCConfig

This file appears to be deprecated and no longer needed.

Add to /etc/security/limits.conf

# increased from 50 to 99 20080315: attempt to fix judder - AJB
## Automatically appended by jack-audio-connection-kit
@jackuser - rtprio 20
@jackuser - memlock 4194304

*               -       rtprio     0
*               -       nice       0
@video          -       rtprio     50
@video          -       nice       0


#@mythtv          -       rtprio     50
@mythtv          -       rtprio     99
@mythtv          -       nice       0

$HOME/.Xclients

#! /bin/bash

# Created by Red Hat Desktop Switcher

#echo >>/tmp/xstartup "in .Xclients at `date` with params $*"

if [ -e "$HOME/.Xclients-$HOSTNAME$DISPLAY" ]; then
    exec $HOME/.Xclients-$HOSTNAME$DISPLAY
else
    exec $HOME/.Xclients-default
fi

/etc/X11/xinit/Xclients.gnome-session.sh

#!/bin/sh

echo >>/tmp/xstartup "in 00-mythfrontend.sh at `date` as `whoami` with params $*"

if [ "$USER" = "mythtv" ]; then
	#AJB20110115 getting tearing not noticed previously w/F14/0.24/nv256.53
	#before we had working Xclients
	#Re-enabled; XvMC combined with GL, Xv VSync appears to be perfect
	## Load nVidia driver custom settings
	nvidia-settings --load-config-only &
	# Restore audio settings
	/usr/sbin/alsactl restore
	# Launch irexec for myth power button stop/start
	IREXECPID=`ps uaxwww | grep irexec$ | awk '{print $2}'`
	if [ "$IREXECPID" = "" ]; then
		irexec &
	fi	
	# Disable dynamic power management (screen blanking)
	/usr/bin/xset -dpms

#AJB20110305 try enabling gnome-screensaver
#AJB20110305 Note that gnome-screensaver's --poke functionality got ripped out
#so must use xscreensaver
#	# Disable screen saver
#	/usr/bin/xset s off


	# Try adding xscreensaver 20080322
	# Works fine, apart from when screensaver kicks in during paused video
	# playback, which causes a crash when resuming with nVidia driver 96.43.01
	# 20080323
	# Works fine with F14/nVidia driver 256.53 20110707
	 /usr/bin/xscreensaver -nosplash&
	#AJB20110305 sleep a bit so xscreensaver/mythfrontend don't race to get keyboard focus
#	 sleep 5s
	# get rid of blue line at bottom of picture
	/usr/bin/xvattr -a XV_COLORKEY -v 66048
	# Launch myth frontend
	#mythfrontend &
	# try to fix problems with MythArchive mythtranscode sometimes failing
	rm -f ~mythtv/.ICEauthority
	
	# add ionice -c 2 -n 0 AJB20110120
	ionice -c 2 -n 0 /usr/bin/mythfrontend >/dev/null 2>&1 &
#	sleep 5s
	gnome-session
# AJB20110305 FIXME - gnome-session steals keyboard focus from mythfrontend
else
	# from /etc/X11/xinit/Xsession AJB20110115
	    # lack of SSH_AGENT is intentional, see #441123.  though
	    # the whole thing should really happen in xinitrc.d anyway.
	    exec -l $SHELL -c gnome-session
	    exec /bin/sh -c "exec -l $SHELL -c \"gnome-session\"" 
fi

Hauppauge Infra-Red Remote

The sensor for the remote is connected to the Nova-T. No sensor is connected to the Nova-T-500. When I was using two Nova-Ts, sometimes the /dev nodes would swap around after a reboot or kernel upgrade. Using the by-path /dev/ entries is a bit more stable.

/etc/sysconfig/lirc
# Note: in addition to these parameters, you need to have working    -*- sh -*-
# configuration file for lircd (and lircmd if enabled).

# Options to lircd(8).  Typically, this will be empty, as which driver to use
# should be specified using the LIRC_DRIVER variable below.
#AJB 20110108 path to ir input device node moves around, so use a shell wildcard
LIRCD_OPTIONS="-d /dev/input/by-path/pci-0000:04:02.?-event-ir"

# The infrared receiver (and/or transmitter) driver to be used by lircd(8),
# similar to passing "-H driver" to lircd(8).
# Run "/usr/sbin/lircd -H help" to get a listing of supported drivers.
LIRC_DRIVER="devinput"
#LIRC_DRIVER=""

# Which lirc device will be used by lircd(8).
# This is the same as passing "-d device" to lircd.
# An empty value will use the default /dev/lirc0 device.
#LIRC_DEVICE="/dev/input/by-path/pci-0000:04:02.?-event-ir"
#LIRC_DEVICE=""

# If "yes", the init script will try to start lircmd(8) too.
ENABLE_LIRCMD="no"

# Options to lircmd(8).
LIRCMD_OPTIONS=""
/etc/lircd.conf

Due to changes in the IR remote code in the kernel between Fedora 8 and Fedora 14, I needed to regenerate this file using irrecord --disable-namespace -H devinput -d /dev/input/by-path/pci-[...]-event-ir $HOME/lircd.conf.

Before I could do so, I also needed to configure HAL to ignore the IR device nodes by creating a couple of .fdi files under /usr/share/hal/fdi/preprobe/20thirdparty/


# Please make this file available to others
# by sending it to <lirc@bartelmus.de>
#
# this config file was automatically generated
# using lirc-0.8.7(devinput) on Sat Jan  8 14:43:26 2011
#
# contributed by 
#
# brand:                       /root/irrecord-201101081438.txt
# model no. of remote control: 
# devices being controlled by this remote:
#

begin remote

  name  /root/irrecord-201101081438.txt
  bits            8
  eps            30
  aeps          100

  one             0     0
  zero            0     0
  pre_data_bits   56
  pre_data       0x4000400001E
  gap          111995
  toggle_bit_mask 0x0

      begin codes
          Go                       0x3B
          Power                    0x3D
          TV                       0x1C
          Videos                   0x18
          Music                    0x19
          Pictures                 0x1A
          Guide                    0x1B
          Radio                    0x0C
          UP                       0x14
          LEFT                     0x16
          RIGHT                    0x17
          DOWN                     0x15
          OK                       0x25
          Back                     0x1F
          Menu                     0x0D
          VolumeUp                 0x10
          VolumeDown               0x11
          Prev-Ch                  0x12
          ChannelUp                0x20
          ChannelDown              0x21
          Mute                     0x0F
          Record                   0x37
          Stop                     0x36
          Replay                   0x32
          Play                     0x35
          Skip                     0x34
          PreviousTrack            0x24
          Pause                    0x30
          NextTrack                0x1E
          1                        0x01
          2                        0x02
          3                        0x03
          4                        0x04
          5                        0x05
          6                        0x06
          7                        0x07
          8                        0x08
          9                        0x09
          Asterisk                 0x0A
          0                        0x00
          Hash                     0x0E
          Red                      0x0B
          Green                    0x2E
          Yellow                   0x38
          Blue                     0x29
      end codes

end remote
/usr/share/hal/fdi/preprobe/20thirdparty/10-ignore-dvbusb-ir.fdi
<?xml version="1.0" encoding="UTF-8"?>
<deviceinfo version="0.2">
<device>
  <match key="info.product" contains_ncase="IR-receiver">
     <merge key="info.ignore" type="bool">true</merge>
  </match>
</device>
</deviceinfo>
/usr/share/hal/fdi/preprobe/20thirdparty/10-ignore-dvbusb-ir.fdi
<?xml version="1.0" encoding="UTF-8"?>
<deviceinfo version="0.2">
<device>
  <match key="info.product" contains_ncase="IR-receiver">
     <merge key="info.ignore" type="bool">true</merge>
  </match>
</device>
</deviceinfo>
/usr/local/bin/mythpowerbutton.sh
#!/bin/bash
PROG=mythfrontend
#PROG=gnome-session
STATUS=`ps -e | grep $PROG | grep -v grep | wc -l | awk '{print $1}'`

if [ `echo $DISPLAY | grep -c ":0"` -ge 1 ]
then
    if [ $STATUS -eq 0 ]
    then
        echo "use mythconverg; update cardinput set startchan=1;" | mysql -u root --password=root    
#	xrandr -s 768x576
	xrandr -s 1024x576 # AJB 20071104
#	xrandr -s 1280x576 # AJB 20071231 - doesn't really work out!
        #( $PROG & )
	# add ionice -c 2 -n 0 AJB20110120
        ( ionice -c 2 -n 0 $PROG >/dev/null 2>&1 & )
    else
        killall $PROG
        echo "use mythconverg; update cardinput set startchan=1;" | mysql -u root --password=root
    fi
fi
exit 0
# try to fix problems with MythArchive mythtranscode sometimes failing
rm -f ~mythtv/.ICEauthority

Sound

/home/mythtv/.asoundrc
# Do not use this directly--it requires specific rate, channels, and format
pcm.dmix-digital {
  type dmix
  ipc_key 1235
  slave {
    pcm "digital-hw"
    period_time 0
    period_size 1024
    buffer_size 4096
    rate 48000
  }
}

# Control device (mixer, etc.) for the card
ctl.dmix-digital {
  type hw
  card 0
}

pcm.!default {
  type plug
  slave {
    pcm multi
    rate 48000
  }
  hint {
    show on
    description "Multiple Output - Use analog and digital outputs simultaneously"
  }
  ttable.0.0 1.0
  ttable.1.1 1.0
  ttable.0.2 1.0
  ttable.1.3 1.0
}

pcm.ajb {
  type plug
  slave {
    pcm multi
    rate 48000
  }
  hint {
    show on
    description "AJB Multiple Output - Use analog and digital outputs simultaneously"
  }
  ttable.0.0 1.0
  ttable.1.1 1.0
  ttable.0.2 1.0
  ttable.1.3 1.0
}

pcm.stereo {
  type plug
  slave {
    pcm multi
    rate 48000
  }
  hint {
    show on
    description "Multiple Stereo Output - Use analog and digital outputs simultaneously"
  }
  ttable.0.0 1.0
  ttable.1.1 1.0
  ttable.0.2 1.0
  ttable.1.3 1.0
}

ctl.stereo {
  type hw
  card 0
}

pcm.multi {
  type multi
  slaves.a.pcm "analog-hw"
  slaves.a.channels 2
  slaves.b.pcm "digital-hw"
  slaves.b.channels 2
  bindings.0.slave a
  bindings.0.channel 0
  bindings.1.slave a
  bindings.1.channel 1
  bindings.2.slave b
  bindings.2.channel 0
  bindings.3.slave b
  bindings.3.channel 1
  hint {
    show on
    description "Multiple Output - Use analog and digital outputs simultaneously"
  }
}

ctl.multi {
  type hw
  card 0
}
MythTV configuration
AudioOutputDevice = ALSA:ajb # IMPORTANT - makes MythTV output simultaneously to front (analog) and S/PDIF (digital) outputs, albeit in Stereo only.
MusicAudioDevice = ALSA:ajb
PassThruOutputDevice = ALSA:iec958:AES0=6 # digital output
PassThruDeviceOverride = 1 # Separate digital output = enabled
AC3PassThru = 0 # Dolby Digital = disabled
DTSPassThru = 0 # DTS = disabled
MixerDevice = ALSA:default
MixerControl = PCM
MasterMixerVolume = 100
PCMMixerVolume = 94
AudioDefaultUpmix = 0 # Upconvert stereo to 5.1 surround = disabled
AudioUpmixType = 0 # Upmix quality?
Audio48kOverride = 0 # Force audio device output to 48kHz = disabled
AdvancedAudioSettings = 1 # Advanced Audio Configuration = enabled
DecodeExtraAudio = 1
SRCQualityOverride = 0 # Override SRC quality = disabled
SRCQuality = 1
Speaker

Note that if MythTV only has a single audio path. A side effect of this is that it cannot be configured both to pass through multi-channel (e.g. 5.1) digital audio and to output stereo analogue audio simultaneously. If you try, you will end up hearing ugly compressed digital noise through your analogue output.

Configured like this, I get stereo audio on both the analogue and digital S/PDIF outputs. I usually watch MythTV recordings with only my TV's speakers enabled, but if I mute my TV and switch on my AV receiver, this is adequate. I have a cheap DVD player if I want to hear a 5.1 DVD. If more UK Freeview broadcasts were > 2.0 audio, I might reconsider this configuration.

MythTV configuration

MythTV Playback Settings

  • Enable realtime priority threads
  • Extra audio buffering
  • Custom Video Playback Profile: Decoder=Standard (ffmpeg), Max CPUs=1, Deblocking filter=enabled, Video renderer=xv-blit, OSD renderer=chromakey, OSD fade=disabled, Primary deinterlacer=Bob (2x), Fallback deinterlacer=None
  • OpenGL vsync setting is no longer present
  • Enable SyncToVBlank=1, XVideoTextureSyncToVBlank=1, XVideoBlitterSyncToVBlank=1 and XVideoSyncToDisplay=1 in $HOME/.nvidia-settings-rc
  • Use 1024x576 for UI, 720x576pali for playback

The bug that resulted in XVideo regions displayed on interlaced displays being scandoubled appears to no longer be present with the combination of 7600GS/GT hardware, nVidia driver version 256.53 and MythTV 0.24-fixes. Output is full vertical resolution, jitter free and scrolling credits are smooth.

For belt-and-braces, I use ionice to run mythfrontend and mythbackend with the highest priority (0) in the best-effort (class=2) IO scheduling class:

<code>
--- /etc/rc.d/init.d/mythbackend.fedora	2011-01-20 23:08:09.650056748 +0000
+++ /etc/rc.d/init.d/mythbackend	2011-02-12 20:09:09.233178903 +0000
@@ -36,7 +36,8 @@
   fi
   export MYTHCONFDIR="$MYTHTV_HOME"
   export HOME="$MYTHTV_HOME"
-  daemon $binary $OPTIONS
+  # add ionice -c 2 -n 0 AJB20110120
+  daemon ionice -c 2 -n 0 $binary $OPTIONS
   RETVAL=$?
   echo
   [ $RETVAL = 0 ] && touch /var/lock/subsys/$prog
</code>

The MySQL daemon is run with priority slightly lower at 1 (still within the 'best-effort' IO scheduling class):

<code>
--- /etc/rc.d/init.d/mysqld.fedora	2011-01-20 23:08:24.259515784 +0000
+++ /etc/rc.d/init.d/mysqld	2011-01-20 23:11:11.200950806 +0000
@@ -96,7 +96,8 @@
 	# and some users might prefer to configure logging to syslog.)
 	# Note: set --basedir to prevent probes that might trigger SELinux
 	# alarms, per bug #547485
-	$exec   --datadir="$datadir" --socket="$socketfile" \
+	# add ionice -c 2 -n 1 AJB20110120
+	ionice -c 2 -n 1 $exec   --datadir="$datadir" --socket="$socketfile" \
 		--pid-file="$mypidfile" \
 		--basedir=/usr --user=mysql >/dev/null 2>&1 &
 	safe_pid=$!
</code>

Other IO-intensive background processes (e.g. mirroring using rsync, certain elements of MythArchive) are run only within the idle (class=3) IO scheduling class. Generally, the only playback disruption I experience is coincident with the flurry of database activity at the start and end of a new recording. There is scope for running mythfrontend within the realtime (class=1) IO scheduling class, but I have not yet experimented with this.

Wrap mythfilldatabase

#!/bin/sh
echo "mythfilldatabase started `date`" >>/var/lib/mythtv/mythfilldatabase.log
echo "Parameters:" >>/var/lib/mythtv/mythfilldatabase.log
for i in $*
do
	/bin/echo -n "<$i> " >>/var/lib/mythtv/mythfilldatabase.log
done
echo "User: `whoami`" >>/var/lib/mythtv/mythfilldatabase.log
echo "Groups: `groups`" >>/var/lib/mythtv/mythfilldatabase.log
echo "PWD: `pwd`" >>/var/lib/mythtv/mythfilldatabase.log
echo "Environment: " >>/var/lib/mythtv/mythfilldatabase.log
#export XMLTV_SUPPLEMENT="http://supplement.xmltv.org"
export XMLTV_SUPPLEMENT="/etc/mythtv/.xmltv/supplement/"
export XMLTV_SUPPLEMENT_VERBOSE=1
export >>/var/lib/mythtv/mythfilldatabase.log
#rm -rf $HOME/.xmltv/supplement/tv_grab_uk_rt/*
cd $HOME/.xmltv/supplement/tv_grab_uk_rt/
wget -N -nv http://supplement.xmltv.org/tv_grab_uk_rt/channel_ids
wget -N -nv http://supplement.xmltv.org/tv_grab_uk_rt/prog_titles_to_process
wget -N -nv http://supplement.xmltv.org/tv_grab_uk_rt/utf8_fixups
cd $HOME
#echo "waiting 10s"
#sleep 10s

su -c "ionice -c 3 nice /usr/bin/mythfilldatabase $*" mythtv

This script sets xmltv to use updated (aka supplement) channel data files, downloading them automatically if they have changed. It also runs mythfilldatabase in the 'idle' IO scheduling class. Configure MythTV to use this script using mythtv-setup.

Wrap /usr/bin/mythcommflag

mv /usr/bin/mythcommflag /usr/bin/mythcommflag.fedora, then put this script in its place:

#!/bin/bash


# edit/tune these #
# Allow ad breaks to be upto 400s long by coalescing non-silence
MAXCOMMBREAKSECS=400
# mytharchivehelper isn't frame-accurate, and mythcommflag won't add final cut pair if the end of the cut is greater
# than the actual final frame, so subtract $ENDFUDGEFRAMES from the value mytharchivehelper returns
ENDFUDGEFRAMES=75
# -70dB and minimum of 0.15s to be considered 'silent'
MP3SPLT_OPTS="th=-70,min=0.15"
# Log file
LOGFILE="/var/log/mythtv/mythcommflag-wrapper"
# Copy commercial skiplist to cutlist automatically? 1=Enabled
COPYTOCUTLIST=1

MYTHCFG=""
# mythbackend in Fedora packages has $HOME=/etc/mythtv
if [ -e $HOME/mysql.txt ]; then
	MYTHCFG="$HOME/mysql.txt"
fi


if [ -e $HOME/.mythtv/mysql.txt ]; then
	MYTHCFG="$HOME/.mythtv/mysql.txt"
fi
if [ "$MYTHCFG" = "" ]; then
	echo >>$LOGFILE "No mysql.txt found in $HOME or $HOME/.mythtv - exiting!"
	exit 1
fi

MAH=`which mytharchivehelper`
if [ "$MAH" = "" ]; then
	echo "mytharchivehelper not found in $PATH - exiting!"
	exit 1
fi
		
# DB username and password
MYTHHOST=`grep DBHostName <$MYTHCFG | awk -F= '{print $2}'`
MYTHUSER=`grep DBUserName <$MYTHCFG | awk -F= '{print $2}'`
MYTHPASS=`grep DBPassword <$MYTHCFG | awk -F= '{print $2}'`
MYTHDB=`grep DBName <$MYTHCFG | awk -F= '{print $2}'`
#echo >>$LOGFILE "[$MYTHHOST] [$MYTHUSER] [$MYTHPASS] [$MYTHDB]"

# root of MythTV recordings
RECORDINGSROOT=`mysql -h${MYTHHOST} -u${MYTHUSER} -p${MYTHPASS} -e "select dirname from storagegroup;" $MYTHDB | tail -n +2 | sort | uniq | tr '\n' ' '`


echo >>$LOGFILE "$0 run with [$*] at `date` by `whoami`"
echo >>$LOGFILE "RECORDINGSROOT=$RECORDINGSROOT"
#export >>$LOGFILE

#/usr/bin/mythcommflag run with [-j 584 -V 8213] at Sat Jan 29 17:26:58 GMT 2011 by root
#select recorded.basename from recorded join jobqueue where jobqueue.id=584 and jobqueue.chanid=recorded.chanid and jobqueue.starttime=recorded.starttime;

silence_detect() {
		local filename=$1
		
		TMPDIR=`mktemp -d /tmp/mythcommflag.XXXXXX` || exit 1		
		
		# get frame count, less 3 seconds (75 frames) fudge factor
		let FRAMES=`mytharchivehelper -i $filename $TMPDIR/streaminfo.xml 1 2>&1 | grep " frames = " | awk -F"= " '{print $2}'`-${ENDFUDGEFRAMES}
		echo >>$LOGFILE "total frames = $FRAMES (+/- 75)"		

		# From <http://www.mythtv.org/wiki/Silence-detect.sh>

# AJB20110129 Have already checked for pre-existing cutlist, and this check doesn't work properly after --clearcutlist anyway
#		[[ "Cutlist: "  == `mythcommflag.fedora --getcutlist -f $filename  |grep Cutlist` ]] \
#		    || { echo already has cutlist && exit 1; }

		cd $TMPDIR
		touch `basename $filename`.touch
		ionice -c3 nice ffmpeg -i $filename -acodec copy sound.mp3
		ionice -c3 nice mp3splt -s -p $MP3SPLT_OPTS sound.mp3

		#AJB20110129 add '$FRAMES' because mythcommflag now requires *pairs* of frames
		CUTLIST=`tail --lines=+3 mp3splt.log|sort -g |\
		       awk 'BEGIN{start=0;ORS=","}{if($2-start<'$MAXCOMMBREAKSECS')
		       {finish=$2} else {print int(start*25+1)"-"int(finish*25-25);
		       start=$1; finish=$2;}}END{print int(start*25+1)"-"'$FRAMES'}'`
		echo >>$LOGFILE "silence-detect has generated cutlist: $CUTLIST"

		echo >>$LOGFILE "silence-detect(): CHANID=$CHANID, STARTTIME=$STARTTIME, FRAMES=$FRAMES"		
		CUTLIST=`tail --lines=+3 mp3splt.log|sort -g |\
		awk 'BEGIN{start=0;ORS="\n"}{if($2-start<'$MAXCOMMBREAKSECS') {finish=$2} else {print "INSERT INTO recordedmarkup (chanid,starttime,mark,type) VALUES ('$CHANID',\"'"$STARTTIME"'\","int(start*25+1)",4);\nINSERT INTO recordedmarkup (chanid,starttime,mark,type) VALUES ('$CHANID',\"'"$STARTTIME"'\","int(finish*25-25)",5);"; start=$1; finish=$2;}}END{print "INSERT INTO recordedmarkup (chanid,starttime,mark,type) VALUES ('$CHANID',\"'"$STARTTIME"'\","int(start*25+1)",4);\nINSERT INTO recordedmarkup (chanid,starttime,mark,type) VALUES ('$CHANID',\"'"$STARTTIME"'\",'$FRAMES',5);"}' | sed 's/\"/'\''/g'`
		RC=$?
#		echo >>$LOGFILE "silence-detect SQLgen returned with $RC, generated SQL skipist: $CUTLIST"		

#		CUTLIST="USE $MYTHDB; $CUTLIST"

		rm -rf $TMPDIR
}		


if [ $# -eq 0 ]; then
	# run with no parameters, flag every unflagged recording
	exec mythcommflag.fedora
	exit $?
else
	if [ $# -eq 4 -a "$1" = "-j" -a "$3" = "-V" ]; then
		# this is a manual flag job
		# TODO AJB20110129 generate a filelist from recorded table where commflagged=0 and cutlist=0
		# then run silence_detect over each filename
		JOB=$2
	else
		# we're being used in some other way, run the real mythcommmflag
		echo >>$LOGFILE "running mythcommflag.fedora $*"
		exec mythcommflag.fedora $*
		exit $?
	fi
	echo >>$LOGFILE "running job $JOB"
	HASCUTLIST=`mysql -h${MYTHHOST} -u${MYTHUSER} -p${MYTHPASS} -e "select recorded.cutlist from recorded join jobqueue where jobqueue.id=$JOB and jobqueue.chanid=recorded.chanid and jobqueue.starttime=recorded.starttime;" $MYTHDB | tail -n +2`	
	if [ "$HASCUTLIST" = "1" ]; then
		echo >>$LOGFILE "program already has (manual?) cutlist, exiting"
		exit 0
	fi
	CALLSIGN=`mysql -h${MYTHHOST} -u${MYTHUSER} -p${MYTHPASS} -e "select channel.callsign from channel join jobqueue where jobqueue.id=$JOB and jobqueue.chanid=channel.chanid;" $MYTHDB | tail -n +2`
	CHANID=`mysql -h${MYTHHOST} -u${MYTHUSER} -p${MYTHPASS} -e "select chanid from jobqueue where jobqueue.id=$JOB;" $MYTHDB | tail -n +2`	
	STARTTIME=`mysql -h${MYTHHOST} -u${MYTHUSER} -p${MYTHPASS} -e "select starttime from jobqueue where jobqueue.id=$JOB;" $MYTHDB | tail -n +2`
	echo >>$LOGFILE "channel callsign is $CALLSIGN"
	echo >>$LOGFILE "chanid=$CHANID STARTTIME=$STARTTIME"
	BASENAME=`mysql -h${MYTHHOST} -u${MYTHUSER} -p${MYTHPASS} -e "select recorded.basename from recorded join jobqueue where jobqueue.id=$JOB and jobqueue.chanid=recorded.chanid and jobqueue.starttime=recorded.starttime;" $MYTHDB | tail -n +2`	
	echo >>$LOGFILE "basename is $BASENAME"
	FILENAME=`ionice -c3 nice find ${RECORDINGSROOT} -name $BASENAME`
	echo >>$LOGFILE "filename is $FILENAME"	

#safe list
#	if [ "$CALLSIGN" = "Film4" -o "$CALLSIGN" = "ITV1" -o "$CALLSIGN" = "ITV1 +1" -o "$CALLSIGN" = "ITV2" -o "$CALLSIGN" = "ITV2 +1" -o "$CALLSIGN" = "ITV3" -o "$CALLSIGN" = "ITV4" -o "$CALLSIGN" = "Dave" -o "$CALLSIGN" = "Dave ja vu" ]; then
# Channel 4 channels seem to work too, but sometimes last cut is too long?
#	if [ "$CALLSIGN" = "Channel 4" -o "$CALLSIGN" = "Channel 4+1" -o "$CALLSIGN" = "More 4" -o "$CALLSIGN" = "E4" -o "$CALLSIGN" = "E4+1" -o "$CALLSIGN" = "Film4" -o "$CALLSIGN" = "ITV1" -o "$CALLSIGN" = "ITV1 +1" -o "$CALLSIGN" = "ITV2" -o "$CALLSIGN" = "ITV2 +1" -o "$CALLSIGN" = "ITV3" -o "$CALLSIGN" = "ITV4" -o "$CALLSIGN" = "Dave" -o "$CALLSIGN" = "Dave ja vu" ]; then
#	if [ "$CALLSIGN" = "FIVE USA" -o "$CALLSIGN" = "FIVER" -o "$CALLSIGN" = "FIVE" -o "$CALLSIGN" = "Channel 4" -o "$CALLSIGN" = "Channel 4+1" -o "$CALLSIGN" = "More 4" -o "$CALLSIGN" = "E4" -o "$CALLSIGN" = "E4+1" -o "$CALLSIGN" = "Film4" -o "$CALLSIGN" = "ITV1" -o "$CALLSIGN" = "ITV1 +1" -o "$CALLSIGN" = "ITV2" -o "$CALLSIGN" = "ITV2 +1" -o "$CALLSIGN" = "ITV3" -o "$CALLSIGN" = "ITV4" -o "$CALLSIGN" = "Dave" -o "$CALLSIGN" = "Dave ja vu" ]; then	
# Fails on FIVER and cuts almost entire recording. Works for other FIVE channels with caveat that they include news bulletins which are't cut
	if [ "$CALLSIGN" = "QUEST" -o "$CALLSIGN" = "FIVE USA" -o "$CALLSIGN" = "FIVE" -o "$CALLSIGN" = "Channel 4" -o "$CALLSIGN" = "Channel 4+1" -o "$CALLSIGN" = "More 4" -o "$CALLSIGN" = "E4" -o "$CALLSIGN" = "E4+1" -o "$CALLSIGN" = "Film4" -o "$CALLSIGN" = "ITV1" -o "$CALLSIGN" = "ITV1 +1" -o "$CALLSIGN" = "ITV2" -o "$CALLSIGN" = "ITV2 +1" -o "$CALLSIGN" = "ITV3" -o "$CALLSIGN" = "ITV4" -o "$CALLSIGN" = "Dave" -o "$CALLSIGN" = "Dave ja vu" ]; then	
		echo >>$LOGFILE "Callsign in whitelist - will run silence_detect"		
		mysql -h${MYTHHOST} -u${MYTHUSER} -p${MYTHPASS} -e "update recorded set commflagged=2 where chanid=$CHANID and starttime='${STARTTIME}';" $MYTHDB
		CUTLIST=""
		echo >>$LOGFILE "silence_detect $FILENAME"
		silence_detect $FILENAME
		echo >>$LOGFILE "silect_detect() set CUTLIST to $CUTLIST"
		let BREAKS=`echo "$CUTLIST"|wc -l`/2
		echo >>$LOGFILE "$BREAKS break(s) found."
#		mythcommflag --setcutlist $CUTLIST -f $FILENAME
		mysql -h${MYTHHOST} -u${MYTHUSER} -p${MYTHPASS} -e "$CUTLIST" $MYTHDB
		RC=$?
#		echo "mythcommflag --setcutlist returned $RC"
		echo >>$LOGFILE "mysql setskiplist returned $RC"
		if [ $RC -eq 0 ]; then
			mysql -h${MYTHHOST} -u${MYTHUSER} -p${MYTHPASS} -e "update recorded set commflagged=1 where chanid=$CHANID and starttime='${STARTTIME}';" ${MYTHDB}
			mysql -h${MYTHHOST} -u${MYTHUSER} -p${MYTHPASS} -e "update jobqueue set status=272, comment='Finished, $BREAKS break(s) found.' where id=$JOB;" ${MYTHDB}			
			if [ $COPYTOCUTLIST -eq 1 ]; then
				mythcommflag --gencutlist -f $FILENAME
				RC=$?
				if [ $RC -eq 0 ]; then
					echo >>$LOGFILE "mythcommflag --gencutlist successfully copied skip list to cut list"
				else
					echo >>$LOGFILE "mythcommflag --gencutlist failed, returned $RC"		
				fi
			fi			
		else
			echo >>$LOGFILE "mythcommflag failed; returned $RC"
			mysql -h${MYTHHOST} -u${MYTHUSER} -p${MYTHPASS} -e "update recorded set commflagged=0 where chanid=$CHANID and starttime='${STARTTIME}';" ${MYTHDB}
		fi		
	else
		# Not a whitelisted channel for silence_detect
		echo >>$LOGFILE "won't run silence-detect, running mythcommflag.fedora $*"
		exec mythcommflag.fedora $*
		exit $?
	fi		
fi
echo >>$LOGFILE

The maintained version of this script can be found at [1]. It uses silence detection to perform commflagging, which works quite well for certain UK stations.

Patch MythArchive's mythburn.py script

--- /usr/share/mythtv/mytharchive.fedora-0.24-ajb3.fc14-20110126/scripts/mythburn.py	2011-01-12 23:34:28.000000000 +0000
+++ /usr/share/mythtv/mytharchive/scripts/mythburn.py	2011-02-12 19:56:44.000000000 +0000
@@ -54,7 +54,8 @@
 debug_secondrunthrough = False
 
 # default encoding profile to use
-defaultEncodingProfile = "SP"
+# defaultEncodingProfile = "SP"
+defaultEncodingProfile = "NONE"
 
 # add audio sync offset when re-muxing
 useSyncOffset = True
@@ -485,19 +486,22 @@
 
     totalframes=int(musiclength * framespersecond)
 
-    command = path_jpeg2yuv[0] + " -n %s -v0 -I p -f %s -j '%s' | %s -b 5000 -a %s -v 1 -f 8 -o '%s'" \
+    command = "ionice -c3 nice "
+    command += path_jpeg2yuv[0] + " -n %s -v0 -I p -f %s -j '%s' | %s -b 5000 -a %s -v 1 -f 8 -o '%s'" \
               % (totalframes, framespersecond, background, path_mpeg2enc[0], aspectratio, tempvideo)
     result = runCommand(command)
     if result<>0:
         fatalError("Failed while running jpeg2yuv - %s" % command)
 
-    command = path_mplex[0] + " -f 8 -v 0 -o '%s' '%s' '%s'" % (tempmovie, tempvideo, music)
+    command = "ionice -c3 nice "
+    command += path_mplex[0] + " -f 8 -v 0 -o '%s' '%s' '%s'" % (tempmovie, tempvideo, music)
     result = runCommand(command)
     if result<>0:
         fatalError("Failed while running mplex - %s" % command)
 
     if xmlfile != "":
-        command = path_spumux[0] + " -m dvd -s 0 '%s' < '%s' > '%s'" % (xmlfile, tempmovie, finaloutput)
+        command = "ionice -c3 nice "
+        command += path_spumux[0] + " -m dvd -s 0 '%s' < '%s' > '%s'" % (xmlfile, tempmovie, finaloutput)
         result = runCommand(command)
         if result<>0:
             fatalError("Failed while running spumux - %s" % command)
@@ -1877,7 +1881,8 @@
         result=os.spawnlp(mode, path_mplex[0], path_mplex[1],
                     '-M',
                     '-f', '8',
-                    '-v', '0',
+                    '-v', '1',
+                    '-b', '500', '-r', '16000',
                     '--sync-offset', '%sms' % syncOffset,
                     '-o', destination,
                     video,
@@ -1887,7 +1892,8 @@
         result=os.spawnlp(mode, path_mplex[0], path_mplex[1],
                     '-M',
                     '-f', '8',
-                    '-v', '0',
+                    '-v', '1',
+                    '-b', '500', '-r', '16000',
                     '--sync-offset', '%sms' % syncOffset,
                     '-o', destination,
                     video,
@@ -1910,7 +1916,8 @@
             fatalError("Failed while running testsubtitlepngs.sh - %s" % command)
 
         write("Running spumux to add subtitles")
-        command = path_spumux[0] + " -P %s/stream.d/spumux.xml <%s >%s" % (os.path.dirname(destination), destination, os.path.splitext(destination)[0] + "-sub.mpg")
+        command = "ionice -c3 nice "        
+        command += path_spumux[0] + " -P %s/stream.d/spumux.xml <%s >%s" % (os.path.dirname(destination), destination, os.path.splitext(destination)[0] + "-sub.mpg")
         result = runCommand(command)
         if result<>0:
             nonfatalError("Failed while running spumux.\n"
@@ -1929,7 +1936,8 @@
 def getStreamInformation(filename, xmlFilename, lenMethod):
     """create a stream.xml file for filename"""
     filename = quoteFilename(filename)
-    command = "mytharchivehelper -i %s %s %d" % (filename, xmlFilename, lenMethod)
+    command = "ionice -c3 nice "    
+    command += "mytharchivehelper -i %s %s %d" % (filename, xmlFilename, lenMethod)
 
     result = runCommand(command)
 
@@ -1972,15 +1980,16 @@
 
     if localfile != "":
         localfile = quoteFilename(localfile)
-        if usecutlist == True:
-            command = "mythtranscode --mpeg2 --honorcutlist -i %s -o %s" % (localfile, destination)
+        command = "ionice -c3 nice "        
+        if usecutlist == True:        
+            command += "mythtranscode --mpeg2 --honorcutlist -i %s -o %s" % (localfile, destination)
         else:
-            command = "mythtranscode --mpeg2 -i %s -o %s" % (localfile, destination)
+            command += "mythtranscode --mpeg2 -i %s -o %s" % (localfile, destination)
     else:
         if usecutlist == True:
-            command = "mythtranscode --mpeg2 --honorcutlist -c %s -s %s -o %s" % (chanid, starttime, destination)
+            command += "mythtranscode --mpeg2 --honorcutlist -c %s -s %s -o %s" % (chanid, starttime, destination)
         else:
-            command = "mythtranscode --mpeg2 -c %s -s %s -o %s" % (chanid, starttime, destination)
+            command += "mythtranscode --mpeg2 -c %s -s %s -o %s" % (chanid, starttime, destination)
 
     result = runCommand(command)
 
@@ -1995,7 +2004,7 @@
 #############################################################
 # Create a projectX cut list for a recording
 
-def generateProjectXCutlist(chanid, starttime, folder):
+def originalgenerateProjectXCutlist(chanid, starttime, folder):
     """generate cutlist_x.txt for ProjectX"""
 
     sqlstatement  = """SELECT mark FROM recordedmarkup 
@@ -2031,6 +2040,59 @@
 
     return True
 
+# AJB modified using
+# http://code.mythtv.org/trac/raw-attachment/ticket/9389/cutlisttrans.txt
+# for 0.24-fixes
+def generateProjectXCutlist(chanid, starttime, folder):
+    """generate cutlist_x.txt for ProjectX"""
+
+    sqlstatement  = """SELECT mark FROM recordedmarkup 
+                    WHERE chanid = '%s' AND starttime = '%s' 
+                    AND type IN (0,1) ORDER BY mark""" % (chanid, starttime)
+
+    db = getDatabaseConnection()
+    cursor = db.cursor()
+    cursor.execute(sqlstatement)
+    result = cursor.fetchall()
+    numrows = int(cursor.rowcount)
+
+    #We must have at least one row returned for this recording
+    if numrows==0:
+        write("No cutlist in the DB for chanid %s, starttime %s" % chanid, starttime)
+        db.close()
+        del db
+        del cursor
+        return False   
+
+    sqlstatement  = """SELECT mark FROM recordedmarkup 
+                    WHERE chanid = '%s' AND starttime = '%s' 
+                    AND type=1 ORDER BY mark LIMIT 1 """ % (chanid, starttime)
+
+    cursor.execute(sqlstatement)
+    firstcut = cursor.fetchall()   
+
+    sqlstatement  = """SELECT mark FROM recordedmarkup 
+                    WHERE chanid = '%s' AND starttime = '%s' 
+                    AND type IN (0,1) ORDER BY mark LIMIT 1 """ % (chanid, starttime)
+
+    cursor.execute(sqlstatement)
+    firstedit = cursor.fetchall()
+
+    cutlist_f=open(os.path.join(folder, "cutlist_x.txt"), 'w')
+    cutlist_f.write("CollectionPanel.CutMode=2\n")
+
+    if firstcut == firstedit:
+         cutlist_f.write("0\n")
+
+    # iterate through resultset
+    for i in range(len(result)):
+        if result[i][0] != "" and result[i][0] <> 0:
+            cutlist_f.write("%d\n" % result[i])
+
+    cutlist_f.close()
+
+    return True
+
 
 #############################################################
 # Use Project-X to cut commercials and/or demux an mpeg2 file
@@ -2055,7 +2117,8 @@
     qfile = quoteFilename(file)
     qcutlist = os.path.join(folder, "cutlist_x.txt")
 
-    command = path_projectx[0] + " -id %s" % getStreamList(folder)
+    command = "ionice -c3 nice "
+    command += path_projectx[0] + " -id %s" % getStreamList(folder)
     if usecutlist == True:
         command += " -cut %s -out %s -name %s %s" % (qcutlist, qdestdir, qpxbasename, qfile)
     else:
@@ -2080,7 +2143,8 @@
         if (os.path.exists(os.path.join(folder, "stream.sup")) and
             os.path.exists(os.path.join(folder, "stream.sup.IFO"))):
             write("Found DVB subtitles converting to DVD subtitles")
-            command = "mytharchivehelper --sup2dast "
+            command = "ionice -c3 nice "
+            command += "mytharchivehelper --sup2dast "
             command += " %s %s 0" % (os.path.join(folder, "stream.sup"), os.path.join(folder, "stream.sup.IFO"))
 
             result = runCommand(command)
@@ -2289,7 +2353,8 @@
 
         source = quoteFilename(source)
 
-        command = "mytharchivehelper -t  %s '%s' %s" % (source, seconds, destination)
+        command = "ionice -c3 nice "
+        command += "mytharchivehelper -t  %s '%s' %s" % (source, seconds, destination)
         result = runCommand(command)
         if result <> 0:
             fatalError("Failed while running mytharchivehelper to get thumbnails.\n"
@@ -2314,7 +2379,8 @@
 
     source = quoteFilename(source)
 
-    command = "mytharchivehelper -v important -t %s '%s' %s" % (source, thumbList, destination)
+    command = "ionice -c3 nice "
+    command += "mytharchivehelper -v important -t %s '%s' %s" % (source, thumbList, destination)
     result = runCommand(command)
     if result <> 0:
         fatalError("Failed while running mytharchivehelper to get thumbnails")
@@ -2329,7 +2395,8 @@
 
     passes = int(getText(profileNode.getElementsByTagName("passes")[0]))
 
-    command = path_ffmpeg[0]
+    command = "ionice -c3 nice "
+    command += path_ffmpeg[0]
 
     if cpuCount > 1:
         command += " -threads %d" % cpuCount
@@ -2515,7 +2582,8 @@
     samplerate, channels = getAudioParams(folder)
     videores, fps, aspectratio = getVideoParams(folder)
 
-    command =  path_ffmpeg[0] + " -y "
+    command = "ionice -c3 nice "
+    command +=  path_ffmpeg[0] + " -y "
 
     if cpuCount > 1:
         command += "-threads %d " % cpuCount
@@ -2567,7 +2635,8 @@
 def CreateDVDISO(title):
     write("Creating ISO image")
     checkCancelFlag()
-    command = path_mkisofs[0] + ' -dvd-video '
+    command = "ionice -c3 nice "
+    command += path_mkisofs[0] + ' -dvd-video '
     command += ' -V ' + quoteFilename(title)
     command += ' -o ' + os.path.join(getTempPath(), 'mythburn.iso')
     command += " " + os.path.join(getTempPath(),'dvd')
@@ -2669,7 +2738,8 @@
 def deMultiplexMPEG2File(folder, mediafile, video, audio1, audio2):
 
     if getFileType(folder) == "mpegts":
-        command = "mythreplex --demux --fix_sync -t TS -o %s " % (folder + "/stream")
+        command = "ionice -c3 nice "    
+        command += "mythreplex --demux --fix_sync -t TS -o %s " % (folder + "/stream")
         command += "-v %d " % (video[VIDEO_ID])
 
         if audio1[AUDIO_ID] != -1: 
@@ -2689,7 +2759,8 @@
                 command += "-c %d " % (audio2[AUDIO_ID])
 
     else:
-        command = "mythreplex --demux --fix_sync -o %s " % (folder + "/stream")
+        command = "ionice -c3 nice "    
+        command += "mythreplex --demux --fix_sync -o %s " % (folder + "/stream")
         command += "-v %d " % (video[VIDEO_ID] & 255)
 
         if audio1[AUDIO_ID] != -1: 
@@ -2726,7 +2797,8 @@
     M2Vsize0 = os.path.getsize(source)
     write("Initial M2Vsize is %.2f Mb , target is %.2f Mb" % ( (float(M2Vsize0)/mega), (float(M2Vsize0)/(factor*mega)) ))
 
-    command = path_M2VRequantiser[0]   
+    command = "ionice -c3 nice "
+    command += path_M2VRequantiser[0]   
     command += " %.5f "  % factor
     command += " %s "  % M2Vsize0
     command += " <  %s " % source
@@ -3501,7 +3573,8 @@
                 height = getScaledAttribute(node, "h")
                 frames = int(secondsToFrames(menulength))
 
-                command = "mytharchivehelper -t  %s '%s' '%s' %d" % (inputfile, starttime, outputfile, frames)
+                command = "ionice -c3 nice "
+                command += "mytharchivehelper -t  %s '%s' '%s' %d" % (inputfile, starttime, outputfile, frames)
                 result = runCommand(command)
                 if (result != 0):
                     write( "mytharchivehelper failed with code %d. Command = %s" % (result, command) )

These changes fix some bugs in the MythArchive script as shipped with the snapshot of 0.24-fixes that I use, and runs IO intensive processes in the idle IO scheduling class so as not to disrupt recording or playback.

Enable authentication and https for MythWeb

/etc/httpd/conf.d/mythweb.conf
<VirtualHost your.host.here.co.uk:80 >
<IfModule mod_rewrite.c>
#Now that stream.php isn't redirected to rewritten https://...
#          RewriteLog "/var/log/httpd/rewrite.log"
#          RewriteLogLevel 9
          RewriteEngine on
          RewriteCond %{HTTPS} !=on
#AJB20110114 attempt to fix mythweb music streaming
#from /music/stream.php>
#https rewrite if request includes music/stream
	  RewriteCond %{REQUEST_URI} !^/mythweb/music/stream.*$
	  RewriteCond %{REQUEST_URI} !^/mythweb/music/stream.php.*$
	  RewriteCond %{REQUEST_URI} !^/mythweb/pl/stream.*$
          RewriteCond %{REQUEST_URI} !^/mythweb/mythweb.php/music/stream.*$
	  RewriteCond %{REQUEST_URI} !^/mythweb/mythweb.pl/pl/stream.*$
          RewriteRule ^.*$ https://%{HTTP_HOST}%{REQUEST_URI} [R=permanent]
</IfModule>
</VirtualHost>


#
# Apache configuration directives for MythWeb.  Please read INSTALL for setup
# requirements and troubleshooting, along with the comments in this file.
#

#
# CHANGE THIS PATH TO MATCH YOUR MYTHWEB INSTALLATION DIRECTORY!  e.g.
#
#    /var/www
#    /home/www/htdocs
#    /var/www/html/mythweb
#    /srv/www/htdocs/mythweb
#
Alias /mythweb/ "/usr/share/mythweb/"
Alias /mythweb "/usr/share/mythweb/"

<Directory "/usr/share/mythweb">

    ############################################################################
    # I *strongly* urge you to turn on authentication for MythWeb.  It is disabled
    # by default because it requires you to set up your own password file.  Please
    # see the man page for htdigest and then configure the folowing four directives
    # to suit your authentication needs.
    #
    #    AuthType           Digest
    #    AuthName           "MythWeb"
    #    AuthUserFile       /etc/httpd/conf.d/mythweb-htdigest
    #    Require            valid-user
    #    BrowserMatch       "MSIE"      AuthDigestEnableQueryStringHack=On
    #    Order              allow,deny
    #    Satisfy            any
    #
    #  * If you're running Apache earlier than 2.2, you will need to use
    #    the AuthDigestFile command instead of AuthUserFile (3rd line above).
    #

AuthType           Digest       
AuthName           "MythWeb"    
AuthUserFile       /etc/httpd/conf/httpd-passwords
Require            valid-user    
BrowserMatch       "MSIE"      AuthDigestEnableQueryStringHack=On    
Order              allow,deny    
Satisfy            any    

    ############################################################################
    # Some special instructions for the MythWeb controller files
    #
        <Files mythweb.*>

        #
        # Use the following environment settings to tell MythWeb where you want it to
        # look to connect to the database, the name of the database to connect to, and
        # the authentication info to use to connect.  The defaults will usually work
        # fine unless you've changed mythtv's mysql.txt file, or are running MythWeb on
        # a different server from your main backend.  Make sure you have mod_env enabled.
        #
            setenv db_server        "localhost"
            setenv db_name          "mythconverg"
            setenv db_login         "MYTHUSERNAME"
            setenv db_password      "MYTHPASSWORD"

        #
        # By default, MythWeb uses the hostname program to look up the hostname of the
        # machine it runs on.  If this reports incorrect data, or you run MythWeb on a
        # machine without the hostname program, set this to your current hostname.
        #
           setenv hostname         "your.host.here.co.uk"
        #

        # By default, php will always search the current directory for include files,
        # but if you wish to install these directories outside of the current path
        # (eg. for security reasons), set this variable to the directory that
        # contains the directories like languages and templates.  eg.
        #
        #   setenv include_path      "/usr/share/mythweb"

        # If you want MythWeb to email php/database errors (and a backtrace) to you,
        # uncomment and set the email address below.
        #
        #   setenv error_email       "mythweb_errors@example.com"
        #

        # If your local file system is something other than UTF-8, set this variable
        # so that the music and video portions of MythWeb can provide proper links
        # to your downloadable files.
        #
        #   setenv fs_encoding       "ISO-8859-1"

        </Files>

    ############################################################################
    # The following settings relate to PHP config.
    #

        <Files *.php>

        #  These settings are intended for apache 2.x.  If your version of apache
        #  doesn't support php_value, or things like memory_limit aren't working
        #  as expected, then use these settings as examples for your own php.ini
        #  files.
            php_value safe_mode                     0

            php_value memory_limit                  512M

            php_value register_globals              0
            php_value magic_quotes_gpc              0
            php_value file_uploads                  0
            php_value allow_url_fopen               On

            php_value zlib.output_handler           Off
            php_value output_handler                NULL

        # Note: php_flag does not work in older versions of php
            php_flag output_handler                 "NULL"

        </Files>

    ############################################################################
    # The settings below relate specifically to mod_rewrite and the rewrite
    # engine used to make the MythWeb user experience a little easier to deal
    # with by simplifying the URLs needed to access the various sections.  Do
    # not touch these settings unless you really know what you're doing..
    #

    # Turn on the rewrite engine
        RewriteEngine  on

    # If MythWeb is installed outside of the document root (eg. using Alias) then
    # you will need to set this directive to the base URL that MythWeb is visible
    # from externally.  If you do not, the web server will return 'not found'.
        RewriteBase    /mythweb

    # Skip out early if we've already been through rewrites,
    # or if this is a /css/, /js/ or /cache/ directory request.
        RewriteRule    ^(css|data|images|js|themes|skins|[a-z_]+\.(php|pl))(/|$)     -     [L]

    # Redirect /pl/ requests to the perl cgi handler.
        RewriteRule     ^(pl(/.*)?)$            mythweb.pl/$1               [QSA,L]

    # Redirect most of the remaining URL requests to the main mythweb script.
    # It will then handle any requests given to it.
        RewriteRule     ^(.+)$                  mythweb.php/$1              [QSA,L]

    # If you're experiencing trouble with the previous two lines in your copy of
    # apache, you could instead use something like:
    #    RewriteRule     ^(pl(/.*)?)$           mythweb.pl?PATH_INFO=/$1    [L,QSA]
    #    RewriteRule     ^(.+)$                 mythweb.php?PATH_INFO=/$1   [L,QSA]

    # Catch anything else that comes through and send it to mythweb.php with no parameters.
        RewriteRule     ^(.*)$                  mythweb.php                 [QSA,L]

    ############################################################################
    # You really shouldn't need to edit anything below this line, so please
    # don't unless you know what you're doing.
    #

    # Allow .htaccess to override whatever it wants from the server config.
        AllowOverride   All

    # Allow browsers to follow symlinks that point outside of the web document
    # tree.  This is how we access music, videos, etc.
        Options         FollowSymLinks

    # MythTV now uses the correct file suffix for mpeg files, so all .nuv files
    # should actually be NuppleVideo.  However, apache probably doesn't know what
    # those are, so we should tell it.
        AddType video/nuppelvideo   .nuv

    # Specify the MIME type for favicon.ico in case the server configuration
    # doesn't or in case the server configuration uses the IANA-approved MIME type
    # (image/vnd.microsoft.icon)--which most browsers won't recognize.
        AddType image/x-icon        .ico

    # Enable mod_deflate.  This works MUCH more reliably than PHP's built-in
    # gzip/Zlib compressors.  It is disabled here because many distros seem not
    # to enable mod_deflate by default, but I strongly recommend that you
    # enable this section.
    #
        BrowserMatch ^Mozilla/4 gzip-only-text/html
        BrowserMatch ^Mozilla/4\.0[678] no-gzip
        BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
    #
        AddOutputFilterByType DEFLATE text/html
        AddOutputFilterByType DEFLATE text/css
        AddOutputFilterByType DEFLATE application/x-javascript

    # This is helpful for mod_deflate -- it prevents proxies from changing
    # the user agent to/from this server, which can prevent compression from
    # being enabled.  It is disabled here because many distros seem not to
    # enable mod_headers by default, but I recommend that you enable it.
    #
        Header append Vary User-Agent env=!dont-vary

    # Set up the perl handler so we can stream properly.
    #
    # IMPORTANT!!  Please see the note in INSTALL section 5.1 that explains why
    # this may not always properly detect mod_perl.
    #
        <Files *.pl>
            <IfModule mod_perl.c>
                SetHandler perl-script
                PerlResponseHandler ModPerl::Registry
                PerlOptions +ParseHeaders
            </IfModule>
            <IfModule !mod_perl.c>
                SetHandler cgi-script
            </IfModule>
            Options +ExecCGI
        </Files>

</Directory>

<Directory "/usr/share/mythweb/data">
    Options -All +FollowSymLinks +IncludesNoExec
</Directory>

#AJB 20110115 fix mythweb weather
<Directory "/usr/share/mythweb/skins/default/img/weather/">
    Options +Indexes
</Directory>


# You will probably also want to uncomment the following rules, which
# disable authentication for MythWeb's download URLs so you can properly
# stream to media players that don't work with authenticated servers.
#
<LocationMatch .*/pl/stream/[0-9]+/[0-9]+>
    Allow from all

#AJB201101014
    Satisfy any

</LocationMatch>


<LocationMatch .*/music/stream.*>
    Allow from all

#AJB20110114 try disable authentication for this part
    Satisfy any

</LocationMatch>

Use the htdigest command to create and maintain the password file, /etc/httpd/conf/httpd-passwords.

Patch MythWeb to enable unauthenticated http streaming
diff -ur mythweb.fedora-0.24-fixes-20110113/modules/music/handler.php mythweb/modules/music/handler.php
--- mythweb.fedora-0.24-fixes-20110113/modules/music/handler.php	2011-01-12 23:39:28.000000000 +0000
+++ mythweb/modules/music/handler.php	2011-02-12 19:56:44.000000000 +0000
@@ -42,5 +42,7 @@
  * couple of different files called above.
 /**/
     function stream_url() {
-        return root_auth_url.'music/';
+#AJB20110114 remove https from root_auth_url
+#        return root_auth_url.'music/';
+         return str_replace("https","http",root_auth_url).'music/';
     }
Only in mythweb/modules/music: handler.php.HTTPstreaming
diff -ur mythweb.fedora-0.24-fixes-20110113/modules/stream/stream_asx.pl mythweb/modules/stream/stream_asx.pl
--- mythweb.fedora-0.24-fixes-20110113/modules/stream/stream_asx.pl	2011-01-12 23:39:28.000000000 +0000
+++ mythweb/modules/stream/stream_asx.pl	2011-02-12 19:56:44.000000000 +0000
@@ -10,13 +10,17 @@
 
 # URI back to this file?  We just need to take the current URI and strip
 # off the .asx suffix.
-    my $uri = ($ENV{'HTTPS'} || $ENV{'SERVER_PORT'} == 443)
-                ? 'https'
-                : 'http';
+# AJB 20110117 http only for streaming
+#    my $uri = ($ENV{'HTTPS'} || $ENV{'SERVER_PORT'} == 443)
+#                ? 'https'
+#                : 'http';
+    my $uri = 'http';
     my $serverAddr = $ENV{'HTTP_X_FORWARDED_HOST'} || $ENV{'SERVER_NAME'} || $ENV{'SERVER_ADDR'};
 # Attempt to remove the port out of the serverAddr if it's in there
     $serverAddr =~ tr/:[0-9]+//;
-    my $serverPort = $ENV{'HTTP_X_FORWARDED_PORT'} || $ENV{'SERVER_PORT'};
+# AJB 20110117 http only for streaming
+#    my $serverPort = $ENV{'HTTP_X_FORWARDED_PORT'} || $ENV{'SERVER_PORT'};
+    my $serverPort = 80;
     $uri .= '://'.$serverAddr.':'.$serverPort
             .$ENV{'REQUEST_URI'};
 

This patch works in combination with the above configuration file for the Apache http server.

Patch default Theme

diff -ur /usr/share/mythtv/themes/default.fedora-0.24-20110125/browser-ui.xml /usr/share/mythtv/themes/default/browser-ui.xml
--- /usr/share/mythtv/themes/default.fedora-0.24-20110125/browser-ui.xml	2011-01-12 23:34:28.000000000 +0000
+++ /usr/share/mythtv/themes/default/browser-ui.xml	2011-02-12 12:27:58.000000000 +0000
@@ -53,9 +53,8 @@
             <statetype name="buttonitem">
                 <area>0,0,180,40</area>
                 <state name="active">
-                    <imagetype name="buttonbackground">
-                        <filename>horiz_selector.png</filename>
-                    </imagetype>
+                    <area>0,0,180,40</area>
+                    <shape name="background" from="basewidgetshape" />
                     <textarea name="buttontext" from="basetextarea">
                         <area>0,0,180,40</area>
                         <font>basesmall</font>
@@ -63,14 +62,12 @@
                     </textarea>
                 </state>
                 <state name="selectedactive" from="active">
-                    <imagetype name="buttonbackground">
-                        <filename>horiz_selector_selected.png</filename>
-                    </imagetype>
+                    <shape name="background" from="baseselectedwidgetshape" />
                 </state>
                 <state name="selectedinactive" from="active">
-                    <imagetype name="buttonbackground">
-                        <filename>horiz_selector_inactive.png</filename>
-                    </imagetype>
+                   <textarea name="buttontext">
+                        <font>basesmallgrey</font>
+                    </textarea>
                 </state>
             </statetype>
             <statetype name="downscrollarrow">

These changes fix the bookmark highlighting in MythBrowser in the snapshot of 0.24-fixes that I use. These changes have been applied upstream, and are no longer necessary in later versions.

Patch default-wide theme

diff -ur /usr/share/mythtv/themes/default-wide.fedora-0.24-20110125/browser-ui.xml /usr/share/mythtv/themes/default-wide/browser-ui.xml
--- /usr/share/mythtv/themes/default-wide.fedora-0.24-20110125/browser-ui.xml	2011-01-12 23:34:28.000000000 +0000
+++ /usr/share/mythtv/themes/default-wide/browser-ui.xml	2011-02-12 12:27:58.000000000 +0000
@@ -61,9 +61,8 @@
             <statetype name="buttonitem">
                 <area>0,0,180,40</area>
                 <state name="active">
-                    <imagetype name="buttonbackground">
-                        <filename>horiz_selector.png</filename>
-                    </imagetype>
+                    <area>0,0,180,40</area>
+                    <shape name="background" from="basewidgetshape" />
                     <textarea name="buttontext" from="basetextarea">
                         <area>0,0,180,40</area>
                         <font>basesmall</font>
@@ -73,14 +72,12 @@
                     </textarea>
                 </state>
                 <state name="selectedactive" from="active">
-                    <imagetype name="buttonbackground">
-                        <filename>horiz_selector_selected.png</filename>
-                    </imagetype>
+                    <shape name="background" from="baseselectedwidgetshape" />
                 </state>
                 <state name="selectedinactive" from="active">
-                    <imagetype name="buttonbackground">
-                        <filename>horiz_selector_inactive.png</filename>
-                    </imagetype>
+                   <textarea name="buttontext">
+                        <font>basesmallgrey</font>
+                    </textarea>
                 </state>
             </statetype>
             <statetype name="downscrollarrow">

As above, but for the default-wide theme, and themes dependent upon it.

Create tweaked MythCenter-wide theme

copy /usr/share/mythtv/themes/MythCenter-wide to /usr/share/mythtv/themes/ajb-MythCenter-wide, then apply this patch for smaller fonts and better contrast for text, so that the UI is usable on a 28" widescreen CRT at 6' or so.

diff -ur MythCenter-wide.fedora/base.xml ajb-MythCenter-wide/base.xml
--- MythCenter-wide.fedora/base.xml	2011-01-12 23:34:29.000000000 +0000
+++ ajb-MythCenter-wide/base.xml	2011-01-16 20:23:35.000000000 +0000
@@ -4,13 +4,13 @@
 
     <!-- Base Font Definitions -->
     <fontdef name="basesmall" face="Droid Sans">
-        <pixelsize>22</pixelsize>
+        <pixelsize>20</pixelsize> <!-- AJB 20110116 originally 22 -->
         <color>#EEEEEE</color>
         <weight>bold</weight>
     </fontdef>
 
     <fontdef name="basesmaller" from="basesmall">
-        <pixelsize>18</pixelsize>
+        <pixelsize>16</pixelsize>
     </fontdef>
 
     <fontdef name="basesmallbold" from="basesmall">
@@ -24,16 +24,16 @@
     </fontdef>
 
     <fontdef name="basemedium" from="basesmall" face="Liberation Sans">
-        <pixelsize>26</pixelsize>
+        <pixelsize>23</pixelsize>
     </fontdef>
 
     <fontdef name="basemediumbold" from="basemedium">
-        <pixelsize>26</pixelsize>
+        <pixelsize>23</pixelsize>
         <weight>bold</weight>
     </fontdef>
 
     <fontdef name="baselarge" from="basemedium">
-        <pixelsize>30</pixelsize>
+        <pixelsize>26</pixelsize>
         <shadowcolor>#000000</shadowcolor>
         <shadowoffset>4,4</shadowoffset>
         <shadowalpha>64</shadowalpha>
@@ -45,7 +45,7 @@
     </fontdef>
 
     <fontdef name="baseextralarge" from="baselarge">
-        <pixelsize>34</pixelsize>
+        <pixelsize>28</pixelsize>
         <shadowcolor>#000000</shadowcolor>
         <shadowoffset>4,4</shadowoffset>
         <shadowalpha>64</shadowalpha>
@@ -57,10 +57,10 @@
         <color>#FFFFFF</color>
     </fontdef>
     <fontdef name="basesmall_normal" from="basesmall">
-        <color>#9999cc</color>
+        <color>#ccccff</color>
     </fontdef>
     <fontdef name="basesmall_normal_inactive" from="basesmall">
-        <color>#666666</color>
+        <color>#888888</color>
     </fontdef>
     <fontdef name="basesmall_warning_selected" from="basesmallbold">
         <color>#dddd44</color>
@@ -75,7 +75,7 @@
         <color>#bbbb33</color>
     </fontdef>
     <fontdef name="basesmall_favourite_unavailable" from="basesmall">
-        <color>#9999cc</color>
+        <color>#ccccff</color>
     </fontdef>
     <fontdef name="basesmall_error_selected" from="basesmallbold">
         <color>#900800</color>
@@ -84,10 +84,10 @@
         <color>#700700</color>
     </fontdef>
     <fontdef name="basesmall_disabled_selected" from="basesmallbold">
-        <color>#888888</color>
+        <color>#aaaaaa</color>
     </fontdef>
     <fontdef name="basesmall_disabled" from="basesmall">
-        <color>#666666</color>
+        <color>#888888</color>
     </fontdef>
     <fontdef name="basesmall_running_selected" from="basesmallbold">
         <color>#00FF00</color>
@@ -105,17 +105,17 @@
         <color>#FFFFFF</color>
     </fontdef>
     <fontdef name="basesmall_disabled_button" from="basesmallbold">
-        <color>#9999cc</color>
+        <color>#ccccff</color>
     </fontdef>
     <!-- State variations on medium font -->
     <fontdef name="basemedium_normal" from="basemediumbold">
-        <color>#9999cc</color>
+        <color>#ccccff</color>
     </fontdef>
     <fontdef name="basemedium_normal_selected" from="basemedium">
         <color>#FFFFFF</color>
     </fontdef>
     <fontdef name="basemedium_disabled" from="basemedium">
-        <color>#666666</color>
+        <color>#888888</color>
     </fontdef>
     <fontdef name="basemedium_highlight" from="basemediumbold">
         <color>#FFFF33</color>
@@ -127,17 +127,17 @@
         <color>#FFFFFF</color>
     </fontdef>
     <fontdef name="basemedium_disabled_button" from="basemediumbold">
-        <color>#9999cc</color>
+        <color>#ccccff</color>
     </fontdef>
 
     <!-- Fonts for specific screens -->
     <fontdef name="deleterecordings_filesize_font" from="basemedium">
-        <pixelsize>40</pixelsize>
+        <pixelsize>34</pixelsize>
         <color>#bbbb33</color>
         <weight>bold</weight>
     </fontdef>
     <fontdef name="baseguide" from="basesmall">
-        <pixelsize>20</pixelsize>
+        <pixelsize>18</pixelsize>
         <weight>normal</weight>
     </fontdef>
 
@@ -1063,7 +1063,7 @@
                     <shape name="background">
                         <area>0,0,166,106</area>
                         <fill style="gradient">
-                            <gradient start="#999999" end="#666666" alpha="220" />
+                            <gradient start="#999999" end="#888888" alpha="220" />
                         </fill>
                     </shape>
                 </state>
@@ -1126,19 +1126,19 @@
 
         <fontdef name="medium" face="Droid Sans">
             <color>#FFFFFF</color>
-            <pixelsize>26</pixelsize>
+            <pixelsize>23</pixelsize>
             <weight>bold</weight>
         </fontdef>
 
         <fontdef name="large" face="Liberation Sans">
              <color>#FFFFFF</color>
-             <pixelsize>28</pixelsize>
+             <pixelsize>25</pixelsize>
              <weight>bold</weight>
         </fontdef>
 
         <fontdef name="clock" face="Liberation Sans">
              <color>#FFFFFF</color>
-             <pixelsize>26</pixelsize>
+             <pixelsize>23</pixelsize>
              <weight>bold</weight>
         </fontdef>
     </window>
diff -ur MythCenter-wide.fedora/menu-ui.xml ajb-MythCenter-wide/menu-ui.xml
--- MythCenter-wide.fedora/menu-ui.xml	2011-01-12 23:35:27.000000000 +0000
+++ ajb-MythCenter-wide/menu-ui.xml	2011-01-16 20:15:46.000000000 +0000
@@ -7,7 +7,7 @@
 
         <fontdef name="menufont" face="Liberation Sans">
             <color>#FFFFFF</color>
-            <pixelsize>30</pixelsize>
+            <pixelsize>26</pixelsize>
             <weight>bold</weight>
             <shadowcolor>#000000</shadowcolor>
             <shadowoffset>2,2</shadowoffset>
@@ -15,7 +15,7 @@
         </fontdef>
 
         <fontdef name="clock" from="small">
-            <pixelsize>28</pixelsize>
+            <pixelsize>25</pixelsize>
         </fontdef>
 
         <clock name="clock">
diff -ur MythCenter-wide.fedora/osd.xml ajb-MythCenter-wide/osd.xml
--- MythCenter-wide.fedora/osd.xml	2011-01-12 23:34:29.000000000 +0000
+++ ajb-MythCenter-wide/osd.xml	2011-01-16 20:15:46.000000000 +0000
@@ -5,14 +5,14 @@
 
     <window name="program_info">
         <fontdef name="small" face="Droid Sans">
-            <pixelsize>22</pixelsize>
+            <pixelsize>20</pixelsize>
             <color>#EEEEEE</color>
         </fontdef>
         <fontdef name="medium" from="small">
-            <pixelsize>28</pixelsize>
+            <pixelsize>25</pixelsize>
         </fontdef>
         <fontdef name="large" from="small">
-            <pixelsize>34</pixelsize>
+            <pixelsize>28</pixelsize>
             <weight>bold</weight>
         </fontdef>
         <area>50,0,1180,720</area>
@@ -130,7 +130,7 @@
 
     <window name="osd_status">
         <fontdef name="medium" face="Droid Sans">
-            <pixelsize>28</pixelsize>
+            <pixelsize>25</pixelsize>
             <color>#EEEEEE</color>
             <weight>bold</weight>
         </fontdef>
@@ -177,15 +177,15 @@
 
     <window name="browse_info">
         <fontdef name="small" face="Droid Sans">
-            <pixelsize>22</pixelsize>
+            <pixelsize>20</pixelsize>
             <color>#EEEEEE</color>
         </fontdef>
         <fontdef name="medium" from="small">
-            <pixelsize>28</pixelsize>
+            <pixelsize>25</pixelsize>
             <weight>bold</weight>
         </fontdef>
         <fontdef name="large" from="medium">
-            <pixelsize>34</pixelsize>
+            <pixelsize>28</pixelsize>
         </fontdef>
         <area>50,520,1180,100</area>
         <imagetype name="background1">
@@ -226,7 +226,7 @@
 
     <window name="osd_input">
         <fontdef name="medium" face="Droid Sans">
-            <pixelsize>28</pixelsize>
+            <pixelsize>25</pixelsize>
             <color>#EEEEEE</color>
             <weight>bold</weight>
         </fontdef>
@@ -244,7 +244,7 @@
 
     <window name="osd_message">
         <fontdef name="medium" face="Droid Sans">
-            <pixelsize>28</pixelsize>
+            <pixelsize>25</pixelsize>
             <color>#EEEEEE</color>
             <weight>bold</weight>
         </fontdef>
@@ -262,7 +262,7 @@
 
     <window name="MythPopupBox">
         <fontdef name="basesmall" face="Droid Sans">
-            <pixelsize>22</pixelsize>
+            <pixelsize>20</pixelsize>
             <color>#EEEEEE</color>
             <weight>bold</weight>
         </fontdef>
@@ -384,7 +384,7 @@
 
     <window name="osd_program_editor">
         <fontdef name="medium" face="Droid Sans">
-            <pixelsize>28</pixelsize>
+            <pixelsize>25</pixelsize>
             <color>#EEEEEE</color>
             <weight>bold</weight>
         </fontdef>
@@ -450,7 +450,7 @@
 
     <window name="ChannelEditor">
         <fontdef name="basesmall" face="Droid Sans">
-            <pixelsize>22</pixelsize>
+            <pixelsize>20</pixelsize>
             <color>#EEEEEE</color>
             <weight>bold</weight>
         </fontdef>
diff -ur MythCenter-wide.fedora/themeinfo.xml ajb-MythCenter-wide/themeinfo.xml
--- MythCenter-wide.fedora/themeinfo.xml	2011-01-12 23:34:29.000000000 +0000
+++ ajb-MythCenter-wide/themeinfo.xml	2011-01-16 20:15:46.000000000 +0000
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <themeinfo>
     <!-- The Theme Name (Required) -->
-    <name>MythCenter-wide</name>
+    <name>ajb-MythCenter-wide</name>
 
     <!-- The Theme Types (Required) -->
     <types>
diff -ur MythCenter-wide.fedora/welcome-ui.xml ajb-MythCenter-wide/welcome-ui.xml
--- MythCenter-wide.fedora/welcome-ui.xml	2011-01-12 23:34:29.000000000 +0000
+++ ajb-MythCenter-wide/welcome-ui.xml	2011-01-16 20:15:46.000000000 +0000
@@ -9,7 +9,7 @@
         -->
         <fontdef name="title" from="baselarge">
             <color>#ffff00</color>
-            <pixelsize>34</pixelsize>
+            <pixelsize>28</pixelsize>
             <shadowcolor>#000000</shadowcolor>
             <shadowoffset>2,2</shadowoffset>
             <weight>bold</weight>
@@ -17,13 +17,13 @@
 
         <fontdef name="time" from="basesmall">
             <color>#9999cc</color>
-            <pixelsize>20</pixelsize>
+            <pixelsize>18</pixelsize>
             <weight>bold</weight>
         </fontdef>
 
         <fontdef name="label" from="basesmall">
             <color>#ffff00</color>
-            <pixelsize>26</pixelsize>
+            <pixelsize>23</pixelsize>
             <shadowcolor>#000000</shadowcolor>
             <shadowoffset>2,2</shadowoffset>
             <weight>bold</weight>
@@ -31,13 +31,13 @@
 
         <fontdef name="info" from="basesmall">
             <color>#ffffff</color>
-            <pixelsize>22</pixelsize>
+            <pixelsize>20</pixelsize>
             <weight>bold</weight>
         </fontdef>
 
         <fontdef name="warning" from="basesmall">
             <color>#ff0000</color>
-            <pixelsize>22</pixelsize>
+            <pixelsize>20</pixelsize>
             <shadowcolor>#000000</shadowcolor>
             <shadowoffset>2,2</shadowoffset>
             <weight>bold</weight>
@@ -45,7 +45,7 @@
 
         <fontdef name="buttons" from="basesmall">
             <color>#ffff00</color>
-            <pixelsize>20</pixelsize>
+            <pixelsize>18</pixelsize>
             <weight>bold</weight>
         </fontdef>
 
diff -ur MythCenter-wide.fedora/zoneminder-ui.xml ajb-MythCenter-wide/zoneminder-ui.xml
--- MythCenter-wide.fedora/zoneminder-ui.xml	2011-01-12 23:35:27.000000000 +0000
+++ ajb-MythCenter-wide/zoneminder-ui.xml	2011-01-16 20:15:46.000000000 +0000
@@ -56,7 +56,7 @@
 
         <fontdef name="running" from="basesmall">
             <color>#00ff00</color>
-            <size>16</size>
+            <size>17</size>
         </fontdef>
 
         <fontdef name="stopped" from="running">
@@ -65,7 +65,7 @@
 
         <fontdef name="footer" from="basesmall">
             <color>#ffffff</color>
-            <size>16</size>
+            <size>17</size>
         </fontdef>
 
         <fontdef name="info" from="basesmall">
@@ -249,19 +249,19 @@
 
         <fontdef name="active" from="basesmall">
             <color>#ffffff</color>
-            <size>18</size>
+            <size>17</size>
             <weight>bold</weight>
         </fontdef>
 
         <fontdef name="inactive" from="basesmall">
             <color>#9999cc</color>
-            <size>18</size>
+            <size>17</size>
             <weight>bold</weight>
         </fontdef>
 
         <fontdef name="selected" from="basesmall">
             <color>#00ff00</color>
-            <size>18</size>
+            <size>17</size>
             <weight>bold</weight>
         </fontdef>
 
@@ -272,12 +272,12 @@
 
         <fontdef name="description" from="basesmall">
             <color>#ffffff</color>
-            <size>18</size>
+            <size>17</size>
         </fontdef>
 
         <fontdef name="label" from="basesmall">
             <color>#ffff00</color>
-            <size>16</size>
+            <size>17</size>
             <weight>bold</weight>
         </fontdef>
 
@@ -654,7 +654,7 @@
 
         <font name="label" from="basesmall">
             <color>#ffff00</color>
-            <size>16</size>
+            <size>17</size>
             <weight>bold</weight>
         </font>
 
@@ -776,22 +776,22 @@
 
         <fontdef name="monitor" from="basesmall">
             <color>#ffff00</color>
-            <size>16</size>
+            <size>17</size>
         </fontdef>
 
         <fontdef name="idle" from="basesmall">
             <color>#ffff00</color>
-            <size>16</size>
+            <size>17</size>
         </fontdef>
 
         <fontdef name="alarm" from="basesmall">
             <color>#ff0000</color>
-            <size>16</size>
+            <size>17</size>
         </fontdef>
 
         <fontdef name="alert" from="basesmall">
             <color>#ffa500</color>
-            <size>16</size>
+            <size>17</size>
         </fontdef>
 
         <textarea name="pagetitle" from="basetextarea">

dgen-SDL joystick patch

This patch (originally from http://jedi.3322.org/jedi/EMUGAME-HOWTO/dgen-sdl-1.23-jsmap.patch - archived by the Wayback Machine here) allows dgen-SDL to use joysticks, with configurable mappings:

diff -ruN dgen-sdl-1.23/rc.cpp dgen-sdl-1.23-new/rc.cpp
--- dgen-sdl-1.23/rc.cpp	2001-07-03 03:59:39.000000000 +0800
+++ dgen-sdl-1.23-new/rc.cpp	2003-06-27 19:09:55.000000000 +0800
@@ -166,6 +166,7 @@
 /* Define all the external RC variables */
 #include "rc-vars.h"
 
+/*
 long js_map_button[2][16] = {
     {
 	MD_A_MASK, MD_C_MASK, MD_A_MASK,
@@ -180,6 +181,7 @@
 	MD_MODE_MASK, 0, 0, 0, 0, 0, 0
     }
 };
+*/
 
 /* Parse a keysym.
  * If the string matches one of the strings in the keysym table above,
@@ -236,6 +238,7 @@
 
 // Made GCC happy about unused things when we don't want a joystick.  :) [PKH]
 // Cheesy hack to set joystick mappings from the RC file. [PKH]
+/*
 static long jsmap(const char *value) {
   if(!strcasecmp(value, "mode"))
     snprintf((char*)value, 2, "%c", 'm');
@@ -278,6 +281,41 @@
     return(0);
     }
 }
+*/
+	
+/**
+  Jedi change the joystick axis/button mapping format in RC file.
+  I'v try my best to fit joy-event with long return value.
+*/
+
+static long joyaxisval (const char *value)
+{
+	JoyAxisValue	jav;
+	int		j,a,v;
+
+	if (sscanf (value, "j%da%d(%d)", &j, &a, &v) != 3) {
+		return -1;
+	} else {
+		jav.jae.which = j;
+		jav.jae.axis = a;
+		jav.jae.value = v;
+		return jav.lv;
+	}
+}
+
+static long joybtnval (const char *value)
+{
+	JoyButtonValue	jbv;
+	int		j,b;
+
+	if (sscanf (value, "j%db%d", &j, &b) != 2) {
+		return -1;
+	} else {
+		jbv.jbe.which = j;
+		jbv.jbe.button = b;
+		return jbv.lv;
+	}
+}
 
 /* Parse the CTV type. As new CTV filters get submitted expect this to grow ;)
  * Current values are:
@@ -366,6 +404,31 @@
   { "int_opengl_width", number, &dgen_opengl_width },
   { "int_opengl_height", number, &dgen_opengl_height },
   { "bool_joystick", boolean, &dgen_joystick },
+  { "joy_pad1_up", joyaxisval, &(joypad1_up.lv)},
+  { "joy_pad1_down", joyaxisval, &(joypad1_down.lv)},
+  { "joy_pad1_left", joyaxisval, &(joypad1_left.lv)},
+  { "joy_pad1_right", joyaxisval, &(joypad1_right.lv)},
+  { "joy_pad1_a", joybtnval, &(joypad1_a.lv)},
+  { "joy_pad1_b", joybtnval, &(joypad1_b.lv)},
+  { "joy_pad1_c", joybtnval, &(joypad1_c.lv)},
+  { "joy_pad1_x", joybtnval, &(joypad1_x.lv)},
+  { "joy_pad1_y", joybtnval, &(joypad1_y.lv)},
+  { "joy_pad1_z", joybtnval, &(joypad1_z.lv)},
+  { "joy_pad1_mode", joybtnval, &(joypad1_mode.lv)},
+  { "joy_pad1_start", joybtnval, &(joypad1_start.lv)},
+  { "joy_pad2_up", joyaxisval, &(joypad2_up.lv)},
+  { "joy_pad2_down", joyaxisval, &(joypad2_down.lv)},
+  { "joy_pad2_left", joyaxisval, &(joypad2_left.lv)},
+  { "joy_pad2_right", joyaxisval, &(joypad2_right.lv)},
+  { "joy_pad2_a", joybtnval, &(joypad2_a.lv)},
+  { "joy_pad2_b", joybtnval, &(joypad2_b.lv)},
+  { "joy_pad2_c", joybtnval, &(joypad2_c.lv)},
+  { "joy_pad2_x", joybtnval, &(joypad2_x.lv)},
+  { "joy_pad2_y", joybtnval, &(joypad2_y.lv)},
+  { "joy_pad2_z", joybtnval, &(joypad2_z.lv)},
+  { "joy_pad2_mode", joybtnval, &(joypad2_mode.lv)},
+  { "joy_pad2_start", joybtnval, &(joypad2_start.lv)},
+/*
   { "joypad1_b0", jsmap, &js_map_button[0][0] },
   { "joypad1_b1", jsmap, &js_map_button[0][1] },
   { "joypad1_b2", jsmap, &js_map_button[0][2] },
@@ -398,6 +461,7 @@
   { "joypad2_b13", jsmap, &js_map_button[1][13] },
   { "joypad2_b14", jsmap, &js_map_button[1][14] },
   { "joypad2_b15", jsmap, &js_map_button[1][15] },
+*/
   { NULL, NULL, NULL } // Terminator
 };
 
@@ -444,7 +508,7 @@
       do {
 	if(!strcasecmp(s->fieldname, field))
 	  {
-	    int potential;
+	    long potential;
 	    potential = (*(s->parser))(value);
 	    /* If we got a bad value, discard and warn user */
 	    if(potential == -1)
diff -ruN dgen-sdl-1.23/rc-vars.h dgen-sdl-1.23-new/rc-vars.h
--- dgen-sdl-1.23/rc-vars.h	2001-07-03 03:20:30.000000000 +0800
+++ dgen-sdl-1.23-new/rc-vars.h	2003-06-27 19:09:59.000000000 +0800
@@ -10,8 +10,12 @@
 // Otherwise, we just declare them as externs
 #ifdef IS_MAIN_CPP
 #define RCVAR(name, def) long name = def
+#define RCJAV(name, which, axis, value) JoyAxisValue name = {which, axis, value}
+#define RCJBV(name, which, button) JoyButtonValue name = {which, button}
 #else
 #define RCVAR(name, def) extern long name
+#define RCJAV(name, which, axis, value) extern JoyAxisValue name
+#define RCJBV(name, which, button) extern JoyButtonValue name
 #endif
 
 RCVAR(pad1_up, PDK_UP);
@@ -84,4 +88,53 @@
 RCVAR(dgen_opengl_width, 640);
 RCVAR(dgen_opengl_height, 480);
 
+typedef struct {
+	char		which;
+	char		axis;
+	signed short	value;
+} JoyAxisEvent;
+
+typedef union {
+	JoyAxisEvent	jae;
+	long		lv;
+} JoyAxisValue;
+
+RCJAV(joypad1_up, 0, 1, -1);
+RCJAV(joypad1_down, 0, 1, 1);
+RCJAV(joypad1_left, 0, 0, -1);
+RCJAV(joypad1_right, 0, 0, 1);
+
+RCJAV(joypad2_up, 1, 1, -1);
+RCJAV(joypad2_down, 1, 1, 1);
+RCJAV(joypad2_left, 1, 0, -1);
+RCJAV(joypad2_right, 1,0,1);
+
+typedef struct {
+	char	which;
+	char	button;
+} JoyButtonEvent;
+
+typedef union {
+	JoyButtonEvent	jbe;
+	long		lv;
+} JoyButtonValue;
+
+RCJBV(joypad1_a, 0, 0);
+RCJBV(joypad1_b, 0, 1);
+RCJBV(joypad1_c, 0, 2);
+RCJBV(joypad1_x, 0, 3);
+RCJBV(joypad1_y, 0, 4);
+RCJBV(joypad1_z, 0, 5);
+RCJBV(joypad1_mode, 0, 6);
+RCJBV(joypad1_start, 0, 7);
+
+RCJBV(joypad2_a, 1, 0);
+RCJBV(joypad2_b, 1, 1);
+RCJBV(joypad2_c, 1, 2);
+RCJBV(joypad2_x, 1, 3);
+RCJBV(joypad2_y, 1, 4);
+RCJBV(joypad2_z, 1, 5);
+RCJBV(joypad2_mode, 1, 6);
+RCJBV(joypad2_start, 1, 7);
+
 #endif // __RC_VARS_H__
diff -ruN dgen-sdl-1.23/sample.dgenrc dgen-sdl-1.23-new/sample.dgenrc
--- dgen-sdl-1.23/sample.dgenrc	2001-07-03 03:18:14.000000000 +0800
+++ dgen-sdl-1.23-new/sample.dgenrc	2003-06-27 19:09:51.000000000 +0800
@@ -36,6 +36,42 @@
 key_pad1_mode = backspace
 key_pad1_start = return
 
+# There are the new format joypad controls defination
+# Joystick axis defination:
+# j0a3(-16384)
+#  | | ||
+#  | | |+- joystick axis event filter value (from 1 to 32767).
+#  | | +-- axis heading (positive/negative).
+#  | +---- axis index (from 0 to 255).
+#  +------ joystick index (from 0 to 255).
+
+# About the joystick axis event filter value:
+                                                                                
+# Usually, the joystick device has noise signals on axis buttons. The noise 
+# signals will disturb your normal play.To avoid this fucking story, you must
+# set a value to the filter. Then if the absolute value of a event is not 
+# bigger than the filter, the engine will leave along this event.The value 
+# range you could set is from 1 to 32767.
+
+# Joystick button defination
+# j0b3
+#  | |
+#  | +- button index (from 0 to 255).
+#  +--- joystick index (from 0 to 255).
+
+joy_pad1_up = j0a1(-16384)
+joy_pad1_down = j0a1(+16384)
+joy_pad1_left = j0a0(-16384)
+joy_pad1_right = j0a0(+16384)
+joy_pad1_a = j0b3
+joy_pad1_b = j0b0
+joy_pad1_c = j0b1
+joy_pad1_x = j0b2
+joy_pad1_y = j0b6
+joy_pad1_z = j0b7
+joy_pad1_mode =j0b9
+joy_pad1_start = j0b8
+
 # The same for pad 2
 # Yes, I KNOW the default player 2 keys are awful. Pick your own!
 key_pad2_up = kp_up
@@ -51,6 +87,19 @@
 key_pad2_mode = kp_plus
 key_pad2_start = kp_enter
 
+joy_pad2_up = j0a3(-16384)
+joy_pad2_down = j0a3(+16384)
+joy_pad2_left = j0a2(-16384)
+joy_pad2_right = j0a2(+16384)
+joy_pad2_a = j0b13
+joy_pad2_b = j0b10
+joy_pad2_c = j0b11
+joy_pad2_x = j0b12
+joy_pad2_y = j0b16
+joy_pad2_z = j0b17
+joy_pad2_mode =j0b19
+joy_pad2_start = j0b18
+
 # Fix checksum, needed by some games with Game Genie codes
 key_fix_checksum = f1
 
diff -ruN dgen-sdl-1.23/sdl/sdl.cpp dgen-sdl-1.23-new/sdl/sdl.cpp
--- dgen-sdl-1.23/sdl/sdl.cpp	2001-07-03 05:36:49.000000000 +0800
+++ dgen-sdl-1.23-new/sdl/sdl.cpp	2003-06-27 19:10:10.000000000 +0800
@@ -749,6 +749,25 @@
   return 1;
 }
 
+// JoyAxisEnent check, return 1 when it was the just event we expected
+// and -1 means joystick-CENTER event, 0 means not match.
+int jaeq (SDL_JoyAxisEvent sjae, JoyAxisValue jav)
+{
+	if (sjae.which == jav.jae.which
+		&& sjae.axis == jav.jae.axis
+		&& (sjae.value^jav.jae.value) >= 0) {
+		return abs(sjae.value) >= abs(jav.jae.value) ? 1 : -1;
+	} else {
+		return 0;
+	}
+}
+
+int jbeq (SDL_JoyButtonEvent sjbe, JoyButtonValue jbv)
+{
+	return (sjbe.which == jbv.jbe.which
+		&& sjbe.button == jbv.jbe.button);
+}
+
 // The massive event handler!
 // I know this is an ugly beast, but please don't be discouraged. If you need
 // help, don't be afraid to ask me how something works. Basically, just handle
@@ -772,6 +791,26 @@
 	{
 #if SDL_JOYSTICK_SUPPORT
        case SDL_JOYAXISMOTION:
+         int baxis;
+         if ((baxis=jaeq(event.jaxis, joypad1_up)) != 0) {
+           baxis>0 ? (megad.pad[0] &= ~0x01,megad.pad[0] |=  0x02) : megad.pad[0] |= 0x3;
+         } else if ((baxis=jaeq(event.jaxis, joypad1_down)) != 0) {
+           baxis>0 ? (megad.pad[0] |=  0x01,megad.pad[0] &= ~0x02) : megad.pad[0] |= 0x3;
+         } else if ((baxis=jaeq(event.jaxis, joypad1_left)) != 0) {
+           baxis>0 ? (megad.pad[0] &= ~0x04,megad.pad[0] |=  0x08) : megad.pad[0] |= 0xC;
+         } else if ((baxis=jaeq(event.jaxis, joypad1_right)) != 0) {
+           baxis>0 ? (megad.pad[0] |=  0x04,megad.pad[0] &= ~0x08) : megad.pad[0] |= 0xC;
+         } else if ((baxis=jaeq(event.jaxis, joypad2_up)) != 0) {
+           baxis>0 ? (megad.pad[1] &= ~0x01,megad.pad[1] |=  0x02) : megad.pad[1] |= 0x3;
+         } else if ((baxis=jaeq(event.jaxis, joypad2_down)) != 0) {
+           baxis>0 ? (megad.pad[1] |=  0x01,megad.pad[1] &= ~0x02) : megad.pad[1] |= 0x3;
+         } else if ((baxis=jaeq(event.jaxis, joypad2_left)) != 0) {
+           baxis>0 ? (megad.pad[1] &= ~0x04,megad.pad[1] |=  0x08) : megad.pad[1] |= 0xC;
+         } else if ((baxis=jaeq(event.jaxis, joypad2_right)) != 0) {
+           baxis>0 ? (megad.pad[1] |=  0x04,megad.pad[1] &= ~0x08) : megad.pad[1] |= 0xC;
+         }
+         break;
+/*
          // x-axis
          if(event.jaxis.axis == 0)
            {
@@ -809,18 +848,91 @@
              break;
            }
          break;
+*/
        case SDL_JOYBUTTONDOWN:
+         if (jbeq(event.jbutton, joypad1_a)) {
+           megad.pad[0] &= ~0x1000;
+         } else if (jbeq(event.jbutton, joypad1_b)) {
+           megad.pad[0] &= ~0x10;
+         } else if (jbeq(event.jbutton, joypad1_c)) {
+           megad.pad[0] &= ~0x20;
+         } else if (jbeq(event.jbutton, joypad1_x)) {
+           megad.pad[0] &= ~0x40000;
+         } else if (jbeq(event.jbutton, joypad1_y)) {
+           megad.pad[0] &= ~0x20000;
+         } else if (jbeq(event.jbutton, joypad1_z)) {
+           megad.pad[0] &= ~0x10000;
+         } else if (jbeq(event.jbutton, joypad1_mode)) {
+           megad.pad[0] &= ~0x80000;
+         } else if (jbeq(event.jbutton, joypad1_start)) {
+           megad.pad[0] &= ~0x2000;
+         } else if (jbeq(event.jbutton, joypad2_a)) {
+           megad.pad[1] &= ~0x1000;
+         } else if (jbeq(event.jbutton, joypad2_b)) {
+           megad.pad[1] &= ~0x10;
+         } else if (jbeq(event.jbutton, joypad2_c)) {
+           megad.pad[1] &= ~0x20;
+         } else if (jbeq(event.jbutton, joypad2_x)) {
+           megad.pad[1] &= ~0x40000;
+         } else if (jbeq(event.jbutton, joypad2_y)) {
+           megad.pad[1] &= ~0x20000;
+         } else if (jbeq(event.jbutton, joypad2_z)) {
+           megad.pad[1] &= ~0x10000;
+         } else if (jbeq(event.jbutton, joypad2_mode)) {
+           megad.pad[1] &= ~0x80000;
+         } else if (jbeq(event.jbutton, joypad2_start)) {
+           megad.pad[1] &= ~0x2000;
+         }
+         break;
+/*
          // Ignore more than 16 buttons (a reasonable limit :)
          if(event.jbutton.button > 15) break;
          megad.pad[event.jbutton.which] &= ~js_map_button[event.jbutton.which]
                                                          [event.jbutton.button];
          break;
+*/
        case SDL_JOYBUTTONUP:
+         if (jbeq(event.jbutton, joypad1_a)) {
+           megad.pad[0] |= 0x1000;
+         } else if (jbeq(event.jbutton, joypad1_b)) {
+           megad.pad[0] |= 0x10;
+         } else if (jbeq(event.jbutton, joypad1_c)) {
+           megad.pad[0] |= 0x20;
+         } else if (jbeq(event.jbutton, joypad1_x)) {
+           megad.pad[0] |= 0x40000;
+         } else if (jbeq(event.jbutton, joypad1_y)) {
+           megad.pad[0] |= 0x20000;
+         } else if (jbeq(event.jbutton, joypad1_z)) {
+           megad.pad[0] |= 0x10000;
+         } else if (jbeq(event.jbutton, joypad1_mode)) {
+           megad.pad[0] |= 0x80000;
+         } else if (jbeq(event.jbutton, joypad1_start)) {
+           megad.pad[0] |= 0x2000;
+         } else if (jbeq(event.jbutton, joypad2_a)) {
+           megad.pad[1] |= 0x1000;
+         } else if (jbeq(event.jbutton, joypad2_b)) {
+           megad.pad[1] |= 0x10;
+         } else if (jbeq(event.jbutton, joypad2_c)) {
+           megad.pad[1] |= 0x20;
+         } else if (jbeq(event.jbutton, joypad2_x)) {
+           megad.pad[1] |= 0x40000;
+         } else if (jbeq(event.jbutton, joypad2_y)) {
+           megad.pad[1] |= 0x20000;
+         } else if (jbeq(event.jbutton, joypad2_z)) {
+           megad.pad[1] |= 0x10000;
+         } else if (jbeq(event.jbutton, joypad2_mode)) {
+           megad.pad[1] |= 0x80000;
+         } else if (jbeq(event.jbutton, joypad2_start)) {
+           megad.pad[1] |= 0x2000;
+         }
+         break;
+/*
          // Ignore more than 16 buttons (a reasonable limit :)
          if(event.jbutton.button > 15) break;
          megad.pad[event.jbutton.which] |= js_map_button[event.jbutton.which]
                                                         [event.jbutton.button];
          break;
+*/
 #endif // SDL_JOYSTICK_SUPPORT
 	case SDL_KEYDOWN:
 	  ksym = event.key.keysym.sym;

I use it with the following $HOME/.dgen/dgenrc:

# This is a sample .dgenrc file
# It simply sets everything to their default values
# Lines that BEGIN with a hash (#) (i.e. NOTHING before it) are comments.
# Also, everything after the "field = value" is ignored (but don't count on it)

# Note that your own RC file doesn't need to include every field like this
# one does, any ones you exclude simply have their compiled-in default values.

# Also, you can have multiple RC files, and use the -r option to dgen
# to pick the rc you want to load.

# Fields beginning with "key_" take key names. The valid key names are listed
# in the dgenrc(5) manpage.

# Fields beginning with "bool_" are boolean, i.e. they take a true or false
# value:
#  "true", "yes", any number except 0: true 
#  "false", "no", "0"                : false

# Fields beginning with "int_" take a _positive_ integer. Simple enough, huh? ;)

# The syntax and fields of this file are documented in a bit more detail in the
# dgenrc(5) manpage.

# These are the controls for pad 1
key_pad1_up = up
key_pad1_down = down
key_pad1_left = left
key_pad1_right = right
key_pad1_a = a
key_pad1_b = s
key_pad1_c = d
key_pad1_x = q
key_pad1_y = w
key_pad1_z = e
key_pad1_mode = backspace
key_pad1_start = return

# The same for pad 2
# Yes, I KNOW the default player 2 keys are awful. Pick your own!
key_pad2_up = kp_up
key_pad2_down = kp_down
key_pad2_left = kp_left
key_pad2_right = kp_right
key_pad2_a = delete
key_pad2_b = end
key_pad2_c = page_down
key_pad2_x = insert
key_pad2_y = home
key_pad2_z = page_up
key_pad2_mode = kp_plus
key_pad2_start = kp_enter

# Fix checksum, needed by some games with Game Genie codes
key_fix_checksum = f1

# Quit dgen
key_quit = escape
# Toggle split screen and crap-tv
key_splitscreen_toggle = f4
key_craptv_toggle = f5
# Screenshot
key_screenshot = f12
# Reset Genesis
key_reset = tab
# Toggle fullscreen mode
key_fullscreen_toggle = alt-enter

# Use this to toggle which CPU core to use, no need to reset!  :)
# If you don't have multiple CPU cores, it won't do anything!
key_cpu_toggle = f11

# This pauses emulation :)
key_stop = z

# Pick save slot
key_slot_0 = 0
key_slot_1 = 1
key_slot_2 = 2
key_slot_3 = 3
key_slot_4 = 4
key_slot_5 = 5
key_slot_6 = 6
key_slot_7 = 7
key_slot_8 = 8
key_slot_9 = 9
# Save/load game to current slot
key_save = f2
key_load = f3

# This sets whether split-screen and crap-tv should be enabled on startup.
bool_splitscreen_startup = no
# There are now multiple CTV effects to try. Pick your favorite:
#  off       - No CTV
#  blur      - Blur bitmap (this is the CTV from older versions)
#  scanline  - Attenuate every other scanline, by Phillip K. Hornung <redx@pknet.com>
#  interlace - Unstable crappy television (I had one that looked like this ;), by me!
ctv_craptv_startup = off

# These decide whether DGen should automatically load slot 0 on startup,
# and/or autosave to slot 0 on exit.
bool_autoload = no
bool_autosave = no

# Skip frames to keep time? (faster, but can make things look bad)
# This doesn't matter if you have sound enabled, since the sound code has its
# own frameskipping
bool_frameskip = yes
# Show cartridge header info at startup, like Snes9X? Causes a 3-second pause,
# but might be interesting to hackers or other curious people (like me :)
bool_show_carthead = no

# Sound?
bool_sound = yes
# The sound rate to use.
int_soundrate = 22050
# Leave this true for 16-bit sound, but if you're unfortunate enough to have
# an old 8-bit card make it false.
bool_16bit = yes
# Number of sound segments for buffering.  Lower values yield faster
# speed, and less latency in controls and sound, but at the cost of CPU
# Values can be 4, 8, 16, or 32 (frames)
int_soundsegs = 8

# This is how many microseconds DGen should sleep every frame. Even little
# amounts can decrease CPU overhead significantly, and the default of 20
# doesn't hurt performance terribly. Of course, set it to 0 if you don't
# mind DGen eating all your CPU (like me ;)
int_nice = 0

# Run fullscreen?
bool_fullscreen = yes

# If you want to increase the size of the window, increase this value.
# It currently must be a whole number.
int_scale = 2

# Use a joystick?
bool_joystick = yes

# Use OpenGL mode?
bool_opengl = no
# Set these to the resolution you want to run OpenGL mode in.
int_opengl_width = 640
int_opengl_height = 480

# There are the new format joypad controls defination
# Joystick axis defination:
# j0a3(-16384)
#  | | ||
#  | | |+- joystick axis event filter value (from 1 to 32767).
#  | | +-- axis heading (positive/negative).
#  | +---- axis index (from 0 to 255).
#  +------ joystick index (from 0 to 255).

# About the joystick axis event filter value:
                                                                                
# Usually, the joystick device has noise signals on axis buttons. The noise 
# signals will disturb your normal play.To avoid this fucking story, you must
# set a value to the filter. Then if the absolute value of a event is not 
# bigger than the filter, the engine will leave along this event.The value 
# range you could set is from 1 to 32767.

# Joystick button defination
# j0b3
#  | |
#  | +- button index (from 0 to 255).
#  +--- joystick index (from 0 to 255).

joy_pad1_up = j0a1(-16384)
joy_pad1_down = j0a1(+16384)
joy_pad1_left = j0a0(-16384)
joy_pad1_right = j0a0(+16384)
joy_pad1_a = j0b2
joy_pad1_b = j0b0
joy_pad1_c = j0b1
joy_pad1_x = j0b4
joy_pad1_y = j0b3
joy_pad1_z = j0b5
joy_pad1_mode =j0b8
joy_pad1_start = j0b9

joy_pad2_up = j1a1(-16384)
joy_pad2_down = j1a1(+16384)
joy_pad2_left = j1a0(-16384)
joy_pad2_right = j1a0(+16384)
joy_pad2_a = j1b2
joy_pad2_b = j1b0
joy_pad2_c = j1b1
joy_pad2_x = j1b4
joy_pad2_y = j1b3
joy_pad2_z = j1b5
joy_pad2_mode =j1b8
joy_pad2_start = j1b9

Hauppauge Nova-T-500 checklist

1) Boot kernel with usbcore.autosuspend=-1 to disable suspending of USB devices (i.e. the two USB tuners behind the VIA USB/PCI bridge on the Nova-T-500 PCI card)

2) Load the dvb_usb kernel module with disable_rc_polling=1 to disable the IR port on the Nova-T-500. I only use the IR port on the Nova-T, so I can live with this.

3) Load the dvb-usb-dib0700 module with force_lna_activation=1 to have the LNA permanently enabled.

4) In /etc/rc.d/rc.local:

echo 0 >/sys/module/dvb_core/parameters/dvb_powerdown_on_sleep

and

#for i in `find /sys -name 'level' | grep usb`; do echo "on" >$i; done
# AJB20110120 power/level deprecated in favour of power/control
for i in `find /sys -name 'control' | grep usb`; do echo "on" >$i; done
for i in `find /sys -name 'control' | grep i2c` ; do echo "on" >$i; done

as belt-and-braces to prevent the Nova-T-500 sub-devices being suspended.

5) Use the 1.20 firmware (MD5: f42f86e2971fd994003186a055813237) file and ensure it's being properly loaded. I've also tried the 1.10 firmware (MD5: 5878ebfcba2d8deb90b9120eb89b02da) with no apparent improvement.

6) Ensure that the machine is cold-booted (thereby forcing a firmware load onto the Nova-T-500) every time due to reports of warm boots being problematic.

7) Disable EIT scanning by MythTV on both of the two Nova-T-500 tuners. Only leave it enabled on the Nova-T card.

8) MythTV is configured to open all the tuner devices when mythbackend starts and keep them open until mythbackend terminates (i.e. dvb_on_demand=0), rather than repeated opening and closing of the tuner devices which has also been reported as problematic for some.

9) MythTV signal_timeout=500, channel_timeout=3000, dvb_tuning_delay=0 (defaults), but I've tried increasing those to 3000, 4000 and 400 respectively, as per <http://www.knoppmythwiki.org/index.php?page=NovaT500> with no apparent improvement.

10) MythTV multirec enabled, configured with 2 virtual tuners per physical tuner.

11) I briefly experimented with setting buggy_sfn_workaround=1 when loading the dib3000mc and dib7000p modules with no apparent improvement. As far as I can see, though, UK DVB-T broadcasting isn't a single frequency network, so a) this is not relevant here and b) it will impair performace. As a result, I'm NOT using the buggy_sfn_workaround.

I've got debug=1 set for the mt2060, dib3000mc and dib7000p modules, debug=127 for dvb_usb and debug=7 for dvb-usb-dib0700, but I'm not seeing anything obviously bad in my kernel syslog. I've got mythbackend running with "-v important,record" but all that seems to report is no progress on failed recordings after "TVRec(_): Successfully set up DVB table monitoring." (where _ is the cardid of the failed tuner).

(From my post to the video-input-infrastructure mailing list)

Note that MythTV's channel scanner tries to fill in certain fields of the dtv_multiplex table automatically, which doesn't work well with the Nova-T-500 (the main symptom is loss of one or more of its tuners). My dtv_multiplex table for the uk-Mendip transmitter, as of 7 July 2011, contains:

+---------+----------+-------------+-----------+-----------+-----------+------------+------+----------+------------+-----------+--------------+-------------------+----------------+---------+---------------+-----------+--------------+-----------+---------+------------+----------------+---------------------+-------------------+
| mplexid | sourceid | transportid | networkid | frequency | inversion | symbolrate | fec  | polarity | modulation | bandwidth | lp_code_rate | transmission_mode | guard_interval | visible | constellation | hierarchy | hp_code_rate | mod_sys   | rolloff | sistandard | serviceversion | updatetimestamp     | default_authority |
+---------+----------+-------------+-----------+-----------+-----------+------------+------+----------+------------+-----------+--------------+-------------------+----------------+---------+---------------+-----------+--------------+-----------+---------+------------+----------------+---------------------+-------------------+
|      15 |        1 |        4161 |      9018 | 794000000 | a         |          0 | auto | v        | qam_64     | 8         | 1/2          | 8                 | 1/32           |       0 | qam_64        | n         | 2/3          | UNDEFINED | 0.35    | dvb        |             33 | 2011-01-24 00:41:50 |                   |
|      16 |        1 |        8204 |      9018 | 738000000 | a         |          0 | auto | v        | qam_64     | 8         | 1/2          | 8                 | 1/32           |       0 | qam_64        | n         | 2/3          | UNDEFINED | 0.35    | dvb        |             33 | 2011-01-18 01:22:19 |                   |
|      17 |        1 |       12290 |      9018 | 802166670 | a         |          0 | auto | v        | qam_64     | 8         | 1/2          | 2                 | 1/32           |       0 | qam_64        | n         | 2/3          | UNDEFINED | 0.35    | dvb        |             33 | 2011-01-18 01:22:19 |                   |
|      18 |        1 |       20480 |      9018 | 754166670 | a         |          0 | auto | v        | qam_16     | 8         | 3/4          | 2                 | 1/32           |       0 | qam_16        | n         | 3/4          | UNDEFINED | 0.35    | dvb        |             33 | 2011-01-18 01:22:19 |                   |
|      19 |        1 |       24640 |      9018 | 842000000 | a         |          0 | auto | v        | qam_64     | 8         | 1/2          | 8                 | 1/32           |       0 | qam_64        | n         | 2/3          | UNDEFINED | 0.35    | dvb        |             33 | 2011-01-24 00:41:50 |                   |
+---------+----------+-------------+-----------+-----------+-----------+------------+------+----------+------------+-----------+--------------+-------------------+----------------+---------+---------------+-----------+--------------+-----------+---------+------------+----------------+---------------------+-------------------+

The dtv_multiplex table will need to be changed again on 28 September 2011 and 28 March 2012 to deal with changes to the frequencies and DVB parameters. Details can be found at http://www.digitaluk.co.uk/postcodechecker/ (tick the "I am in the aerial installation trade" checkbox), with contributory information from http://www.ukfree.tv/. Channel frequencies can be determined by using queries like http://www.ukfree.tv/mapsofsignal.php?c=52&a=1 (e.g. for Channel 52).

Comments

  • The Hauppauge Nova-T-500 needs to be handled quite carefully to ensure that it is reliable. Most significant is to ensure that the kernel does not suspend USB devices, and that the machine is always cold-booted.
  • CPU usage when recording three channels simultaneously is about [unknown]% plus [unknown] system time.
  • Both the Hauppauge Nova-T and Nova-T-500 cards support multirec in MythTV 0.21. CPU usage when recording from six channels simultaneously is about [unknown]% plus about [unknown]% system time.
  • I currently have configured 4 multirec virtual tuners per physical tuner, giving a total of 12 virtual tuners. Recording and playback are reliable.
  • CPU usage when playing back a recording is about [unknown]%.
  • Commercial Flagging doesn't really work on UK DVB-T broadcasts, apart from the aforementioned silence detection technique.
  • MythWeather doesn't work in 0.20.2. It works again in 0.21 using the BBC grabber.
  • Many emulators need to be run with SDL_AUDIODRIVER=esd in order to work with FC8's default PulseAudio configuration. Xmame needs to be run under padsp and use the -dp oss option.

Old System, pre-January 2011

With an eye on power consumption, I went for a combined frontend/backend implementation. I tried a quick run through with a scratch machine that I was no longer using. Once I'd determined, it'd probably be up for the job, I bought components specially. I mainly used Jarod C. Wilson's 'Fedora Myth(TV)ology' document to configure it, but had to discover some things myself by trial-and-error.

Hardware Specification

  • Intel Pentium 4 2.53GHz CPU (was Intel Celeron 1.7GHz when CPU usage stats were gathered; the P4 is about 50-100% faster)
  • 768MB RAM (originally 256MB)
  • Gigabyte GA-8PE667 Ultra Motherboard (i845PE)
  • Seagate ST3500630A PATA 500GB disc (OS, database, recordings)
  • Seagate ST3300622A PATA 300GB disc (originally only disc; now music, emulator ROMs)
  • LiteOn/JLMS XJ-HD165H DVD-ROM
  • NEC ND-4570A DVD+/-RW
  • Codegen ATX-9001 case
  • 1*Hauppauge Nova-T DVB-T tuner (originally 2)
  • 1*Hauppauge Nova-T-500 dual DVB-T tuner with Hauppauge infra-red remote control
  • 1*Pace Bt878 Analogue NICAM/FM tuner (not currently used)
  • 1*D-Link quad-port NIC
  • GeForce4 MX 440 AGP 128MB fanless VGA card (bought used to replace failing cheaper nVidia card)
  • home-built VGA-to-RGB SCART adaptor with integrated audio in/out and composite from SCART
  • 2*PADIX/Rockfire PX-205 PSX-USB Bridge with two Logic-7 Playstation dual-shock gamepads
  • Ruwido/Chicony KB-9820 infra-red PS/2 keyboard/mousepad
  • Panasonic TX-28DTX11 100Hz DVB-T 16:9 TV
  • SLx 4-way UHF amplifier
  • Yamaha RX-V361 AV Receiver/Surround Decoder, linked via 3m coax

Software Specification

  • Fedora Core 8 running 2.6.23.9-85.fc8 kernel (reverted from 2.6.24.3-12.fc8 after problems with 'mt2060 failed to read/write' errors and inability to tune) and standard video4linux drivers. This kernel revision appears to fully support the Nova-T-500, including the remote control, thus completely negating any reason to use out-of-tree v4l drivers from the mercurial repository. Note that previous FC8 kernels supported the Nova-T-500, but with no remote control support. The v4l drivers from the mercurial repository are reputed to be more stable with the Nova-T-500, but I experienced a couple of hard locks when running with a snapshot taken on 17 March 2008.
  • MythTV 21 from ATrpms
  • pdnsd caching DNS server
  • privoxy ad-filtering HTTP proxy
  • DHCP daemon
  • netfilter/iptables firewall
  • NTP server
  • nVidia 96.43.01 drivers from ATrpms
  • Xmame/Xmess 0.106, fceultra 0.98.12, VisualBoyAdvance 1.7.2, zsnes 1.52, dgen-sdl 1.23
  • dvb-usb-dib0700-1.20.fw firmware for Nova-T-500 (may need symlinks in /lib/firmware named dvb-usb-dib0700-01.fw and dvb-usb-dib0700-1.10.fw)

OS Configuration

Partitioning

/dev/sda1    2668MiB /           ext3
/dev/sda2    2668MiB spare
/dev/sda3    2691MiB swap
/dev/sda4          - extended
/dev/sda5  410089MiB /myth/video jfs
/dev/sda6   23847MiB /tmp        ext2
/dev/sda7    9547MiB /var        ext3
/dev/sda8   19086MiB /usr        ext3
/dev/sda9    6346MiB /home       ext3

/dev/sdb1    2668MiB spare
/dev/sdb2    2668MiB spare
/dev/sdb3    2691MiB spare
/dev/sdb4          - extended
/dev/sdb5   74395MiB spare
/dev/sdb6    9547MiB spare
/dev/sdb7    1914MiB spare
/dev/sdb8   14316MiB spare
/dev/sdb9   76301MiB /myth/music     ext2
/dev/sdb10 101670MiB /myth/emulators ext2

/etc/php.ini

Configure PHP's date.timezone setting to match local timezone, or MythWeb will fail to generate preview thumbnails for recordings that were made whilst DST was in force if DST is not currently in force, and vice versa.

Example:

date.timezone = Europe/London

/etc/my.cnf

[mysqld]
key_buffer = 16M
table_cache = 128
sort_buffer_size = 2M
myisam_sort_buffer_size = 8M
query_cache_size = 16M
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

/etc/X11/xorg.conf


# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig:  version 1.0  (buildmeister@builder3)  Wed Dec 14 16:39:22 PST 2005
# XFree86 4 configuration created by pyxf86config

Section "ServerLayout"
	Identifier     "Default Layout"
	Screen      0  "Screen0" 0 0
	InputDevice    "Mouse0" "CorePointer"
	InputDevice    "Keyboard0" "CoreKeyboard"
EndSection

# This, combined with disabling syncing in ~/.nvidia-settings-rc makes OpenGL vsync work
# properly
Section "Extensions"
        Option      "Composite" "Disable"
EndSection

Section "Files"

# RgbPath is the location of the RGB database.  Note, this is the name of the 
# file minus the extension (like ".txt" or ".db").  There is normally
# no need to change the default.
# Multiple FontPath entries are allowed (they are concatenated together)
# By default, Red Hat 6.0 and later now use a font server independent of
# the X server to render fonts.
	RgbPath      "/usr/X11R6/lib/X11/rgb"
	ModulePath   "/usr/lib/xorg/modules/extensions/nvidia"
	ModulePath   "/usr/lib/xorg/modules/extensions"
	ModulePath   "/usr/lib/xorg/modules"
	ModulePath   "/usr/lib/xorg/modules/"
EndSection

Section "ServerFlags"
	Option	    "AllowMouseOpenFail"
EndSection

Section "InputDevice"

# Specify which keyboard LEDs can be user-controlled (eg, with xset(1))
#	Option	"Xleds"		"1 2 3"
# To disable the XKEYBOARD extension, uncomment XkbDisable.
#	Option	"XkbDisable"
# To customise the XKB settings to suit your keyboard, modify the
# lines below (which are the defaults).  For example, for a non-U.S.
# keyboard, you will probably want to use:
#	Option	"XkbModel"	"pc102"
# If you have a US Microsoft Natural keyboard, you can use:
#	Option	"XkbModel"	"microsoft"
#
# Then to change the language, change the Layout setting.
# For example, a german layout can be obtained with:
#	Option	"XkbLayout"	"de"
# or:
#	Option	"XkbLayout"	"de"
#	Option	"XkbVariant"	"nodeadkeys"
#
# If you'd like to switch the positions of your capslock and
# control keys, use:
#	Option	"XkbOptions"	"ctrl:swapcaps"
# Or if you just want both to be control, use:
#	Option	"XkbOptions"	"ctrl:nocaps"
#
	Identifier  "Keyboard0"
	Driver      "kbd"
	Option	    "XkbModel" "pc105"
	Option	    "XkbLayout" "gb"
EndSection

Section "InputDevice"
	Identifier  "Mouse0"
	Driver      "mouse"
	Option	    "Protocol" "IMPS/2"
	Option	    "Device" "/dev/input/mice"
	Option	    "ZAxisMapping" "4 5"
	Option	    "Emulate3Buttons" "yes"
EndSection

Section "Monitor"

#    HorizSync       31.5 - 37.9
#    VertRefresh     50.0 - 70.0
	Identifier   "Monitor0"
	VendorName   "Monitor Vendor"
	ModelName    "Unknown monitor"
	HorizSync    0.0 - 16.0
	VertRefresh  49.0 - 62.0
	ModeLine     "800x576pali" 15.4 800 823 895 984 576 580 583 625 -hsync -vsync interlace
	ModeLine     "800x288pal-half" 15.4 800 823 895 984 288 290 292 313 -hsync -vsync
#	ModeLine     "768x576pali" 14.8 768 789 858 944 576 581 586 625 -hsync -vsync interlace
# 768x576@14.75 is 15.625kHz horiz sync
	ModeLine     "768x576pali" 14.75 768 789 858 944 576 581 586 625 -hsync -vsync interlace
	ModeLine     "768x288pal-half" 14.8 768 792 856 944 288 290 292 313 -hsync -vsync
#	ModeLine     "720x576pali" 13.9 720 744 808 888 576 580 583 625 -hsync -vsync interlace

# dvb is normally 720x576, 4:3 analogue is normally 768x576
# previous best
# 720x576 w/ 13.5MHz dotclock is 50.0000Hz, 15.6250kHz, checked with hacked xvidtune
# and manually: 864 * 15625 = 13.5M
# Good, but a bit too far to the right - AJB 20071110
#	ModeLine     "720x576pali" 13.5 720 722 786 864 576 581 586 625 -hsync -vsync interlace

#	ModeLine     "720x576pali" 13.5 720 727 791 864 576 581 586 625 -hsync -vsync interlace
#	ModeLine     "720x576pali" 13.5 720 737 801 864 576 581 586 625 -hsync -vsync interlace
	ModeLine     "720x576pali" 13.5 720 757 821 864 576 581 586 625 -hsync -vsync interlace

# worth trying if 720x576@13.5 flickers:
# from http://www.avforums.com/forums/showthread.php?t=136811&page=33
# ModeLine "720x576" 15.125 720 762 834 968 576 579 607 625 -hsync -vsync interlace
# from http://www.avforums.com/forums/showthread.php?t=136811&page=27
ModeLine "1024x576" 19.750 1024 1056 1152 1264 576 581 586 625 -hsync -vsync interlace

#	ModeLine     "720x288pal-half" 13.9 720 744 808 888 288 290 292 313 -hsync -vsync
# should be 13.875MHz for 15.625kHz horiz sync
	ModeLine     "720x288pal-half" 13.875 720 744 808 888 288 290 292 313 -hsync -vsync
# previously used for some oddball broadcasts
# 704x576 w/ 13.5MHz dotclock is 50.0000Hz, 15.6250kHz, checked with hacked xvidtune
	ModeLine     "704x576pali" 13.5 704 720 784 864 576 580 583 625 -hsync -vsync interlace
	ModeLine     "704x288pal-half" 13.5 704 720 784 864 288 290 292 313 -hsync -vsync

# appears to be closest to PAL spec, according to:
# http://www.gossamer-threads.com/lists/mythtv/users/191409?search_string=interlace;#191409
# http://www.gossamer-threads.com/lists/mythtv/users/100222?search_string=scart;#100222
# still flickers occasionally with 8776 drivers
# 720x576 w/ 13.875MHz dotclock is 49.98Hz according to xvidtune
#	ModeLine     "720x576pali" 13.875 720 744 808 888 576 581 586 625 -hsync -vsync interlace
#	ModeLine     "720x288pal-half" 13.875 720 744 808 888 288 290 293 313 -hsync -vsync
#	ModeLine     "704x576pali" 13.6 704 728 792 872 576 581 586 625 -hsync -vsync interlace
#	ModeLine     "704x288pal-half" 13.6 704 728 792 872 288 290 293 313 -hsync -vsync

# previously used for some oddball broadcasts
#	ModeLine     "704x576pali" 13.5 704 720 784 864 576 580 583 625 -hsync -vsync interlace
#	ModeLine     "704x288pal-half" 13.5 704 720 784 864 288 290 292 313 -hsync -vsync

	ModeLine     "648x576pali" 12.5 648 664 720 824 576 580 583 625 -hsync -vsync interlace
	ModeLine     "648x288pal-half" 12.5 648 664 720 824 288 290 292 313 -hsync -vsync
	ModeLine     "800x480ntsci" 15.1 800 808 879 960 480 484 487 525 -hsync -vsync interlace
	ModeLine     "800x240ntsc-half" 15.1 800 808 879 960 240 242 244 263 -hsync -vsync
	ModeLine     "720x480ntsci" 13.6 720 728 792 864 480 484 487 525 -hsync -vsync interlace
	ModeLine     "720x240ntsc-half" 13.6 720 728 792 864 240 242 244 263 -hsync -vsync
	ModeLine     "704x480ntsci" 13.3 704 712 776 848 480 484 487 525 -hsync -vsync interlace
	ModeLine     "704x240ntsc-half" 13.3 704 712 776 848 240 242 244 263 -hsync -vsync
	ModeLine     "657x480ntsci" 12.5 656 664 728 792 480 484 487 525 -hsync -vsync interlace
	ModeLine     "657x240ntsc-half" 12.5 656 664 728 792 240 242 244 263 -hsync -vsync
	ModeLine     "320x256pal" 10.9 320 352 368 400 256 261 264 269 -hsync -vsync doublescan
	ModeLine     "320x512pali" 5.5 320 352 368 400 512 523 527 539 -hsync -vsync interlace
	ModeLine     "320x200pal" 8.4 320 352 368 400 200 204 206 211 -hsync -vsync doublescan
	ModeLine     "320x400pali" 4.2 320 352 360 392 400 409 411 421 -hsync -vsync interlace
	ModeLine     "320x400ntsci" 5.1 320 352 368 400 400 409 411 421 -hsync -vsync interlace
	ModeLine     "320x200ntsc" 10.2 320 352 368 400 200 204 206 211 -hsync -vsync doublescan
	ModeLine     "352x288pald" 13.5 352 392 492 512 288 292 300 304 -hsync -vsync doublescan
	ModeLine     "352x288paldi" 13.5 352 392 492 512 288 292 300 304 -hsync -vsync interlace doublescan
	Option	    "dpms"
EndSection

Section "Device"

# next line might make XvMC work
# or fix NV WAIT problems
# ...maybe, but makes picture bounce - AJB 20060403
    Option         "NvAgp" "1"
    Option         "UseEvents" "True"
# another thing that might help with NV WAIT - AJB 20060403
#    Option         "TVStandard" "PAL-I"
	Identifier  "Videocard0"
	Driver      "nvidia"
	VendorName  "Videocard vendor"
	BoardName   "NVIDIA GeForce 4 (generic)"
	Option	    "RenderAccel" "off"
#    Option         "TVOutFormat" "COMPOSITE"
	Option	    "ConnectedMonitor" "CRT"
# attempt to fix occasional judders
        Option      "UseEvents" "true"
EndSection

Section "Screen"
	Identifier "Screen0"
	Device     "Videocard0"
	Monitor    "Monitor0"
	DefaultDepth     24
	SubSection "Display"
		Viewport   0 0
		Depth     16
		Modes    "1024x576" "720x576pali" "720x288pal-half" "704x576pali" "704x288pal-half" "648x576pali" "648x288pal-half"
#		Modes    "720x576pali" "720x288pal-half" "704x576pali" "704x288pal-half" "648x576pali" "648x288pal-half"
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     24
		Modes    "1024x576" "720x576pali" "720x288pal-half" "704x576pali" "704x288pal-half" "648x576pali" "648x288pal-half"
#		Modes    "720x576pali" "720x288pal-half" "704x576pali" "704x288pal-half" "648x576pali" "648x288pal-half"
	EndSubSection
EndSection

/etc/rc.d/rc.local

#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local
# mtd needs mysqld to be up, so moved to mythbackend initscript
# AJB 20071106
#/usr/bin/mtd --daemon
setkeycodes e01e 120
/sbin/setpci -s 00:1f.1 latency_timer=b0
/sbin/setpci -s 02:0c.0 latency_timer=b0

# nvidia recommended setting as per <http://www.nvnews.net/vbulletin/showpost.php?p=854678&postcount=5>
# - AJB 20060403
/sbin/setpci -s 01:00.0 latency_timer=80

# attempt to fix router disappearing - AJB 20060423
# 10M doesn't seem to fix it entirely, but it seems to recover
# glitches regularly
# disabled after switching eth0 and eth1 roles around
#/sbin/mii-tool -A 10baseT-HD eth0 # advertise only 10baseT-HD
#/sbin/mii-tool -F 10baseT-HD eth0 # force 10baseT-HD

# attempt to fix router disappearing - AJB 20060424
# this seems worse than 10M-HD
# sometimes doesn't recover
#/sbin/mii-tool -A 100baseTx-HD eth0 # advertise only 10baseT-HD
#/sbin/mii-tool -F 100baseTx-HD eth0 # force 10baseT-HD

# this seems to be ignored in /etc/sysconfig/harddiskhdg AJB 20060622
# 240*5s=20m
#hdparm -S 240 /dev/sdb
# AJB 20071105 - 2*30m=60m
# disabled 20071224 after configuring InstantMirror
# hdparm -S 242 /dev/sdb
lsmod >/tmp/lsmod-rc.local-pre.txt 2>&1
#modprobe dvb_usb_dib0700
#lsmod >/tmp/lsmod-rc.local-post.txt 2>&1

# Attempt to fix judder AJB 20071114
blockdev --setra 2048 /dev/sda

# Disable DVB LNB powerdown, since module option seems to be ignored AJB 20080318
echo 0 >/sys/module/dvb_core/parameters/dvb_powerdown_on_sleep

# Fix USB power to on AJB 20081207
for i in /sys/devices/pci*/*/usb*/power/level /sys/devices/pci*/*/*/usb*/power/level /sys/devices/pci*/*/*/usb*/*/power/level;
        do echo "on" >$i
done


/etc/modprobe.d/options

options dvb-usb-dib0700 force_lna_activation=1

# disable IR remote input on Nova-T-500 (and any other USB DVB devices)
options dvb_usb disable_rc_polling=1

# may not work, so may need to echo to /sys/... in rc.local
options dvb_core dvb_powerdown_on_sleep=0
options dvb-core dvb_powerdown_on_sleep=0

options snd-intel8x0 index=0
install snd-intel8x0 /sbin/modprobe --ignore-install snd-intel8x0 && /usr/sbin/alsactl restore 0 >/dev/null 2>&1 || :

# I2C module options
alias char-major-89 i2c-dev

/etc/X11/XvMCConfig

libXvMCNVIDIA_dynamic.so.1

Add to /etc/security/limits.conf

*               -       rtprio     0
*               -       nice       0
@video          -       rtprio     50
@video          -       nice       0
@mythtv          -       rtprio     50
@mythtv          -       nice       0

$HOME/.Xclients

#!/bin/sh
# Load nVidia driver custom settings
nvidia-settings --load-config-only &
# Restore audio settings
/usr/sbin/alsactl restore
# Launch irexec for myth power button stop/start
IREXECPID=`ps uaxwww | grep irexec$ | awk '{print $2}'`
if [ "$IREXECPID" = "" ]; then
        irexec &
fi
# Disable dynamic power management (screen blanking)
/usr/X11R6/bin/xset -dpms
# Disable screen saver
/usr/X11R6/bin/xset s off
# get rid of blue line at bottom of picture
/usr/bin/xvattr -a XV_COLORKEY -v 66048
# Launch myth frontend
#mythfrontend &
mythfrontend >/dev/null 2>&1 &
gnome-session

Hauppauge Infra-Red Remote

The sensor for the remote is connected to the Nova-T. No sensor is connected to the Nova-T-500. When I was using two Nova-Ts, sometimes the /dev nodes would swap around after a reboot or kernel upgrade. Using the by-path /dev/ entries is a bit more stable.

/etc/sysconfig/lircd
# Options to lircd
#LIRCD_OPTIONS="-H dev/input -d /dev/input/by-path/pci-0000:02:03.2--event-ir"
# path to the device node for the Nova-T sometimes changes between .2 and .0,
# so use a wildcard to match, as long as there's only ever one Nova-T present!
LIRCD_OPTIONS="-H dev/input -d /dev/input/by-path/pci-0000:02:03.?--event-ir"
/etc/lircd.conf

# Please make this file available to others
# by sending it to <lirc@bartelmus.de>
#
# this config file was automatically generated
# using lirc-0.8.7(devinput) on Sat Jan  8 14:43:26 2011
#
# contributed by 
#
# brand:                       /root/irrecord-201101081438.txt
# model no. of remote control: 
# devices being controlled by this remote:
#

begin remote

  name  /root/irrecord-201101081438.txt
  bits            8
  eps            30
  aeps          100

  one             0     0
  zero            0     0
  pre_data_bits   56
  pre_data       0x4000400001E
  gap          111995
  toggle_bit_mask 0x0

      begin codes
          Go                       0x3B
          Power                    0x3D
          TV                       0x1C
          Videos                   0x18
          Music                    0x19
          Pictures                 0x1A
          Guide                    0x1B
          Radio                    0x0C
          UP                       0x14
          LEFT                     0x16
          RIGHT                    0x17
          DOWN                     0x15
          OK                       0x25
          Back                     0x1F
          Menu                     0x0D
          VolumeUp                 0x10
          VolumeDown               0x11
          Prev-Ch                  0x12
          ChannelUp                0x20
          ChannelDown              0x21
          Mute                     0x0F
          Record                   0x37
          Stop                     0x36
          Replay                   0x32
          Play                     0x35
          Skip                     0x34
          PreviousTrack            0x24
          Pause                    0x30
          NextTrack                0x1E
          1                        0x01
          2                        0x02
          3                        0x03
          4                        0x04
          5                        0x05
          6                        0x06
          7                        0x07
          8                        0x08
          9                        0x09
          Asterisk                 0x0A
          0                        0x00
          Hash                     0x0E
          Red                      0x0B
          Green                    0x2E
          Yellow                   0x38
          Blue                     0x29
      end codes

end remote


$HOME/.mythtv/lircrc

Symlinked to $HOME/.mythtv/.lircrc which contains:

# Power Button
begin
prog = irexec
#button = OFF
button = Power
#button = POWER # (for my RS15-2116 remote)
repeat = 0
config = /usr/local/bin/mythpowerbutton.sh
end

# ~/.mythtv/lircrc#
# MythTV native LIRC config file for
# the Hauppauge PVR 150 silver remote
#
# Modified from Jarod Wilson's which came from Jeff Campbell's
# and Brad Templeton's
# Modified still further by Robert Jones
# Here we have the jump point commands.  They only work if you have
# defined function keys for these jump points.  For me the most
# common command is the menu of recordings, so I put that on "videos"
# even though that's counter-intuitive

begin
prog = mythtv
button = TV
repeat = 3
config = F1
end

begin
prog = mythtv
button = Videos
repeat = 3
config = F2
end

# Not yet defined
begin
prog = mythtv
button = Music
repeat = 3
config = F3
end

begin
prog = mythtv
button = Pictures
repeat = 3
config = F4
end

begin
prog = mythtv
button = Guide
repeat = 3
config = F5
end

begin
prog = mythtv
button = Radio
repeat = 3
config = F6
end

begin
prog = mythtv
button = UP
repeat = 3
config = Up
end

begin
prog = mythtv
button = DOWN
repeat = 3
config = Down
end

begin
prog = mythtv
button = LEFT
repeat = 3
config = Left
end

begin
prog = mythtv
button = RIGHT
repeat = 3
config = Right
end

# Channel Up
begin
prog = mythtv
button = ChannelUp
repeat = 3
config = Up
end

# Channel Down
begin
prog = mythtv
button = ChannelDown
repeat = 3
config = Down
end

# OK/Select
begin
prog = mythtv
button = OK
config = Space
end

# Play
begin
prog = mythtv
button = Play
config = Return
end

# Stop
begin
prog = mythtv
button = Stop
config = I
end

# Escape/Exit/Back
begin
prog = mythtv
button = Back
config = Esc
end

# clashes with irexec definition - AJB 20060401
## Power Off/Exit
#begin
#prog = mythtv
#button = Power
#config = Esc
#end


# Pause
begin
prog = mythtv
button = Pause
repeat = 3
config = P
end

# Mute
begin
prog = mythtv
button = Mute
repeat = 3
config = |
end

# Fast forward (30 sec default)
begin
prog = mythtv
button = Skip
repeat = 3
config = >
end

# Rewind (10 sec default)
begin
prog = mythtv
button = Replay
repeat = 3
config = <
end

# Skip forward (10 min default)
begin
prog = mythtv
button = NextTrack
repeat = 3
config = End
end

# Skip backward (10 min default)
begin
prog = mythtv
button = PreviousTrack 
repeat = 3
config = Home
end

# Record
begin
prog = mythtv
button = Record
repeat = 3
config = R
end

# Delete
begin
prog = mythtv
button = Red
repeat = 3
config = D
end

# Decrease play speed
begin
prog = mythtv
button = Green
repeat = 3
config = J
end

# Display EPG while in live TV,
# View selected show while in EPG
begin
prog = mythtv
button = Menu
repeat = 3
config = M
end

begin
prog = mythtv
button = VolumeUp
repeat = 3
config = )
end

begin
prog = mythtv
button = VolumeDown
repeat = 3
config = (
end

# Bring up OSD info
begin
prog = mythtv
button = Go
repeat = 3
config = I
end

# Change display aspect ratio
begin
prog = mythtv
button = Prev-Ch
repeat = 3
config = W
end

# double speed watch
begin
prog = mythtv
button = Yellow
repeat = 3
config = J
end

# change tuners
begin
prog = mythtv
button = Hash
repeat = 3
config = Y
end

# Bring up Time stretch
begin
prog = mythtv
button = Blue
repeat = 3
config = A
end

# Numbers 0-9

begin
prog = mythtv
button = 0
repeat = 3
config = 0
end

begin
prog = mythtv
button = 1
repeat = 3
config = 1
end

begin
prog = mythtv
button = 2
repeat = 3
config = 2
end

begin
prog = mythtv
button = 3
repeat = 3
config = 3
end

begin
prog = mythtv
button = 4
repeat = 3
config = 4
end

begin
prog = mythtv
button = 5
repeat = 3
config = 5
end

begin
prog = mythtv
button = 6
repeat = 3
config = 6
end

begin
prog = mythtv
button = 7
repeat = 3
config = 7
end

begin
prog = mythtv
button = 8
repeat = 3
config = 8
end

begin
prog = mythtv
button = 9
repeat = 3
config = 9
end


### MPlayer lirc setup

# Show OSD
begin
prog = mplayer
button = Menu
repeat = 3
config = osd
end

# Pause playback
begin
prog = mplayer
button = Pause
repeat = 3
config = pause
end

# Skip ahead a minute if playing
# If paused, resume playing
begin
prog = mplayer
button = Play
repeat = 3
config = seek +1
end

# Stop playback and exit
begin
prog = mplayer
button = Stop
repeat = 3
config = quit
end

# Mute
begin
prog = mplayer
button = Mute
repeat = 3
config = mute
end

# Seek back 10 seconds
begin
prog = mplayer
button = Replay
repeat = 3
config = seek -10
end

# Seek forward 30 seconds
begin
prog = mplayer
button = Skip 
repeat = 3
config = seek +30
end

# Quit
begin
prog = mplayer
button = Back
repeat = 3
config = quit
end

# Seek forward 10 minutes
begin
prog = mplayer
button = NextTrack
repeat = 3
config = seek +600
end

# Seek backward 10 minutes
begin
prog = mplayer
button = PreviousTrack 
repeat = 3
config = seek -600
end

# Toggle full-screen
begin
prog = mplayer
button = Red
repeat = 3
config = vo_fullscreen
end

begin
     button = Volumeup
     prog = mplayer
     config = volume 1
     repeat = 1
end

begin
    button = VolumeDown
    prog = mplayer
    config = volume -1
    repeat = 1
end

begin
     button = ChannelUp
     prog = mplayer
     config = pt_step 1
end
begin
     button = ChannelDown
     prog = mplayer
     config = pt_step -1
end

begin
     button = Yellow
     prog = mplayer
     config = audio_delay +0.1
end
begin
     button = Green
     prog = mplayer
     config = audio_delay -0.1
end

begin
	button=Subtitles
	prog=mplayer
	config = sub_visibility
end

begin
	button=Text
	prog=mplayer
	config=sub_select
end

begin
        button=Blue
        prog=mplayer
        config=switch_audio
end

### Xine lirc setup

begin
prog = xine
button = Play
repeat = 3
config = Play
end

begin
prog = xine
button = Stop
repeat = 3
config = Stop
end

begin
prog = xine
button = Power
repeat = 3
config = Quit
end

begin
prog = xine
button = Pause
repeat = 3
config = Pause
end

begin
prog = xine
button = ChannelUp
repeat = 3
config = EventUp
end

begin
prog = xine
button = ChannelDown
repeat = 3
config = EventDown
end

begin
prog = xine
button = VolumeDown
repeat = 3
config = EventLeft
end

begin
prog = xine
button = VolumeUp
repeat = 3
config = EventRight
end

begin
prog = xine
button = OK
repeat = 3
config = EventSelect
end

begin
prog = xine
button = Back
repeat = 3
config = Menu
end

begin
prog = xine
button = Skip
repeat = 3
#config = SpeedFaster
config = SeekRelative+60
end

begin
prog = xine
button = Replay
repeat = 3
#config = SpeedSlower
config = SeekRelative-60
end

begin
prog = xine
button = VolumeUp
repeat = 3
config = Volume+
end

begin
prog = xine
button = VolumeDown
repeat = 3
config = Volume-
end

begin
prog = xine
button = Mute
repeat = 3
config = Mute
end

begin
prog = xine
button = Menu
repeat = 3
config = RootMenu
end

begin
prog = xine
button = NextTrack
repeat = 3
config = EventNext
end

begin
prog = xine
button = PreviousTrack
repeat = 3
config = EventPrior
end

begin
prog = xine
button = Go
repeat = 3
config = OSDStreamInfos
end

begin
prog = xine
button = Red
repeat = 3
config = Quit
end
/usr/local/bin/mythpowerbutton.sh
#!/bin/bash
PROG=mythfrontend
#PROG=gnome-session
STATUS=`ps -e | grep $PROG | grep -v grep | wc -l | awk '{print $1}'`

if [ `echo $DISPLAY | grep -c ":0"` -ge 1 ]
then
    if [ $STATUS -eq 0 ]
    then
        echo "use mythconverg; update cardinput set startchan=1;" | mysql -u root --password=xxx
#       xrandr -s 768x576
        xrandr -s 1024x576 # AJB 20071104
        #( $PROG & )
        ( $PROG >/dev/null 2>&1 & )# ~/.asoundrc or /etc/asound.conf


    else
        killall $PROG
        echo "use mythconverg; update cardinput set startchan=1;" | mysql -u root --password=xxx
    fi
fi
exit 0

Sound

/home/mythtv/.asoundrc
# ALSA configuration file

##### USAGE #####
# Save this file as "~/.asoundrc" (for user-specific sound configuration) or
# "/etc/asound.conf" (for system-wide sound configuration) and specify ALSA
# device names ad described in the next section.


##### DEVICE NAMES #####
# This configuration file defines four devices for use by the user.  Those
# devices are "analog", "mixed-analog", "digital", and "mixed-digital".  The
# user may also re-define "default" to be identical to one of the above-named
# devices (i.e. to send all sound output to the digital output unless otherwise
# specified).  Use the device names as described below:
#  - "analog" outputs to the analog output directly and (at least on software
#  sound cards) blocks other audio output.  After playback completes, "queued"
#  sounds are output in sequence.
#  - "mixed-analog" mixes audio output from multiple programs into the analog
#  output (so you can hear beeps, alerts, and other noises while playing back
#  an audio stream).
#  - "digital" outputs to the digital output directly.  Since most (all?)
#  digital outputs expect 48kHz PCM audio, this may not work for some playback
#  (i.e. CD's--which are 44.1kHz PCM audio--or 32kHz audio streams from TV
#  recordings, etc.).
#  - "mixed-digital"

# All other devices created within this file are used only by the configuration
# file itself and should /not/ be used directly.  In other words, do not use
# the devices "analog-hw", "dmix-analog", "digital-hw", or "dmix-digital".


##### IMPORTANT #####
# To make this ALSA configuration file work with your sound card, you will need
# to define the appropriate card and device information for the "analog-hw" and
# "digital-hw" devices below.  You can find the card and device information
# using "aplay -l".


##### Configuration File #####

# Override the default output used by ALSA.  If you do not override the
# default, your default device is identical to the (unmixed) "analog" device
# shown below.  If you prefer mixed and/or digital output, uncomment the
# appropriate four lines below (only one slave.pcm line).
#
# Note, also, that as of ALSA 1.0.9, "software" sound cards have been modified
# such that their default "default" device is identical to the "mixed-analog"
# device.  Whether using an ALSA version before or after 1.0.9, it does no harm
# and has no affect on performance to redefine the device (even if the
# redefinition does not change anything).  Also, by using this ALSA
# configuration file, you once again have access to unmixed analog output using
# the "analog" device.
pcm.!default {
  type plug
## Uncomment the following to use (unmixed) "analog" by default
#  slave.pcm "analog-hw"
## Uncomment the following to use "mixed-analog" by default
  slave.pcm "dmix-analog"
## Uncomment the following to use (unmixed) "digital" by default
#  slave.pcm "digital-hw"
## Uncomment the following to use "mixed-digital" by default
#  slave.pcm "dmix-digital"
}

# Control device (mixer, etc.) for the card
ctl.!default {
  type hw
  card 0
}

# Alias for (converted) analog output on the card
# - This is identical to the device named "default"--which always exists and
# refers to hw:0,0 (unless overridden)
# - Therefore, we can specify "hw:0,0", "default", or "analog" to access analog
# output on the card
# - Note that as of ALSA 1.0.9, "software" sound card definitions redefine
# "default" to do mixing, meaning this device is different from "default" and
# allows playback while blocking other sound sources (until playback
# completes).
pcm.analog {
  type plug
  slave.pcm "analog-hw"
}

# Control device (mixer, etc.) for the card
ctl.analog {
  type hw
  card 0
}

# Alias for (converted) mixed analog output on the card
# - This will accept audio input--regardless of rate--and convert to the rate
# required for the dmix plugin (in this case 48000Hz)
# - Note that as of ALSA 1.0.9, "software" sound card definitions redefine
# "default" to do mixing, meaning this device is identical to "default" for
# "software" sound cards.
pcm.mixed-analog {
  type plug
  slave.pcm "dmix-analog"
}

# Control device (mixer, etc.) for the card
ctl.mixed-analog {
  type hw
  card 0
}

# Alias for (converted) digital (S/PDIF) output on the card
# - This will accept audio input--regardless of rate--and convert to the rate
# required for the S/PDIF hardware (in this case 48000Hz)

#AJB
# original
#pcm.digital {
#  type plug
#  slave.pcm "digital-hw"
#}

#pcm.digital {
#  type plug
#  slave.pcm "dmix-digital"
#}

pcm.digital {
  type plug
  slave.pcm "digital-hw"
}


# Control device (mixer, etc.) for the card
ctl.digital {
  type hw
  card 0
}

# Alias for mixed (converted) digital (S/PDIF) output on the card
#  - This will accept audio input--regardless of rate--and convert to the rate
#  required for the S/PDIF hardware (in this case 48000Hz)
pcm.mixed-digital {
  type plug
  slave.pcm "dmix-digital"
}

# Control device (mixer, etc.) for the card
ctl.mixed-digital {
  type hw
  card 0
}

# The following devices are not useful by themselves.  They require specific
# rates, channels, and formats.  Therefore, you probably do not want to use
# them directly.  Instead use of of the devices defined above.

# Alias for analog output on the card
# Do not use this directly--it requires specific rate, channels, and format
pcm.analog-hw {
  type hw
  card 0
  # The default value for device is 0, so no need to specify
#  - Uncomment one of the below or create a new "device N" line as appropriate
#    for your sound card or 
#  device 1
#  device 4
}

# Control device (mixer, etc.) for the card
ctl.analog-hw {
  type hw
  card 0
}

# Alias for digital (S/PDIF) output on the card
# Do not use this directly--it requires specific rate, channels, and format
pcm.digital-hw {
  type hw
  card 0
#  device 1
#  - Comment out "device 1" above and uncomment one of the below or create a
#    new "device N" line as appropriate for your sound card or 
#  device 2
#  device 4

# AJB
   device 4
}

# Control device (mixer, etc.) for the card
ctl.digital-hw {
  type hw
  card 0
}

# Direct software mixing plugin for analog output on the card
# Do not use this directly--it requires specific rate, channels, and format
pcm.dmix-analog {
  type dmix
  ipc_key 1234
  slave {
    pcm "analog-hw"
    period_time 0
    period_size 1024
    buffer_size 4096
    rate 48000
  } 
}

# Control device (mixer, etc.) for the card
ctl.dmix-analog {
  type hw
  card 0
}

# Direct software mixing plugin for digital (S/PDIF) output on the card
# Do not use this directly--it requires specific rate, channels, and format
pcm.dmix-digital {
  type dmix
  ipc_key 1235
  slave {
    pcm "digital-hw"
    period_time 0
    period_size 1024
    buffer_size 4096
    rate 48000
  } 
}

# Control device (mixer, etc.) for the card
ctl.dmix-digital {
  type hw
  card 0
}

pcm.!default {
type plug
slave {
pcm multi
rate 48000
}
ttable.0.0 1.0
ttable.1.1 1.0
ttable.0.2 1.0
ttable.1.3 1.0
}

pcm.stereo {
type plug
slave {
pcm multi
rate 48000
}
ttable.0.0 1.0
ttable.1.1 1.0
ttable.0.2 1.0
ttable.1.3 1.0
}

ctl.stereo {
type hw
card 0
}

pcm.multi {
type multi
slaves.a.pcm "analog-hw"
slaves.a.channels 2

#AJB
# originally "digital-hw"
slaves.b.pcm "digital-hw"
#slaves.b.pcm "dmix-digital"

slaves.b.channels 2
bindings.0.slave a
bindings.0.channel 0
bindings.1.slave a
bindings.1.channel 1
bindings.2.slave b
bindings.2.channel 0
bindings.3.slave b
bindings.3.channel 1
}

ctl.multi {
type hw
card 0
}
MythTV configuration
AudioOutputDevice = ALSA:default # IMPORTANT - makes MythTV output simultaneously to front (analog) and S/PDIF (digital) outputs
PassThruOutputDevice = ALSA:iec958:{ AES0 0x02 }
AC3PassThru = Enabled
DTSPassThru = Enabled
MixerDevice = Default
MixerControl = Master
MasterMixerVolume = 100

MythTV configuration

MythTV Playback Settings

  • Deinterlace, Linear Blend (interlaced output sometimes gets out-of-sync with TV)
  • Disable OpenGL vsync
  • Enable SyncToVBlank=1, XVideoTextureSyncToVBlank=1 and XVideoBlitterSyncToVBlank=1 in $HOME/.nvidia-settings-rc
  • Use 1024x576 for UI, 720x576pali for playback

- or -

  • Deinterlace, Linear Blend (best shapes), but experiment with Bob 2x and no deinterlacing
  • Enable OpenGL vsync
  • Use 1024x576 for UI, 720x576pali for playback
  • enable SyncToVBlank=0, XVideoTextureSyncToVBlank=0 and XVideoBlitterSyncToVBlank=0 in $HOME/.nvidia-settings-rc

- or -

  • Disable deinterlacing, run mythfrontend with NO_XV=1 environment variable set (or use the opengl or Xshm output targets). Best quality, but burns CPU (~80% usage)

Note that due to an apparent bug in the current nVidia legacy drivers (9143, maybe other versions too), Xvideo regions displayed on interlaced displays appear to be scandoubled. Switching to an ATI Radeon 7500 appears to fix this but introduces other problems to make it an unacceptable alternative to me.

Edit MythTV Titivillus OSD Theme

Edit /usr/share/mythtv/themes/Titivillus-OSD/osd.xml to centre correctly:

<mythosdtheme>
  <timeformat>FROMSETTINGS</timeformat>
  <fadeaway>45</fadeaway>

  <font name="titlefont" face="Arial">
    <color>255</color>
    <size>19</size>
    <size:small>13</size:small>
    <size:big>21</size:big>
    <shadow>3,3</shadow>
  </font>


  <font name="infofont" face="Arial">
    <color>255</color>
    <size>14</size>
    <size:small>13</size:small>
    <size:big>16</size:big>
    <outline>yes</outline>
  </font>

  <font name="smallinfofont" face="Arial">
    <color>255</color>
    <size>13</size>
    <size:small>12</size:small>
    <size:big>15</size:big>
    <outline>yes</outline>
  </font>

  <font name="kindasmallinfofont" face="Arial">
    <color>255</color>
    <size>14</size>
    <size:small>12</size:small>
    <size:big>16</size:big>
    <shadow>1,1</shadow>
  </font>


  <font name="infofontnool" face="Arial">
    <color>255</color>
    <size>14</size>
    <size:small>12</size:small>
    <size:big>16</size:big>
    <outline>no</outline>
  </font>

  <font name="infofontblack" face="Arial">
    <color>0</color>
    <size>14</size>
    <size:small>12</size:small>
    <size:big>16</size:big>
    <outline>no</outline>
  </font>

  <font name="infofont2" face="Arial">
    <color>255</color>
    <size>13</size>
    <size:small>12</size:small>
    <size:big>14</size:big>
    <shadow>1,1</shadow>
  </font>

  <font name="largeinfofont" face="Arial">
    <color>255</color>
    <size>20</size>
    <size:small>18</size:small>
    <size:big>22</size:big>
    <shadow>3,3</shadow>
  </font>


  <font name="mediuminfofont" face="Arial">
    <color>255</color>
    <size>15</size>
    <size:small>13</size:small>
    <size:big>17</size:big>
    <outline>yes</outline>
  </font>

  <font name="infofontgray" face="Arial">
    <color>200</color>
    <size>14</size>
    <size:small>12</size:small>
    <size:big>16</size:big>
    <shadow>1,1</shadow>
  </font>

  <font name="infofontgrayol"  face="Arial">
    <color>128</color>
    <size>14</size>
    <size:small>12</size:small>
    <size:big>17</size:big>
    <outline>yes</outline>
  </font>

  <font name="channelfont"  face="Arial">
    <color normal="#00FF00">255</color>
    <size>28</size>
    <size:small>20</size:small>
    <size:big>30</size:big>
    <outline>yes</outline>
  </font>

  <font name="settings" face="Arial">
    <color>255</color>
    <size>18</size>
    <size:small>16</size:small>
    <size:big>20</size:big>
    <outline>yes</outline>
  </font>

  <font name="position" face="Arial">
    <color>255</color>
    <size>12</size>
    <size:small>10</size:small>
    <size:big>14</size:big>
    <outline>yes</outline>
  </font>

  <font name="position2" face="Arial">
    <color>255</color>
    <size>16</size>
    <outline>yes</outline>
  </font>

  <font name="notifyfont" face="Arial">
    <color>255</color>
    <size>13</size>
    <size:small>12</size:small>
    <size:big>15</size:big>
    <outline>yes</outline>
  </font>


  <container name="program_info" fademovement="0,-6">
    <image name="background">
      <filename>osd-bigger.png</filename>
      <position>15,20</position>
    </image>
    <textarea name="title">
      <area>62,26,450,27</area>
      <font>titlefont</font>
    </textarea>
    <textarea name="subtitle">
      <area>70,50,435,27</area>
      <font>smallinfofont</font>
    </textarea>
    <textarea name="description">
      <multiline>yes</multiline>
      <area>37,106,576,240</area>
      <font>infofont2</font>
      <value>%LONGREPEAT%%STARS%%DESCRIPTION%</value>
      <linespacing>2</linespacing>
    </textarea>

     <!-- here to see which one I like better -->
     <textarea name="length">
	 <multiline>no</multiline>
	 <area>37,71,350,30</area>
	 <font>smallinfofont</font>
       <value>%STARTTIME%-%ENDTIME% (%LENMINS%)</value>
      </textarea>

    <image name="channelicon"> <!-- set internally, doesn't need a filename -->
      <position>37,26</position>
      <staticsize>25,25</staticsize> <!-- resize the image to these dimensions -->
    </image>
    <!-- removed and replaced by chan_number at the end of this file
    <textarea name="channel" align="center">
       <area>526,30,90,30</area>
       <font>channelfont</font>
       <value>%CHANNUM%</value>
    </textarea>
    -->
    <textarea name="callsign" align="center">
       <area>460,70,130,30</area>
       <font>mediuminfofont</font>
    </textarea>
    <textarea name="time" align="right">
       <area>352,70,120,30</area>
       <font>mediuminfofont</font>
    </textarea>
  </container>

  <container name="channel_editor">
    <image name="background">
      <filename>osd-channel-edit.png</filename>
      <position>102,99</position>
    </image>
    <textarea name="dialog_label" align="center">
      <area>105,106,450,40</area>
      <font>infofont</font>
      <value>Channel Editor</value>
    </textarea>
    <textarea name="callsign_label" align="right">
      <area>120,151,155,40</area>
      <font>infofont</font>
      <value>Callsign</value>
    </textarea>
    <textarea name="callsign" entry="0">
      <area>310,151,220,40</area>
      <font>infofontgray</font>
      <altfont>infofont</altfont>
      <value></value>
    </textarea>
    <textarea name="channum_label" align="right">
      <area>120,200,155,40</area>
      <font>infofont</font>
      <value>Channel #</value>
    </textarea>
    <textarea name="channum" entry="1">
      <area>310,200,220,40</area>
      <font>infofontgray</font>
      <altfont>infofont</altfont>
      <value></value>
    </textarea>
    <textarea name="channame_label" align="right">
      <area>120,246,155,40</area>
      <font>infofont</font>
      <value>Channel Name</value>
    </textarea>
    <textarea name="channame" entry="2">
      <area>310,246,220,40</area>
      <font>infofontgray</font>
      <altfont>infofont</altfont>
      <value></value>
    </textarea>
    <textarea name="XMLTV_label" align="right">
      <area>120,295,155,40</area>
      <font>infofont</font>
      <value>XMLTV ID</value>
    </textarea>
    <textarea name="XMLTV" entry="3">
      <area>310,295,220,40</area>
      <font>infofontgray</font>
      <altfont>infofont</altfont>
      <value></value>
    </textarea>
    <textarea name="probe_all" entry="4" button="yes" align="center">
      <area>120,342,185,40</area>
      <font>infofontgray</font>
      <altfont>infofont</altfont>
      <value>[P]robe</value>
    </textarea>
    <textarea name="ok" entry="5" button="yes" align="center">
      <area>330,342,185,40</area>
      <font>infofontgray</font>
      <altfont>infofont</altfont>
      <value>[O]k</value>
    </textarea>
  </container>

  <container name="browse_info" fademovement="0,-6">
    <image name="background">
      <filename>osd-bigger.png</filename>
      <position>15,20</position>
    </image>
       <textarea name="browsing">
          <area>480,1,200,200</area>
          <font>smallinfofont</font>
         <value>Browsing</value>
     </textarea>
     <textarea name="title">
      <area>62,26,450,27</area>
      <font>titlefont</font>
    </textarea>
    <textarea name="subtitle">
      <area>70,50,435,27</area>
      <font>smallinfofont</font>
    </textarea>

    <textarea name="length">
      <multiline>yes</multiline>
      <area>37,71,350,30</area>
      <font>smallinfofont</font>
      <value>%STARTTIME%-%ENDTIME% (%LENMINS%)</value>
    </textarea>

    <textarea name="description">
      <multiline>yes</multiline>
      <area>37,106,559,240</area>
      <font>infofont2</font>
      <value>%LONGREPEAT%%STARS%%DESCRIPTION%</value>
    </textarea>

        <image name="channelicon"> <!-- set internally, doesn't need a filename -->
      <position>37,26</position>
      <staticsize>25,25</staticsize> <!-- resize the image to these dimensions -->
    </image>
    
    <textarea name="channel" align="center">
       <area>526,30,90,30</area>
       <font>channelfont</font>
       <value>%CHANNUM%</value>
    </textarea>
   
    <textarea name="callsign" align="center">
       <area>460,70,130,30</area>
       <font>mediuminfofont</font>
    </textarea>
    <textarea name="time" align="right">
       <area>352,70,120,30</area>
       <font>mediuminfofont</font>
    </textarea>
  </container>

  <container name="status" priority="10" fademovement="0,-6">
    <image name="background">
      <filename>osd-small.png</filename>
      <position>15,360</position>
    </image>
    <textarea name="status" align="left">
      <area>35,375,300,100</area>
      <font>largeinfofont</font>
    </textarea>
    <slider name="statusslider" type="fill">
      <area>60,425,442,22</area>
      <filename>fill-blue.png</filename>
    </slider>
    <textarea name="slidertext" align="center">
      <area>355,368,250,65</area>
      <font>position2</font>
    </textarea>
  </container>

  <container name="editmode">
    <image name="background">
      <filename>edit_background.png</filename>
      <position>31,325</position>
    </image>
    <slider name="editslider" type="edit">
      <area>160,407,410,65</area>
      <filename>fill-blue.png</filename>
      <altfilename>red.png</altfilename>
    </slider>
    <slider name="editposition" type="position">
      <area>160,400,410,60</area>
      <filename>position-indicator.png</filename>
    </slider>
    <textarea name="timedisplay" align="center">
      <area>337,358,350,30</area>
      <font>position2</font>
    </textarea>
    <textarea name="cutindicator" align="left">
      <area>58,402,100,30</area>
      <font>position</font>
    </textarea>
    <textarea name="seekamount" align="left">
      <area>40,430,200,30</area>
      <font>infofont</font>
    </textarea>
    <editarrow name="left">
      <filename>cut-end.png</filename>
      <area>160,405,410,25</area>
    </editarrow>
    <editarrow name="right">
      <filename>cut-start.png</filename>
      <area>160,405,410,25</area>
    </editarrow>
  </container>

  <container name="settings">
    <textarea name="settings">
      <area>50,50,350,32</area>
      <font>settings</font>
    </textarea>
  </container>

  <container name="basedialog" priority="0"> <!-- must be named this -->
    <image name="background">
      <filename>popup.png</filename>
      <position>0,0</position>
    </image>
    <!-- Uncomment to mask out background	  
    <box name="background">
      <area>80,60,480,360</area>
    </box>
    -->
    <textarea name="message">
      <area>85,110,470,253</area>
      <font>mediuminfofont</font>
      <multiline>yes</multiline>
    </textarea>
    <textarea name="option1">
      <area>110,253,470,30</area>
      <font>infofont2</font>
      <altfont>infofontgray</altfont>
    </textarea>
    <textarea name="option2">
      <area>110,283,470,30</area>
      <font>infofont2</font>
      <altfont>infofontgray</altfont>
    </textarea>
    <textarea name="option3">
      <area>110,313,470,30</area>
      <font>infofont2</font>
      <altfont>infofontgray</altfont>
    </textarea>
    <textarea name="option4">
      <area>110,343,470,30</area>
      <font>infofont2</font>
      <altfont>infofontgray</altfont>
    </textarea>

    <positionrects name="selector"> <!-- draws a white rectangle at these 
                                         coords indicating the current 
                                         selection -->
      <area>105,246,460,30</area>
      <area>105,276,460,30</area>
      <area>105,306,460,30</area>
      <area>105,336,460,30</area>
    </positionrects>
<!-- Alternatively, this form will show an image (instead of the drawn white 
     rectangle) at the given positions to indicate the current selection 
    <positionimage name="selector">
      <filename>cut-start.png</filename>
      <position>60,296</position>
      <position>60,326</position>
      <position>60,356</position>
      <position>60,386</position>
    </positionimage>
-->
  </container>

  <container name="notify_cid_info" priority="10" fademovement="0,6">
    <image name="background">
      <filename>osd-callerid.png</filename>
      <position>20,200</position>
    </image>
    <textarea name="notify_cid_name">
      <area>45,208,285,30</area>
      <font>notifyfont</font>
      <multiline>no</multiline>
    </textarea>
    <textarea name="notify_cid_num">
      <area>45,235,250,30</area>
      <font>notifyfont</font>
      <multiline>no</multiline>
    </textarea>
    <textarea name="notify_cid_dt">
      <area>45,262,285,30</area>
      <font>notifyfont</font>
      <multiline>no</multiline>
    </textarea>
  </container>

  <container name="notify_alert_text" priority="10" fademovement="0,6">
    <image name="background">
      <filename>osd-alert.png</filename>
      <position>8,10</position>
    </image>

    <textarea name="notify_text">
      <area>20,17,590,80</area>
      <font>notifyfont</font>
      <multiline>yes</multiline>
    </textarea>
  </container>

  <container name="news_scroller" priority="20">
    <box name="background">
      <area>0,434,640,40</area>
    </box>
    <textarea name="text_scroll">
      <area>0,440,640,40</area>
      <font>settings</font>
      <scroller>yes</scroller>
      <scrollmovement>-3,0</scrollmovement> <!-- only x movement for now -->
    </textarea>
  </container>

  <container name="menu">
    <listtreemenu name="menu">
      <area>40,50,620,300</area>
      <listsize>0,0,274,260</listsize>
      <leveloffset>10</leveloffset>
      <gradient type="unselected" start="#505050" end="#000000" alpha="100">
      </gradient>
      <gradient type="selected" start="#5238CA" end="#343898" alpha="255">
      </gradient>
      <fcnfont name="infofont" function="active"></fcnfont>
      <fcnfont name="infofontgray" function="inactive"></fcnfont>
    </listtreemenu>
  </container>


<!--  This replaces the description channel_number
 -->
<container name="channel_number" priority="0">
    <textarea name="channum"  align="center">
      <area>526,30,90,30</area>
      <font>channelfont</font>
    </textarea>
</container> 
</mythosdtheme>

/usr/share/mythtv/themes/Titivillus-OSD/osd-bigger.png

http://www.mythtv.org/wiki/images/d/d8/Osd-bigger.png

Edit MythTV glass-wide osd.xml

<mythosdtheme>
  <!--Mythtv OSD "ProjectGrayhem-OSD" by Justin Hornsby -->
  <!-- borrows heavily from other OSD themes -->
  <!-- if timeformat is set to 'FROMSETTINGS', it will use the time format
       specified in the general mythtv settings -->
  <timeformat>FROMSETTINGS</timeformat>
  <fadeaway>30</fadeaway>
 
  <font name="channelfont">
	  <color>125</color>
	  <!-- <filename>VeraBd.ttf</filename> --> 
	  <size>22</size>
	  <size:small>18</size:small>
	  <shadow>2,2</shadow>
  </font>
  
  <font name="callsignfont">
	<color>200</color>
	<!-- <filename>Vera.ttf</filename> -->
	<size>7</size>
	<size:small>6</size:small>
        <size:big>8</size:big>
  </font>

  <font name="infofont">
	<color>255</color>
	<!-- <filename>Vera.ttf</filename> -->
	<size>12</size>
	<size:small>10</size:small>
        <size:big>14</size:big>
  </font>
  <font name="notify">
	  <color>255</color>
	  <!-- <filename>Vera.ttf</filename> -->
	  <size>14</size>
	  <size:small>12</size:small>
  </font>
  <font name="infofontgray">
	<color>128</color>
	<!-- <filename>Vera.ttf</filename> -->
	<size>15</size>
	<size:small>13</size:small>
  </font>
  <font name="smallfont">
	  <color>255</color>
	  <!-- <filename>Vera.ttf</filename> -->
	  <size>12</size>
	  <size:small>12</size:small>
  </font>
  
  <font name="titlefont" face="Vera">
	<color normal="#FFFFFF">255</color>
	<!-- <filename>VeraBd.ttf</filename> --> 
	<size>16</size>
	<size:small>14</size:small>
  </font>
  
  <font name="grayfont">
    	<color>175</color>
    	<!-- <filename>Vera.ttf</filename> -->
    	<size>10</size>
    	<size:small>10</size:small>
        <size:big>12</size:big>
    	<outline>yes</outline>
  </font>
 
  <font name="timefont">
    	<color>255</color>
    	<!-- <filename>Vera.ttf</filename> -->
    	<size>14</size>
    	<size:small>12</size:small>
  </font>

  <font name="settings">
	<color>255</color>
    	<!-- <filename>Vera.ttf</filename> -->
    	<size>16</size>
    	<size:small>14</size:small>
  </font>
 
  <container name="program_info" fademovement="0,10">
	  <image name="background">
		  <filename>osd/osd_mid.png</filename>
		  <position>0,320</position>
	  </image>
	  <textarea name="title">
		  <area>100,335,400,30</area>
		  <font>titlefont</font>
	  </textarea>
	  <textarea name="description">
		  <multiline>yes</multiline>
		  <area>100,398,500,74</area>
		  <font>infofont</font>
		  <value>%SUBTITLE|"|" %%DESCRIPTION%</value>
	  </textarea>
	  <textarea name="starttime">
		  <area>100,374,440,20</area>
		  <font>grayfont</font>
		  <value>(%STARTTIME% - %ENDTIME%)  %LENMINS%</value>
	  </textarea> 
	  <image name="channelicon">
		  <position>32,344</position>
		  <staticsize>25,25</staticsize>
	  </image>
	  <textarea name="time" align="right">
		  <area>500,337,100,40</area>
		  <font>timefont</font>
	  </textarea>
	  <textarea name="channum" align="center">
		  <area>32,400,60,30</area>
		  <font>channelfont</font>
		  <value>%CHANNUM%</value>
	  </textarea>
  </container>

  <container name="channel_number" fademovement="0,10">
	  <textarea name="channum" align="center">
		  <area>32,400,60,30</area>
		  <font>channelfont</font>
		  <value>%CHANNUM%</value>
	  </textarea>
	  <textarea name="callsign" align="center">
		  <multiline>no</multiline>
		  <area>32,435,60,30</area>
		  <font>callsignfont</font>
		  <value>%CALLSIGN%</value>
	  </textarea>
  </container> 

  <container name="browse_info" fademovement="0,10">
	<image name="background">
		<filename>osd/osd_mid.png</filename>
		<position>0,320</position>
	</image>
	<textarea name="title">
		<area>100,335,400,30</area>
		<font>titlefont</font>
	</textarea>
	<textarea name="description">
		<multiline>yes</multiline>
		<area>100,390,500,74</area>
		<font>infofont</font>
		<value>%SUBTITLE|"|" %%DESCRIPTION%</value>
	</textarea>
	<textarea name="starttime">
		<area>100,374,440,20</area>
		<font>grayfont</font>
		<value>(%STARTTIME% - %ENDTIME%)  %LENMINS%</value>
	</textarea> 
	<image name="channelicon">
		<position>32,344</position>
		<staticsize>25,25</staticsize>
	</image>
	<textarea name="time" align="right">
		<area>500,337,100,40</area>
		<font>timefont</font>
	</textarea>
	<textarea name="channum" align="center">
		<area>32,400,60,30</area>
		<font>channelfont</font>
		<value>%CHANNUM%</value>
    	</textarea>
	<textarea name="callsign" align="center">
		<multiline>no</multiline>
		<area>32,435,60,30</area>
		<font>callsignfont</font>
		<value>%CALLSIGN%</value>
	</textarea> 
  </container>
   
  <container name="status" priority="10" fademovement="0,10">
    <image name="background">
      <filename>osd/osd_mid.png</filename>
      <position>0,320</position>
    </image>
    <image name="sliderframe">
      <filename>osd/paused_frame.png</filename>
      <position>70,395</position>
      <staticsize>500,22</staticsize>
    </image>
    <textarea name="status">
      <area>70,335,400,30</area>
      <font>titlefont</font>
    </textarea>
    <slider name="statusslider" type="fill">
      <area>80,398,480,16</area>
      <filename>osd/fill_green.png</filename>
    </slider>
    <textarea name="slidertext">
      <area>135,380,350,45</area>
      <font>smallfont</font>
      <multiline>no</multiline>
    </textarea>
    <textarea name="time" align="right">
        <area>414,335,90,40</area>
        <font>timefont</font>
     </textarea>
  </container>

  <container name="notify_cid_info" priority="10" fademovement="0,10">
    <image name="background">
	<filename>osd/osd_mid.png</filename>
	<position>0,320</position>
    </image>
    <image name="watermark">
      <filename>osd/phone.png</filename>
      <position>70,354</position>
    </image>
    <textarea name="notify_cid_name">
      <area>276,376,400,20</area>
      <font>infofont</font>
      <multiline>no</multiline>
    </textarea>
    <textarea name="notify_cid_num">
      <area>276,396,400,20</area>
      <font>infofont</font>
      <multiline>no</multiline>
    </textarea>
    <textarea name="notify_cid_dt">
      <area>276,416,400,20</area>
      <font>infofont</font>
      <multiline>no</multiline>
    </textarea>
  </container>

  <container name="notify_alert_text" priority="10" fademovement="0,10">
    <image name="background">
      <filename>osd/osd_mid.png</filename>
      <position>0,320</position>
    </image>
    <textarea name="notify_text">
      <area>60,370,580,60</area>
      <font>infofont</font>
      <multiline>yes</multiline>
    </textarea>
  </container>

  <container name="editmode" fademovement="0,6">
    <image name="background">
      <filename>osd/edit.png</filename>
      <position>0,320</position>
    </image>
    <textarea name="edit">
      <area>30,335,100,27</area>
      <font>titlefont</font>
      <value>Edit</value>
    </textarea>
    <slider name="editslider" type="edit">
      <area>30,408,579,16</area>
      <filename>osd/fill_green.png</filename>
      <altfilename>osd/fill_red.png</altfilename>
    </slider>
    <slider name="editposition" type="position">
	<area>30,404,580,16</area>
      	<filename>osd/position_marker.png</filename>
    </slider>
    <editarrow name="left">
      <filename>osd/cut_end.png</filename>
      <area>35,404,580,65</area>
    </editarrow>
    <editarrow name="right">
      <filename>osd/cut_start.png</filename>
      <area>30,404,580,65</area>
    </editarrow>
    <textarea name="timedisplay">
      <area>30,380,100,60</area>
      <font>smallfont</font>
    </textarea>
    <textarea name="cutindicator" align="center">
	<area>0,380,640,19</area>
     	<font>settings</font>
    </textarea>
    <textarea name="seekamount" align="right">
      <area>480,335,125,40</area>
      <font>timefont</font>
    </textarea>
  </container>

  <container name="settings">
      <image name="background"> 
	<filename>osd/osd_mid.png</filename> 
	<position>0,320</position> 
      </image> 
    <textarea name="settings">
      <area>50,335,350,32</area>
      <font>settings</font>
    </textarea>
  </container>

 <container name="basedialog" priority="0" fademovement="0,0"> <!-- must be named this --> 
   <image name="background"> 
     <filename>osd/popup.png</filename> 
     <position>100,74</position> 
   </image> 
   <positionimage name="selector"> 
     <filename>osd/select.png</filename> 
      <position>114,263</position> 
      <position>114,293</position> 
      <position>114,323</position> 
      <position>114,353</position> 
    </positionimage> 
    <textarea name="message"> 455
      <area>120,94,394,220</area> 
      <font>settings</font> 
      <multiline>yes</multiline> 
   </textarea> 
   <textarea name="option1"> 
      <area>120,269,455,30</area> 
      <font>notify</font> 
      <altfont>grayfont</altfont> 
   </textarea> 
   <textarea name="option2"> 
      <area>120,299,455,30</area> 
      <font>notify</font> 
      <altfont>grayfont</altfont> 
   </textarea> 
   <textarea name="option3"> 
      <area>120,329,455,30</area> 
      <font>notify</font> 
      <altfont>grayfont</altfont> 
   </textarea> 
   <textarea name="option4"> 
      <area>120,359,455,30</area> 
      <font>notify</font> 
      <altfont>grayfont</altfont> 
   </textarea> 
 </container> 
 

  <container name="news_scroller" priority="20">
    <image name="background">
      <filename>osd/scroll.png</filename>
      <position>0,350</position>
    </image>
    <textarea name="text_scroll">
      <area>0,360,640,40</area>
      <font>settings</font>
      <scroller>yes</scroller>
      <scrollmovement>-3,0</scrollmovement> <!-- only x movement for now -->
    </textarea>
  </container>

  <container name="menu">
    <listtreemenu name="menu">
      <area>40,50,640,310</area>
      <listsize>0,0,274,260</listsize>
      <leveloffset>10</leveloffset>
      <gradient type="unselected" start="#505050" end="#000000" alpha="150">
      </gradient>
      <gradient type="selected" start="#52CA38" end="#349838" alpha="255">
      </gradient>
      <fcnfont name="infofont" function="active"></fcnfont>
      <fcnfont name="infofontgray" function="inactive"></fcnfont>
    </listtreemenu>
  </container>
    
  <container name="channel_editor">
    <image name="background">
      <filename>osd/osd-channel-edit.png</filename>
      <position>102,99</position>
    </image>
    <textarea name="dialog_label" align="center">
      <area>105,106,450,40</area>
      <font>infofont</font>
      <value>Channel Editor</value>
    </textarea>
    <textarea name="callsign_label" align="right">
      <area>120,151,155,40</area>
      <font>infofont</font>
      <value>Callsign</value>
    </textarea>
    <textarea name="callsign" entry="0">
      <area>310,151,220,40</area>
      <font>infofontgray</font>
      <altfont>infofont</altfont>
      <value></value>
    </textarea>
    <textarea name="channum_label" align="right">
      <area>120,200,155,40</area>
      <font>infofont</font>
      <value>Channel #</value>
    </textarea>
    <textarea name="channum" entry="1">
      <area>310,200,220,40</area>
      <font>infofontgray</font>
      <altfont>infofont</altfont>
      <value></value>
    </textarea>
    <textarea name="channame_label" align="right">
      <area>120,246,155,40</area>
      <font>infofont</font>
      <value>Channel Name</value>
    </textarea>
    <textarea name="channame" entry="2">
      <area>310,246,220,40</area>
      <font>infofontgray</font>
      <altfont>infofont</altfont>
      <value></value>
    </textarea>
    <textarea name="XMLTV_label" align="right">
      <area>120,295,155,40</area>
      <font>infofont</font>
      <value>XMLTV ID</value>
    </textarea>
    <textarea name="XMLTV" entry="3">
      <area>310,295,220,40</area>
      <font>infofontgray</font>
      <altfont>infofont</altfont>
      <value></value>
    </textarea>
    <textarea name="probe_all" entry="4" button="yes" align="center">
      <area>120,342,185,40</area>
      <font>infofontgray</font>
      <altfont>infofont</altfont>
      <value>[P]robe</value>
    </textarea>
    <textarea name="ok" entry="5" button="yes" align="center">
      <area>330,342,185,40</area>
      <font>infofontgray</font>
      <altfont>infofont</altfont>
      <value>[O]k</value>
    </textarea>
  </container>
    
</mythosdtheme>

Edit MythTV glass-wide theme.xml

<myththeme>
    <font name="active" face="Bitstream Vera Sans">
      <color>#ffffff</color>
      <size>15</size>
      <size:small>15</size:small>
      <size:big>17</size:big>
      <bold>no</bold>
    </font>

    <font name="selected" face="Bitstream Vera Sans">
      <color>#ffffff</color>
      <size>15</size>
      <size:small>15</size:small>
      <size:big>17</size:big>
      <bold>yes</bold>
    </font>

    <font name="inactive" face="Bitstream Vera Sans">
      <color>#bbbbbb</color>
      <size>15</size>
      <size:small>15</size:small>
      <size:big>17</size:big>
      <bold>no</bold>
    </font>

   <font name="title" face="Bitstream Vera Sans">
      <color>#FFFFFF</color>
      <size>24</size>
      <size:small>16</size:small>
      <size:big>24</size:big>
      <bold>yes</bold>
      <dropcolor>#111111</dropcolor>
      <shadow>2,2</shadow>
    </font>

    <font name="info" face="Bitstream Vera Sans">
      <color>#FFFFFF</color>
      <size>18</size>
      <size:small>14</size:small>
      <size:big>20</size:big>
      <bold>no</bold>
      <dropcolor>#111111</dropcolor>
      <shadow>2,2</shadow>
    </font>

    <font name="infosmall" face="Bitstream Vera Sans">
      <color>#FFFFFF</color>
      <size>16</size>
      <size:small>12</size:small>
      <size:big>18</size:big>
      <bold>no</bold>
      <dropcolor>#111111</dropcolor>
      <shadow>2,2</shadow>
    </font>

    <font name="tagged" face="Bitstream Vera Sans">
      <color>#dddd33</color>
      <size>16</size>
      <size:small>14</size:small>
      <size:big>18</size:big>
      <bold>no</bold>
      <dropcolor>#111111</dropcolor>
      <shadow>2,2</shadow>
    </font>

    <font name="desc2" face="Bitstream Vera Sans">
      <color>#FFFFFF</color>
      <size>18</size>
      <size:small>16</size:small>
      <size:big>20</size:big>
      <bold>no</bold>
      <dropcolor>#111111</dropcolor>
      <shadow>2,2</shadow>
    </font>
    
    <font name="desc" face="Bitstream Vera Sans">
      <color>#ffffff</color>
      <size>20</size>
      <size:small>13</size:small>
      <size:big>20</size:big>
      <bold>yes</bold>
      <dropcolor>#111111</dropcolor>
      <shadow>2,2</shadow>
    </font>

    <font name="chaninfo" face="Bitstream Vera Sans">
      <color>#ffffff</color>
      <size>14</size>
      <size:small>12</size:small>
      <size:big>17</size:big>
      <bold>no</bold>
      <dropcolor>#111111</dropcolor>
      <shadow>2,2</shadow>
    </font>

    <font name="recstatus" face="Bitstream Vera Sans">
      <color>#cccccc</color>
      <size>15</size>
      <size:small>12</size:small>
      <size:big>17</size:big>
      <bold>no</bold>
      <dropcolor>#111111</dropcolor>
      <shadow>2,2</shadow>
    </font>

    <font name="recording" face="Bitstream Vera Sans">
      <color>#cc5555</color>
      <size>15</size>
      <size:small>12</size:small>
      <size:big>17</size:big>
      <bold>yes</bold>
      <dropcolor>#ffffff</dropcolor>
      <shadow>2,2</shadow>
    </font>

    <font name="record" face="Bitstream Vera Sans">
      <color>#00cc00</color>
      <size>15</size>
      <size:small>12</size:small>
      <size:big>17</size:big>
      <bold>no</bold>
      <dropcolor>#ffffff</dropcolor>
      <shadow>2,2</shadow>
    </font>

    <font name="conflict" face="Bitstream Vera Sans">
      <color>#ff3333</color>
      <size>15</size>
      <size:small>12</size:small>
      <bold>yes</bold>
    </font>

    <font name="small" face="Bitstream Vera Sans">
      <color>#FFFFFF</color>
      <size>16</size>
      <size:small>10</size:small>
      <size:big>18</size:big>
      <dropcolor>#111111</dropcolor>
      <shadow>2,2</shadow>
    </font>

  <background style="normal">
    <image>background.png</image>
    <buttonarea>100,100,1057,520</buttonarea>
    <buttonspread>no</buttonspread>
    <visiblerowlimit>8</visiblerowlimit>
    <columns>1</columns>
  </background>

<titles>
      <position>650,25</position>
      <image mode="MAIN">title/title_main.png</image>
      <image mode="INFO">title/title_info_center.png</image>
      <image mode="OPTICAL_DISK">title/title_optical_disks.png</image>
      <image mode="UTIL">title/title_util.png</image>
      <image mode="SCHEDULE">title/title_schedule.png</image>
      <image mode="LIBRARY">title/title_library.png</image>
      <image mode="MUSIC">title/title_music.png</image>
      <image mode="GALLERY">title/title_gallery.png</image>
      <image mode="MANAGE_RECORDINGS">title/title_manage_recordings.png</image>
      <image mode="SETUP">title/title_setup.png</image>
      <image mode="TVSETUP">title/title_setup.png</image>
      <image mode="SETUP_TVRECPRIORITIES">title/title_priorities.png</image>
      <image mode="MEDIA_SETUP">title/title_setup.png</image>
      <image mode="INFO_SETUP">title/title_setup.png</image>
      <image mode="DVD_SETTINGS">title/title_setup.png</image>
      <image mode="MUSIC_SETTINGS">title/title_setup.png</image>
      <image mode="VIDEO_SETTINGS">title/title_setup.png</image>
      <image mode="GAME_SETTINGS">title/title_setup.png</image>
      <image mode="NETFLIX">title/title_netflix.png</image>
      <image mode="ARCHIVE">title/title_archive.png</image>
      <image mode="ARCHIVEFORMAT">title/title_archive.png</image>
      <image mode="ARCHIVEUTILS">title/title_archive.png</image>
      <image mode="ARCHIVESELECT">title/title_archive.png</image>
      <image mode="SEARCH">title/title_search.png</image>
      <image mode="WORDS">title/title_search.png</image>
      <image mode="LISTS">title/title_search.png</image>
</titles>

  <genericbutton>
   <watermarkposition>820,180</watermarkposition>
    <normal>button_off.png</normal>
    <active>button_on.png</active>
    <text>
      <area>30,25,0,0</area>
      <color>white</color>
      <shadow>
          <color>#111111</color>
          <offset>2,2</offset>
          <alpha>255</alpha>
      </shadow>
      <fontname>Bitstream Vera Sans</fontname>
      <fontsize>21</fontsize>
      <bold>no</bold>
      <italics>no</italics>
      <centered>no</centered>
    </text>
  </genericbutton>

  <uparrow>
    <image>shared/uparrow.png</image>
    <position>90,100</position>
  </uparrow>

  <downarrow>
    <image>shared/downarrow.png</image>
    <position>90,590</position>
  </downarrow>


<!-- ################################################################ -->
<!-- ########  Below are all the buttons that's in the menus ######## -->
<!-- ################################################################ -->

<!-- ####################################-->
<!-- ########  dvd_settings.xml  ########-->
<!-- ####################################-->

  <buttondef name="DVD_SETTINGS_GENERAL">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/doovde.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="DVD_SETTINGS_PLAY">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/doovde.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="DVD_SETTINGS_RIP">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/import.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>


  <buttondef name="EJECT">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/eject.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>


<!-- ###############################-->
<!-- ########  dvdmenu.xml  ########-->
<!-- ###############################-->

  <buttondef name="DVD_PLAY">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/doovde.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="VCD_PLAY">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/doovde.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="DVD_RIP">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/import.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="EJECT">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/eject.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

<!-- #####################################-->
<!-- ########  game_settings.xml  ########-->
<!-- #####################################-->

  <buttondef name="GAME_SETTINGS_GENERAL">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/game.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="GAME_SCAN">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/game.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

<!-- ################################-->
<!-- ########  mainmenu.xml  ########-->
<!-- ################################-->

  <buttondef name="TV">
    <image>text-blank.png</image>
   <watermarkimage>watermarks/tv.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="MUSIC">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/music.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="VIDEO">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/films.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="DVD">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/doovde.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="FM">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/blank.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="IMAGES">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/camera.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="GAME">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/game.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="WEATHER">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/weather.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="NEWS">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/rss.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="WEBPAGE">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/www.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="SETUP">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/setup.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="SHUTDOWN">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/power.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

 <buttondef name="RECIPE">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/blank.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

<!-- #####################################-->
<!-- ########  main_settings.xml  ########-->
<!-- #####################################-->

  <buttondef name="SETTINGS_GENERAL">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/setup.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="SETTINGS_APPEARANCE">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/appearance.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="SETTINGS_TV">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/tv.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="SETTINGS_MUSIC">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/music.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="SETTINGS_VIDEO">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/films.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="SETTINGS_DVD">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/doovde.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="SETTINGS_FM">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/blank.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="SETTINGS_IMAGES">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/camera.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="SETTINGS_GAME">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/game.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="SETTINGS_WEATHER">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/weather.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="SETTINGS_NEWS">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/rss.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="SETTINGS_WEBPAGE">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/www.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="SETTINGS_XBOX">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/setup.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="SETTINGS_RECIPE">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/blank.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

<!-- ######################################-->
<!-- ########     MythPhone        ########-->
<!-- ######################################-->

  <buttondef name="PHONE">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/phone.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>


<!-- ######################################-->
<!-- ########  music_settings.xml  ########-->
<!-- ######################################-->

  <buttondef name="MUSIC_SETTINGS_GENERAL">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/music.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="MUSIC_SETTINGS_PLAYER">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/music.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="MUSIC_SETTINGS_RIP">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/import.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

<!-- #################################-->
<!-- ########  musicmenu.xml  ########-->
<!-- #################################-->

  <buttondef name="MUSIC_PLAY">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/music.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="MUSIC_PLAYLIST">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/music.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="MUSIC_RIP">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/import.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="MUSIC_SCAN">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/search.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

<!-- ##############################################-->
<!-- ########  recpriorities_settings.xml  ########-->
<!-- ##############################################-->

  <buttondef name="TV_RECPRIORITIES_SETTINGS_GENERAL">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/priorities.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="TV_RECPRIORITIES_CHANNEL">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/priorities.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

<!-- #############################-->
<!-- ########  setup.xml  ########-->
<!-- #############################-->

  <buttondef name="SETUP_GENERAL">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/setup.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="SETUP_CAPTURE_CARDS">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/tuner.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="SETUP_VIDEO_SOURCES">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/setup.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="SETUP_INPUT_CONNECTIONS">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/setup.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="SETUP_CHANNEL_EDITOR">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/setup.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="SETUP_KEYS">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/controls.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

<!-- ###################################-->
<!-- ########  tv_schedule.xml  ########-->
<!-- ###################################-->

  <buttondef name="TV_PROGRAM_GUIDE">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/calendar.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="TV_PROGFIND">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/finder.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="TV_SEARCH_WORDS">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/search.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="TV_SEARCH_LISTS">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/search.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="TV_CUSTOM_RECORD">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/rec.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="TV_MANUAL_SCHEDULE">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/rec.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="TV_RECPRIORITIES">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/priorities.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="TV_CONFLICTS">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/priorities.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

<!-- #################################-->
<!-- ########  tv_search.xml  ########-->
<!-- #################################-->

  <buttondef name="TV_SEARCH_TITLES">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/search.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="TV_SEARCH_KEYWORDS">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/search.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="TV_SEARCH_PEOPLE">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/people.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="TV_SEARCH_POWER">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/lightbulb.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

<!-- ################################-->
<!-- ########  tv_lists.xml  ########-->
<!-- ################################-->

  <buttondef name="TV_SEARCH_NEW_TITLES">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/search.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="TV_SEARCH_MOVIES">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/films.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="TV_SEARCH_CATEGORIES">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/categories.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="TV_SEARCH_CHANNELS">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/search.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="TV_SEARCH_TIMES">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/clock.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

    <buttondef name="TV_SEARCH_DESCRIPTIONS">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/search.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

    <buttondef name="TV_SEARCH_LISTINGS">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/search.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>


<!-- ###################################-->
<!-- ########  tv_settings.xml  ########-->
<!-- ###################################-->

  <buttondef name="TV_SETTINGS_GENERAL">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/tv.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="TV_SETTINGS_PROGRAM_GUIDE">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/calendar.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="TV_SETTINGS_PLAYBACK">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/setup.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="TV_SETTINGS_RECORDING_PROFILES">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/setup.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="TV_SETTINGS_RECPRIORITIES">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/priorities.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="TV_SETTINGS_PLAYBACK_GROUPS">
    <image>ui/button_off.png</image>
   <watermarkimage>watermarks/setup.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

<!-- ##############################-->
<!-- ########  tvmenu.xml  ########-->
<!-- ##############################-->

  <buttondef name="TV_WATCH_TV">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/tv.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="TV_SCHEDULE_RECORDINGS">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/calendar.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="TV_WATCH_RECORDINGS">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/recordings.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="TV_DELETE">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/delete.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="TV_PREVIOUS">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/previous.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="TV_STATUS">
    <image>text-blank.png</image>
   <watermarkimage>watermarks/status.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

<!-- ######################################-->
<!-- ########  video_settings.xml  ########-->
<!-- ######################################-->

  <buttondef name="VIDEO_SETTINGS_GENERAL">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/films.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="VIDEO_SETTINGS_PLAYER">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/films.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="VIDEO_FILE_TYPES">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/films.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

<!-- #################################-->
<!-- ########  videomenu.xml  ########-->
<!-- #################################-->

  <buttondef name="VIDEO_BROWSER">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/films.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="VIDEO_LIST">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/films.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="VIDEO_MANAGER">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/films.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

<!-- ###########################################-->
<!-- ########  AltMenus Specific Icons  ########-->
<!-- ###########################################-->

  <buttondef name="TV_UPCOMING_RECORDINGS">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/previous.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="SETTINGS_MEDIA">
    <image>text-blank.png</image>
   <watermarkimage>watermarks/library.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="SETTINGS_INFO_CENTER">
    <image>text-blank.png</image>
   <watermarkimage>watermarks/info.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="MENU_MEDIA_LIBRARY">
    <image>text-blank.png</image>
     <watermarkimage>watermarks/library.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="MENU_MANAGE_RECORDINGS">
    <image>text-blank.png</image>
   <watermarkimage>watermarks/tvguide.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="MENU_INFO_CENTER">
    <image>text-blank.png</image>
   <watermarkimage>watermarks/info.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="MENU_OPTICAL_DISKS">
    <image>text-blank.png</image>
   <watermarkimage>watermarks/doovde.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="MENU_UTILITIES_SETUP">
    <image>text-blank.png</image>
   <watermarkimage>watermarks/setup.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="SETUP_FRONTEND">
    <image>text-blank.png</image>
   <watermarkimage>watermarks/setup.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="SETUP_BACKEND">
    <image>text-blank.png</image>
   <watermarkimage>watermarks/setup.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="SETUP_MENU">
    <image>text-blank.png</image>
   <watermarkimage>watermarks/setup.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="NETFLIX">
    <image>text-blank.png</image>
   <watermarkimage>watermarks/films.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

  <buttondef name="SETTINGS_NETFLIX">
    <image>text-blank.png</image>
   <watermarkimage>watermarks/films.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

<!-- MYTHARCHIVE -->

  <buttondef name="ARCHIVE">
    <image>text-blank.png</image>
    <watermarkimage>watermarks/export.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>

 <buttondef name="SETTINGS_ARCHIVE">
    <image>text-blank.png</image>
   <watermarkimage>watermarks/export.png</watermarkimage>
    <offset>0,0</offset>
  </buttondef>
 
 <buttondef name="ARCHIVE_FINDER">
   <image>text-blank.png</image>
  <watermarkimage>watermarks/search.png</watermarkimage>
   <offset>0,0</offset>
 </buttondef>

 <buttondef name="ARCHIVE_EXPORT_VIDEO">
   <image>text-blank.png</image>
  <watermarkimage>watermarks/export.png</watermarkimage>
   <offset>0,0</offset>
 </buttondef>

 <buttondef name="ARCHIVE_IMPORT_VIDEO">
   <image>text-blank.png</image>
  <watermarkimage>watermarks/import.png</watermarkimage>
   <offset>0,0</offset>
 </buttondef>

 <buttondef name="ARCHIVE_SELECT_RECORDINGS">
   <image>text-blank.png</image>
  <watermarkimage>watermarks/recordings.png</watermarkimage>
   <offset>0,0</offset>
 </buttondef>

 <buttondef name="ARCHIVE_SELECT_VIDEOS">
   <image>text-blank.png</image>
  <watermarkimage>watermarks/export.png</watermarkimage>
   <offset>0,0</offset>
 </buttondef>

 <buttondef name="ARCHIVE_SELECT_FILES">
   <image>text-blank.png</image>
  <watermarkimage>watermarks/export.png</watermarkimage>
   <offset>0,0</offset>
 </buttondef>

 <buttondef name="ARCHIVE_CREATE_DVD">
   <image>text-blank.png</image>
  <watermarkimage>watermarks/export.png</watermarkimage>
   <offset>0,0</offset>
 </buttondef>

 <buttondef name="ARCHIVE_CREATE_ARCHIVE">
   <image>text-blank.png</image>
  <watermarkimage>watermarks/export.png</watermarkimage>
   <offset>0,0</offset>
 </buttondef>

 <buttondef name="ARCHIVE_ENCODE_VIDEO">
   <image>text-blank.png</image>
  <watermarkimage>watermarks/export.png</watermarkimage>
   <offset>0,0</offset>
 </buttondef>

<!-- ZONEMINDER -->

<buttondef name="ZONEMINDER">
   <image>text-blank.png</image>
  <watermarkimage>watermarks/blank.png</watermarkimage>
   <offset>0,0</offset>
 </buttondef>

 <buttondef name="SETTINGS_ZONEMINDER">
   <image>text-blank.png</image>
  <watermarkimage>watermarks/blank.png</watermarkimage>
   <offset>0,0</offset>
 </buttondef>

<!-- MINIMYTH -->

<buttondef name="MINIMYTH_GAME_SAVE">
   <image>text-blank.png</image>
  <watermarkimage>watermarks/game.png</watermarkimage>
   <offset>0,0</offset>
</buttondef>

<buttondef name="MINIMYTH_GAME_RESTORE">
   <image>text-blank.png</image>
  <watermarkimage>watermarks/game.png</watermarkimage>
   <offset>0,0</offset>
</buttondef>

<buttondef name="MINIMYTH_THEMECACHE_SAVE">
   <image>text-blank.png</image>
  <watermarkimage>watermarks/appearance.png</watermarkimage>
   <offset>0,0</offset>
</buttondef>

<buttondef name="MINIMYTH_CODECS_SAVE">
   <image>text-blank.png</image>
  <watermarkimage>watermarks/setup.png</watermarkimage>
   <offset>0,0</offset>
</buttondef>

<buttondef name="MOVIETIMES">
   <image>text-blank.png</image>
  <watermarkimage>watermarks/films.png</watermarkimage>
   <offset>0,0</offset>
</buttondef>

<buttondef name="SETTINGS_MOVIETIMES">
   <image>text-blank.png</image>
  <watermarkimage>watermarks/films.png</watermarkimage>
   <offset>0,0</offset>
</buttondef>

</myththeme>

Comments

  • CPU usage when recording three channels simultaneously is about 7% plus [unknown] system time.
  • Both the Hauppauge Nova-T and Nova-T-500 cards support multirec in MythTV 0.21. CPU usage when recording from six channels simultaneously is about 15-20% plus about 8% system time.
  • CPU usage when playing back a recording is about 30-40%.
  • Sometimes recordings are corrupt and unwatchable. I suspect my signal is very variable, but it might also be http://www.mythtv.org/wiki/index.php/Troubleshooting:Mythfilldatabase_IO_bottleneck
  • Commercial Flagging doesn't really work on UK DVB-T broadcasts.
  • MythWeather doesn't work in 0.20.2. It works again in 0.21 using the BBC grabber.
  • I had a quick go at getting the Bt878 analogue tuner card working in order to help convert some VHS tapes to DVD, but never really got it working properly.
  • Hopefully future nVidia drivers will improve their handling of sync interrupts, so interlaced output doesn't get out-of-sync with the TV display. At this point, the deinterlace option can be disabled.
  • Many emulators need to be run with SDL_AUDIODRIVER=esd in order to work with FC8's default PulseAudio configuration. Xmame needs to be run under padsp and use the -dp oss option.
  • With the upgrade to FC8 and 0.20.2 of MythTV more RAM and/or CPU power might be a good idea. Menu navigation is sometimes a bit slow
  • Sometimes S/PDIF audio output halts when the host is under load. Playback of DTS soundtracks of DVDs is particularly prone to this, but I've experienced it within MythMusic too.
  • I'm now using the MythCenter-wide theme after the glass-wide theme ( http://www.mythtvthemes.co.uk/glasswide.shtml ) stopped working with MythArchive.