Canadiangeek.net How do you know you can't do something if you haven't tried

Raspberry PI Media Players

Over the years I have used many different types of devices to play digital movies on the TV.  This started back in the late 90's with a Haupage TV out card with a wireless 2.4 Ghz transmitter over to my

rear projection TV, upgraded to a dedicated home theater PC, replaced with a Xbox mod running XBMC, replaced then with an apple TV running XBMC so I could handle 720P, replaced with a Pivos running Android to run 1080p, replaced again with a Pivos running XBMC on Linux.  This has finally all been thrown out the window and I have landed on the solution that I should stick with for a while.

Parts

Features

  • Runs 1080P content SMOOTH
  • Serial adapter will map to a TCP/IP port.  This will allow the automation system to send the TV serial commands over the network (one network cable to the PI runs video/control)
  • Small and low power
  • Updates to newer XBMC versions on each boot (Raspbmc feature)
  • Renders 1080P 3D content on TV's that support 3D (I tested)

Problems

  • The Odd Codec wont render, just get audio (still trying to get the pattern for this)
  • No Remote (use Ipod/Iphone/Ipad app to control XBMC)

Steps

  • Install Raspbmc (see website for install details)
  • Logon to SSH, username "pi" and password "raspberry"
  • Set a root password by typing "sudo passwd root", enter your new password.
  • Type "su" and enter the new password you just set
  • type "cat /proc/cpuinfo" at the SSH terminal to get your CPU Serial
  • Buy the codecs from Here using the CPU Serial you found above (Instructions)
  • type "nano /boot/config.txt" from SSH and put in the licences that you will have received by email (these emails take a day or two)
  • to check if keys installed right type "/opt/vc/bin/vcgencmd codec_enabled MPG2" and "/opt/vc/bin/vcgencmd codec_enabled WVC1"
  • Plug in the USB to serial adapter and reboot, you should now have a /dev/ttyUSBo device
  • Login to SSH with the root account again.
  • To test the serial port type this on the command line.  "echo "mc 01 08" > /dev/ttyUSB0"  where "MC 01 08" is one of the TV serial commands you can test (like ON)
  • If the serial command doesn't work use "stty -F /dev/ttyUSB0" to check the default Baud rate, it may be wrong or you may require a null modem/straight RS232 cable.
  • Install socat by typing "apt-get install socat"
  • type "nano /etc/init.d/socat" and paste the following text

#! /bin/sh # /etc/init.d/socat # ### BEGIN INIT INFO # Provides:          socat # Required-Start:    $local_fs $network # Required-Stop:     $local_fs # Default-Start:     2 3 4 5 # Default-Stop:      0 1 6 # Short-Description: socat loader # Description:       socat loader ### END INIT INFO

# Some things that run always socat tcp-l:54321,reuseaddr,fork file:/dev/ttyUSB0

# Carry out specific functions when asked to by the system case "$1" in   start)     echo "Starting script socat "     echo "Could do more here"     ;;   stop)     echo "Stopping script socat"     echo "Could do more here"     ;;   *)chmod 755 /etc/init.d/socat update-rc.d socat defaults

echo "Usage: /etc/init.d/socat {start|stop}"     exit 1     ;; esac

exit 0

  • Exit Nano after saving and type "chmod 755 socat" followed by "update-rc.d socat defaults"
  • Now logon to XBMC with a keyboard
    • Enable remote json
    • Set the region and timezone (sets the weather to Celsius and the time)
    • Set Overclock (fast) (from the RaspBMC menu)
    • Disable unsafe shutdown warning (from the RaspBMC menu)
    • Setup default page to the weather page
    • Enable instant DVD play when disk is detected.
    • Screen saver off display
    • 4x3 as 16x9
    • Disable activate teletext
    • Enable airplay
  • Now make a backup of the RPI SD card   http://forum.stmlabs.com/showthread.php?tid=8795

 

I then restored that backup to 5 more Raspberry PI's, one for every TV in the house.  I also recommend using DHCP reservations on your router to lock in the IP address from each PI.  This will ensure that your automation scripts don't randomly break when the DHCP address changes.