Raspberry Pi Config.txt

The Raspberry Pi is different in many things compared to a normal computer. A normal PC has a BIOS where all system configurations can be set. Therefore the RPi uses a file called 'config.txt'.

There are two different way how the config.txt is edited. One is via SSH and the other is by plugging the SD-card to another PC (Windows, Linux or MacOS).

The SSH way

As LibreELEC's system is generally a read-only system by default, you will need to get those write-permissions first:

mount -o remount,rw /flash

Nano is a very easy-to-use built-in text editor:

nano /flash/config.txt

To save the changes you made, press CTRL + o and save the file.

Press ENTER to confirm the existing filename.

To exit the nano editor, press CTRL + x.

Now you have to change back the read/write permissions of the system partition to 'read-only' again:

mount -o remount,ro /flash

You need to reboot for the changes in the config.txt to take effect:

reboot

Editing by another PC

Remove the SD-card from your RPi, plug it into a Windows, Linux or MacOS based PC. In Windows, preferably edit the file with a text editor capable of saving text files in Unix-format, such as Notepad++ or Wordpad (not Notepad.exe).

For some video formats you will need specific licenses. Those can be purchased here: http://www.raspberrypi.com/license-keys/

We recommend you to buy both.

Purchasing the keys

To purchase the license keys, you will need the serial number of your RPi. This number can be obtained via SSH:

cat /proc/cpuinfo

Adding the keys to config.txt

Open your config.txt file as described above, and add these lines to the file:

decode_MPG2=0x00000000

decode_WVC1=0x00000000

Replace the '00000000' values with the keys you received after your purchase.

Checking the license

In case you may have issues with your license, there are some commands to verify the licenses are enabled…

SSH into your Raspberry Pi and enter the following commands:

vcgencmd codec_enabled MPG2 vcgencmd codec_enabled WVC1

If the licenses are enabled, you should see something like this on your terminal:

MPG2=enabled

If it returns disabled, you will need to check that:

  1. You entered the correct serial number when purchasing the licence.
  2. You have correctly added the licence key to the config.txt file.
  3. You uncommented the relevant lines in the config.txt file by removing the # and space from the start of the line.
  4. You have rebooted before testing.

Raspberry Pi's latest kernels and firmware now by default use Device Tree (DT) to manage some resource allocation module usage.

The current solution is not a pure Device Tree system – there is still board support code that creates some platform devices – but the external interfaces (i2c, i2s, spi) and the audio devices that use them must now be instantiated using a Device Tree Blob (DTB) passed to the kernel by the loader (start.elf).

The main impact of using Device Tree is to change from everything on, relying on module blacklisting to manage contention, to everything off unless requested by the DTB. In order to continue to use external interfaces and the peripherals that attach to them, you will need to add some new settings to your config.txt

Adding Device Tree Overlays

The current supported DTB's can be found in /flash/overlays. These can be set by using any of the following overlays

audio interfaces

dtoverlay=hifiberry-dac
dtoverlay=hifiberry-dacplus
dtoverlay=hifiberry-digi
dtoverlay=hifiberry-amp
dtoverlay=iqaudio-dac
dtoverlay=iqaudio-dacplus

IR receiver

dtoverlay=gpio-ir

override the defaults for the gpio-ir module (example):

dtoverlay=gpio-ir,gpio_pin=25,gpio_pull=up,rc-map-name=rc-technisat-usb2

optional hardware interfaces

dtparam=i2c1=on  # For later RPi's
dtparam=i2c0=on  # For early RPi's
dtparam=spi=on