Patchbox and Zero Injector

I am using the Zero audio Injector (from audioinjector.net)
It works very well, except…

The Zero Audio Injector HAT does not respond to MODEP until a few seconds after Patchbox OS reaches the console. I believe this is because the ALSA mixer doest apply its settings until then.

In the recent past, I tested using some USB sound cards. and they were available to MODEP 15 seconds in to boot (before boot finished) and MODEP was producing effects through it.

Because I am running headless. I don’t care when its done booting, but I do care when it starts processing audio. The USB card did it quicker than the Zero Audio Injector HAT. I want to see if there is a way to get the HAT audio to start before the console.

any suggestions?

I also use AudioInjector Zero for my system. It looks like mine becomes active within 11 seconds. To make sure it starts, I execute the following command at the start of my service:
alsactl -f /usr/share/doc/audioInjector/asound.state.RCA.thru.test restore

It might be helpful to understand what actions are being taken during boot that could be delaying the audio. I would take a look at /var/log/syslog and/or the output of the dmesg command to see the sequence of boot events leading up to initialization of audioinjector.

FWIW, on my system, I see that USB gets initialized within 3 seconds, then networking, disk and video before audio.

I am very good at making linux explode.
Where / how do I add that?

I was able to find some masking options and applied them.
it made a 10 second difference. now I am at 21~26 seconds until I get processing.

(Pisound disable)
sudo systemctl stop pisound-btn
sudo systemctl mask pisound-btn
sudo systemctl stop pisound-ctl
sudo systemctl mask pisound-ctl

(touchosc2midi disable)
sudo systemctl stop modep-touchosc2midi
sudo systemctl mask modep-touchosc2midi
patchbox module deactivate
patchbox module activate modep

I re enabled touchosx2midi, I found it very valuable for remote control via iPhone app touchosc

I added the following as well:

#Shutown Command Button (added a momentary button from ground to GPIO 10 for safe shutdown.)
dtoverlay=gpio-shutdown,gpio_pin=10
#LED (added LED from GPIO 3 (gnd) (330 ohm resistor) to GPIO 4 LED.
enable_uart=1

Disable the rainbow splash

screendisable_splash=1

Disable bluetooth

dtoverlay=pi3-disable-bt

Set the bootloader delay to 0 seconds. The default is 1s if not specified.

boot_delay=0

Saved 1 more second so far.
It still gets close to the console before I get processing. (25~30 seconds)

Places I got the above ideas from:
https://www.stderr.nl/Blog/Hardware/RaspberryPi/PowerButton.html


Here is are the guts of the project so far:

Current issues / plans:

  • 6 AA (@9v) batteries only last around 15-20 mins.
  • I want to add “patch up / patch down” buttons through GPIO, so you don’t have to use another device to control it.