You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: configuration/config-txt/conditional.md
+13-11
Original file line number
Diff line number
Diff line change
@@ -1,16 +1,18 @@
1
1
## Conditional filters in config.txt
2
2
3
-
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.
3
+
When a single SD card (or card image) is being used with one Pi and one monitor, it is easy to set `config.txt` as required for that specific combination and keep it that way, amending it only when something changes.
4
4
5
-
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 that certain sections of the config file are used only in specific cases, allowing a single `config.txt` to create different configurations when read by different hardware.
5
+
6
+
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 define certain sections of the config file to be used only in specific cases, allowing a single `config.txt` to create different configurations when read by different hardware.
6
7
7
8
### The `[all]` filter
8
9
9
-
The `[all]` filter is the most basic filter: it resets all previously set filters and allows any settings listed below it to be applied to all hardware.
10
+
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.
11
+
10
12
11
13
[all]
12
14
13
-
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).
15
+
It is usually a good idea to add an `[all]` filter at the end of groups of filtered settings to avoid unintentionally combining filters (see below).
14
16
15
17
### The `[pi1]` and `[pi2]` (etc.) filters
16
18
@@ -22,7 +24,7 @@ Any settings below a `[pi2]` filter will only be applied to Pi 2 hardware. The `
22
24
[pi3]
23
25
[pi0]
24
26
25
-
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:
27
+
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, as the Pi 1 and Pi 2 have different default speeds. For example, to define separate `initramfs` images for each:
26
28
27
29
[pi1]
28
30
initramfs initrd.img-3.18.7+ followkernel
@@ -50,20 +52,20 @@ This will print something like this:
50
52
51
53
device_name=VSC-TD2220
52
54
53
-
You can then specify settings that apply only to this monitor like so:
55
+
You can then specify settings that apply only to this monitor:
54
56
55
57
[EDID=VSC-TD2220]
56
58
hdmi_group=2
57
59
hdmi_mode=82
58
60
[all]
59
61
60
-
This forces 1920x1080 DVT mode for this monitor, without affecting any other monitors.
62
+
This forces 1920x1080 DVT mode for the specified monitor, without affecting any other monitors.
61
63
62
-
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.
64
+
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 find the correct name. Hotplugging a different monitor into the Pi after boot will not select different settings.
63
65
64
66
### The serial number filter
65
67
66
-
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).
68
+
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 is not possible, 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 are using composite output (for which EDID cannot be read).
67
69
68
70
To view the serial number of your Pi, run the following command:
69
71
@@ -73,7 +75,7 @@ The serial will be shown as a 16-digit hex value at the bottom. For example, if
73
75
74
76
Serial : 0000000012345678
75
77
76
-
Then you can define settings that will only be applied to this specific Pi like so:
78
+
then you can define settings that will only be applied to this specific Pi:
77
79
78
80
[0x12345678]
79
81
# settings here are applied only to the Pi with this serial
@@ -82,7 +84,7 @@ Then you can define settings that will only be applied to this specific Pi like
82
84
83
85
### Combining conditional filters
84
86
85
-
Filters of the same type replace each other, so `[pi2]` overrides `[pi1]`, as it's not possible for both to be true at once.
87
+
Filters of the same type replace each other, so `[pi2]` overrides `[pi1]`, because it is not possible for both to be true at once.
86
88
87
89
Filters of different types can be combined simply by listing them one after the other, for example:
0 commit comments