Essential Raspberry Pi Commands Using vcgencmd

vcgencmd tool is used to output information from the VideoCore GPU on Raspberry Pi. You can find the source code for the vcgencmd utility at Github.To get a list of all supported vcgencmd commands, use vcgencmd commands. Below are some useful commands and their required parameters.

vcos

The vcos command has two useful subcommands:

  • version shows the build date and version of the firmware on VideoCore

  • log status displays the error log status for various VideoCore firmware regions

version

Displays the build date and version of the VideoCore firmware.

get_camera

Displays the enabled and detected status of the Raspberry Pi camera: 1 means yes, 0 means no. Although all firmware except the reduced version supports the camera, it must be enabled using raspi-config.

get_throttled

Returns the restricted status of the system. This is a bit pattern – a set bit indicates the following:

Bit Hex Value Meaning

0

0x1

Undervoltage detected

1

0x2

Arm frequency capped

2

0x4

Currently throttled

3

0x8

Software temperature limit activated

16

0x10000

Undervoltage detected

17

0x20000

Arm frequency capped detected

18

0x40000

Throttled

19

0x80000

Software temperature limit in effect

measure_temp

Returns the SoC temperature measured by its internal temperature sensor; on Raspberry Pi 4, measure_temp pmic returns the temperature of the PMIC.

measure_clock [clock]

This will return the current frequency of the specified clock. Options include:

Clock Description

arm

ARM core

core

GPU core

h264

H.264 block

isp

Image sensor pipeline

v3d

3D block

uart

UART

pwm

PWM module (analog audio output)

emmc

SD card interface

pixel

Pixel

vec

Analog video encoder

hdmi

HDMI

dpi

Display parallel interface

For example: vcgencmd measure_clock arm

measure_volts [block]

Displays the current voltage used by the specific module.

Block Description

core

VC4 core voltage

sdram_c

SDRAM core voltage

sdram_i

SDRAM I/O voltage

sdram_p

SDRAM physical voltage

otp_dump

Displays the contents of the OTP (one-time programmable) memory inside the SoC. These are 32-bit values, indexed from 8 to 64. For more details, refer to the OTP page.

get_config [configuration item|int|str]

Displays the value of the specified configuration setting: alternatively, specify int (integer) or str (string) to see all configuration items of a given type. For example:

vcgencmd get_config total_mem

Returns the total memory on the device (in MB).

get_mem type

Reports the amount of memory addressable by ARM and GPU. vcgencmd get_mem arm shows the usage of memory addressable by ARM; vcgencmd get_mem gpu shows the usage of memory addressable by GPU. Note that on devices with more than 1GB of memory, the arm parameter will always return 1GB minus the gpu memory value, as the GPU firmware only knows about the first 1GB of memory. For an accurate report of total memory on the device, refer to the get_config section for the configuration item total_mem.

codec_enabled [type]

Reports whether the specified codec type is enabled. Possible type options are AGIF, FLAC, H263, H264, MJPA, MJPB, MJPG, MPG2, MPG4, MVC0, PCM, THRA, VORB, VP6, VP8, WMV9, WVC1. Those highlighted currently require a paid license (for more information, see the config.txt section), but this is not the case on Raspberry Pi 4 and 400, where these hardware codecs are disabled in favor of software decoding that does not require a license. Note that the H.265 hardware block on Raspberry Pi 4 and 400 is not part of the VideoCore GPU, and its status cannot be accessed via this command.

get_lcd_info

Displays the resolution and color depth of any attached displays.

mem_oom

Displays statistics about any OOM (out of memory) events that have occurred in the VideoCore memory space.

mem_reloc_stats

Displays statistics from the relocatable memory allocator on VideoCore.

read_ring_osc

Returns the current speed, voltage, and temperature of the ring oscillator.

hdmi_timings

Displays the current HDMI timing settings. For details on return values, see Video configuration.

dispmanx_list

Dumps the list of all dispmanx items currently being displayed.

display_power [0 | 1 | -1] [display]

Displays the current display power state, or sets the display power state. vcgencmd display_power 0 will turn off the power to the current display. vcgencmd display_power 1 will turn on the power to the display. If no parameters are set, the current power state will be displayed. The last parameter is an optional display ID returned by tvservice -l or from the table below, allowing you to turn on or off a specific display. Note that for the 7-inch Raspberry Pi touchscreen, this just turns the backlight on and off. The touch functionality continues to work normally.

vcgencmd display_power 0 7 will turn off the power to display ID 7, which is HDMI 1 on Raspberry Pi 4.

Display ID

Main LCD

0

Secondary LCD

1

HDMI 0

2

Composite

3

HDMI 1

7

To determine if a specific display ID is on or off, use -1 as the first parameter.

vcgencmd display_power -1 7 will return 0 if display ID 7 is off; it will return 1 if display ID 7 is on; it will return -1 if display ID 7 is in an unknown state (e.g., not detected).

Leave a Comment