So you've got your Pi Zero, but you don't have an HDMI monitor! The Pi Zero has a composite video out port which is very easy to access, and we're going to show you how! You'll need a few bits and pieces, including a soldering iron to solder some headers on:
We're going to be soldering two pin headers onto the Pi Zero, circled in red and labeled TV in the picture below
go ahead an solder your pin headers on! You can of course solder wires
directly to the board if you'd like, but headers are neater (and their
connection subsequently removable).
get your RCA connector, and plug the two male ends into the two screw
terminals. Again, you can use wire for this, but male pins are probably
Now we can plug the female end of the jumper wires into our Zero.
should always be "Positive" (+) of the RCA connector, to the pin
labelled "TV" on the Raspberry Pi. In this case, it is our white jumper
Pi should automatically switch the output method depending on what you
have plugged in, e.g. if you have no HDMI plugged in, and you connect
the RCA, it should output via RCA. However, if you've pre-configured
your system (for example on another Pi) it may not work.
If it doesn't work off the bat, you'll need to edit the Pi's config.txt file to force video output via RCA.
So, open up your Pi's config.txt file, you can do this in terminal using the command:
sudo nano /boot/config.txt
There are two lines you need to edit.
First, you need to REMOVE the comment # from the line
So it should look like this:
Next, you need to ADD a comment # to the line
So it should look like this:
Check the lines highlighted in red in the images below for clarification.
Remember to save the config file when you exit!
That's it! You can now plug the Zero into your RCA/composite video and it should output on that channel!
config.txtAs it's an embedded platform, the Raspberry Pi doesn't have a BIOS like you'd find on a conventional PC. The various system configuration parameters, which would traditionally be edited and stored using a BIOS, are stored in an optional text file named
config.txt. This is read by the GPU before the ARM CPU and Linux are initialised, therefore it must be located on the first (boot) partition of your SD card, alongside
start.elf. This file is normally accessible as
/boot/config.txtfrom Linux and must be edited as root, but from Windows or OS X it's seen 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.txton your boot partition yet, then 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 get the current active settings with 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's a small number of config settings that can't be retrieved using
config.txtis read by the early-stage boot firmware it has a very simple file format. The format is a single
property=valuestatement on each line, where
valueis 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
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
gpu_memGPU memory in megabytes. Sets the memory split between the CPU and GPU; the CPU gets the remaining memory. Minimum value is
16; maximum value is
944, depending on whether you're using a 256M, 512MB or 1024MB Pi. The default value is
gpu_memto 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.
gpu_mem_1024allows you to swap the same SD card between 256MB, 512MB and 1024MB Pis without having to edit
gpu_mem_256GPU memory in megabytes for the 256MB Raspberry Pi (ignored if memory size is not 256MB). This overrides
gpu_mem. The maximum value is
192and the default is not set.
gpu_mem_512GPU memory in megabytes for the 512MB Raspberry Pi (ignored if memory size is not 512MB). This overrides
gpu_mem. The maximum value is
448and the default is not set.
gpu_mem_1024GPU memory in megabytes for the 1024MB Raspberry Pi 2 (ignored if memory size is not 1024MB). This overrides
gpu_mem. The maximum value is
944and the default is not set.
disable_l2cacheSetting this to
1disables the CPU's access to the GPU's L2 cache; requires a corresponding L2 disabled kernel. Default value is
disable_pvtSetting this to
1disables adjusting the refresh rate of RAM every 500ms; this action measures the RAM's temperature. Default value is
CMA - Dynamic memory splitThe firmware and kernel as of 19th November 2012 supports CMA (Contiguous Memory Allocator), which means the memory split between CPU and GPU is managed dynamically at runtime. However, this is not officially supported.
You can find an example config.txt here.
cma_lwmWhen the GPU has less than
cma_lwm(low-watermark) megabytes of memory available, it will request some from the CPU.
cma_hwmWhen the GPU has more than
cma_hwm(high-watermark) megabytes of memory available, it will release some to the CPU.
The following options need to be in
cmdline.txtfor CMA to work:
disable_camera_ledSetting this to
1prevents the red camera LED from turning on when recording video or taking a still picture. Useful for preventing reflections when the camera is facing a window.
Onboard analogue audio (3.5mm jack)The onboard audio output has a few config options that alter the behaviour of how the analogue audio is driven and whether some firmware features are enabled or not.
disable_audio_ditherBy default, a 1.0LSB dither is applied to the audio stream if it's routed to the analogue audio output. This can create audible background "hiss" in some situations, such as if the ALSA volume is set to a low level. Set this to
1to disable dither application.
pwm_sample_bitsAdjust the bit depth of the analogue audio output. The default bit depth is
11. Selecting bit depths below
8will result in nonfunctional audio - settings below
8result in a PLL frequency too low to support. Generally only useful as a demonstration of how bit depth affects quantisation noise.
Composite video mode options
sdtv_modeDefines the TV standard used for composite video output over the yellow RCA jack; the default value is
|1||Japanese version of NTSC – no pedestal|
|3||Brazilian version of PAL – 525/60 rather than 625/50, different subcarrier|
sdtv_aspectThis defines the aspect ratio for composite video output. The default value is
sdtv_disable_colourburstSetting this to
1disables colour burst on composite video output. The picture will be displayed in monochrome, but it may possibly be sharper.
HDMI mode options
hdmi_safeSetting this to
1uses "safe mode" settings to try to boot with maximum HDMI compatibility. This is the same as setting the following parameters:
hdmi_force_hotplug=1 hdmi_ignore_edid=0xa5000080 config_hdmi_boost=4 hdmi_group=2 hdmi_mode=4 disable_overscan=0 overscan_left=24 overscan_right=24 overscan_top=24 overscan_bottom=24
hdmi_ignore_edidSetting this to
0xa5000080enables the ignoring of EDID/display data if your display doesn't have an accurate EDID. It requires this unusual value to ensure that it doesn't get triggered accidentally.
hdmi_edid_fileSetting this to
1will cause the GPU to read EDID data from the
edid.datfile, located in the boot partition, instead of reading it from the monitor. More information is available here.
hdmi_force_edid_audioSetting this to
1pretends that all audio formats are supported by the display, allowing passthrough of DTS/AC3 even when not reported as supported.
hdmi_ignore_edid_audioSetting this to
1pretends that all audio formats are unsupported by the display. This means ALSA will default to the analogue audio (headphone) jack.
hdmi_force_edid_3dSetting this to
1pretends that all CEA modes support 3D, even when the EDID doesn't indicate support for them.
avoid_edid_fuzzy_matchSetting this to
1avoids "fuzzy matching" of modes described in the EDID. Instead, it will pick the standard mode with the matching resolution and closest framerate, even if blanking is wrong.
hdmi_ignore_cec_initSetting this to
1will prevent the initial active source message being sent during bootup. This avoids bringing a CEC-enabled TV out of standby and channel switching when rebooting your Raspberry Pi.
hdmi_ignore_cecSetting this to
1pretends that CEC is not supported at all by the TV. No CEC functions will be supported.
hdmi_pixel_encodingForce the pixel encoding mode. By default, it will use the mode requested from the EDID, so it shouldn't need changing.
|0||default (RGB limited for CEA, RGB full for DMT)|
|1||RGB limited (16-235)|
|2||RGB full (0-255)|
|3||YCbCr limited (16-235)|
|4||YCbCr full (0-255)|
hdmi_driveThis allows you to choose between HDMI and DVI output modes.
|1||Normal DVI mode (No sound)|
|2||Normal HDMI mode (Sound will be sent if supported and enabled)|
config_hdmi_boostConfigures the signal strength of the HDMI interface; the default value is
0and the maximum is
4if you have interference issues with HDMI.
hdmi_groupThis defines the HDMI output group to be either CEA (Consumer Electronics Association, the standard typically used by TVs) or DMT (Display Monitor Timings, the standard typically used by monitors). This setting should be used in conjunction with
|0||Auto-detect from EDID|
hdmi_modeThis, together with
hdmi_group, defines the HDMI output format.
For setting a custom display mode not listed here, see this thread.
These values are valid if
|3||480p||60Hz||16:9 aspect ratio|
|7||480i||60Hz||16:9 aspect ratio|
|9||240p||60Hz||16:9 aspect ratio|
|11||480i||60Hz||pixel quadrupling, 16:9 aspect ratio|
|13||240p||60Hz||pixel quadrupling, 16:9 aspect ratio|
|15||480p||60Hz||pixel doubling, 16:9 aspect ratio|
|18||576p||50Hz||16:9 aspect ratio|
|22||576i||50Hz||16:9 aspect ratio|
|24||288p||50Hz||16:9 aspect ratio|
|26||576i||50Hz||pixel quadrupling, 16:9 aspect ratio|
|28||288p||50Hz||pixel quadrupling, 16:9 aspect ratio|
|30||576p||50Hz||pixel doubling, 16:9 aspect ratio|
|36||480p||60Hz||pixel quadrupling, 16:9 aspect ratio|
|38||576p||50Hz||pixel quadrupling, 16:9 aspect ratio|
|43||576p||100Hz||16:9 aspect ratio|
|45||576i||100Hz||16:9 aspect ratio|
|49||480p||120Hz||16:9 aspect ratio|
|51||480i||120Hz||16:9 aspect ratio|
|53||576p||200Hz||16:9 aspect ratio|
|55||576i||200Hz||16:9 aspect ratio|
|57||480p||240Hz||16:9 aspect ratio|
|59||480i||240Hz||16:9 aspect ratio|
These values are valid if
|15||1024x768||43Hz||incompatible with the Raspberry Pi|
Which values are valid for my monitor?Your HDMI monitor may support only a limited set of formats. To find out which formats are supported, use the following method:
- Set the output format to VGA 60Hz (
hdmi_mode=1) and boot up your Raspberry Pi
- Enter the following command to give a list of CEA supported modes:
/opt/vc/bin/tvservice -m CEA
- Enter the following command to give a list of DMT supported modes:
/opt/vc/bin/tvservice -m DMT
- Enter the following command to show your current state:
- Enter the following commands to dump more detailed information from your monitor:
/opt/vc/bin/tvservice -d edid.dat; /opt/vc/bin/edidparser edid.dat
edid.datshould also be provided when troubleshooting problems with the default HDMI mode.
Custom modeIf your monitor requires a mode that is not in one of the tables above, then it's possible to define a custom CVT mode for it instead:
hdmi_cvt=<width> <height> <framerate> <aspect> <margins> <interlace> <rb>
|width||(required)||width in pixels|
|height||(required)||height in pixels|
|framerate||(required)||framerate in Hz|
|aspect||3||aspect ratio 1=4:3, 2=14:9, 3=16:9, 4=5:4, 5=16:10, 6=15:9|
|margins||0||0=margins disabled, 1=margins enabled|
|rb||0||0=normal, 1=reduced blanking|
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:
This may not work if your monitor does not support standard CVT timings.
hdmi_cvt=800 480 60 6 hdmi_group=2 hdmi_mode=87 hdmi_drive=2
Generic display options
hdmi_force_hotplugSetting this to
1pretends that the HDMI hotplug signal is asserted, so it appears that a HDMI display is attached. In other words, HDMI output mode will be used, even if no HDMI monitor is detected.
hdmi_ignore_hotplugSetting this to
1pretends that the HDMI hotplug signal is not asserted, so it appears that a HDMI display is not attached. In other words, composite output mode will be used, even if an HDMI monitor is detected.
1to disable overscan.
overscan_leftSpecifies the number of pixels to skip on the left edge of the screen. Increase this value if the text flows off the left edge of the screen; decrease it if there's a black border between the left edge of the screen and the text.
overscan_rightSpecifies the number of pixels to skip on the right edge of the screen.
overscan_topSpecifies the number of pixels to skip on the top edge of the screen.
overscan_bottomSpecifies the number of pixels to skip on the bottom edge of the screen.
framebuffer_widthSpecifies the console framebuffer width in pixels. The default is the display width minus the total horizontal overscan.
framebuffer_heightSpecifies the console framebuffer height in pixels. The default is the display height minus the total vertical overscan.
framebuffer_depthSpecifies the console framebuffer depth in bits per pixel. The default value is
|8||8bit framebuffer||Default RGB palette makes screen unreadable|
|24||24bit framebuffer||May result in a corrupted display|
|32||32bit framebuffer||May need to be used in conjunction with
1to disable the alpha channel. Can help with the display of a 32bit
test_modeDisplays a test image and sound during boot (but only over the composite video and analogue audio outputs) for the given number of seconds, before continuing to boot the OS as normal. This is used as a manufacturing test; the default value is
display_rotateCan be used to rotate or flip the screen orientation; the default value is
|1||rotate 90 degrees clockwise|
|2||rotate 180 degrees clockwise|
|3||rotate 270 degrees clockwise|
Licence keys/codecsHardware decoding of additional codecs can be enabled by purchasing a licence that is locked to the CPU serial number of your Raspberry Pi.
decode_MPG2Licence key to allow hardware MPEG-2 decoding, e.g.
decode_WVC1Licence key to allow hardware VC-1 decoding, e.g.
If you've got multiple Raspberry Pis and you've bought a codec licence for each of them, you can list up to 8 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
start.elffrom filling in ATAGS (memory from
0x100) before launching the kernel.
cmdlineThe alternative filename on the boot partition to read the kernel command line string from; the default value is
kernelThe alternative filename on the boot partition to use when loading the kernel; the default value is
kernel_addressThe memory address into which the kernel image should be loaded.
1to load the kernel at the memory address
ramfsfileOptional filename on the boot partition of a ramfs to load. More information is available here.
ramfsaddrThe memory address into which the
ramfsfileshould be loaded.
initramfsThis specifies both the ramfs filename and the memory address to load it at; it performs the actions of both
ramfsaddrin one parameter. Example values are:
initramfs initramf.gz 0x00800000. NOTE: This option uses different syntax to all the other options; you should not use a
init_uart_baudThe initial UART baud rate; the default value is
init_uart_clockThe initial UART clock frequency; the default value is
init_emmc_clockThe initial eMMC clock frequency; the default value is
bootcode_delayWait for a given number of seconds in
start.elf; the default value is
This is particularly useful to insert a delay before reading the EDID of the monitor, which can help 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_delayWait for a given number of seconds in
start.elfbefore 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_msWait for a given number of milliseconds in
start.elf, together with
boot_delay, before loading the kernel. The default value is
disable_splashIf set to
1, don't show the rainbow splash screen on boot. The default value is
Device treeThere are several
config.txtparameters related to device tree setup, and these are documented separately here.
OverclockingNOTE: Setting any overclocking parameters to values other than those used by raspi-config will set a permanent bit within the SoC, making it possible to detect that your Pi has been overclocked. This was originally set to detect a void warranty if the device had been overclocked. Since September 19th 2012, you can overclock your Pi without affecting your warranty; for more information see the blog post on turbo mode.
The latest kernel has a cpufreq kernel driver with the "ondemand" governor enabled by default. It has no effect if you have no overclock settings; if you overclock, the CPU frequency will vary with processor load. Non-default values are only used when needed according to the governor. You can adjust the minimum values with the
*_minconfig options, or disable dynamic clocking with
force_turbo=1; for more information see here.
Overclocking and overvoltage will be disabled at runtime when the SoC reaches 85°C, in order to cool it down. You should not hit the limit, even with maximum settings at 25°C ambient temperature; for more information see here.
|arm_freq||Frequency of the ARM CPU in MHz. The default value is
|core_freq||Frequency of the GPU processor core in MHz. It has an impact on CPU
performance, since it drives the L2 cache. The default value is
|h264_freq||Frequency of the hardware video block in MHz. The default value is
|isp_freq||Frequency of the image sensor pipeline block in MHz. The default value is
|v3d_freq||Frequency of the 3D block in MHz. The default value is
|avoid_pwm_pll||Don't dedicate a PLL to PWM audio. This will reduce analogue audio quality slightly. The spare PLL allows the
|sdram_freq||Frequency of the SDRAM in MHz. The default value is
|over_voltage||CPU/GPU core voltage adjustment. [-16,8] equates to [0.8V,1.4V] with
0.025V steps; in other words, specifying -16 will give 0.8V as the
GPU/core voltage, and specifying 8 will give 1.4V. The default value is
|over_voltage_sdram_c||SDRAM controller voltage adjustment. [-16,8] equates to [0.8V,1.4V] with 0.025V steps. The default value is
|over_voltage_sdram_i||SDRAM I/O voltage adjustment. [-16,8] equates to [0.8V,1.4V] with 0.025V steps. The default value is
|over_voltage_sdram_p||SDRAM phy voltage adjustment. [-16,8] equates to [0.8V,1.4V] with 0.025V steps. The default value is
|force_turbo||Disables the dynamic cpufreq driver and minimum settings described
below. Enables h264/v3d/isp overclocking options. The default value is
|initial_turbo||Enables turbo mode from boot for the given value in seconds up to 60, or until cpufreq sets a frequency; for more information see here. This option can help with SD card corruption if the Pi is overclocked. The default value is
|arm_freq_min||Minimum value of
|core_freq_min||Minimum value of
|sdram_freq_min||Minimum value of
|over_voltage_min||Minimum value of
|temp_limit||Overheat protection. This sets the clocks and voltages to default
when the SoC reaches this value in Celsius. Setting this higher than the
default voids your warranty; the default value is
|current_limit_override||Disables SMPS current limit protection when set to
This enables dynamic clocks and voltage for the CPU, GPU core, and SDRAM. When busy, the CPU frequency goes up to
arm_freqand down to
over_voltage_minbehave in a similar manner.
over_voltageis limited to 6 (1.35V). Non-default values for the h264/v3d/isp frequencies are ignored.
Disables dynamic frequency clocking, so that all frequencies and voltages stay high. Overclocking of h264/v3d/isp GPU parts is allowed, as well as setting
over_voltageup to 8 (1.4V). For more information see here.
Clocks relationshipThe GPU core, h264, v3d, and ISP blocks all share a PLL and therefore need to have related frequencies. The CPU, SDRAM and GPU each have their own PLLs and can have unrelated frequencies; for more information see here.
The frequencies are calculated as follows:
pll_freq = floor(2400 / (2 x core_freq)) x (2 x core_freq) gpu_freq = pll_freq / [even number]
gpu_freqis automatically rounded to the nearest even integer; asking for
gpu_freq=300will result in the divisor of 2000/300 = 6.666 => 6 and so result in a
avoid_pwm_pllSetting this to
1will decouple a PLL from the PWM hardware. This will result in more hiss on the analogue audio output, but will allow you to set the
gpu_freqindependently of the
Monitoring temperature and voltageTo view the Pi's temperature, type:
cat /sys/class/thermal/thermal_zone0/temp. Divide the result by 1000 to get the value in Celsius.
To view the Pi's current frequency, type:
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq. Divide the result by 1000 to get the value in MHz.
To monitor the Pi's PSU voltage, you'll need a multimeter to measure between the TP1 and TP2 power supply test points; more information is available in power.
It's generally a good idea to keep the core temperature below 70 degrees and the voltage above 4.8V. Note that some USB power supplies fall as low as 4.2V; this is because they are usually designed to charge a 3.7V LiPo battery, rather than to supply 5V to a computer. If your overclocked Raspberry Pi is getting hot a heatsink can be helpful, especially if the Pi is to be run inside a case. A suitable heatsink is the self-adhesive BGA (ball-grid-array) 14x14x10 mm heatsink, available from RS Components.
Overclocking problemsMost overclocking issues show up immediately with a failure to boot. If this occurs, hold down the
shiftkey during the next boot which will temporarily disable all overclocking; this will allow you to boot successfully and then edit your settings.
Conditional filtersWhen a single SD card (or card image) is only being used with one Pi and one monitor, it's easy to simply set
config.txtas 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.txtto create different configurations when read by different hardware.
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.
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).
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.
These are particularly useful for defining different
cmdlinesettings, 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
initramfsimages for each:
Remember to use the
[pi1] initramfs initrd.img-3.18.7+ followkernel [pi2] initramfs initrd.img-3.18.7-v7+ followkernel [all]
[all]filter at the end, so that any subsequent settings aren't limited to Pi 2 hardware only.
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:
This will print something like this:
You can then specify settings that apply only to this monitor like so:
This forces 1920x1080 DVT mode for this monitor, without affecting any other monitors.
[EDID=VSC-TD2220] hdmi_group=2 hdmi_mode=82 [all]
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 filterSometimes 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:
The serial will be shown as a 16-digit hex value at the bottom. For example, if you see:
Then you can define settings that will only be applied to this specific Pi like so:
Serial : 0000000012345678
[0x12345678] # settings here are applied only to the Pi with this serial [all] # settings here are applied to all hardware
Combining conditional filtersFilters of the same type replace each other, so
[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
[all]filter to reset all previous filters and avoid unintentionally combining different filter types.
This article uses content from the eLinux wiki page RPiconfig, which is shared under the Creative Commons Attribution-ShareAlike 3.0 Unported license