Monday, October 8, 2012

Raspberry Pi - The limitations

Warning: Geekspeak post

There's been quite a flutter about low cost machines. Personally I think the Raspberry Pi is going to do what the XO (OLPC) did. Without OLPC, the netbook market wouldn't have existed. So the Raspberry Pi is cheap and brilliant.

But... it has limitations. And surprisingly, those limitations aren't the CPU (700MHz ARM 11). Actually - it kind of is a limitation, but there are even more limiting factors.

Firstly, USB. This has been a sore point for the RaspberryPi since the first development boards got out there. The Broadcom chipset initially had bad drivers. And then people started to notice voltage drops which caused the Raspberry Pi to reboot or USB just stopped working. The USB ports, for the first revision, were limited to 140mA. For the second version, while the limitation isn't quite so profound, it can still cause a power drop which forces a power interruption to the Raspberry Pi. The official fix is to use a powered USB hub.

But there's an even bigger problem - for me at least. It turns out that a lot of the limitations of the CPU can be mitigated by leveraging the GPU. So using omxplayer in Raspian gives you this great experience - only about 25% of the CPU is used for high quality content.

Take a really good look at the output of top and you start to notice something really odd. The wait time (the time that the CPU spends waiting for data) is right up there.

This happens regardless of whether you're using the SD card that you booted from or a usb device, essentially, the ONLY ways for data to get to the CPU on this board. It's never going to be that quick a boot up time (pity).

BUT it gets even more disturbing. I plugged a usb wifi adapter in wanting to avoid having to run network cables everywhere. Copying files to it using scp gives me speeds of less than 150KB/s - around 20 minutes for a 175MB file. To put this into context, I get about twice that on my Internet connection. Just a quick edit here: I suspect some sort of driver issue. Given that I'll be looking to do set ups for behind TV's and the like, I probably don't need those tiny little "nano" wifi adapters.

It turns out that the NIC on the revision B version is just a usb device itself - so you're already sharing the USB with something. Add a keyboard, hard drive, mouse and keyboard and you've got something that's going to struggle.

Essentially, in terms of geek toys, this is brilliant but, it's not the kitchen sink. i.e. It's probably best not to use one as a router/firewall as you'll start hitting speed issues (I was looking forward to replacing my firewall with a Raspberry Pi - it'd save a hell of a lot of room. IPFire has been ported to the Raspberry Pi). For the use I wanted - a distributed media centre (i.e. you should be able to have one in the back of every TV and if you plug in a device, it's contents should show up on every Pi) - it's a bit of a bust. Without the speed, it'd make it terrible to actually load media on there (such as TED talks).

So the Raspberry Pi has a ways to go. That's the hardware. In terms of software, omxplayer, the only video player that takes full advantage of the Raspberry Pi's video acceleration features, proves that huge benefits can be gained by leveraging the GPU. It's a huge shame then that Raspbian, the Debian build for Raspberry Pi, uses a 2D desktop by default (although I think there'd be a fair amount of work to be done for any desktop environment to leverage the GPU). Some time in the future, it'd be really great to see a desktop that leverages the GPU to create a truly braggable experience.

Here's something interesting for all you hackers out there - it turns out that the Raspberry Pi is actually cheaper than a lot of the Arduino shield's (expansion modules) out there. It's cheaper to use a Raspberry Pi rather than buy an ethernet shield. Inversely, an Arduino is far cheaper than a Gertboard (the expansion to Raspberry Pi to give it more Arduino type capabilities). It's a match made in heaven really.

No comments:

Post a Comment