Skip to content

Commit 342f228

Browse files
committed
Merge pull request raspberrypi#177 from uecasm/patch-1
Add hdmi_cvt and filters
2 parents ee94d00 + d73e2c0 commit 342f228

File tree

1 file changed

+117
-0
lines changed

1 file changed

+117
-0
lines changed

configuration/config-txt.md

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,33 @@ Your HDMI monitor may support only a limited set of formats. To find out which f
379379

380380
The `edid.dat` should also be provided when troubleshooting problems with the default HDMI mode.
381381

382+
### Custom mode
383+
384+
If your monitor requires a mode that is not in one of the tables above, then it is possible to define a custom [CVT](http://en.wikipedia.org/wiki/Coordinated_Video_Timings) mode for it instead:
385+
386+
hdmi_cvt=<width> <height> <framerate> <aspect> <margins> <interlace> <rb>
387+
388+
| Value | Default | Description |
389+
| --- | --- | --- |
390+
| width | (required) | width in pixels |
391+
| height | (required) | height in pixels |
392+
| framerate | (required) | framerate in Hz |
393+
| aspect | 3 | aspect ratio 1=4:3, 2=14:9, 3=16:9, 4=5:4, 5=16:10, 6=15:9 |
394+
| margins | 0 | 0=margins disabled, 1=margins enabled |
395+
| interlace | 0 | 0=progressive, 1=interlaced |
396+
| rb | 0 | 0=normal, 1=reduced blanking |
397+
398+
(Fields at the end can be omitted to use the default values.)
399+
400+
Note that this simply _creates_ the mode (group 2 mode 87); in order to make the Pi use this by default you must add some additional settings. As an example, the following selects an 800x480 resolution and enables audio drive:
401+
402+
hdmi_cvt=800 480 60 6
403+
hdmi_group=2
404+
hdmi_mode=87
405+
hdmi_drive=2
406+
407+
This may not work if your monitor does not support standard CVT timings.
408+
382409
### Generic display options
383410

384411
#### hdmi_force_hotplug
@@ -612,6 +639,96 @@ It's generally a good idea to keep the core temperature below 70 degrees and the
612639

613640
Most overclocking issues show up immediately with a failure to boot. If this occurs, hold down the `shift` key during the next boot which will temporarily disable all overclocking; this will allow you to boot successfully and then edit your settings.
614641

642+
## Conditional Filters
643+
644+
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.
645+
646+
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.
647+
648+
### The `[all]` filter
649+
650+
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.
651+
652+
[all]
653+
654+
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).
655+
656+
### The `[pi1]` and `[pi2]` filters
657+
658+
Any settings below a `[pi1]` filter will only be applied to Pi1 (A, A+, B, B+) hardware.
659+
Any settings below a `[pi2]` filter will only be applied to Pi2 hardware.
660+
661+
[pi1]
662+
[pi2]
663+
664+
These are particularly useful for defining different `kernel`, `initramfs`, and `cmdline` settings, as the Pi1 and Pi2 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:
665+
666+
[pi1]
667+
initramfs initrd.img-3.18.7+ followkernel
668+
[pi2]
669+
initramfs initrd.img-3.18.7-v7+ followkernel
670+
[all]
671+
672+
Remember to use the `[all]` filter at the end, so that any subsequent settings aren't limited to Pi2 hardware only.
673+
674+
### The `[EDID=*]` filter
675+
676+
When switching between multiple monitors while using a single SD card in your Pi, and where a blank config is not sufficient to automatically select the desired resolution for each one, this allows specific settings to be chosen based on the monitors' EDID names.
677+
678+
To view the EDID name of a specific monitor, run the following command:
679+
680+
tvservice -n
681+
682+
This will print something like this:
683+
684+
device_name=VSC-TD2220
685+
686+
You can then specify settings that apply only to this monitor like so:
687+
688+
[EDID=VSC-TD2220]
689+
hdmi_group=2
690+
hdmi_mode=82
691+
[all]
692+
693+
This forces 1920x1080 DVT mode for this monitor, without affecting any other monitors.
694+
695+
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.
696+
697+
### The serial number filter
698+
699+
Sometimes settings should only be applied to a single specific Pi, even if you swap the SD card to a different one. Examples include license keys and overclocking settings (although the license 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 for some reason (provided that you don't swap monitors between your Pis) -- for example if your monitor does not supply a usable EDID name or if you are using composite output (for which EDID cannot be read).
700+
701+
To view the serial number of your Pi, run the following command:
702+
703+
cat /proc/cpuinfo
704+
705+
The serial will be shown as a 16-digit hex value at the bottom. For example, if you see:
706+
707+
Serial : 0000000012345678
708+
709+
Then you can define settings that will only be applied to this specific Pi like so:
710+
711+
[0x12345678]
712+
# settings here are applied only to the Pi with this serial
713+
[all]
714+
# settings here are applied to all hardware
715+
716+
### Combining conditional filters
717+
718+
Filters of the same type replace each other (so `[pi2]` overrides `[pi1]`, as it is not possible for both to be true at once).
719+
720+
Filters of different types can be combined simply by listing them one after the other, eg:
721+
722+
# settings here are applied to all hardware
723+
[EDID=VSC-TD2220]
724+
# settings here are applied only if monitor VSC-TD2220 is connected
725+
[pi2]
726+
# settings here are applied only if monitor VSC-TD2220 is connected *and* on a Pi2
727+
[all]
728+
# settings here are applied to all hardware
729+
730+
Use the `[all]` filter to reset all previous filters and avoid unintentionally combining different filter types.
731+
615732
---
616733

617734
*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/)*

0 commit comments

Comments
 (0)