Skip to content

raspinfo: Fix camera listing and vcgencmd errors on current images - #218

Merged
popcornmix merged 3 commits into
raspberrypi:masterfrom
YORROY123:raspinfo-pi5-gencmd
Oct 13, 2026
Merged

popcornmix merged 3 commits into
raspberrypi:masterfrom
YORROY123:raspinfo-pi5-gencmd

Conversation

@YORROY123

Copy link
Copy Markdown
Contributor

raspinfo prints Command not registered twice on a Pi 5, and on current images it never lists cameras on any model.

  • Camera section: libcamera-hello was renamed rpicam-hello, and trixie images ship only the new name. raspinfo therefore always fell back to vcgencmd get_camera, which Pi 5 firmware does not register. It now tries rpicam-hello --list first and keeps libcamera-hello --list for older images. It calls get_camera only if the firmware lists it.
  • Videocore section: mem_reloc_stats is called only when vcgencmd commands lists it. As noted in vcgencmd mem_reloc_status: "Command not registered" #137, Pi 5 has no relocatable heap.

A small vcgencmd_has() helper checks vcgencmd commands and matches whole words, so get does not match get_config.

Tested on a Pi 5 Rev 1.1, trixie, raspinfo 20260626-1:

  • Command not registered: 2 -> 0.
  • The camera section shows No cameras available! (no camera attached).
  • The rest of the output is identical apart from counters and timestamps.
  • sh -n passes.

Fixes #39
Fixes #137

libcamera-hello was renamed rpicam-hello, and current images only ship
the new name. raspinfo therefore never listed cameras and fell back to
"vcgencmd get_camera", which Pi 5 firmware does not register, printing
"Command not registered" instead of camera information.

Prefer rpicam-hello, keep libcamera-hello for older images, and only
call get_camera and mem_reloc_stats when the firmware registers them
(Pi 5 has no relocatable heap, so mem_reloc_stats does not exist).

Fixes raspberrypi#39, fixes raspberrypi#137.

Signed-off-by: Roy <rongh7426@gmail.com>
@popcornmix

Copy link
Copy Markdown
Contributor

Thanks looks fine.

When testing I noticed the regex on the EEPROM section missed pi500 and cm5.
Perhaps you could add that fix? One suggestion that may be more robust is to use
grep -q bcm2712 /proc/device-tree/compatible

The revision-code regex only matches board types 0x11, 0x13, 0x14, 0x15
and 0x17, so Pi 500 (0x19) and CM5 (0x18) never reported their
bootloader EEPROM. Also match any board whose device tree is compatible
with bcm2712, which covers every current and future BCM2712 board, and
keep the regex for the Pi 4 family.

Signed-off-by: Roy <rongh7426@gmail.com>
@YORROY123

Copy link
Copy Markdown
Contributor Author

Thanks for testing. Added in b8dd07a: the EEPROM section now also runs when /proc/device-tree/compatible contains bcm2712, as you suggested. I kept the revision-code regex so the Pi 4 family (BCM2711) still matches.

Checked on the Pi 5 (EEPROM section shown as before), and with fake cpuinfo/compatible files for the other cases:

Board Revision Before After
CM5 d04180 skipped shown
Pi 500 d04190 skipped shown
Pi 5 d04170 shown shown
Pi 4 c03114 shown shown
Pi 3B+ a020d3 skipped skipped

@YORROY123

Copy link
Copy Markdown
Contributor Author

Also confirmed on real CM5 hardware (Compute Module 5 Rev 1.0, revision c04180, packaged raspinfo 20251120-1):

Version EEPROM section Exit code
packaged /usr/bin/raspinfo missing 0
b8dd07a present 0

With b8dd07a the section shows the rpi-eeprom-update output as expected:

EEPROM
------

BOOTLOADER: up to date
   CURRENT: 2026-05-11 11:20:02 UTC (1778498402)
    LATEST: 2025-11-05 17:37:18 UTC (1762364238)
   RELEASE: default (/usr/lib/firmware/raspberrypi/bootloader-2712/default)

@popcornmix

Copy link
Copy Markdown
Contributor

I'd drop the regex and use bcm2711 in compatible for Pi4 family (and bcm2712 for pi5).

Match bcm2711 (Pi 4, Pi 400, CM4) or bcm2712 (Pi 5, Pi 500, CM5) in
/proc/device-tree/compatible and drop the revision-code regex.

Signed-off-by: Roy <rongh7426@gmail.com>
@YORROY123

Copy link
Copy Markdown
Contributor Author

Done in 8b71871: the regex is gone, and the EEPROM section now runs when compatible contains bcm2711 or bcm2712.

Checked on the Pi 5 (section shown, sh -n clean), and with fake compatible files: CM5, Pi 500, Pi 5, Pi 4, Pi 400 and CM4 show the section; Pi 3B+ and Pi Zero W skip it.

@popcornmix
popcornmix merged commit 3ca3e98 into raspberrypi:master Oct 13, 2026
@popcornmix

Copy link
Copy Markdown
Contributor

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

vcgencmd mem_reloc_status: "Command not registered" raspinfo on a Pi 5 gives vcgencmd errors

2 participants