Skip to content

Instantly share code, notes, and snippets.

Avatar

坂本 貴史 takaswie

View GitHub Profile
@takaswie
takaswie / dump-offset-and-size.c
Last active Oct 7, 2021
ABI compatibility test for asound.h in regards of snd_pcm_mmap_control
View dump-offset-and-size.c
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <stdint.h>
#define __user
#include "path-to-include/uapi/sound/asound.h"
#if defined(PREVIOUS)
@takaswie
takaswie / pcm-rw-interleaved.c
Last active Jul 29, 2021
ALSA PCM application to utilize intermediate buffer inner kernel space
View pcm-rw-interleaved.c
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <stdint.h>
#include <limits.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
@takaswie
takaswie / parse.py
Last active Dec 25, 2020
parser for 'perf.data.script.211220202054.txt'
View parse.py
#!/usr/bin/env python3
from sys import argv
from re import compile, search
records = []
with open(argv[1], 'r') as f:
record = []
for line in f.readlines():
@takaswie
takaswie / avid-trx.py
Last active Sep 17, 2020
Avid Adlenarine asynchronous protocol
View avid-trx.py
#!/usr/bin/env python3
# SPDX-License-Identifier: GPL-3.0-or-later
# Copyright (c) 2020 Takashi Sakamoto
import gi
gi.require_version('GLib', '2.0')
gi.require_version('Hinawa', '3.0')
from gi.repository import GLib, Hinawa
@takaswie
takaswie / install-signal-handler.rs
Created Dec 6, 2019
A Rust sample to install signal handler to quit event loop.
View install-signal-handler.rs
extern crate nix;
extern crate libc;
use nix::sys::signal;
use std::sync::atomic::{AtomicBool, Ordering};
static RUNNING: AtomicBool = AtomicBool::new(false);
extern "C" fn handle(_: libc::c_int, _: *mut libc::siginfo_t,
_: *mut libc::c_void) {
@takaswie
takaswie / async-op.c
Created Apr 5, 2019
A sample of async operation of GLib.
View async-op.c
#include <glib.h>
#include <glib-object.h>
#include <gio/gio.h>
#include <stdio.h>
#include <stdlib.h>
typedef int CakeFlavor;
typedef int CakeFrostingType;
@takaswie
takaswie / pcm-capture-threshold-test.c
Created Oct 29, 2018
pcm-capture-threshold-test.c
View pcm-capture-threshold-test.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <poll.h>
#include <alsa/asoundlib.h>
@takaswie
takaswie / sample.py
Last active Oct 7, 2018
A sample Python 3 script for a new SndTscm object for new features of firewire-tascam driver
View sample.py
#!/usr/bin/env python3
from sys import exit
from time import sleep
import gi
gi.require_version('Hinawa', '2.0')
from gi.repository import Hinawa
unit = Hinawa.SndTscm()
@takaswie
takaswie / onemix-entries.txt
Created Aug 13, 2018
Output of efibootmgr on One Mix
View onemix-entries.txt
BootCurrent: 0006
Timeout: 1 seconds
BootOrder: 0006,0000,0002,0005
Boot0000* Windows Boot Manager HD(1,GPT,fcfdba89-71af-4068-8a6c-ed765606a95e,0x800,0x32000)/File(\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1.-.f.3.2.b.3.4.4.d.4.7.9.5.}....................
Boot0002* Other Boot Item HD(5,GPT,048e20ad-0f20-42d4-a1b4-1fd64e84200c,0xe735800,0x1c2000)/File(\EFI\BOOT\BOOTX64.EFI)
Boot0005* UEFI: Built-in EFI Shell VenMedia(5023b95c-db26-429b-a648-bd47664c8012)..BO
Boot0006* UEFI: 1.00, Partition 1 PciRoot(0x0)/Pci(0x14,0x0)/USB(7,0)/HD(1,MBR,0x663eb4c4,0x3906b4,0x1240)..BO
View focusrite-saffire_pro_26.log
{'router': {'is-exposed': True, 'is-readonly': False, 'is-storable': True, 'maximum-routes': 128}, 'mixer': {'is-exposed': True, 'is-readonly': False, 'is-storable': True, 'input-device-id': 2, 'output-device-id': 2, 'input-channels': 18, 'output-channels': 16}, 'general': {'dynamic-stream-conf': True, 'available-storage': True, 'available-peak': True, 'maximum-tx-streams': 2, 'maximum-rx-streams': 2, 'storable-stream-conf': True, 'asic_type': 'TCD-2220'}, 'reserved': bytearray(b'\x00\x00\x00\x00')}
0 {'peak': 0, 'src-blk': 'ins0', 'src-ch': 0, 'dst-blk': 'avs-0', 'dst-ch': 0}
1 {'peak': 0, 'src-blk': 'ins0', 'src-ch': 1, 'dst-blk': 'avs-0', 'dst-ch': 1}
2 {'peak': 0, 'src-blk': 'ins0', 'src-ch': 2, 'dst-blk': 'avs-0', 'dst-ch': 2}
3 {'peak': 0, 'src-blk': 'ins0', 'src-ch': 3, 'dst-blk': 'avs-0', 'dst-ch': 3}
4 {'peak': 0, 'src-blk': 'ins0', 'src-ch': 4, 'dst-blk': 'avs-0', 'dst-ch': 4}
5 {'peak': 0, 'src-blk': 'ins0', 'src-ch': 5, 'dst-blk': 'avs-0', 'dst-ch': 5}
6 {'peak': 0, 'src-blk': 'aes', 'src-ch': 4,