Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: Configtxt reformat #540

Merged
merged 21 commits into from
Mar 8, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions configuration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Some basic guides to configuring your Raspberry Pi.

- [raspi-config](raspi-config.md)
- The Raspberry Pi configuration tool in Raspbian, allowing you to easily enable features such as the camera, and change your specific settings such as keyboard layout.
- [config.txt](config-txt.md)
- [config.txt](config-txt/README.md)
- The Raspberry Pi configuration file.
- [Wireless](wireless/README.md)
- Configuring your Pi to connect to a wireless network using a wireless dongle.
Expand All @@ -19,4 +19,4 @@ Some basic guides to configuring your Raspberry Pi.
- [Default pin configuration](pin-configuration.md)
- Changing the default pin states.
- [Device Trees Config](device-tree.md)
- Device Trees, overlays and parameters.
- Device Trees, overlays, and parameters.
762 changes: 0 additions & 762 deletions configuration/config-txt.md

This file was deleted.

51 changes: 51 additions & 0 deletions configuration/config-txt/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# config.txt

The Raspberry Pi uses a configuration file instead of the [BIOS](https://en.wikipedia.org/wiki/BIOS) you would expect to find on a conventional PC. The system configuration parameters, which would traditionally be edited and stored using a BIOS, are stored instead in an optional text file named `config.txt`. This is read by the GPU before the ARM CPU and Linux are initialised. It must therefore be located on the first (boot) partition of your SD card, alongside `bootcode.bin` and `start.elf`. This file is normally accessible as `/boot/config.txt` from Linux, and must be edited as [root](../../linux/usage/root.md). From Windows or OS X it is visible as a file in the only accessible part of the card. If you need to apply some of the config settings below, but you don't have a `config.txt` on your boot partition yet, simply create it as a new text file.

Any changes will only take effect after you've rebooted your Raspberry Pi. After Linux has booted, you can view the current active settings using the following commands:

`vcgencmd get_config <config>` - displays a specific config value, e.g. `vcgencmd get_config arm_freq`.

`vcgencmd get_config int` - lists all the integer config options that are set (non-zero).

`vcgencmd get_config str` - lists all the string config options that are set (non-null).

Note that there are a few config settings that cannot be retrieved using `vcgencmd`.

## File format

The `config.txt` file is read by the early-stage boot firmware, so it has a very simple file format. The format is a single `property=value` statement on each line, where `value` is either an integer or a string. Comments may be added, or existing config values may be commented out and disabled, by starting a line with the `#` character.

Here is an example file:

```
# Force the monitor to HDMI mode so that sound will be sent over HDMI cable
hdmi_drive=2
# Set monitor mode to DMT
hdmi_group=2
# Set monitor resolution to 1024x768 XGA 60Hz (HDMI_DMT_XGA_60)
hdmi_mode=16
# Make display smaller to stop text spilling off the screen
overscan_left=20
overscan_right=12
overscan_top=10
overscan_bottom=10
```

# config.txt Options

A range of options can be specified using the config.txt file. These are split into different sections, indexed below.

- [Memory](memory.md)
- [Licence Keys/Codecs](codeclicence.md)
- [Video/Display](video.md)
- [Audio](audio.md)
- [Camera](camera.md)
- [Boot](boot.md)
- [Device Tree](../device-tree.md)
- [Overclocking](overclocking.md)
- [Conditional Filters](conditional.md)



*This article uses content from the eLinux wiki page [RPiconfig](http://elinux.org/RPiconfig), which is shared under the [Creative Commons Attribution-ShareAlike 3.0 Unported license](http://creativecommons.org/licenses/by-sa/3.0/)*
18 changes: 18 additions & 0 deletions configuration/config-txt/audio.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
## config.txt - Onboard analogue audio (3.5mm jack)

The onboard audio output uses config options to change the way the analogue audio is driven, and whether some firmware features are enabled or not.

### disable_audio_dither

By default, a 1.0LSB dither is applied to the audio stream if it is routed to the analogue audio output. This can create audible background "hiss" in some situations, for example when the ALSA volume is set to a low level. Set this to `1` to disable dither application.

### pwm_sample_bits

This adjusts the bit depth of the analogue audio output. The default bit depth is `11`. Selecting bit depths below `8` will result in nonfunctional audio, as settings below `8` result in a PLL frequency too low to support. This is generally only useful as a demonstration of how bit depth affects quantisation noise.






*This article uses content from the eLinux wiki page [RPiconfig](http://elinux.org/RPiconfig), which is shared under the [Creative Commons Attribution-ShareAlike 3.0 Unported license](http://creativecommons.org/licenses/by-sa/3.0/)*
69 changes: 69 additions & 0 deletions configuration/config-txt/boot.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
## config.txt - Boot options

### disable_commandline_tags

Set the `disable_commandline_tags` command to `1` to stop `start.elf` from filling in ATAGS (memory from `0x100`) before launching the kernel.

### cmdline

`cmdline` is the alternative filename on the boot partition from which to read the kernel command line string; the default value is `cmdline.txt`.

### kernel

`kernel` is the alternative filename on the boot partition to use when loading the kernel; the default value is `kernel.img`.

### kernel_address

`kernel_address` is the memory address into which the kernel image should be loaded. 32-bit kernels are loaded to address `0x8000` by default, and 64-bit kernels to address `0x80000`. If `kernel_old` is set, kernels are loaded to the address `0x0`.

### kernel_old

Set `kernel_old` to `1` to load the kernel at the memory address `0x0`.

### ramfsfile

`ramfsfile` is the optional filename on the boot partition of a ramfs to load. More information is available [here](http://www.raspberrypi.org/phpBB3/viewtopic.php?f=63&t=10532).

### ramfsaddr

`ramfsaddr` is the memory address into which the `ramfsfile` should be loaded.

### initramfs

The `initramfs` command specifies both the ramfs filename **and** the memory address at which to load it. It performs the actions of both `ramfsfile` and `ramfsaddr` in one parameter. Example values are: `initramfs initramf.gz 0x00800000`. **NOTE:** This option uses different syntax from all the other options, and you should not use a `=` character here.

### init_uart_baud

`init_uart_baud` is the initial UART baud rate: the default value is `115200`.

### init_uart_clock

`init_uart_clock` is the initial UART clock frequency: the default value is `3000000` (3MHz).

### init_emmc_clock

`init_emmc_clock` is the initial eMMC clock frequency: the default value is `100000000` (100MHz).

### bootcode_delay

The `bootcode_delay` command means wait for a given number of seconds in `bootcode.bin` before loading `start.elf`: the default value is `0`.

This is particularly useful to insert a delay before reading the EDID of the monitor. This is useful if the Pi and monitor are powered from the same source, but the monitor takes longer to start up than the Pi. Try setting this value if the display detection is wrong on initial boot, but is correct if you soft-reboot the Pi without removing power from the monitor.

### boot_delay

The `boot_delay` command means wait for a given number of seconds in `start.elf` before loading the kernel: the default value is `1`. The total delay in milliseconds is calculated as `(1000 x boot_delay) + boot_delay_ms`. This can be useful if your SD card needs a while to get ready before Linux is able to boot from it.

### boot_delay_ms

The `boot_delay_ms` command means wait for a given number of milliseconds in `start.elf`, together with `boot_delay`, before loading the kernel. The default value is `0`.

### disable_splash

If `disable_splash` is set to `1`, don't show the rainbow splash screen on boot. The default value is `0`.





*This article uses content from the eLinux wiki page [RPiconfig](http://elinux.org/RPiconfig), which is shared under the [Creative Commons Attribution-ShareAlike 3.0 Unported license](http://creativecommons.org/licenses/by-sa/3.0/)*
13 changes: 13 additions & 0 deletions configuration/config-txt/camera.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## config.txt - Camera

### disable_camera_led

Setting this to `1` prevents the red camera LED from turning on when recording video or taking a still picture. This is useful for preventing reflections when the camera is facing a window, for example.







*This article uses content from the eLinux wiki page [RPiconfig](http://elinux.org/RPiconfig), which is shared under the [Creative Commons Attribution-ShareAlike 3.0 Unported license](http://creativecommons.org/licenses/by-sa/3.0/)*
18 changes: 18 additions & 0 deletions configuration/config-txt/codeclicence.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
## config.txt - Licence keys/codec Options

Hardware decoding of additional codecs can be enabled by [purchasing a licence](http://swag.raspberrypi.org/collections/software) that is locked to the CPU serial number of your Raspberry Pi.

### decode_MPG2

`decode_MPG2` is a licence key to allow hardware MPEG-2 decoding, e.g. `decode_MPG2=0x12345678`.

### decode_WVC1

Licence key to allow hardware VC-1 decoding, e.g. `decode_WVC1=0x12345678`.

If you have multiple Raspberry Pis and you've bought a codec licence for each of them, you can list up to eight licence keys in a single `config.txt`, for example `decode_MPG2=0x12345678,0xabcdabcd,0x87654321`. This enables you to swap the same SD card between the different Pis without having to edit `config.txt` each time.




*This article uses content from the eLinux wiki page [RPiconfig](http://elinux.org/RPiconfig), which is shared under the [Creative Commons Attribution-ShareAlike 3.0 Unported license](http://creativecommons.org/licenses/by-sa/3.0/)*
96 changes: 96 additions & 0 deletions configuration/config-txt/conditional.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
## config.txt - Conditional filters

When a single SD card (or card image) is only being used with one Pi and one monitor, it's easy to simply set `config.txt` as required for that specific combination and keep it that way, amending only when something changes.

However, if one Pi is swapped between different monitors, or if the SD card (or card image) is being swapped between multiple Pis, a single set of settings may no longer be sufficient. Conditional filters allow you to make certain sections of the config file used only in specific cases, allowing a single `config.txt` to create different configurations when read by different hardware.

### The `[all]` filter

This is the most basic filter: it resets all previously set filters and allows any settings listed below it to be applied to all hardware.

[all]

It's usually a good idea to add an `[all]` filter at the end of groups of filtered settings to avoid unintentionally combining filters (see below).

### The `[pi1]` and `[pi2]` filters

Any settings below a `[pi1]` filter will only be applied to Pi 1 (A, A+, B, B+) hardware.
Any settings below a `[pi2]` filter will only be applied to Pi 2 hardware.

[pi1]
[pi2]

These are particularly useful for defining different `kernel`, `initramfs`, and `cmdline` settings, as the Pi 1 and Pi 2 require different kernels. They can also be useful to define different overclocking settings for each, since they have different default speeds. For example, to define separate `initramfs` images for each:

[pi1]
initramfs initrd.img-3.18.7+ followkernel
[pi2]
initramfs initrd.img-3.18.7-v7+ followkernel
[all]

Remember to use the `[all]` filter at the end, so that any subsequent settings aren't limited to Pi 2 hardware only.

### The `[EDID=*]` filter

When switching between multiple monitors while using a single SD card in your Pi, and where a blank config isn't sufficient to automatically select the desired resolution for each one, this allows specific settings to be chosen based on the monitors' EDID names.

To view the EDID name of a specific monitor, run the following command:

tvservice -n

This will print something like this:

device_name=VSC-TD2220

You can then specify settings that apply only to this monitor like so:

[EDID=VSC-TD2220]
hdmi_group=2
hdmi_mode=82
[all]

This forces 1920x1080 DVT mode for this monitor, without affecting any other monitors.

Note that these settings apply only at boot, so the monitor must be connected at boot time and the Pi must be able to read its EDID information to get the correct name. Hotplugging a different monitor after boot will not reselect different settings.

### The serial number filter

Sometimes settings should only be applied to a single specific Pi, even if you swap the SD card to a different one. Examples include licence keys and overclocking settings (although the licence keys already support SD card swapping in a different way). You can also use this to select different display settings even if the EDID identification above isn't possible for some reason, provided that you don't swap monitors between your Pis - for example, if your monitor doesn't supply a usable EDID name or if you're using composite output (for which EDID cannot be read).

To view the serial number of your Pi, run the following command:

cat /proc/cpuinfo

The serial will be shown as a 16-digit hex value at the bottom. For example, if you see:

Serial : 0000000012345678

Then you can define settings that will only be applied to this specific Pi like so:

[0x12345678]
# settings here are applied only to the Pi with this serial
[all]
# settings here are applied to all hardware

### Combining conditional filters

Filters of the same type replace each other, so `[pi2]` overrides `[pi1]`, as it's not possible for both to be true at once.

Filters of different types can be combined simply by listing them one after the other, for example:

# settings here are applied to all hardware
[EDID=VSC-TD2220]
# settings here are applied only if monitor VSC-TD2220 is connected
[pi2]
# settings here are applied only if monitor VSC-TD2220 is connected *and* on a Pi 2
[all]
# settings here are applied to all hardware

Use the `[all]` filter to reset all previous filters and avoid unintentionally combining different filter types.

---




*This article uses content from the eLinux wiki page [RPiconfig](http://elinux.org/RPiconfig), which is shared under the [Creative Commons Attribution-ShareAlike 3.0 Unported license](http://creativecommons.org/licenses/by-sa/3.0/)*
54 changes: 54 additions & 0 deletions configuration/config-txt/memory.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
## config.txt - Memory Options

### gpu_mem

GPU memory in megabytes. This sets the memory split between the CPU and GPU; the CPU gets the remaining memory. Minimum value is `16`; maximum value is `192`, `448`, or `944`, depending on whether you're using a 256M, 512MB, or 1024MB Pi. The default value is `64`.

Setting `gpu_mem` to low values may automatically disable certain firmware features, as there are some things the GPU simply can't do with too little memory. So if a certain feature you're trying to use isn't working, try setting a larger GPU memory split.

Using `gpu_mem_256`, `gpu_mem_512`, and `gpu_mem_1024` allows you to swap the same SD card between 256MB, 512MB, and 1024MB Pis without having to edit `config.txt` each time:

### gpu_mem_256

GPU memory in megabytes for the 256MB Raspberry Pi (ignored if memory size is not 256MB). This overrides `gpu_mem`. The maximum value is `192` and the default is not set.

### gpu_mem_512

GPU memory in megabytes for the 512MB Raspberry Pi (ignored if memory size is not 512MB). This overrides `gpu_mem`. The maximum value is `448` and the default is not set.

### gpu_mem_1024

GPU memory in megabytes for the 1024MB Raspberry Pi 2 (ignored if memory size is not 1024MB). This overrides `gpu_mem`. The maximum value is `944` and the default is not set.

### disable_l2cache

Setting this to `1` disables the CPU's access to the GPU's L2 cache; requires a corresponding L2 disabled kernel. Default value is `0`.

### disable_pvt

Setting this to `1` disables adjusting the refresh rate of RAM every 500ms; this action measures the RAM's temperature. Default value is `0`.

### CMA - Dynamic memory split

As of 19th November 2012, the firmware and kernel support CMA (Contiguous Memory Allocator), which means the memory split between CPU and GPU is managed dynamically at runtime. However, this is not [officially supported](https://github.com/raspberrypi/linux/issues/503).

You can find an [example config.txt here](http://www.raspberrypi.org/phpBB3/viewtopic.php?p=223549#p223549).

#### cma_lwm

When the GPU has less than `cma_lwm` megabytes of memory available (the low-water mark), it will request some from the CPU.

#### cma_hwm

When the GPU has more than `cma_hwm` megabytes of memory available (the high-water mark), it will release some to the CPU.

The following options need to be in `cmdline.txt` for CMA to work:

```
coherent_pool=6M smsc95xx.turbo_mode=N
```




*This article uses content from the eLinux wiki page [RPiconfig](http://elinux.org/RPiconfig), which is shared under the [Creative Commons Attribution-ShareAlike 3.0 Unported license](http://creativecommons.org/licenses/by-sa/3.0/)*
Loading