Mythbuntu based PVR box (old, replaced in 2014)
- Gigabyte GA-G33M-DS2R
- Core 2 Duo E4500
- nVidia GT210
- 500GB HD
- 1GB DDR2/800 RAM
- Antec Fusion 430 black case
- Mythbuntu 10.04 (amd64)
- XBMC frontend
- DViCo Dual Digital 4 (CX23885 based PCIe card) DVB-T tuner card
- Sony PS3 bluetooth remote
- Connected to a Toshiba Regza full HD LCD TV via HDMI
Video driver
I opted for the latest driver by following
http://www.webupd8.org/2010/06/how-to-install-nvidia-25635-display.html Short version:
sudo add-apt-repository ppa:ubuntu-x-swat/x-updates
sudo apt-get update && sudo apt-get install nvidia-current nvidia-current-modaliases nvidia-settings
sudo modprobe nvidia-current
For some reason the default mode picked was 1360x768 rather than 1920x1080. See attached xorg.conf. I am not sure if this is the best solution though.
Also, I have to set overscan compensation, this may be due to the modeline used, needs more investigation. The xsession file runs nvidia-settings -l which sets this on login (unfortunately this means GDM is hard to use since it puts the session selector on the screen edge so you can't see it..)
Tips & tricks
- My main myth user is 'myth' and is logged in automatically at boot by editing
/etc/gdm/custom.conf
and putting the following in the [daemon]
section
TimedLoginEnable=true
TimedLogin=myth
TimedLoginDelay=5
- I run twm instead of xfce to avoid having network manager and package update messages appear on the main display. It also runs irexec so the user can kill the front end if needed.
- Due to changes with GDM there is no custom session which runs .xsession any more, so do the following to work around it...
sudo chown root:root /usr/share/xsessions/custom.desktop /usr/bin/custom-xsession
sudo chmod 555 /usr/bin/custom-xsession
-
- Install twm with
sudo apt-get install twm
- Copy twmrc to
~myth/.twmrc
- Login manually and select "Custom" as the type.
- Enabled shutdown & wakeup using the ACPI timer.
- Allowed mythtv user to run shutdown and to modify the ACPI alarm via sudo (see this sudoers extract)
- Copy the attached scripts checkshutdown, xbmc_idle_check.py, check-mythweb.py and setwakeup to
/home/myth/bin
and chmod 755 them.
- Add myth to the adm group so it can read the apache log file (needed for check-mythweb.py) by running
sudo usermod -g adm mythtv
- Note this script assumed the BIOS clock is using UTC, edit
/etc/default/rcS
and set UTC=yes.
- Run mythtv-setup and go into the General menu.
- Set "Block shutdown before client connected"
- Set the idle times as you see fit (120s, 15m, 120s here)
- Command to set wakeup time is
mythshutdown --setwakeup $time
- Set the wakeup time format to
yyyy-MM-ddThh:mm
- Server halt command
mythshutdown --shutdown
- Set the pre-shutdown check command to
/home/myth/bin/checkshutdown --check
- Run mythwelcome --setup and configure as you like.
- Set "Command to set wakeup time" to
/home/myth/bin/setwakeup $time
(this is what is used to actually set the wakeup time in the end)
- Set the "Wakeup time format" to
time_t
- Set nvram-wakeup Restart Command to an empty string.
- Set "Command to reboot" to
/usr/bin/sudo /sbin/shutdown -r now
- Set "Command to shutdown" to
/usr/bin/sudo /sbin/shutdown -P now
- Set "Command to start frontend" to
/usr/bin/xbmc-standalone
- Alter the TV overscan settings with
sudo aticonfig --tv-geometry=85x82+17-0
(using sudo so it can frob xorg.conf)
- udev can create a symlink for the IR receiver - this is good because new input devices can cause it to get a different number.
- Find out input device it is by reading the output of
dmesg
(/dev/input/event7
in this case)
[ 17.920332] input: i2c IR (FusionHDTV) as /devices/virtual/input/input7
[ 17.920380] ir-kbd-i2c: i2c IR (FusionHDTV) detected at i2c-0/0-006b/ir0 [cx23885[0]]
-
- Create a udev rule file
/etc/udev/rules.d/10-local.rules
to match something unique to the device, eg KERNEL=="event*",SYSFS{phys}=="i2c-0/0-006b/ir0",SYMLINK="input/irremote"
- Restart udev with
/etc/init.d/udev restart
and you should have /dev/input/irremote
- Edit
/etc/lirc/hardware.conf
and change the REMOTE to FusionRemote, REMOTE_DRIVER to devinput, and REMOTE_DEVICE to /dev/input/irremote and change START_LIRCD to true.
- Note the attached mythtv file has bindings to make myth more usable with this remote (vs the precanned ones)
- Status cron sends error message, fix by copying the config.xml from the user you run mythtv as, eg
sudo mkdir ~root/.mythtv
sudo cp ~myth/.mythtv/config.xml ~root/.mythtv/
- Setup a backup system (for the non-video files) using a USB stick
- Copy dobackup to
~myth/bin/dobackup
- Run
visudo
and add the following lines
Cmnd_Alias BACKUP=/home/myth/bin/dobackup
myth ALL=(ALL) NOPASSWD:BACKUP
-
- Add the following to the myth user crontab (adjust the time to be when the system is typically up)
# Send error emails here
MAILTO= user@host.com
# m h dom mon dow command
15 19 * * Tue /usr/bin/sudo /home/myth/bin/dobackup
- Enable the remote by following these instructions and these. I didn't bother with the LIRC stuff as the default map seemed OK, might look later.
- Add
uinput
to /etc/modules
- Copy input.conf to /etc/bluetooth (and restart bluetooth)
- Put
dev.cdrom.autoclose=0
into /etc/sysctl.conf
to disable tray autoclose (and appears to make XBMC see DVDs properly)
- Edit
/etc/acpi/powerbtn.sh
and change the 'shutdown...' line to '/usr/bin/killall xbmc.bin' to kill XBMC and go back to mythwelcome instead of shutting the PC down.
Outstanding issues
- WoL doesn't work, the network card is put to sleep on shutdown. Tried
ethtool
and acpitool -W
but no luck. Here is a bug report.
- mythfrontend crashes somewhere in the fglrx driver, apparently a mesa bug but I can't find the page again, seems to happen less often in the real system vs the ATI X1950 Pro.
- Channel searching is broken (badly) - it searches but doesn't find everything. Running the
scan
tool finds more so you need to merge them together to get a complete set.
scan /usr/share/dvb/dvb-t/au-Adelaide >channels.conf
# Run mythtv-setup and import it
mv channels.conf ~/.tzap
# Link so mplayer can find it too
ln -s ~/.tzap/channels.conf ~/.mplayer
Fixed issues
- Updating to Ubuntu 9.10 got the card TV input working out of the box but not the IR receiver. The case LCD panel worked, the IR looks like it should (has a devinput entry now) but I don't have an MCE remote to test with.
- TZ in mythweb is 30 mins behind. Doesn't affect the recording of programs.
- Tried this (update the TZ DB in PHP) but no change
- Editing /etc/php5/apache2/php.ini and setting 'date.timezone = Australia/Adelaide' has fixed it.
- Either the different BT dongle works properly, or as per this page the hid_apple driver needs to be preloaded.
Pictures
-- Main.darius - 13 Apr 2008