# since it will simply abort at the point we stop mythbackend below. If this is required use upstart or some

+

# other means to decouple pm-suspend from the mythbackend process.

+

+

LOG=/var/log/mythtv/mythsuspend.log

+

MODULES="dvb_usb_dib0700"

+

+

echo "Will now $1 mythtv" | tee -a $LOG

+

+

case $1 in

+

suspend|hibernate)

+

+

stop mythtv-backend 2>&1 | tee -a $LOG

+

sleep 3

+

modprobe -r $MODULES 2>&1 | tee -a $LOG

+

;;

+

resume|thaw)

+

+

modprobe $MODULES

+

start mythtv-backend | tee -a $LOG

+

;;

+

esac

+

</pre>

+

+

== Frontend ==

+

+

=== Hardware ===

+

* ZOTAC ionitx-d-e board, 2G memory

+

* Szrealan E-2011 case (tiny!)

+

* External DVD player

+

* 1Tb external e-Sata drive

* BenQ PE8700 DLP Projector

* BenQ PE8700 DLP Projector

+

* Sony Bravia TV over HDMI

+

* CambridgeAudio AV receiver

+

=== Software ===

=== Software ===

−

* Ubuntu Dapper (upgraded from Breezy server install)

+

* MythBuntu 12.04 64bit

−

* Kernel 2.6.15-27-amd64-k8

+

* [http://synergy2.sourceforge.net/ Synergy] to allow laptop to be the keyboard/mouse.

−

* v4l-dvb-0.9 drivers patched to handle vendor/device codes being the same between 2 different devices!! (Many thanks to [http://www.itee.uq.edu.au/~chrisp/Linux-DVB/ Chris Pascoe] for getting the DVICO card going)

Current cheap as Chinese remote does not send the wakeup signal from the power button unfortunately

−

* [http://www.cse.unsw.edu.au/~willu/xmltv/tv_grab_au_reg.html XMLTV grabber] from the OZTivo site

+

−

* [[MythMusic]]

+

−

* [[MythGallery]]

+

−

* [[MythDVD]] using xine as an external player

+

−

* [[MythWeb on Jetty]] rather than apache including the WAP version on the BlackBerry!

+

−

* Using irexec to restart Myth, including with a different Layout to switch between the Projector and TV

+

−

== What's not ==

+

==== Auto-start X ====

−

* The Albatron FX5200 card does not do PAL output properly, as it renders in B&W. Fortunately my TV autodetects NTSC colour.

+

−

* The Gigabyte FX5200 card has been fingered as the cause of my DVI problems on my projector. Apparently it freaks out a PCB component causing the EDID data to become corrupt. (So far so good on the Albatron card since Aug 2006).

+

−

BTW: I previously had the Albatron and Gigabyte cards the wrong way around in this description....

/home/mythtv/bin/check_idle.sh

#!/bin/sh
ACCESS_LOG="/var/log/apache2/access.log"
LOG_AGE="5 minutes ago"
# Anacron runs our daily, weekly, monthly housekeeping (backups etc)
# anacron runs at boot, on resume from suspend, and at 2:00am via a cron job
# It will actually do its thing the first time it runs after midnight on any given day
# In general I expect it to run at 2:30am when we are resumed by a cron scheduled WOL event from the router
pgrep 'anacron' && {
echo "Anacron job is running"
exit 1
}
# users are logged in
if [ `who | wc -l` -gt 0 ] ; then
who
exit 1
fi
# apache request in last 5 minutes
# also need to configure apache to drop its dummy internal connections from the access logs
if [ -f $ACCESS_LOG -a `stat -c %Y $ACCESS_LOG` -gt `date --date "$LOG_AGE" "+%s"` ] ; then
echo "Web server in use"
exit 1
fi
# and all the standard mythtv stuff
/usr/bin/mythshutdown -v --check

/etc/sudoers.d/mythtv

#Enable mythtv to set the real time clock and emit the suspending event without a password prompt
%mythtv ALL = NOPASSWD: /usr/local/sbin/emit-suspend.sh, /usr/local/sbin/set-wakeup.sh

/usr/local/sbin/set-wakeup.sh

#!/bin/sh
#$1 is the first argument to the script. It is the time in seconds since 1970
#this is defined in mythtv-setup with the time_t argument
echo 0 > /sys/class/rtc/rtc0/wakealarm #this clears your alarm.
echo $1 > /sys/class/rtc/rtc0/wakealarm #this writes your alarm

xorg.conf

The FX5200 cards were the cause of my DVI problems on my projector. Apparently they freak out a PCB component causing the EDID data to become corrupt.
(a Gigabyte card lasted from Aug 2006 to Dec 2007. Fortunately the new nvidia driver allow you to use a CustomEDID to load the data from a file.

Option ExactModeTimingsDVI is also important for the projector.

Option "UseEDIDDpi" "false" or some equivalent control of DPI is important for the Samsung television otherwise you get really small fonts (fixed in 0.21)

There are two layouts, the default uses outputs via VGA to a Samsung LCD television, the second uses DVI to the PE8700 projector.

~mythtv/bin/suspend_mythtv.sh

#!/bin/sh
# We use dbus-send because it seems to block until resume which is what we want
echo "Suspending"
dbus-send --system --print-reply --dest=org.freedesktop.Hal /org/freedesktop/Hal/devices/computer \
org.freedesktop.Hal.Device.SystemPowerManagement.Suspend int32:2
echo "Resumed"

~mythtv/bin/kill_mythtv.sh

Script is called by the ruby program, but also useful to restart from ssh

LIRC Remote Control

Sound

~/.asoundrc

Could probably do better 48/44kHz switching on the analog output between music and video but if that is important we just go digital passthrough and let the receiver do the work.

In myth config, you can see that default sound device is ALSA:myth-video, the passthrough device is ALSA:myth-passthru, and mythmusic uses ALSA:myth-music. the AC3PassThru and DTSPassThru
settings are managed by the ruby program