Skip to content

ThingLabsOSS/peek-carthing

Repository files navigation

peek-carthing — hardware inventory for the Spotify Car Thing

Drop-in tool that produces a single JSON document describing the hardware state of a running Car Thing — SoC, eMMC, panel, GPU, display pipeline, I²C bus, IIO, DRM, the lot.

Works as long as the device has ADB enabled (a community firmware mod on retail units).

Two flavors:

flavor what you get typical size
full (peek_mmio.ko + peek-collect.py) everything readable on the device ~275 KB JSON
slim (peek_mmio_slim.ko + peek-slim.py) GPU + display + eMMC + serials + panel ID + board revision ~45 KB JSON (4 KB gzipped)

For the nitty gritty — building, the module-CRC trick, every MMIO block, the panel-probe internals, compact/gzip modes, known limitations — see DETAILS.md.

Quick start (pre-built)

# fetch from the latest release
gh release download --repo ThingLabsOSS/peek-carthing \
    --pattern '*.ko' --pattern '*.py'

# full flavor
adb push peek_mmio.ko peek-collect.py /tmp/
adb shell python3 /tmp/peek-collect.py > hwinfo.json

# slim flavor (smaller / faster / includes panel probe)
adb push peek_mmio_slim.ko peek-slim.py /tmp/
adb shell python3 /tmp/peek-slim.py > hwinfo-slim.json
# add --compact for 20 KB, --gzip for 4 KB

The kmod is one-shot: insmod returns -EBUSY by design and the script re-parses dmesg on subsequent runs. Re-running across boots is fine.

Quick-look stats from the JSON

# full
jq '.soc.midr_decoded.part, .thermal.zones[].temp_c' hwinfo.json
jq '.kmod_mmio.sections | keys' hwinfo.json
jq '.kmod_mmio.sections["VPU near-ENCL (display timing block) @ 0xff907000 (1280 B)"].panel_timing' hwinfo.json

# slim
jq '.panel_id.probe.variant, .serials.canonical' hwinfo-slim.json
jq '.board_rev.saradc.rev_channel' hwinfo-slim.json
jq '.emmc.userspace.hosts[0].cards[0] | {name, manfid, date}' hwinfo-slim.json

Project layout

peek-carthing/
├── peek_mmio.c          — kmod (full)
├── peek_mmio_slim.c     — kmod (slim)
├── peek_carthing.c      — alt kmod for mainline kernel use
├── peek-collect.py      — full aggregator
├── peek-slim.py         — slim aggregator + TLSC6X panel probe
├── peek-userspace.sh    — older plain-text dumper
├── force_insmod.c       — finit_module wrapper (reference)
├── Makefile             — builds both peek_mmio.ko + peek_mmio_slim.ko
├── Makefile.full        — full peek_carthing.ko build
├── Makefile.mmio        — legacy peek_mmio.ko-only build
├── findings.md          — notes on what the JSON reveals
├── DETAILS.md           — build / internals / per-section details
└── README.md            — this file

License

GPL-2.0. Uses kernel-internal APIs that require GPL.

About

Deep hardware inventory tool for the Spotify Car Thing — kernel module + JSON-producing userspace aggregator. Pulls live MMIO state (HHI, VPU/ENCL, DSI, Mali GPU, eMMC, audio bus, DDR) that CONFIG_DEVMEM=n on stock kernel locks out, plus sysfs/proc walk.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors