DIY CAB IR BOX -with RPI

Started by Elantric, November 05, 2016, 10:47:18 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Elantric

http://www.thegearpage.net/board/index.php?threads/cabinet-irs-and-using-an-arduino-raspberry-pi-to-process-them.1668407/page-4
Quote
999nop said: ↑
Can you please share your shell commands on how to setup Raspberry headless (jackd+jconvolver only), so we don't need to dig up all the info from around the net, and try to focus on making this work:)

iim7V7I7 Wrote


Using a real time kernel doesn't seem to help with latency much, so overclocking and running headless are currently the best last hopes, so I'll try that next, and post the steps needed, if it helps.

999nop said: ↑
Also, what's realtime kernel and how do we get one:)?
It's pretty easy to build a realtime kernel, although it takes a while, and you'll need to keep an eye on the Pi' s temperature (I took the top of the case off of the Pi3, which seemed to help, a little). You'll need gigabytes of free space for the kernel sources and build.

If this process fails, you might find yourself with an unbootable Pi3 and lost data/system. Before trying this you might want to use a spare memory card to experiment with, and/or make a backup of your current setup/data!

Using an unoptimized Pi3 like http://www.thegearpage.net/board/in...-to-process-them.1668407/page-4#post-22921611 and steps similar to https://www.raspberrypi.org/documentation/linux/kernel/building.md for building a kernel, these shell commands might work (if not, let me know, maybe I forgot something)...

sudo bash # to act as root
apt install bc ncurses-dev # needed by the build process
# switch the Pi3 to kernel 4.4.27, to match the realtime patch target, just in case
rpi-update 230f261
reboot
uname -a # does it say kernel 4.4.27?
# set up the kernel/patch build in some random directory
# if there is a newer version of the realtime kernel patch, try it
mkdir -p kernels/4.4.27/realtime
cd kernels/4.4.27/realtime
wget https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/patch-4.4.27-rt37.patch.gz
cd ..
# this pull could take a while
# it doesn't use --depth because the goal is building an older version of the kernel source
git clone https://github.com/raspberrypi/linux
cd linux
# checkout a local copy of the kernel source for 4.4.27
# to match the realtime patch target version
git checkout bc6f89e
# hopefully everything is ready...
export KERNEL=kernel7
make bcm2709_defconfig
# apply the realtime patch to the kernel source for 4.4.27
zcat ../realtime/patch-4.4.27-rt37.patch.gz | patch -p1
# now configure the build for realtime
make menuconfig
# in menuconfig, arrow down to Kernel Features, press ENTER, Preemption Model, ENTER
# arrow down to Fully Preemptable, press ENTER
# arrow right or left to Save (on the menu below), press ENTER
# then repeat (on the menu below) Exit, ENTER, until you've exited menuconfig completely
# hopefully everything is ready to build!
# it took 1.5 hours on a Pi3, speed depends on memory card read/write speed
# it might take 3 or 4 hours on a Pi2, or maybe longer
make -j4 zImage modules dtbs
# act as root, via sudo
sudo make modules_install
sudo cp arch/arm/boot/dts/*.dtb /boot/
sudo cp arch/arm/boot/dts/overlays/*.dtb* /boot/overlays/
sudo cp arch/arm/boot/dts/overlays/README /boot/overlays/
sudo scripts/mkknlimg arch/arm/boot/zImage /boot/$KERNEL.img
reboot
uname -a # this should look a little different now!

Elantric

iim7V7I7 Wrote
https://www.vguitarforums.com/smf/index.php?topic=19498.msg139501#msg139501


Just now, I was able to boot the Pi3 without a GUI (local headless), run jackd and jconvolver from terminals (the http://wiki.linuxaudio.org/wiki/raspberrypi instructions for command line headless jackd worked), use a little C program to connect the audio channels (calling jack_client_open() and then jack_connect() with "system:capture_1", "jconvolver:In-1" etc, see http://www.jackaudio.org/files/docs/html/index.html for details), disconnect all other USB devices, and get below 5ms latency, even as low as 2ms using guitar->THR10->Pi3->jconvolver->THR10. Even as low as 1ms, but that wasn't usable for very long. Eventually, they all started to sound weird, periodically, as waves of dropouts hit (or puke, if I didn't use jackd -s). I'm hoping that with a real time kernel, booting headless, using every tweak possible from http://wiki.linuxaudio.org/wiki/raspberrypi (and some luck), eventually low latency processing without any dropouts will happen, once I find out what causes the wave of dropouts to periodically corrupt the audio (and find a way to make it stop).

Elantric


Quote# it took 1.5 hours on a Pi3, speed depends on memory card read/write speed

SD Card Speed Test
https://www.cameramemoryspeed.com/reviews/micro-sd-cards/