interplane.Get Omega
Read in your language

aienux

Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.

Brought by drakestapleton

branch main Branches Tags History

aienux / scripts / ck_chirp_test.sh

27 lines · 1277 bytes Raw Blame History
1#!/bin/sh
2# ck_chirp_test.sh -- host test of the startup sound (native/kernel/ui/chirp.c),
3# the gravitational-wave chirp timed to the night sky of the startup.
4# 1. Silent while the stars come out and after the end; both channels
5# the same; the loudest sample at the peak level; no step big enough to
6# click.
7# 2. Loudness comes in as the black holes appear, only rises to the merger,
8# peaks there and fades in tens of milliseconds.
9# 3. Pitch is steady while the holes circle, only rises in the spiral, reaches the top
10# in the last 60 ms; the pitch heard (zero crossings) matches.
11# 4. Frames worked out in any order give the same sound.
12# The sound lands in target/native-kernel-chirp/chirp.wav for a person to
13# listen to. Hosted only. Ends with "AIENOS_CHIRP: PASS" or
14# "AIENOS_CHIRP: FAIL <why>".
15set -u
16cd "$(dirname "$0")/.."
17K=native/kernel
18OUT=target/native-kernel-chirp
19W=$(mktemp -d "${TMPDIR:-/tmp}/ck_chirp.XXXXXX")
20trap 'rm -rf "$W"' EXIT
21fail() { echo "AIENOS_CHIRP: FAIL $*"; exit 1; }
22CC=${HOSTCC:-cc}
23mkdir -p "$OUT"
24$CC -std=c11 -O2 -Wall -Wextra -Werror -o "$W/test" $K/ui/tests/chirp_test.c $K/ui/chirp.c || fail "test does not build"
25"$W/test" "$OUT" || fail "sound checks"
26echo "sound: $OUT/chirp.wav"
27echo "AIENOS_CHIRP: PASS"