You are here: Foswiki>Dons Web>MediaBox (03 Jan 2015, darius)Edit Attach

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
I Attachment Action Size Date Who Comment
channels.confconf channels.conf manage 3 K 29 Jul 2009 - 11:24 Main.darius  
check-mythweb.pypy check-mythweb.py manage 1 K 26 Dec 2008 - 12:45 Main.darius  
checkshutdownEXT checkshutdown manage 1 K 03 Aug 2011 - 14:16 Main.darius  
custom-xsessionEXT custom-xsession manage 33 bytes 13 Apr 2010 - 13:54 Main.darius  
custom.desktopdesktop custom.desktop manage 165 bytes 13 Apr 2010 - 13:52 Main.darius  
dobackupEXT dobackup manage 991 bytes 06 Jan 2009 - 09:50 Main.darius  
input.confconf input.conf manage 3 K 15 Feb 2013 - 08:14 Main.darius Fix mute
interfacesEXT interfaces manage 102 bytes 28 Apr 2008 - 11:21 Main.darius  
mythpoweroffEXT mythpoweroff manage 291 bytes 28 Dec 2008 - 10:43 Main.darius  
mythtvEXT mythtv manage 4 K 09 Aug 2010 - 12:57 Main.darius  
nvidia-settings-rcEXT nvidia-settings-rc manage 1 K 16 Feb 2011 - 23:49 Main.darius  
setwakeupEXT setwakeup manage 400 bytes 21 Apr 2010 - 12:27 Main.darius  
sudoersEXT sudoers manage 200 bytes 21 Apr 2010 - 12:20 Main.darius  
twmrcEXT twmrc manage 2 K 13 Apr 2010 - 13:25 Main.darius  
wpa_supplicant.confconf wpa_supplicant.conf manage 132 bytes 28 Apr 2008 - 11:22 Main.darius  
xbmc_idle_check.py.txttxt xbmc_idle_check.py.txt manage 1 K 03 Aug 2011 - 13:54 Main.darius  
xorg.confconf xorg.conf manage 2 K 16 Feb 2011 - 23:51 Main.darius  
xsessionEXT xsession manage 1 K 03 Aug 2011 - 13:54 Main.darius  
Topic revision: r39 - 03 Jan 2015, darius
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback