Raspberry Pi 3 and H.256

Some time ago I got annoyed by some movies encoded in h.256 are not running smoothly on the Kodi of my Raspberry Pi 3.

h.256 is a block-oriented quite new video compression algorithm, that is unfortunately not supported natively by the hardware decoder on the Raspberry Pi 3. So it has to be done in Software, and (apparently) the computational power of the Pi is too weak.

Surfing through some posts, and someone claining to found a solution by overclocking the Raspberry Pi. I decided to give it a try.


# Overclocking goal

The goal was to bring the h.265 codec smoothly on the screen, using 1080p@30fps. Some people said, that overclocking the pi to 1300 MHz should be enough. So that’s where I have to go.

Only do overclocking, with an adequate cooling system! Since the Raspberry ships without any heat sink, I needed to buy one.

# Cooling system

I’ve decided to go with a plain Aluminium heat sink, but monitor the temperature very closely with cputemp and gputemp, two tools that ship by default on the Raspbian and OpenELEC:

##############################################
#                  OpenELEC                  #
#             http://openelec.tv             #
##############################################

OpenELEC (official) Version: 7.0.1
kodi:~ # cputemp
55 C
kodi:~ # gputemp
55 C
kodi:~ #

Works. During the whole overclocking procedure I was connected to the Raspberry via ssh to monitor the temperatures very closely. At least one readout every second, ready to intervene if something goes nasty.

The goal was to keep the temperature below 85 degrees (soft-limit) and immediately cancel the procedure after 90 degree (hard-limit). During the overclocking procedure I reached the hard-limit.

# Overclocking

And here we go. Backup /flash/config.txt before editing, so that you can set it back to default, once you have finished.

mount -r remount,rw /flash
nano /flash/config.txt
cp /flash/config.txt /flash/config.txt.bak

# Edit the settings to your need

arm_freq=1300
over_voltage=5
gpu_freq=500# sdram overclock
sdram_freq=500
sdram_schmoo=0x02000020
over_voltage_sdram_p=6
over_voltage_sdram_i=4
over_voltage_sdram_c=4</pre>

There are plenty of examples herehttps://www.raspberrypi.org/forums/viewtopic.php?f=66&t=138123). You may need to figure out, witch one works for you.

There’s also this amazing wiki page about overclocking, the risks and the pitfalls. I think that’s the resource you should read before getting started.

The default clocking settings for a Raspberry Pi are commented out, thus if you are unsure about your current configuration, just comment it out, reboot and you’ll have the stable plain configuration again.

In the end, I tries to get the system working with the following configuration

arm_freq=1300
over_voltage=5
gpu_freq=500

# sdram overclock
sdram_freq=500
sdram_schmoo=0x02000020
over_voltage_sdram_p=6
over_voltage_sdram_i=4
over_voltage_sdram_c=4

System was stable, but heating up a lot, up to more than 85 degrees. That’s an important threshold, because at 85 degrees the Raspberry starts to protect itself from the heat death by throttling down the CPU. So in overall you’ll have no benefit from overclocking, except a small boost in performance before it throttles you down to worse throughput, than with plain vanilla settings.

# Results

The poor Raspberry Pi got really hot during this procedure. 1300 MHz would be too much for a long-period. Also because it throttles itself down, I did not get any benefit from the overclocking procedure.

And although I pushed it to the limit with the available cooling system, I couldn’t reach a smooth experience.

So I conclude: h.265 as not suitable for my Raspberry Pi. Well, seems that I have to encode it to something more Raspberry friendly …

Still, it was a nice project!