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.