Skip to content

Instantly share code, notes, and snippets.

View kbingham's full-sized avatar

Kieran Bingham kbingham

View GitHub Profile
@kbingham
kbingham / Makefile
Last active April 1, 2024 11:38
My Generic Makefile.Useful for creating a simple build for a single target from a set of c files.This could extended to provide support for other languages, or cross compilations.Let me know if you find this useful, or make any useful (generic) updates that are worth sharing.
# Kierans Generic Makefile
# www.kieranbingham.co.uk
# Default to build with multiple instances for speed
MAKEFLAGS =+ -j
# Beware, This will create this application
# binary based on the current directory name.
TARGET := $(shell basename `pwd`)
@kbingham
kbingham / uvc-gadget.sh
Created May 15, 2018 08:18
UVC ConfigFS Gadget configuration tool
#!/bin/sh
set -e
#set -x
CONFIGFS="/sys/kernel/config"
GADGET="$CONFIGFS/usb_gadget"
VID="0x0525"
PID="0xa4a2"
SERIAL="0123456789"
FROM debian:bullseye
ENV DEBIAN_FRONTEND noninteractive
ENV LANG='C.UTF-8' LC_ALL='C.UTF-8'
# Support multiarch builds to perform cross compilation
# https://wiki.debian.org/Multiarch/HOWTO
RUN dpkg --add-architecture arm64
# Expected system requirements
@kbingham
kbingham / dmesg-diff
Last active December 22, 2023 09:30
If you need to 'diff' two dmesg files, you will find that the timestamps cause diff-noise. Remove the timestamps so that you get to the underlying diff.
#!/bin/bash
# dmesg-diff
# Kieran Bingham 2016
# Public Domain
#
# Strip out Linux Kernel timestamps when performing a diff on two dmesg files
#
# Initial version as proof-of-concept, but already useful.
# This could be extended to parse extra flags for diff for example
@kbingham
kbingham / check-v4l2-sensor-compatibility.awk
Created April 20, 2023 14:28
Check for keywords in a V4L2 Subdevice driver
#!/usr/bin/awk -f
function initialiseControls(ids, keys, controls)
{
split(ids, keys)
for (i in keys) {
controls[keys[i]] = "--------"
# Track the maximum key length
len = length(keys[i])
From 3507214a30a9b615faf7d0998defdde69864f386 Mon Sep 17 00:00:00 2001
From: Kieran Bingham <kieran.bingham@ideasonboard.com>
Date: Sun, 30 Oct 2022 22:12:38 +0000
Subject: [PATCH] gstreamer: provider: Support builds with
GST_DISABLE_GST_DEBUG
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
When the host system packages gstreamer with GST_DISABLE_GST_DEBUG defined, the
@kbingham
kbingham / lcdebug
Created September 26, 2022 15:27
lcdebug - helper to debug libcamera
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0-or-later
# Support debugging libcamera commands and applications.
# We default to enabling the most debug
# (that's why we're being used right)
FILTER="*"
LEVEL="0"
@kbingham
kbingham / check-v4l2-sensor-compatibility.awk
Created February 25, 2022 11:02
Quick tool to help reviewing Camera Sensor drivers in linux-media to support libcamera requirements
#!/usr/bin/awk -f
function initialiseControls(ids, keys, controls)
{
split(ids, keys)
for (i in keys) controls[keys[i]] = "--------"
}
BEGIN {
print "Processing " ARGV[1]
for m in /sys/bus/media/devices/media*;
do
mn=`basename $m`
model=`cat $m/model`
echo $mn: $model
done | sort -V;
[bindings]
G = call hooks.getmail(ui)