Sunday, 28 February 2016

The Raspberry Pi 3.

Well, another Pi birthday (the first, or perhaps the 4th), and what a present, another new Raspberry Pi model, and it’s a cracker!

There are two major changes, and what changes they are. For the first time, the Pi has built in Wifi and Bluetooth, and even more amazing, the ARM cores are now A53’s which means 64bit processing!

Let’s looks closer at the new specs.

CPU: Quadcore 64-bit ARM Cortex A53
Clock speed: 1.2GHz.
Wifi: 802.11n
Bluetooth: 4.1
Graphics: 400Mhz VideocoreIV

The Wifi/BT is provided by a Broadcom package, a BCM43438. The Wifi is connected to a SDIO port, this was previously used for the SD card which has moved to the SDHOST interface. The BT connects via a serial interface.

The caches on the Pi3 remains as before, a 512KB L2 cache for the ARM cores, and a 128KB cache for the VideocoreIV. Note the VC4 is now clocked at 400Mhz, compared to the Pi2’s 250Mhz. It’s worth noting that although the ARM’s now have a much larger memory address space, the VideoCore is still limited to 1GB (30-bit address space, top two bits used for cache aliases) and all ARM SDRAM accesses go through VideoCore AXI infrastructure, so for the moment, 1GB remains the upper limit for SDRAM.

All other interfaces are the same as the Pi2.

What does this all mean though? It means that the PI3 is approximately 50% faster than the Pi2, the inbuilt Wireless means no more Wireless/BT dongles, and because it’s connected over SDIO, the heavily used USB port into the CPU now has a reduced workload, which should mean higher throughput for some use cases, like USB attached HD drives. But what about the 64bit stuff? Well, time will tell how much extra performance is gained from going to 64bit. There should be some performance gain for applications specifically compiled for 64bit, running on a 64bit Linux kernel.

Are there any downsides? Yes, a few caveats. More CPU power needs more actual power. A borderline PSU on a Pi2 may not be good enough for a Pi3. If you are using lots of high power peripherals, a 2.5A supply is recommended, and the official supply will now be specified to that current.  And, for the first time EVER, your Pi3 MIGHT need a heatsink. That extra power has to go somewhere. For general desktop type use, a heatsink probably won't be necessary, but if you are stressing all four cores, with NEON going as well, it might get a bit toasty. It cannot harm the chip (which is why the board is not provided with a heatsink), they would still run at 125DegC, but the core frequencies are now reduced when the temperature reaches 80 (yellow square on screen), and turbo mode is turned off completely if it reaches 85degC (red square on screen).  This is to stop burnt fingers!

Heatsink requirements will also depend on what sort of case you are using - a fully enclosed case like a PiBow will get hotter than a bare board for example.

At launch, the standard Raspbian 32bit userland and 32bit kernel will be the default. Full kernel 64bit support also requires a completely new 64bit userland as well, so that is for future development. It is expect that running 32bit apps on a 64bit kernel will show little or no improvement over 32/32, so until 64bits apps are available, the default kernel will remain 32bit.


The Raspberry Pi Foundation continues to produce devices at groundbreaking price performance levels, with solid software support, and best of all, is still ploughing their profits into education projects. Awesome.

Tuesday, 3 February 2015

Raspberry Pi 2 - Colated FAQ's


What’s the new CPU and how does it compare?

It’s a BCM2836, which is a Quad Core Cortex-A7 with a Videocore4 GPU. It is almost exactly the same in all respects to the BCM2835, but with those quad cores instead of the single core Arm11. The one other main difference is the memory caches. Each core on the 2836 has a 32KB L1 instruction cache and a 32KB L1 data cache. The 2835 caches were only 16KB. In addition the 2836 has a 512KB L2 cache specifically for the ARM cores, on the 2835 the L2 was shared with the VC4. An exclusive use Vicodecore L2 cache is retained on the 2836.

What clock speed does it run at, and can I overclock?

By default the clock speed is 900Mhz. There is some overhead available for overclocking, and also overvolting, although you risk the warranty with large overvolts. A 1000Mhz overclock option is available in raspi-config.

What this about more memory?

The new Pi has 1GB of RAM, so double that of the Mk1. This is an upper limit - the 2836 cannot address more than 1GB, so there will not be a memory upgrade.

How much faster is it?

The A7 instruction set of the new cores is more efficient than the Arm11 so at the same clock speed a single core will be 1.6-2.0 times faster. Add on the extra cores and with a multithreaded application you should get as much as a 6 times speed increase. This isn’t the only story though. Even a single threaded application will run much faster because a lot of background tasks will be able to be moved to another core. For example, when running under X windows (the desktop), a lot of the graphics processing will run on another core, a lot of USB and SD card processing will move to another core, so a single threaded app will generally have a whole core to itself.

Do I need to rebuild to get this extra performance?

Whilst applications built for the B+ will run faster on the Pi2, for the reasons explained above, by rebuilding with the correct compiler options to target the specific processor architecture, extra speed can be found. Quite a lot of extra speed if the applications can use NEON! Note you can run either types of build on the P2 at any time, but A7/NEON optimised code will not run on P1’s.

What’s this about NEON?

NEON is an ARM processor extension to allow vector operations on data. The 2836 does have single issue NEON extensions built in and these can provide a huge increase in performance for some tasks (often graphical). For example, the x264 encoder library showed upto a 30x increase in performance when built with Cortex-A7 and NEON optimisations.

What about the USB and ethernet?

The USB and ethernet connections are the same as the B+ (2835). This means a maximum of 100Mbits/s for the ethernet, and USB2.0. However, since the USB can be constrained by the speed of the CPU, the added processing capacity means the work required to run the USB will be a lower proportion of total CPU time, so higher network and USB speeds are expected.  For example, for instance a USB SSD goes from about 27MB/s on Pi1 to 31MB/s on Pi2.

How big an SD card can I use?

The SD card Interface is the same, so this is the same as the B+, cards up to 64GB have worked successfully.

Do I still need CODEC licences?

Yes, if you want to use the HW decoders. However, the higher speed of the device MIGHT mean a SW decoder can be used. This will depend on the resolution of the video you are trying to display.

What about H265 (HEVC)

H265 is currently being tested, but this would be entirely SW decoded, as there is no HW support,  so will not be capable of much over 720p25, if that., without extensive optimisation that will take some time to do.

What about the compute module and Model A?

The CM is under development, but there is no release date as yet. Model A wil follow after the CM.

Can I use an SD card from my Pi1?

Yes, but ensure your SD card is fully up to date and the Pi2 needs a specific kernel build that is only available on the latest releases. To update, sudo apt-get update && sudo apt-get upgrade

Is it really 100% backwards compatible?

Sort of! The only area that may cause problems is that the memory mapped registers are now in a different place, so code that accesses these registers will need to have a new base address set. This address has been made available using a call at run time, so code can be modified to read this address and use it rather than having hardwired numbers. It a simple change that ensures code runs on any model of Pi.

What about Android?

Whilst the Foundation has no plans for port Android themselves, the new processor may mean Android will work a bit better than before, but there is still work to be done to use the GPU.

And what on earth is Windows 10?

Microsoft have been busy porting a version of WIndows 10 to the Pi2. This is the Windows On Devices version, for Internet of Things applications. It has no desktop, and a normal Windows 10 version will not install on the Raspberry Pi. In no way is this a replacement for the existing Linux OS, it’s an additional OS that people may wish to use. Note that the Foundation have not been sponsored in any way on this, it's all from Microsoft with infrequent tech support from the RPF.

What’s going to happen to the older models?

These will continue to be built as long as there is demand for them. Software will continue to be produced and optimised for the 4.5M Raspberry Pi’s already out there.

Is Power over Ethernet/Wake on LAN supported?

No, everything else is the same as the B+.

So, why didn't the RPF add Gigabit ethernet or SATA

That would require a new chip with both of the features build in to the hardware in order to take advantage of the speed. It wasn't possible to do that on the BCM2836 in the timescale - it's a LOT of work, both in HW design, implementation, and in software to support it. The only other option would have been to use a  chip with it already on, but there are no appropriate chips in the Videocore range that have them. So a new chip would mean a complete break with the Pi1 architecture, destroying any backward compatibility - no camera for example.

Monday, 2 February 2015

Raspberry Pi 2 B - First Impressions

The recently announced Raspberry Pi 2, at first look, appears exactly the same as its version 1+ predecessor. All the sockets and LED’s appear in the same place, which means most B+ cases and third party add-ons should work fine. (One exception is the Pibow Coupe, which is being modified as we speak to ensure it works on the 2B). Only when you look a little closer do you see the Broadcom logo on top of the slightly larger CPU, and realise that the device no longer uses a PoP memory chip. Looking underneath, and the expanded 1GB memory chip comes in to view.

The new SoC, the BCM2836, is a souped up version of the original BCM2835 chip used on the original Pi. It uses the same GPU (the Videocore4), but instead of the single ArmV6 device, now has four A7 cores with NEON instruction support. The cores are the recent P5 release, so very up to date. This combined with the higher memory capacity (upped from 512MB to 1GB) means a lot more capability. The clock speed of the device is set by default to 900, which is a bit quicker than the 2835. However, the added performance of the A7 cores means even single threaded applications will run faster on the new chip. Multithreaded applications that take advantage of the 4 cores should see up to a 6x improvements in pure speed. At this stage, the overclocking capabilities of the new CPU are relatively untested, but 1000 is certainly available. and I suspect that if you are willing to risk damage through overvolting, similar overclocks to the 2835 will be possible.

That’s not all though, there have also been improvements to the processors caches. The BCM2835 has a 16K instruction, and a 16K data Level 1 caches to help with memory accesses, but the BCM2836 now has 32KB L1 data and instruction per core, and in addition, a 512K Level 2 cache used by all 4 cores, but that is for the ARM onl;y and is no longer shared by the GPU.. So a total of 640K cache dedicated to the ARM’s compared to 32K. This should make a huge difference to the average memory access speed.

It’s worth comparing the A7 cores with the A5 cores used on some other SBC’s. The A5 is a dramatically cut down version of the A7. It uses the same Armv7 instruction set but has a much smaller silicon area and has a lot of performance features removed, resulting in capabilities not much better than an ARMv6 device. They are capable of higher clock speeds, but this benefit is offset by the poor instructions execution speed. So a A7 usually outperforms an A5, even one running at a higher clock speed.

The processor and memory change is the big headline, all other peripherals remains the same, which means the same GPIO’s, the same camera, same SD card, same interoperability with no changes required to the software (for 99% of applications). Given the educational nature of the device, this backwards compatibility is essential to ensure a smooth transition for schools and other learning establishments.

Everything that works on the current Pi will (or should!) work on the new one, because the A7 is backwards compatible with the v6. ALmost all the current software packages available in Raspbian should work fine on the new Pi. The kernel has been recompiled with all the new features required for the A7s (multi core etc) but appears to the end user in the same way. At the moment, there is no intention by the Foundation to move to a specific Armv7 repository as this would mean maintaining two huge repos, so for real performance users you’ll want to recompile your applications and libraries with the A7 as the target - this should give a small amount of extra speed. It should be possible to use something like the Ubuntu Armv7 repo to download precompiled packages, but I have not attempted to do this.

So, what difference does the new processor make? Well, first impressions are very favourable indeed. During boot, instead of the single Raspberry Pi appearing at the top of the console, you now have 4, one for each core. Boot time of Raspbian is about the same, perhaps a little quicker than previously. Response on the console is quicker and programs start up with much less delay than before. Running the standard LXDE as supplied shows it is immediately snappier to use. Applications again start up faster, and running more than one application at the same time doesn’t slow the device down, the faster multiple cores, and extra memory make a huge difference here. Web browsing is considerably faster, especially with the optimised browser and Scratch shows definite improvements in speed. Keeping an eye on the CPU meter shows a much lower CPU usage overall than on the original device. Compiling the Chapel compiler (C++) took just under 10 minutes on the B2+, but well over an hour on the B+, so the extra horsepower, and I think this is what makes the real difference, double the memory, makes compiling a pleasure rather than a chore.

A quick camera test using the Raspberry Pi camera with the standard demo apps, as well as some gstreamer pipelines, showed this works fine. The extra faster cores should mean faster performance in image processing with the right software. We also tried a software only H264 encode using the x264 library (compiled for ARMv6 so not completely optimised with A7 instructions and NEON etc), and managed over 20fps at VGA resolution, which is pretty impressive.

Anecdotal tests of Sonic Pi done by the Foundation show CPU usage dropping from 80% to 3% (yes, 3%). Another impressive speed improvement.

In precis, this is a great upgrade. A quad core device, with decent graphics and multimedia capabilities, completely backwards compatible with the 4M Raspberry Pi’s already out there. Is this now a desktop replacement? Well, for some, yes, I think it is. For more power hungry users, perhaps not, but for $35, there is nothing to touch the Raspberry Pi 2 Model B+, and I suspect an awful lot more Raspberries are about to be sold!

Monday, 25 July 2011

My Whirlpool Fridge freezer leaks from the freezer section...

Well, it used to!

I've got one of those American style side by side Fridge freezers, and for the last couple of years(!) something has been leaking in to the bottom of the freezer, and leaving a big block of ice. Eventually, the ice block is so large the water starts leaking out of the bottom of the door.

It's all caused by the drain hole becoming blocked with ice. This drain hole normally allows the water produced by the frost free mechanism to drain out of the bottom of the freezer in to a pan in the bottom of the unit, where it then evaporates.

In a particularly hopeless bit of design, this hole easily becomes blocked with ice formed from the draining water.

It can be fixed however, by the use of a bit of copper wire. Remove the contents of the freezer, undo the screws holding the back panel and remove it (you may need to remove some shelf supports so the panel can come out). At the bottom you will see the blocked drain hole, and this needs unblocking. I used a hair dryer and hot water. Eventually all the ice will have melted, and you can now insert the copper wire. I used a bit from some household wiring (2.5mm T&E). You then need to poke one end down the drain hole for a few centimeters, and then let the other end hang or lightly wrap it around the defrost element, which is a black heater bar running across the bottom of the cooling element. This is what defrosts the fridge, as every 8 hrs or so it warms up and gets rid of the frost on the cooler - and this where all the water comes from. The copper wire transfers some of this heat down in to the hole, keeping it defrosted, allowing the water to escape!

Ta Da. All done. Reassembly is the reverse of dismantling.

Thursday, 23 June 2011

Ubuntu Preferred Application - Photo Manager F-Spot vs Shotwell

I've been using F-spot to manage photos for ages, and my Ubuntu box defaults to using it even with the latest releases (with Unity). However, I just created accounts for the children on the machine, and wanted those accounts to use Shotwell instead. So, I have both installed, but one account must use F-spot and the others use Shotwell. Could I find the instructions on how to do that? Nope. Well, yes, but only after a lot of looking.

There is a preferred applications options in system settings, but this doesn't cover the photo manager - which it should.

In the end I found an option in Nautilus (that's the Ubuntu/Gnome File Manager), so if you go to nautilus/Edit/Preferences/Media tab, you can find options to set various default applications. The one you want is Photos!

Thursday, 16 June 2011

Tesco sherbet lemons have CHANGED!

Bought a couple of packs just now, hoping to find the not-at-all-like Barratt's Sherbet Lemons of past purchases, but no, they are now just like Barratt's Sherbet Lemons.

What a disappointment. I really liked the old ones - crunchier and fizzier. And more yellow.

Shame on you Tesco's.

Wednesday, 25 May 2011

More good customer service

We recently had a new bathroom fitted, and had bought all the bits ourselves, with the fitter (next door!) doing all the real work. Anyway, one of the taps handles on the very expensive (£126) tap unit on the bath kept working loose, and repeated tightening later eventually stripped the thread of the grub screw hole. So, I phoned up the people who we bought it from, explained what had happened and could we have a new handle please. A couple of days later a COMPLETE tap unit arrived FOC. Yes, the whole £126 worth.

Thanks Victoria Plumb, that's excellent customer service.