Libraries, codecs, OSS

Here’s a post from JamesH, one of the team working on the Raspberry Pi’s software. He works for Broadcom as his day job, and knows the BCM2835 as well as anybody; you will also have seen him posting in our forums and spanking trolls in our blog comments. Thanks JamesH! 

There have been quite a few questions in the forums and on the comments about what libraries will be available, what codecs, what is open source etc. This short post will try and give people some idea of what will be available at or around launch time. It won’t be comprehensive – I am sure that for some it will generate more questions than answers, but I hope it will be of help.

Firstly, libraries. Any distribution will need to supply a set of closed source libraries that give access to the GPU acceleration features. The libraries that will be available are :

  • OpenGL ES 2.0
    OpenGL is a 3D library, very commonly used on desktops and embedded systems. It is defined by the Khronos Group.
  • OpenVG
    OpenVG is a 2D vector drawing library, also commonly used on desktops and embedded systems. Again, defined by the Khronos Group.
  • EGL
    EGL is an interface between Khronos rendering APIs such as OpenGL ES or OpenVG and the underlying native platform window system.
  • OpenMAX IL
    OpenMAX supplies a set of API’s that provides abstractions for routines used during audio, video, and still images processing. OpenMAX defines three layers, this is the IL layer, which provides an interface between media framework such as Gstreamer and a set of multimedia components (such as codecs).

The first three adhere to the standard Linux library API’s, so should be a straight forward swap in for applications that use them. OpenMAX IL does not have a standard API at this stage, so is a custom implementation. All these libraries are as supplied by Broadcom, the SoC (System On Chip)  provider.

There is loads of information on Wikipedia and the Khronos website on these API’s.

Codecs

Two licensed codecs will be provided at launch, MPEG4 and h.264.  Codec licences have quite an impact of the cost of the device which is why there are only two at this stage. There are non-licensed Codecs such at MPEG2, VC1 etc, but for the moment they will not be accelerated by the GPU.

Dom adds: As an aside, the GPU can hardware decode H264, MPEG1/2/4, VC1, AVS, MJPG at 1080p30. It can software (but still vector accelerated) decode VP6, VP7, VP8, RV, Theora, WMV9 at DVD resolutions. We are restricted due to licensing what we can support. We should be able to support VP8, MJPG and Theora, as I believe they are license free.

Open vs Closed Source

The Open/Closed source debate can become quite heated, as those perusing the comments and forums may have noticed. As stated above, the host side libraries for the graphics acceleration are closed source and are provided by the SoC supplier. The Foundation has no control over the closed nature of these libraries. Since the vast majority of people simply use libraries such as these, it was deeded a trade off worth making to get the high graphics performance.  It’s worth noting there are no other SoC devices with a similar graphics performance that are open source. There is no GPL issue here, these are user side libraries not linked in any way to the kernel.

There are a few drivers for the SoC which are linked in to the kernel, these are GPLed and hence OSS. One of these drivers is the interface from the user space libraries to the GPU. The user side libraries use this ‘driver’ to communicate with the GPU and tell it what to do.

Here’s a handy diagram that may help visualise what’s what.

RaspberryArch

What's OSS, and what's not?

Finally, for those of you wondering why we do not sell the device as a kit, one reason can be seen in the picture below. The picture shows, on the left, the PoP memory and it’s BGA array. This fits on top of the chip on the right, the BRCM2835 SoC (underside showing). As you might imagine, it’s very difficult to position and then manually solder these small SoC devices. Each of those dots needs its own individual dot of solder, and the two packages have to be lined up perfectly. Some people in our forums say they have tried to solder BGA components and succeeded. We know of many, many more who have failed; and there is no recovering once you have failed. Usually, it’s robots called Pick and Place machines that do all the positioning, after the PCB has had solder paste applied to all the pads which helps the parts stick to it. The board then goes off to a reflow oven where the solder is melted, completing the electrical connection.

brcm2835 plus memory

The BRCM2835 (right) and its accompanying memory, on JamesH's dainty fingertip. Click to enlarge.

So there you have it, a very quick introduction to the libraries, codecs, and even a quick explanation of how the PCB’s are populated!


Livecoding with Qt5 on the Raspberry Pi

A quick Friday video. This is Qt5 with QML and OpenGL shaders, running a tool written by Baldand. (For the less coding-inclined among you, this is a nice live demonstration of the graphics programming you can do on the Raspberry Pi, showing changes made on the fly.) Lovely stuff. Thanks again to all you Qt devs!


Getting ready for launch: kernel sources on GitHub

As we wait for the first units to come back from the factory, Dom’s been getting our kernel sources into a fit shape to release. A fork of the 3.1.9 kernel with our patches is now available at https://github.com/raspberrypi/linux.


XBMC running on Raspberry Pi

We wanted to keep the fact that XBMC is running beautifully on Raspberry Pi at least moderately quiet until Gimli and Davilla from XBMC had unveiled their demo at Scale 10x  this weekend. Now they have done, so we can all talk about it: here’s some video showing how you can use your Raspberry Pi as a media centre. A $25/$35 media centre the size of a pack of playing cards.

You’ll be able to download the XBMC source tree, but we will probably also offer some binaries to make things easier for you – I’m also looking at getting it put in our default root file system if at all possible.


AirPlay and Raspberry Pi

Here’s some more video from Dom, one of our developers. It has cows in it. And AirPlay, which is streaming those cows wirelessly from YouTube to the Raspberry Pi.


Slashdot video interview with Eben

Eben was working on the Broadcom stand at CES as part of his day job last week, when Slashdot came over and grabbed a few minutes with him to talk about Raspberry Pi. Broadcom had asked him to wear a tie while he was on the stand; as you may be able to tell, neckwear is not something that comes very naturally to him…

Thanks to Slashdot – you can read their original post here.


A Monday grab-bag of community cleverness

We’re very proud of the community at Raspberry Pi. If you haven’t dipped a toe into the forums here yet, you really should – there are a lot of very smart people talking about very interesting stuff and making some very cool things in there.

We rely on our community to make the Raspberry Pi what it is. While we provide the hardware, the community ports (and writes) the software that runs on the device and supporting materials needed to teach with it, and comes up with some inventive uses of the Raspberry Pi that had never even crossed our minds. Quadcopters and baby monitors, anybody?

Lego prototype case design by Eric Baird – click on image for more details and instructions on how to build one yourself

The need for help in getting our educational software stack in good order, alongside the materials we need to help teachers use the Raspberry Pi in lessons, is the reason we’re not launching straight into schools. We want the Raspberry Pi to be available for a few months for the community to work on before it’s unleashed on kids wholesale. Our friends at Computing at School are writing teaching and learning materials; early drafts we’ve seen from them so far have been first-rate. You’ve already seen demos of KidsRuby running on Raspberry Pi, and we’ve been running Scratch (here it is in the background of a Raspi pic from the BBC’s Rory Cellan Jones), another kids’ programming tool, ever since we got our alpha boards to play with back in the summer. There will be more of this sort of thing to come; we’ve got partners working on ports of some very exciting tools which we hope will genuinely engage kids at the moment. Watch this space for announcements.

Picture of a superbly detailed 3d model of the Raspberry Pi by Confusis. Click on image for a page where you can download a .skp (SketchUp) file.

Even though the devices aren’t available to the general public yet, the community has been busy with development using a VM put together by Russell Davis (who posts here as UKScone). There’s an excellent series of video tutorials we are pointing beginners at, which is being filmed and curated by Liam Fraser, who is also working on a GUI (graphical user interface, for the non-technical folk who have got this far) to help beginners easily load their SD cards and get started with the device. The projects and collaboration section of our forums is a great place to look if you have some ideas and you’d like some help or company while you develop them; or if you just want to check that nobody’s working on your idea already.

An animated version of our logo made by forum member Antario. Click on the image for more colour variations and sizes.

Paul Maunders, who bought one of our beta boards at auction, has been testing it (note that he’s using a beta distro; things won’t be quite like this with the retail boards and we are aware of a few software kinks which are being ironed out for the final version) and is answering any and all questions about his experience on Reddit. He’s also taking video of his board working and is blogging about what he’s doing with it.

Abishur, one of our forum mods, has been working on hacking a working NES (“Well…I hope it’ll be working when I finish”) to house a Raspberry Pi so he can use it to stream video and play retro games. There is a blow-by-blow account of what he’s up to, alongside a lot of detailed photos, in the dedicated forum thread.

I’ve only scratched the surface here – there’s so much development of cool software, so many exciting hardware plans and such a lot of fan art out there that it’d take me all day to talk about it. If you’ve got a personal project you’d like us to know about, please let us know in the comments.


Raspberry Pi website to go dark on Jan 18 to protest against SOPA

Update, Jan 16: Some people have been emailing us, tweeting us and leaving comments below to tell us that SOPA is dead, because it’s been shelved by House Majority Leader Eric Cantor (without his giving any reason; the widespread discontent that has been expressed and the White House’s threat of a veto may have something to do with it, though). This is indeed good news; but it does not mean that the bill will not resurface with minor tweaks; and it also does not mean that PIPA, the Senate version of the same bill (see below) will be shelved too. So we will still be going dark on the 18th. So will Wikipedia, Reddit and many other sites which are much more visible than ours. 

On January 18, Raspberry Pi, alongside many other websites, is going dark for a day to protest against the proposed introduction of the Stop Online Piracy Act (SOPA) and its Senate counterpart, the PROTECT IP Act (PIPA) in the USA. SOPA will not just affect those in the USA; its knock-on effects would touch every website in the world. Under the proposed legislation, it would be illegal for us (or you) to link to any website – any website at all, including community-driven behemoths like YouTube, Flickr, Blogspot or WordPress – without checking first that nothing on that site infringes copyright. And we’d have to review those sites continually after a link was made.

Under these Acts, every person making a link to such a site would have to check the millions of other pages on that site to ensure that nobody, anywhere, is breaching copyright. Even search results would be covered under the proposed law. And if a website like ours were to be prosecuted for linking to another site where copyrighted material was hosted, our domain could be confiscated and our IP address added to a USA-wide blacklist, even though we are UK-based and have servers hosted outside the USA – all this without legal process.

So far, so ridiculous. It’s censorship and shifting of responsibility on a grand scale. But despite a loud chorus of opposition to the Acts from legal experts, internet experts, journalists, website owners like us, human rights activists (want to publicise the next Arab Spring using Twitter, Facebook, YouTube or another site that potentially infringes? You’ve just provided the powers that be with an instant excuse and mechanism to shut you down) and ordinary people who just surf the web, the Acts stand a genuine chance of being pushed through. Lobbyists like the Motion Picture Association of America (MPAA), the Recording Industry Association of America (RIAA) and the movie and music studios have much louder voices and deeper pockets than we individuals on the internet do; but by joining together on January 18 we hope that we can make enough of an impact to be noticed by those voting on the legislation, and by the news outlets that they read and watch.

So on January 18, Raspberry Pi intends to join the planned shutdown organised by Reddit. This site will be unavailable until midnight EST. We encourage those of you who can to join us – and if you’re a US citizen, please call or email your representative.


We’ve started manufacture!

Raspberry Pis started being made a couple of days ago, but I was forbidden to tell you about it until signed contracts and receipts for payment had arrived – it’s been killing me, especially since I’ve had tens of you asking me when manufacturing would start every day for the last few weeks. I am not good at keeping secrets.

This means that the first units from the first batch will be rolling off the line at the end of January. This first batch will consist only of Model Bs, although you will be able to buy Model As later on. Details about whether we’ll wait for all 10k to come off the line before starting sales, and about what date we’ll be starting on, will come later; so that gives you something else for you to shift around nervously on your chairs about for at least another week or so. (Please stop emailing me about it. Please.)

Unfortunately, we’ve not been able to manage manufacture in quite the way we’d hoped. As you will know if you’ve been reading the forums and the articles on this website, the Raspberry Pi Foundation had intended to get all its manufacture done in the UK; after all, we’re a UK charity, we want to help bootstrap the UK electronics industry, and doing our manufacturing in the UK seemed another way to help reach our goals.

We investigated a number of possible UK manufacturers, but encountered a few problems, some of which made matters impossible. Firstly, the schedule for manufacture for every UK business we approached was between 12 and 14 weeks (compared to a 3-4 week turnaround in the Far East). That would have meant you’d be waiting three months rather than three weeks to buy your Raspberry Pi, and we didn’t think that was acceptable.

Secondly, we found that pricing in the UK varied enormously with factories’ capacity. If a factory had sufficient capacity to do the work for us, they were typically quoting very high prices; we’d expected a delta between manufacture pricing between the UK and the Far East, but these build prices not only wiped out all our margin, but actually pushed us into the red. Some factories were able to offer us prices which were marginally profitable, but they were only able to produce at most a few hundred units a month; and even then, we were doing better by more than five dollars per unit if we moved that manufacture to the Far East. When you’re talking about tens of thousands of units per batch, losing that sum of money for the charity – a sum that we can spend on more manufacture, more outreach work and more research and development – just to be able to say we’d kept all the work in one country, starts to look irresponsible.

I’d like to draw attention to one cost in particular that really created problems for us in Britain. Simply put, if we build the Raspberry Pi in Britain, we have to pay a lot more tax. If a British company imports components, it has to pay tax on those (and most components are not made in the UK). If, however, a completed device is made abroad and imported into the UK – with all of those components soldered onto it – it does not attract any import duty at all. This means that it’s really, really tax inefficient for an electronics company to do its manufacturing in Britain, and it’s one of the reasons that so much of our manufacturing goes overseas. Right now, the way things stand means that a company doing its manufacturing abroad, depriving the UK economy, gets a tax break. It’s an absolutely mad way for the Inland Revenue to be running things, and it’s an issue we’ve taken up with the Department for Business, Innovation and Skills.

So we have had to make the pragmatic decision and look to Taiwan and China for our manufacturing, at least for this first batch. We are still working hard on investigating UK possibilities; at the moment, we’re investigating an option which would mean that all the Model As (whose demand we expect to be much lower than that of the Model Bs) will be built in the UK, and at the moment that’s looking quite do-able, although it’s not as efficient economically as doing it in Asia. I’ll fill you in on how that goes later on.

 


Beta board bought by anonymous bidder and donated to museum

Just when we thought the auctions experience couldn’t get any more exciting, a rather brilliant thing has happened. A well-wisher who wants to remain anonymous (and whom, when I am back in the country, I intend to buttonhole and buy a pint or six for) paid £989 for one of the ten beta boards we are auctioning at the moment, and has donated it to the Computer Museum at the Centre for Computing History.

Raspberry Pi on eBay

We met Jason Fitzpatrick, director of the Museum, a couple of weeks ago at a talk we gave in Cambridge; we’d already been hoping to work with him and the Centre for Computing History on some of their schools outreach work, so this is a very happy coming together. He’s as excited as we are about the donation, and says:

We are really pleased and quite taken aback at this generous donation. We are extremely supportive of the Raspberry Pi project and feel that it could usher in a new era for computing, allowing potential programmers to ‘get to the bits’ and who knows, maybe create the next big thing!

We will be purchasing a number of the (somewhat cheaper) Raspberry Pis to take out for school visits and help promote the programming in schools initiative – something we very strongly believe in.

The Raspberry Pi is an unusual addition to the museum’s collection, which is largely made up of hardware from the 1960s-1980s. The museum, like us, hopes that the Raspberry Pi will bootstrap a new era of computing in schools. Jason says he wants to be able to point to the museum’s Raspberry Pi in future years and say: ”and this is the computer that changed everything” …

There are still six of the very limited edition of beta boards, the first Raspberry Pis ever made, left to go in our charity auction. All proceeds from the auction will go to fund the Raspberry Pi Foundation’s charitable work. We are amazed at the generosity people have been showing so far; thank you and good luck to everybody who has been bidding.