Skip to content

Instantly share code, notes, and snippets.

View Gnurou's full-sized avatar

Alexandre Courbot Gnurou

View GitHub Profile
@Gnurou
Gnurou / Kexec for ARM
Created October 28, 2013 03:34
Cross-compiling Kexec for ARM, how-to.
./bootstrap
LDFLAGS=-static ./configure --host=arm-none-linux-gnueabi --without-zlib --without-lzma
make
-> static binary in build/sbin/kexec
@Gnurou
Gnurou / captest.c
Last active June 16, 2022 09:47
Test program demonstrating the V4L2 request API on a capture device (vivid)
/*
* This program illustrates how the V4L2 request API can be used on a capture
* device, using the vivid driver. It must be invoked with the path to the vivid
* capture device as parameter, e.g.
*
* $ ./captest /dev/videoX
*
* NB_CAPTURES of decreasing brightness are then scheduled on the capture device,
* then saved to disk as captureX.rgb. The request API is used to confirm that
* the captures have been performed using the expected brightness, and the
@Gnurou
Gnurou / kdev_kernel.py
Last active January 24, 2019 14:06
Convert Linux kernel config into Kdevelop macro defines
#!/usr/bin/env python3
import sys
import os
import re
r = re.compile('\#define (\w+) (.+)')
f = open(os.path.join(sys.argv[1], 'include/generated/autoconf.h'))
@Gnurou
Gnurou / SHIELD loopback initramfs script
Last active October 31, 2018 08:42
A minimal /init script for a Busybox initramfs that mounts a loopback device file from SHIELD's data partition as root and continue booting from it. It allows to have a non-intrusive Linux installation along with Android on SHIELD.
#!/bin/sh
mkdir /proc
mkdir /sys
mkdir /d
/bin/mount /proc
/bin/mount /sys
echo /sbin/mdev >/proc/sys/kernel/hotplug
mdev -s
mkdir /roothost
mkdir /newroot
@Gnurou
Gnurou / m2mtest.c
Last active April 17, 2018 04:17
Test program demonstrating the V4L2 request API on a codec device (vim2m)
/*
* This program is a very simple demonstration of the proposed V4L2 request API.
* It must be invoked with the path to the vim2m device as parameter, e.g.
*
* $ ./m2mtest /dev/videoX /dev/mediaX
*
* It performs the following:
* * open the vim2m and media devices, allocate buffers and requests
* * submit a first request with a processing time of 600 ms
* * submit a second request with a processing time of 2000 ms
@Gnurou
Gnurou / gist:dbc3776ed97ea7d4ce6041ea15eb0438
Last active January 31, 2018 10:20
Request API simple test program
/*
* This program is a very simple demonstration of the proposed V4L2 request API.
* It must be invoked with the path to the vim2m device as parameter, e.g.
*
* $ ./m2mtest /dev/videoX
*
* It performs the following:
* * open the vim2m and /dev/media0 devices, allocate buffers and requests
* * submit a first request with a processing time of 600 ms
* * submit a second request with a processing time of 2000 ms
https://trac.ffmpeg.org/wiki/Debug/MacroblocksAndMotionVectors
Show motion vectors in real time:
ffplay -flags2 +export_mvs -vf codecview=mv=pf+bf+bb video.avi
Show only keyframes:
ffplay -vf select="eq(pict_type\,PICT_TYPE_I)" video.avi

Keybase proof

I hereby claim:

  • I am Gnurou on github.
  • I am gnurou (https://keybase.io/gnurou) on keybase.
  • I have a public key whose fingerprint is 3A5A 6608 87D9 EC34 D662 FB27 04B0 8C8F 1524 FAF8

To claim this, I am signing this object:

@Gnurou
Gnurou / gist:a21e1ec65ce01aa89d390879e9763bf8
Created October 28, 2016 03:39
Pixel C override keyboard mappings
Everything needed is explained here:
https://source.android.com/devices/input/key-character-map-files.html
https://source.android.com/devices/input/key-layout-files.html
Put the files in /data/system/devices/.../DEVICE_NAME so they survive system updates.
@Gnurou
Gnurou / gist:749930267e2ca4bc290b
Last active September 9, 2016 02:53
How to compile glmark2 under Linux/ARM with a special prefix
./waf configure --with-flavors=drm-gl,drm-glesv2,wayland-gl,wayland-glesv2,x11-gl,x11-glesv2 --prefix=/opt/nouveau
./waf
./waf install
Compile issues? http://lists.freedesktop.org/archives/wayland-devel/2013-April/008497.html