Difference between revisions of "User:Cowbutt"

From MythTV Official Wiki
Jump to: navigation, search
m (Nova-T-500 checklist)
m (/etc/lircd.conf)
 
(25 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">
+
# may not work, so may need to echo to /sys/... in rc.local
</pre></code>
+
options dvb_core dvb_powerdown_on_sleep=0
 +
options dvb-core dvb_powerdown_on_sleep=0
  
=== Hauppauge Nova-T-500 checklist ===
+
options snd-intel8x0 index=0
1) Boot kernel with usbcore.autosuspend=-1 to disable suspending of USB
+
install snd-intel8x0 /sbin/modprobe --ignore-install snd-intel8x0 && /usr/sbin/alsactl restore 0 >/dev/null 2>&1 || :
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
+
# I2C module options
IR port on the Nova-T-500. I only use the IR port on the Nova-T, so I can
+
alias char-major-89 i2c-dev
live with this.
+
</pre></code>
  
3) Load the dvb-usb-dib0700 module with force_lna_activation=1 to have the
+
==== /etc/X11/XvMCConfig ====
LNA permanently enabled.
+
<code><pre>
 +
libXvMCNVIDIA_dynamic.so.1
 +
</pre></code>
  
4) In /etc/rc.d/rc.local:
+
==== 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>
  
echo 0 >/sys/module/dvb_core/parameters/dvb_powerdown_on_sleep
+
==== $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>
  
and
+
==== Hauppauge Infra-Red Remote ====
  
#for i in `find /sys -name 'level' | grep usb`; do echo "on" >$i; done
+
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.
# 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.
+
===== /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>
  
5) Use the 1.20 firmware (MD5: f42f86e2971fd994003186a055813237) file and
+
===== /etc/lircd.conf =====
ensure it's being properly loaded. I've also tried the 1.10 firmware (MD5:
+
<code><pre>
5878ebfcba2d8deb90b9120eb89b02da) with no apparent improvement.
 
  
6) Ensure that the machine is cold-booted (thereby forcing a firmware load
+
# Please make this file available to others
onto the Nova-T-500) every time due to reports of warm boots being
+
# by sending it to <lirc@bartelmus.de>
problematic.
+
#
 +
# 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:
 +
#
  
7) Disable EIT scanning by MythTV on both of the two Nova-T-500 tuners. Only
+
begin remote
leave it enabled on the Nova-T card.
 
  
8) MythTV is configured to open all the tuner devices when mythbackend
+
  name  /root/irrecord-201101081438.txt
starts and keep them open until mythbackend terminates (i.e.
+
  bits            8
dvb_on_demand=0), rather than repeated opening and closing of the tuner
+
  eps            30
devices which has also been reported as problematic for some.
+
  aeps          100
  
9) MythTV signal_timeout=500, channel_timeout=3000, dvb_tuning_delay=0
+
  one            0     0
(defaults), but I've tried increasing those to 3000, 4000 and 400
+
  zero            0    0
respectively, as per <http://www.knoppmythwiki.org/index.php?page=NovaT500>
+
  pre_data_bits  56
with no apparent improvement.
+
  pre_data      0x4000400001E
 +
  gap          111995
 +
  toggle_bit_mask 0x0
  
10) MythTV multirec enabled, configured with 2 virtual tuners per physical
+
      begin codes
tuner.
+
          Go                      0x3B
 
+
          Power                    0x3D
11) I briefly experimented with setting buggy_sfn_workaround=1 when loading
+
          TV                      0x1C
the dib3000mc and dib7000p modules with no apparent improvement.  As far as
+
          Videos                  0x18
I can see, though, UK DVB-T broadcasting isn't a single frequency network,
+
          Music                    0x19
so a) this is not relevant here and b) it will impair performace.  As a
+
          Pictures                0x1A
result, I'm NOT using the buggy_sfn_workaround.
+
          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
  
I've got debug=1 set for the mt2060, dib3000mc and dib7000p modules,
+
end remote
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 [http://permalink.gmane.org/gmane.linux.drivers.video-input-infrastructure/28366 post] to the video-input-infrastructure mailing list)
 
 
 
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:
 
 
 
<code><pre>
 
+---------+----------+-------------+-----------+-----------+-----------+------------+------+----------+------------+-----------+--------------+-------------------+----------------+---------+---------------+-----------+--------------+-----------+---------+------------+----------------+---------------------+-------------------+
 
| 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 |                  |
 
+---------+----------+-------------+-----------+-----------+-----------+------------+------+----------+------------+-----------+--------------+-------------------+----------------+---------+---------------+-----------+--------------+-----------+---------+------------+----------------+---------------------+-------------------+
 
<pre></code>
 
 
 
=== 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 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 <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.
 
* 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.
 
 
 
== 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 [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