Raspberry Pi Codec Licences

= Introduction =

To save money on licencing the Raspberry Pi foundation decided to leave out MPG2 and WVC1 (among others) licencing and as such the hardware decoders are not enabled. Attempting to play content using these codecs will result in either a blank screen, or very poor performance.

Due to popular demand the Raspberry Pi foundation has made these codecs available for purchase.

= Obtain your Raspberry Pi's serial number =

Before purchasing the licences you will need to obtain your Raspberry Pi's serial number, the hardware serial number is not the same as the sticky label on the board, so we will need to do a bit of work to get the serial.

Start by SSHing into the Raspberry Pi, the below can be performed from a Linux or Mac command prompt, Windows users will need to use an application such as Putty.

ssh root@openelec

The default password for root is openelec (The password is case sensitive so make sure you type it in all lower case).

To obtain the serial number run the below command:

cat /proc/cpuinfo | grep Serial

You will see an output similar to the below, the long string of numbers and letters is your serial number, copy it or write it down:

OpenELEC:~ # cat /proc/cpuinfo | grep Serial Serial		: 00000000xxxxxxxx

= Purchase your licences =

If you have not purchased the codecs already, head over to the Raspberry Pi store and purchase the desired licence keys.

Raspberry Pi Store

The Raspberry Pi foundation will email your licence codes to you.

= Enabling the licences without removing the SD card from the Raspberry Pi =

SSH into the Raspberry Pi again.

We need to edit a file called config.txt, when OpenELEC is running it can be found in the /flash folder, however this folder is read only after boot.

Before we can edit the file we need to remount the /flash folder as read write:

mount /flash -o remount,rw

Now we can edit the file with nano, a light weight console based text editor:

nano /flash/config.txt

Scroll to the bottom of the file and look for this section, use the keyboard arrows to position the cursor:


 * 1) License keys to enable GPU hardware decoding for various codecs
 * 2) to obtain keys visit the shop at http://www.raspberrypi.com
 * 1) to obtain keys visit the shop at http://www.raspberrypi.com


 * 1) decode_MPG2=0x00000000
 * 2) decode_WVC1=0x00000000
 * 3) decode_DTS=0x00000000
 * 4) decode_DDP=0x00000000

To enable the MPG2 licence you need to do two things:  Replace 0x00000000 with the licence key you received via email. Remove the # and space from the relevant line, ie for MPG2 remove the # and space from the line # decode_MPG2= 

Once you have made your changes press CTRL and X on your keyboard, nano will ask if you want to save the changes, press Y on your keyboard then Enter, if you recieve an error that the file is read only try the remount command again.

To make sure the changes are written to the SD card type:

sync

Then remount the file system as read only:

mount /flash -o remount,ro

Finally reboot the Raspberry Pi either from the menu in XBMC or typing:

reboot

After the Raspberry Pi has rebooted you should be able to play content using the hardware decoders.

= Enabling the licences by removing the SD card from the Raspberry Pi =

You can also edit the required files on your computer instead of via the command line.

Remove the SD card from the Raspberry Pi and plug it into a card reader attached to your computer.

Once connected to your computer you should see a drive in your file manager called SYSTEM, open this drive and look for a file called config.txt.

Edit the file as above by finding the appropriate lines and uncommenting the line then adding the licence key to the line.

= Trouble Shooting =

If you are having issues with your licence there are some tests you can do to confirm if the licence is enabled or not.

SSH into your Raspberry Pi and run the below commands:

vcgencmd codec_enabled MPG2 vcgencmd codec_enabled WVC1

If MPG2 or WVC1 has been successfully enabled it should return something similar to this:

MPG2=enabled

If it returns disabled you will need to check:  You entered the correct serial number when purchasing the licence. You have correctly added the licence key to the config.txt file. You uncommented the relevant lines in the config.txt file by removing the # and space from the start of the line. You have rebooted before testing. 