LibreELEC.wiki
  • Introduction
  • Support
    • Log Files
    • Updating
  • Installation
    • Create Media
    • Add-Ons
    • Containers
    • Security
  • Hardware
    • Allwinner
    • Amlogic
      • BananaPi M5 / M2S
      • LaFrite
      • WeTek Hub/Play2
    • NXP - iMX6/iMX8
    • Intel x86-64 (Generic)
      • Laptops
    • Qualcomm
    • Raspberry Pi
    • Rockchip
    • Samsung (Exynos)
    • Virtual Image
  • Configuration
    • 4K / HDR
    • Blu-Ray Playback
    • Config.txt
    • Cron
    • Dual Boot
    • EDID
    • Fonts
    • Hidden WiFi
    • Hypercon
    • Hyperion
    • Infra-Red Remotes
    • LCDProc
    • Network Boot
    • Pulseaudio
    • Safe Mode
    • Samba
    • SSL/TLS Certificates
    • Startup & Shutdown
    • Useful Scripts
    • WireGuard
  • How To
    • Add Firmware
    • Blacklist Kernel Module
    • Change Bootsplash
    • Force Add-on Update
    • Add content via Samba Shares
    • Mount Network Share
  • Development
    • Building (Basics)
    • Building (Docker)
    • Building (Advanced)
    • Building (Windows WSL)
    • Beginners Guide to Git
    • Build Commands
      • Build Commands (Add-ons)
      • Build Commands LE 12.0.x
      • Build Commands LE 11.0.x
      • Build Commands LE 10.0.x
      • Build Commands LE 9.2.x
      • Build Commands LE 9.0.x
      • Build Commands LE 8.2.x
      • Build Commands LE 8.0.x
      • Build Commands LE 7.0.x
    • Nightly Images
    • Release Management
    • Website
  • Project
    • Releases
    • Forks
    • Licenses
      • Source Code
      • Documentation
    • Mirrors
Powered by GitBook
On this page
  • Editing config.txt
  • Editing via SSH
  • Editing on your computer
  • Adding codec licenses or specific hardware HATs
  • MPEG2 and VC-1 Licenses
  • Overlays for HATs and extra hardware
  • Overclocking

Was this helpful?

Edit on GitHub
Export as PDF
  1. Configuration

Config.txt

PreviousBlu-Ray PlaybackNextCron

Last updated 8 days ago

Was this helpful?

On Raspberry Pi hardware, the config.txt file is used to configure boot and hardware configuration, similar to how the BIOS or UEFI are used on an PC.

Editing config.txt

There are two options for editing config.txt: over the network using SSH or removing the storage medium (SD card, USB drive) and editing the file directly on your computer.

Editing via SSH

config.txt is usually on the /boot partition in Raspberry Pi OS. In LibreELEC, the /flash boot partition is read-only by default, so we need to remount it in read-write mode:

mount -o remount,rw /flash

We will use the nano text editor to modify the file. Save changes with ctrl+o and exit using ctrl+x:

nano /flash/config.txt

After editing, set the /flash partition back to read-only mode:

mount -o remount,ro /flash

Finally, reboot for the changes in config.txt to be applied:

reboot

Editing on your computer

Turn off the Raspberry Pi, remove the SD card on USB drive on which LibreELEC is installed, and use a card reader connected to your Windows, Linux, or macOS computer.

If using Windows, use a text editor capable of saving text files in Unix format, e.g. or Wordpad.exe (not Notepad.exe).

Adding codec licenses or specific hardware HATs

MPEG2 and VC-1 Licenses

  • Raspberry Pi 3 hardware has higher spec CPUs and is capable of software-decoding without the licenses, although purchasing them allows hardware-decoding and your device will run cooler.

  • Raspberry Pi 4 is capable of software decoding these formats and license keys are not available.

To purchase license keys you need the serial number of your Raspberry Pi. This can be read with the following command:

cat /proc/cpuinfo

Edit config.txt as described above, uncommenting the license key lines by removing the # marks, and replacing 00000000 with the keys you received after purchasing:

decode_MPG2=0x00000000
decode_WVC1=0x00000000

Reboot and confirm the license keys are installed correctly by running these commands:

vcgencmd codec_enabled MPG2
vcgencmd codec_enabled WVC1

If the licenses are enabled you should see this:

MPG2=enabled
WVC1=enabled

If any key that you purchased shows disabled check that:

  • You entered the correct serial number

  • You added the licence key to config.txt correctly

  • You uncommented the lines in config.txt by removing the \# mark (and space)

  • You rebooted before testing

Overlays for HATs and extra hardware

Raspberry Pi kernels use a board-specific device-tree file to describe the board's hardware and how things are connected. As the Raspberry Pi is designed to be extended with extra hardware via HATs and peripheral connectors the kernel also supports device-tree "overlay" files. When configured, these overlay "fragments" of device-tree content that describe the extra hardware on the board device-tree, and the the kernel reads them as a single combined file.

Overlays can be found in /flash/overlays and they are configured in config.txt in the root folder of the SD card that you boot the Raspberry Pi from. The following are examples of common overlay changes.

Audio Interfaces

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

On RPi 5, using Libreelec 12 and upwards, different audio interfaces are needed:

dtoverlay=hifiberry-dacplus
dtoverlay=hifiberry-dacplus-std
dtoverlay=hifiberry-dacplus-pro

With kernels older than 6.1.77 on RPi 5, "slave" mode must be forced:

dtoverlay=hifiberry-dacplus,slave

Infra-Red Receivers

dtoverlay=gpio-ir

Override defaults for the gpio-ir module:

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

Overclocking

Raspberry Pi 0/1/2 cannot hardware-decode MPEG2/VC-1 media files without a license key that can be purchased from the . The hardware is too slow to software decode these formats without the keys.

Please see for more details on overclocking.

Notepad++
Raspberry Pi Foundation
the Raspberry Pi documentation