Monday, February 25, 2013

Raspberry Pi (Model B 512MB)

Raspberry Pi

Quite a few friends and co workers have picked up one in the past year.  I figure it was time for me to check this neat little device out.  It's basically a 700mhz ARM11 based computer than can run linux and a few other things.  The Broadcom BCM2835 is pretty capable at 3D (xbox 1 levels) and hardware video decoding (1080p h.264) though the cpu is dog slow (300mhz pentium II levels).  If you go in with proper expectations for basically what is a $35 computer you'll come out pleasantly surprised.

I'm going to basically walk through everything I did to get things up and running, all the gotchas I ran into, and all the fun things I got working.

- I picked up mine here in the USA from element14 model B 512MB for $35.  They were a pleasure to deal with.  I got it in about 3 weeks from ordering.  Yes, things are still back ordered even after a year but not as bad.  I also picked up this very nice clear enclosure for around $7.  Shipping was very reasonable.  If you don't want to wait amazon has a few sellers with prime for around $50 so you pay about a $15 premium.  My goal was to put this together as cheap as possible and try to use as many parts as I had lying around.
- You will need some SDHC cards (class 10 preferably since you want some fast ones) for persistent storage.  Everything boots off of SDHC so it's easy enough to try different images and builds.  I picked up two 16gb sony class 10 sdhc cards for around $8 each.  16GB seems to be plenty.
- Things I used that I already had:
- micro usb cable for power.
- USB charger with at least 700ma output.  I found some logitech one I had lying around that put out 1A so it worked fine.
- ethernet cable (always have a stack of extras from monoprice)
- hdmi cable (always have a stack of extras from monoprice)
- logitech cordless mediaboard .  Luckily this keyboard mouse dongle didn't draw too much power and worked fine with the Raspberry Pi (raspi) otherwise you might need a powered usb hub.
- here is what the lights mean:

PWR = 5V input power present
OK = SD card access indicator
FDX = Ethernet Full Duplex connection
LNK = Ethernet connection present
10M = 100 Mbps Ethernet connection

Total cost: $65 (including shipping)

I highly recommend you buy the additional codecs (about $5) if you plan to use this thing at all as a media player.  Do it early since it can take a few days to receive the codes by email.  You'll have to get at least raspbian up and running though to grab your serial number.

Raspbian "wheezy"
- This is the official linux (debian) distro for the raspi.  Grab it here.  Follow the pdf quick start guide.  It's pretty straight forward.  The link for Win32 Disk Imager is out of date.  You might also want to grab SD Formatter first and format the sd card before writing the image.  In Rasp-config make sure you set your keyboard to usa.  By default it is UK so @ and " are swapped.  In fact I would go through all the options.  I would change memory split to 128mb for gpu and change the password for user pi.  I also disabled overscan.  After a reboot or two you should be up and running.
sudo halt (properly shut down before unplugging)
sudo reboot
startx (start up lxde window environment)
- I had some intermittent hdmi issues but this seemed to fix it:
cd /boot
sudo nano config.txt
made the following changes:
- Mounting Network shares.  Just make sure you properly escape spaces in your share name when editing fstab.
- Here is a nice beginners guide.  You will want to do your updates:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
sudo rpi-update (update the firmware).
- I also installed tightvnc and have it auto start from that guide.  Tight vnc from windows worked pretty well. I also tried ssh with putty which worked fine too.  Handy if something goes horribly wrong and you need to remote in and shutdown the raspi nicely.
- Install libreoffice from the official pi store.
sudo apt-get install hunspell (get spell checking working)
- Install Minecraft.  It runs pretty well though draw distances are very short.
- Install chromium.   There is no flash support since flash for arm linux was never developed.  Browsing is painfully slow for the most part.  Don't even try gmail unless you use the basic html version.
- pretty good email client:
sudo apt-get install claws-mail (it will be under internet in lxde)
- Install quake 3 arena:
I grabbed the pak files from
The binary in that zip didn't work for me.  I had to compile it myself as documented in the first link.  It takes about an hour.  It runs incredibly smooth at 1080p.  I was quite impressed.
- Tried retroPi.  Building from source takes a day.  I found it a bit of a confusing mess and haven't quite gotten anything to work with it.  I would probably hold off on this.
- installed XBMC on raspbian.  It works for the most part.  There are some quirks like I can't actually type with the keyboard though keyboard navigation works.  I just can't type to enter stuff like share credentials.  I had to use the mouse and on screen keyboard.  I can't figure out how to shutdown back to the command line.  I can basically shutdown the raspi or reboot it.  1080p mkv's are stuttery.  Good thing there is a better way to run XBMC (see below).
- Installed vlc but not really worth it since it doesn't support hardware acceleration. OMXplayer is an included command line video player that supports hw acceleration but I didn't mess with it.  The idea of a command line video player sounds painful to use.
- You can also backup your sd card to an image file using win32 disk imager especially if you've spent several hours tweaking things.

- This is an image which you can expand using raspi-config:
It works pretty well.  I loaded a few roms but you have to stick to the older games because of the limited cpu.

- After researching a bit this is supposed to be the most optimized version of xbmc for raspi.  I installed this on a 2GB sd card.  You really don't need much space:
- It works quite well out of the box.  I mounted the sd card in windows and modified the config.txt file (use notepad++) with my codec serial codes to enable vc1 and mpeg hw decoding.  This is very handy if you play mpg/mpeg2/wmv files.  It works great with hdhomerun recorded mpeg2 .ts files.  They play back very smoothly.
- Go under settings | appearance and make sure you have the right region set so the clock is right.
- Enable air play.  I was able to air play youtube from my iphone 5.  Performance was good.
- Other plugins work quite well like youtube and even  Dig a little and you'll find all sorts of umm less official plugins, and you can even get pandora working.
- Everything played great off of network shares with full 5.1 bitstream audio output.  For mkv h.264, .ts, mpeg, avi, xvid everything played very smoothly even 1080p mkv.  The UI is a bit sluggish but actual playback was great.  Codec support is a bit more hit and miss though.  One wmv I tried had static sound, same with a flv. DVD ISO did NOT work for me even with the mpeg2 codec enabled.  But for the major codecs and containers it seems to do pretty well.
- photos and mp3s worked fine.
- subtitles are handled well
- the official xbmc remote app for iOS works pretty well.
- As a pure media player it's about 90% there.

WD TV Live vs XBMC Android MK808 vs openELEC XBMC Raspi
- WD TV Live still is hands down the best for streaming media but this raspi is close.  XBMC on android MK808 has broader codec support but the lack of 5.1 kills it.  Also, raspi plays hdhomerun hd mpeg2 files better than the  mk808.  Raspi is also friendly with plugins since the internal player actually supports hw decoding.  The UI is definitely more sluggish.  The biggest drawback of wd tv live is it only does media.  MK808 and especially the Raspi are mini computers that can do quite a bit more.  WDTV integrates nicely with harmony remote so it has the highest WAF.  I personally have no regrets owning all 3.  They each really have their own strengths and weaknesses.
- There's just something nice about buying the raspi.  First, the build quality seems better than these chinese mk808s.  The raspi just feels more solid, stable, and behaves more predictably than the mk808 though the mk808 really is a lot faster, fast enough for everyday use.

Killawatt numbers:
- power usage openelec: 2w idle.  3w while playing 1080p mkv.
- power usage raspbian: 2w idle at command line.  3w with cpu at max while running chromium in LXDE.

Highly recommended.  I had a blast over the weekend getting my linux on and just digging in to see what this tiny cheap computer could do.  For general purpose computing I think it's a bit limited.  For light office work it's fine but browsing is really too painfully slow to be practical.  I did install lynx (text based browser) and at least that was fast but yeah not that practical.  openELEC was a pleasant surprise performance/compatibility wise.  Emulation is relegated to very old retro stuff but works more or less.  For $35 I can't really ask for much more.  It's definitely a fun toy to tinker with.  Definitely good if you want to teach somebody computers and maybe a bit of programming.  I probably won't use it much as a everyday computer but would work pretty well as a media streamer.

No comments: