Mar 31, 2013

HTPC Comes True With Raspberry Pi

Today we're going to install a light-weighted Linux distribution - OpenELEC, to make a home theater PC (HTPC) with the Raspberry Pi.  OpenELEC is designed to be simple and fast by running XBMC in standalone mode to turn your PC into a media center.  Current latest version of OpenELEC is 3.0.0 as of this writing and the OS image could be downloaded HERE.  The installation takes less than 10 minutes with very small disk space footprints (less than 250 MB).  SSH server was enabled by default and you could login as root (password: openelec), but there's no passwd command available to change the password in a traditional way.  Poor security design!

Booting OpenELEC

openelec:~ # df -h
Filesystem                Size      Used Available Use% Mounted on
none                    185.1M     87.4M     97.6M  47% /dev
/dev/mmcblk0p1          124.7M     96.1M     28.7M  77% /flash
/dev/mmcblk0p2            1.7G     61.2M      1.6G   4% /storage
/dev/loop0               87.4M     87.4M         0 100% /
none                    186.5M         0    186.5M   0% /dev/shm
/dev/sda1               916.9G    727.4G    142.9G  84% /var/media/cove

openelec:~ # passwd
-sh: passwd: command not found

Although the CPU in Raspberry Pi is an ARM 700 MHz processor (could be over-clocked up to 1 GHz), but the GPU (Broadcom VideoCore IV) is fast enough for 1080p video playback, which is the key to an HTPC.  Since controlling an HTPC with a keyboard and mouse is way too geeky, we'll dump them and use an IR remote instead (shown below).

With the Raspberry enclosed in the black case, the composition looks less ugly tho.
Port usage in the USB hub (from left to right):
  • Power supply for the Pi
  • IR remote receiver
  • USB external hard disk

While playing 1080p video, the CPU temperature is like 62 °C (144 °F) , guess it could go up to 70 °C (158 °F) in summer, and the power consumption is less than 8W with peripherals attached shown above.

Hardware info of the Raspberry Pi

The last thing to do is enabling the AirPlay feature in XBMC.  Go to System -> Settings -> Services -> AirPlay to enable it, then your iOS devices could either play the music or display the photos to the XBMC screen (mirroring not feasible due to hardware limitation).

AirPlay feature in XBMC

Note that the iOS device and the XBMC must be within the same local network (or subnet to be specific) for the service to be broadcasted correctly. (no configuration is needed on iOS devices.) Click the AirPlay icon while browsing the photo to airplay it to the remote screen.

AirPlay icon on iOS

Photo on iPad airplayed to the remote XBMC screen

[Updated on Apr. 4, 2013]

Additional notes regarding the remote control, since the Raspberry Pi is CEC-enabled, which is a feature in HDMI specification that allows the user to operate multiple devices with one remote control, if your TV set is also CEC-enabled, you can just use your TV remote to control XMBC.  Pretty cool, huh?

Luckily the TV (Sharp LC-52GX30T) I used is CEC-enabled. To check if your TV supports HDMI-CEC or not, login to the OpenELEC and type "cec-client":

openelec:~ # cec-client
No device type given. Using 'recording device'
CEC Parser created - libCEC version 2.1.1
no serial port given. trying autodetect:
 path:     Raspberry Pi
 com port: RPI

opening a connection to the CEC adapter...
DEBUG:   [             108]     unregistering all CEC clients
DEBUG:   [             111]     Broadcast (F): osd name set to 'Broadcast'
DEBUG:   [             117]     InitHostCEC - vchiq_initialise succeeded
DEBUG:   [             118]     InitHostCEC - vchi_initialise succeeded
DEBUG:   [             120]     InitHostCEC - vchi_connect succeeded
DEBUG:   [             124]     logical address changed to Broadcast (f)
DEBUG:   [             125]     RegisterLogicalAddress - registering address e
DEBUG:   [             306]     logical address changed to Recorder 1 (1)
DEBUG:   [             307]     logical address changed to Free use (e)
DEBUG:   [             307]     Open - vc_cec initialised
NOTICE:  [             308]     connection opened
DEBUG:   [             314]     << Broadcast (F) -> TV (0): POLL
DEBUG:   [             314]     initiator 'Broadcast' is not supported by the CEC adapter. using 'Free use' instead
TRAFFIC: [             314]     << e0
DEBUG:   [             316]     processor thread started
DEBUG:   [             346]     >> POLL sent
DEBUG:   [             346]     TV (0): device status changed into 'present'
DEBUG:   [             346]     << requesting vendor ID of 'TV' (0)
TRAFFIC: [             346]     << e0:8c
TRAFFIC: [             538]     >> 0f:87:08:00:1f
DEBUG:   [             538]     >> TV (0) -> Broadcast (F): device vendor id (87)
DEBUG:   [             538]     TV (0): vendor = Sharp (08001f)
DEBUG:   [             539]     expected response received (87: device vendor id)

NOTICE:  [             539]     registering new CEC client - v2.1.1
DEBUG:   [             539]     detecting logical address for type 'recording device'

Or take a look at the lower-right corner after XBMC boots, a pop-up message will be shown (see image below) if a CEC-enabled device is connected.

Message shows this TV is CEC-enabled

Here's a quick test results on CEC features against my TV:
  • Use the TV remote to control XBMC - PASS
  • Shutdown XBMC and the TV will be turned off automatically - PASS
  • While TV is on, turn on the Pi and the TV video source will be switched to the XBMC automatically - PASS
  • While TV is off, turn on the Pi and the TV will be turned on automatically - FAIL
Details on the CEC features tested could be configured in the System / Settings / Input devices / Peripherals / CEC Adapter.

No comments:

Post a Comment