About technologies for your digital home

For beginners and tinkerers

Tweak Raspberry PI XBMC (OpenELEC)

June 8th, 2014

As it was explained in the post about Raspberry Pi, it has only 700 MHz CPU. Surely, it is not too powerful for a media player running XBMC. The Raspberry Pi’s GPU is shaped in very specific way and as a result, the same under-powered CPU is used for some graphics tasks (e.g. showing XBMC interface, performing the decoding of unsupported video and audio codecs by GPU). Those additional tasks make Raspberry Pi life even more hard.

There are many ways to tweak Raspberry Pi XBMC performance. Some of those tweaks are reasonably risky, while other are completely risk-free. Here is a list of ways you can tweak your Raspberry Pi XBMC.

The 1st suggestion is to overclock Raspberry Pi CPU.

Overclock cpu, sdram and gpu core without overvoltaging

This is the most simple but at the same time quite risky method to get the better performance. Some of overclocking aspects were discussed in previous post. Just a reminder – you should be careful and remember that playing with those settings might void your warranty.

A config file is located in the root directory called config.txt. You will see it after inserting an SD card into your PC SD card reader not through SSH)

/system/config.txt

The section from config.txt:

arm_freq=850
core_freq=250
sdram_freq=400
force_turbo=1

As you could see, there are four main variables: arm_freq, core_freq, sdram_freq and force_turbo which control ARM CPU , its core’s and SDRAM  frequencies; and force turbo. The last one option switches off the dynamic speed and selects your chosen frequency.

I use the “Medium” mode on my Raspberry Pi, which settings are given below:

# mode  'Medium' : 900 | 333 | 450 | 2

You can try different settings until you will find what matches your needs.

Just do not forget to put heat-sinks on your Raspberry Pi XBMC before starting to play with overclocking!

Raspberry Pi XBMC (OpenELEC) reads the thumbnails of video files every time before playing them. The performance will improve by disabling this option.

Disable reading thumbnails from the video files

This can be achieved by going on Raspberry Pi XBMC to:

Settings > Video > File

where you have to deselect

generate thumbnails

After doing this, your Raspberry Pi CPU will have less work 😉

Another part of the issues with Raspberry Pi might be related to the video buffering. So, the next improvement is to increase a buffer size for video.

Increase video buffering:

In order to do this, you have to create a file advancedsettings.xml in the directory /Storage/.xbmc/userdata (on OpenElec v5., this file should be created in /storage/.kodi/userdata)

<advancedsettings>
  <network>
    <cachemembuffersize>31457280</cachemembuffersize>
  </network>
  <gui>
    <algorithmdirtyregions>3</algorithmdirtyregions>
  </gui>
</advancedsettings>

In this example, 30MB was assigned as a buffer size, while the default value is 20MB. However, you should remember that by increasing this value, the starting (buffering) time will increase as well. So, you should not increase it too much as well.

Activated option ‘algorithmdirtyregions’  will try to redraw only those parts of the graphical user interface which have changed. That should save some of your Raspberry Pi XBMC CPU time.

Disable non-used services

If there are enabled non-used services (e.g.Samba, Cron etc.), the Raspberry Pi resources (memory and processor) would be still used. So, it is a good practice to disable them. In order to do this, you should go to System->OpenELEC->Services. You will have deselect them in the shown window:

OpenELEC disable services

 

Fix Wrong Raspberry Pi’s OpenELEC Time

By default, Raspberry Pi XBMC time is incorrect. That can be fixed by going to System->Appearance->International

First, you need  to choose ‘Region‘. After this, ‘Timezone country‘ has to be adjusted and Timezone.

Fix wrong Raspberry Pi time

 

In order to produce higher quality audio, you might consider upgrading an integrated 11-bit sound-card to something better.

Have fun with your tweaked Raspberry Pi XBMC! 😉

Update:
My Raspberry Pi started to freeze few days ago during the playback of HD video from a network share. The command ‘top’ showed that there was spiking usage of CPU by network card. I found on Internet that some other people were having similar issues related to high CPU usage by network. The solution was to disable the RSS feeds which are normally shown in lower part of the screen. You can achieve this by going System Settings -> Appearance. It worked like a charm 😉