VCGENCMD(1)

πŸ“¦
version 0-unstable-2024-12 Β· 2 versions
, in nixos 26.05, nixpkgs unstable

πŸ’… vcgencmd β€” the manual, but make it make sense

okay so bestie, you know how the Raspberry Pi has a whole GPU doing its thing behind the scenes? This is vcgencmd, a command line utility that can get various pieces of information from the VideoCore GPU on the Raspberry Pi. That's it. That's the whole vibe. It's your little walkie-talkie to the GPU πŸ‘‘βœ¨


🌸 SYNOPSIS 🌸

vcgencmd [-t] command [params]

vcgencmd -h
vcgencmd --help

πŸ¦‹ OPTIONS πŸ¦‹

  • -t β€” time how long the command takes to complete ⏱️ (yes, it's a stopwatch era)
  • -h, --help β€” show this information, i.e. the help text, i.e. the "what do I even do" moment 🫢

✨ COMMANDS ✨

so to get a list of all the commands that vcgencmd supports, just type vcgencmd commands. iconic move, honestly. Some of the more useful commands are described below πŸ‘‡

πŸŽ€ vcos sub-command

The vcos command has a number of sub-commands, like a little family:

  • version β€” displays the build date and version of the firmware on the VideoCore 🧚
  • log status β€” displays the error log status of the various VideoCore software areas πŸ“‹

πŸ“ version

Displays the build date and version of the firmware on the VideoCore. same energy as vcos version, different address πŸ’–

πŸ“· get_camera

Displays the enabled and detected state of the official camera. 1 means yes, 0 means no β€” no cap, that's the whole scale. Whilst all firmware (except cutdown versions) will support the camera, this support needs to be enabled by using the start_x boot option [BOOT]. so like, it can support it, but you gotta turn it on yourself, bestie πŸ’…

πŸ”₯ get_throttled

Returns the throttled state of the system. This is a bit pattern β€” a bit being set indicates the following meanings:

  • Bit 0 β€” Under-voltage detected
  • Bit 1 β€” Arm frequency capped
  • Bit 2 β€” Currently throttled
  • Bit 3 β€” Soft temperature limit active
  • Bit 16 β€” Under-voltage has occurred
  • Bit 17 β€” Arm frequency capping has occurred
  • Bit 18 β€” Throttling has occurred
  • Bit 19 β€” Soft temperature limit has occurred

A value of zero indicates that none of the above conditions is true. zero = no drama 🌈

To find if one of these bits has been set, convert the value returned to binary, then number each bit along the top. You can then see which bits are set. For example:

0x50000 = 0101 0000 0000 0000 0000

Adding the bit numbers along the top we get:

19   18   17   16   15   14   13   12   11   10   9   8   7   6   5   4   3   2   1
 0    1    0    1    0    0    0    0    0    0   0   0   0   0   0   0   0   0   0

From this we can see that bits 18 and 16 are set, indicating that the Pi has previously been throttled due to under-voltage, but is not currently throttled for any reason. so like, it was going through it, but it's fine now 😭🫢

🌑️ measure_temp

Returns the temperature of the SoC as measured by the on-board temperature sensor. is it hot in here or is it just the SoC ✨

⏰ measure_clock clock

This returns the current frequency of the specified clock. The options are:

  • arm β€” ARM cores
  • core β€” VC4 scaler cores
  • h264 β€” H.264 block
  • isp β€” Image Signal Processor
  • v3d β€” 3D block
  • uart β€” UART
  • pwm β€” PWM block (analog audio output)
  • emmc β€” SD card interface
  • pixel β€” Pixel valve
  • vec β€” Analog video encoder
  • hdmi β€” HDMI
  • dpi β€” Display Peripheral Interface

For example, vcgencmd measure_clock arm. easy πŸ’–

⚑ measure_volts block

Displays the current voltages used by the specific block.

  • core β€” VC4 core voltage
  • sdram_c
  • sdram_i
  • sdram_p

(the sdram ones don't get a description in the source, so we're not inventing one, bestie β€” we respect the source πŸ™ˆ)

πŸ”’ otp_dump

Displays the content of the One Time Programmable (OTP) memory, which is part of the SoC. These are 32 bit values, indexed from 8 to 64. See the raspi-otp(7) for more details. one time means one time, no redo πŸŽ€

🧠 get_mem type

Reports on the amount of memory allocated to the ARM cores with vcgencmd get_mem arm or the VC4 with vcgencmd get_mem gpu.

Note: On a Raspberry Pi 4 with greater than 1GB of RAM, the arm option is inaccurate. This is because the GPU firmware which implements this command is only aware of the first gigabyte of RAM on the system, so the arm setting will always return 1GB minus the gpu memory value. To get an accurate report of the amount of ARM memory, use one of the standard Linux commands, such as free or cat /proc/meminfo. πŸ’€ like it's lying to you but lovingly

🎬 codec_enabled type

Reports whether the specified CODEC type is enabled. Possible options for type are AGIF, FLAC, H263, H264, MJPA, MJPB, MJPG, MPG2, MPG4, MVC0, PCM, THRA, VORB, VP6, VP8, WMV9, WVC1.

MPG2, WMV9, and WVC1 currently require a paid for licence (see the [FAQ] for more info), except on the Pi4, where these hardware codecs are disabled in preference to software decoding, which requires no licence. Note that because the H265 hardware block on the Raspberry Pi4 is not part of the VideoCore GPU, its status is not accessed via this command. πŸ’Έ yes some of these cost money, and yes, the Pi4 said "we do it in software now" πŸ’…

βš™οΈ get_config type|name

This returns all the configuration items of the specified type that have been set in config.txt, or a single configuration item. Possible values for the type parameter are int, str, or simply use the name of the configuration item. your call, main character 🫢

πŸ–₯️ get_lcd_info

Displays the resolution and colour depth of any attached display. pretty pixels, quantified ✨

πŸ’₯ mem_oom

Displays statistics on any Out Of Memory events occuring in the VC4 memory space. (yes, "occuring" β€” that's how the source spells it, we don't fix, we don't touch, we respect 😌)

πŸ“¦ mem_reloc_stats

Displays statistics from the relocatable memory allocator on the VC4.

🌊 read_ring_osc

Returns the curent speed voltage and temperature of the ring oscillator. (again: "curent" is the source's spelling, iykyk πŸ™ˆ)

πŸ“Ί hdmi_timings

Displays the current HDMI settings timings. See [VIDEO] for details of the values returned.

πŸͺŸ dispmanx_list

Dump a list of all dispmanx items currently being displayed. dump it, queen πŸ‘‘

πŸ”Œ display_power 0|1|-1

πŸ”Œ display_power 0|1|-1 display

Show current display power state, or set the display power state.

  • vcgencmd display_power 0 will turn off power to the current display.
  • vcgencmd display_power 1 will turn on power to the display.
  • If no parameter is set, this will display the current power state.

The final parameter is an optional display ID, as returned by tvservice -l or from the table below, which allows a specific display to be turned on or off.

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

  • Display Main LCD β€” ID 0
  • Display Secondary LCD β€” ID 1
  • Display HDMI 0 β€” ID 2
  • Display Composite β€” ID 3
  • Display HDMI 1 β€” ID 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, 1 if display ID 7 is on, or -1 if display ID 7 is in an unknown state, for example undetected. three possible answers, pick your fighter πŸŽ€


πŸšͺ EXIT STATUS πŸšͺ

  • 0 β€” Command completed successfully πŸŽ‰ slay
  • -1 β€” Problem with VHCI 😬
  • -2 β€” VideoCore returned an error πŸ’€

πŸ‘€ SEE ALSO πŸ‘€


okay bestie that's the whole page 🫢 it's vcgencmd(1) out of the General Commands Manual, and that little VCGENCMD(1) tag down at the bottom is just the page's footer/source marker doing its thing. go forth and query that VideoCore, you icon πŸ’–πŸŽ€βœ¨

πŸ“¦ where this page comes from