Skip to content

fix: use low-latency signalsmith config instead of presetDefault #470

fix: use low-latency signalsmith config instead of presetDefault

fix: use low-latency signalsmith config instead of presetDefault #470

Workflow file for this run

name: Build rPi Bare Metal Looper
on:
push:
branches: [master]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
env:
RASPPI: 4
AARCH: 32
steps:
- name: Install toolchain, make, and ccache
run: sudo apt-get install -y make gcc-arm-none-eabi ccache
- name: Clone rsta2/circle
run: git clone --depth=1 https://github.com/rsta2/circle circle
- name: Clone circle-prh into circle/_prh
run: git clone --depth=1 https://github.com/phorton1/circle-prh circle/_prh
- name: Checkout looper into circle/_prh/_apps/Looper
uses: actions/checkout@v4
with:
path: circle/_prh/_apps/Looper
- name: Compute cache key for libraries
id: cache-key
run: |
CIRCLE_HASH=$(find circle -type f -name "*.h" -o -name "*.cpp" | sort | xargs cat | md5sum | cut -d' ' -f1)
PATCHES_HASH=$(find circle/_prh/_apps/Looper/patches -type f | sort | xargs cat | md5sum | cut -d' ' -f1)
CACHE_KEY="circle-libs-${CIRCLE_HASH:0:8}-${PATCHES_HASH:0:8}"
echo "key=$CACHE_KEY" >> $GITHUB_OUTPUT
- name: Restore cached libraries
uses: actions/cache@v3
id: cache-restore
with:
path: |
circle/lib/libcircle.a
circle/lib/fs/libfs.a
circle/lib/input/libinput.a
circle/lib/sched/libsched.a
circle/lib/usb/libusb.a
circle/lib/usb/gadget/libusbgadget.a
circle/lib/net/libnet.a
circle/addon/fatfs/libfatfs.a
circle/addon/SDCard/libsdcard.a
circle/addon/wlan/libwlan.a
circle/_prh/utils/lib_my_utils.a
circle/_prh/audio/libaudio.a
key: ${{ steps.cache-key.outputs.key }}
restore-keys: circle-libs-
- name: Apply patches
run: |
ln -sf bcm_pcm.h circle/_prh/audio/BCM_PCM.h
cp circle/_prh/_apps/Looper/patches/miniuart.cpp circle/_prh/utils/miniuart.cpp
cp circle/_prh/_apps/Looper/patches/AudioTypes.h circle/_prh/audio/AudioTypes.h
cp circle/_prh/_apps/Looper/patches/audio_Makefile circle/_prh/audio/Makefile
cp circle/_prh/_apps/Looper/patches/utils_Makefile circle/_prh/utils/Makefile
cp circle/_prh/_apps/Looper/patches/input_usb.h circle/_prh/audio/input_usb.h
cp circle/_prh/_apps/Looper/patches/input_usb.cpp circle/_prh/audio/input_usb.cpp
cp circle/_prh/_apps/Looper/patches/output_usb.h circle/_prh/audio/output_usb.h
cp circle/_prh/_apps/Looper/patches/output_usb.cpp circle/_prh/audio/output_usb.cpp
cp circle/_prh/_apps/Looper/patches/usbaudiodevice.h circle/_prh/audio/usbaudiodevice.h
cp circle/_prh/_apps/Looper/patches/usbaudiodevice.cpp circle/_prh/audio/usbaudiodevice.cpp
cp circle/_prh/_apps/Looper/patches/usbmidihost.cpp circle/lib/usb/usbmidihost.cpp
cp circle/_prh/_apps/Looper/patches/usbconfigparser.cpp circle/lib/usb/usbconfigparser.cpp
cp circle/_prh/_apps/Looper/patches/usbdevice.cpp circle/lib/usb/usbdevice.cpp
cp circle/_prh/_apps/Looper/patches/usbaudiodevice.h circle/lib/usb/usbaudiodevice.h
cp circle/_prh/_apps/Looper/patches/usbaudiodevice.cpp circle/lib/usb/usbaudiodevice.cpp
cp circle/_prh/_apps/Looper/patches/usbdevicefactory.cpp circle/lib/usb/usbdevicefactory.cpp
cp circle/_prh/_apps/Looper/patches/usb_Makefile circle/lib/usb/Makefile
cp circle/_prh/_apps/Looper/patches/AudioSystem.cpp circle/_prh/audio/AudioSystem.cpp
cp circle/_prh/_apps/Looper/patches/std_kernel_stub.h circle/_prh/system/std_kernel.h
cp circle/_prh/_apps/Looper/patches/kernel.h circle/_prh/_apps/Looper/kernel.h
cp circle/_prh/_apps/Looper/patches/kernel.cpp circle/_prh/_apps/Looper/kernel.cpp
cp circle/_prh/_apps/Looper/patches/kernel_run.cpp circle/_prh/_apps/Looper/kernel_run.cpp
cp circle/_prh/_apps/Looper/patches/multicore.cpp circle/_prh/_apps/Looper/multicore.cpp
cp circle/_prh/_apps/Looper/patches/main.cpp circle/_prh/_apps/Looper/main.cpp
cp circle/_prh/_apps/Looper/patches/p9chan.h circle/addon/wlan/p9chan.h
cp circle/_prh/_apps/Looper/patches/p9chan.cpp circle/addon/wlan/p9chan.cpp
cp circle/_prh/_apps/Looper/patches/dwusbgadgetendpoint.h circle/lib/usb/gadget/dwusbgadgetendpoint.h
cp circle/_prh/_apps/Looper/patches/dwusbgadgetendpoint.h circle/include/circle/usb/gadget/dwusbgadgetendpoint.h
cp circle/_prh/_apps/Looper/patches/dwusbgadgetendpoint.cpp circle/lib/usb/gadget/dwusbgadgetendpoint.cpp
cp circle/_prh/_apps/Looper/patches/dwusbgadgetendpoint0.cpp circle/lib/usb/gadget/dwusbgadgetendpoint0.cpp
cp circle/_prh/_apps/Looper/patches/dwusbgadget.cpp circle/lib/usb/gadget/dwusbgadget.cpp
cp circle/_prh/_apps/Looper/patches/usbaudiogadget.h circle/_prh/audio/usbaudiogadget.h
cp circle/_prh/_apps/Looper/patches/usbaudiogadget.cpp circle/_prh/audio/usbaudiogadget.cpp
cp circle/_prh/_apps/Looper/patches/usbaudiogadgetendpoint.h circle/_prh/audio/usbaudiogadgetendpoint.h
cp circle/_prh/_apps/Looper/patches/usbaudiogadgetendpoint.cpp circle/_prh/audio/usbaudiogadgetendpoint.cpp
cp circle/_prh/_apps/Looper/patches/input_otg.h circle/_prh/audio/input_otg.h
cp circle/_prh/_apps/Looper/patches/input_otg.cpp circle/_prh/audio/input_otg.cpp
cp circle/_prh/_apps/Looper/patches/output_otg.h circle/_prh/audio/output_otg.h
cp circle/_prh/_apps/Looper/patches/output_otg.cpp circle/_prh/audio/output_otg.cpp
sed -i 's|//#define ARM_ALLOW_MULTI_CORE|#define ARM_ALLOW_MULTI_CORE|' circle/include/circle/sysconfig.h
python3 circle/_prh/_apps/Looper/patches/patch_rules_mk.py
- name: Build circle libraries
if: steps.cache-restore.outputs.cache-hit != 'true'
run: |
export CC="ccache arm-none-eabi-gcc"
export CXX="ccache arm-none-eabi-g++"
ccache -z
make -C circle/lib RASPPI=4 AARCH=32 ARM_ALLOW_MULTI_CORE=1 -j4
make -C circle/lib/fs RASPPI=4 AARCH=32 ARM_ALLOW_MULTI_CORE=1 -j4
make -C circle/lib/input RASPPI=4 AARCH=32 ARM_ALLOW_MULTI_CORE=1 -j4
make -C circle/lib/sched RASPPI=4 AARCH=32 ARM_ALLOW_MULTI_CORE=1 -j4
make -C circle/lib/usb RASPPI=4 AARCH=32 ARM_ALLOW_MULTI_CORE=1 -j4
make -C circle/lib/usb/gadget RASPPI=4 AARCH=32 ARM_ALLOW_MULTI_CORE=1 -j4
make -C circle/lib/net RASPPI=4 AARCH=32 ARM_ALLOW_MULTI_CORE=1 -j4
make -C circle/addon/fatfs RASPPI=4 AARCH=32 ARM_ALLOW_MULTI_CORE=1 -j4
make -C circle/addon/SDCard RASPPI=4 AARCH=32 ARM_ALLOW_MULTI_CORE=1 -j4
make -C circle/addon/wlan RASPPI=4 AARCH=32 ARM_ALLOW_MULTI_CORE=1 -j4
- name: Download WiFi firmware
run: |
SHA=c9d3ae6584ab79d19a4f94ccf701e888f9f87a53
BASE=https://github.com/RPi-Distro/firmware-nonfree/raw/${SHA}/debian/config/brcm80211
mkdir -p circle/_prh/_apps/Looper/dist/firmware
wget -q -O circle/_prh/_apps/Looper/dist/firmware/brcmfmac43455-sdio.bin ${BASE}/cypress/cyfmac43455-sdio-minimal.bin
wget -q -O circle/_prh/_apps/Looper/dist/firmware/brcmfmac43455-sdio.txt ${BASE}/brcm/brcmfmac43455-sdio.txt
wget -q -O circle/_prh/_apps/Looper/dist/firmware/brcmfmac43455-sdio.clm_blob ${BASE}/cypress/cyfmac43455-sdio.clm_blob
- name: Generate embedded firmware
run: |
python3 circle/_prh/_apps/Looper/patches/gen_wlan_firmware.py \
circle/_prh/_apps/Looper/dist/firmware \
/tmp/wlan_firmware.S
arm-none-eabi-as -mcpu=cortex-a72 -mfpu=neon-fp-armv8 -mfloat-abi=hard \
-o circle/_prh/_apps/Looper/wlan_firmware.o \
/tmp/wlan_firmware.S
- name: Build circle-prh libraries
run: |
make -C circle/_prh/utils RASPPI=4 AARCH=32 ARM_ALLOW_MULTI_CORE=1 -j4
make -C circle/_prh/audio RASPPI=4 AARCH=32 LOOPER_USB_AUDIO=1 LOOPER_OTG_AUDIO=1 ARM_ALLOW_MULTI_CORE=1 -j4
- name: Save libraries to cache
if: steps.cache-restore.outputs.cache-hit != 'true'
uses: actions/cache/save@v3
with:
path: |
circle/lib/libcircle.a
circle/lib/fs/libfs.a
circle/lib/input/libinput.a
circle/lib/sched/libsched.a
circle/lib/usb/libusb.a
circle/lib/usb/gadget/libusbgadget.a
circle/lib/net/libnet.a
circle/addon/fatfs/libfatfs.a
circle/addon/SDCard/libsdcard.a
circle/addon/wlan/libwlan.a
circle/_prh/utils/lib_my_utils.a
circle/_prh/audio/libaudio.a
key: ${{ steps.cache-key.outputs.key }}
- name: Build Looper
timeout-minutes: 60
run: |
set -o pipefail
cp -r circle/_prh/_apps/Looper/patches/rubberband circle/_prh/_apps/Looper/
cp -r circle/_prh/_apps/Looper/patches/signalsmith circle/_prh/_apps/Looper/
make -C circle/_prh/_apps/Looper RASPPI=4 AARCH=32 LOOPER_USB_AUDIO=1 LOOPER_OTG_AUDIO=1 ARM_ALLOW_MULTI_CORE=1 CHECK_DEPS=0 -j4 2>&1 | tee /tmp/build_looper.log
- name: Show last build output on failure
if: failure()
run: tail -50 /tmp/build_looper.log || true
- name: Collect boot files
run: |
mkdir -p dist
cp circle/_prh/_apps/Looper/kernel7l.img dist/
cp -r circle/boot/. dist/
cp -r circle/_prh/_apps/Looper/dist/firmware dist/firmware
echo "usbspeed=full" > dist/cmdline.txt
printf '[all]\nboot_delay=0\ndisable_splash=1\ngpu_mem=64\n\n[pi4]\narm_64bit=0\nkernel=kernel7l.img\n' > dist/config.txt
cd dist && zip -r ../looper-sd.zip .
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: looper-sd
path: looper-sd.zip
- name: Create or update latest release
uses: ncipollo/release-action@v1
with:
name: Latest Build
tag: latest
artifacts: looper-sd.zip
replacesArtifacts: true
allowUpdates: true
body: "Automated build from commit ${{ github.sha }}"
makeLatest: true