@mdsimon2 I was playing around with my RPi and testing out different configurations regarding power consumption and start up times. My Zero 2W boots up with it's current SD card in about 22 seconds according to
systemd-analyze
. That's not bad, but I was hoping to decrease the time it takes to output sound after power on. While my attempts to decrease power consumption inevitably increases loading times, I noticed that disabling unneeded features* and reordering service start up can have significant impact on start up time without affecting the operation of the device/Camilla services. It went down to 18 sec before I accidentally disabled some important network feature
So while the choosing a fast SD card is the best performance tweak, I would have hoped to have tips (from anyone who knows Linux) how to modify services so that the OS would have minimum required things it needs, in order of importance, for 1) headless operation, 2) run CamillaDSP with chosen input and output (in my case USB in and HAT out), 3) run Camilla GUI service (web interface) and 4) SSH and other system or tertiary services.
The means to accomplish would basically be tuning RPi OS Lite, disable unneeded services, reorder services so that the order of preference would be accomplished (when Camilla DSP can input and output sound, all else can come after) and maybe HW performance tuning for boot up and normal operation after that. It would seem that the Linux comes with services that have overlapping features, but my knowledge is limited about them. Even the Lite OS seems to have features that are for the GUI OS, but I cannot be sure how removing them would affect. It's quite troublesome to fix, if you don't have an SSH connection...
I have so far tried to disable as many hardware features that I don't need (Bluetooth, HDMI ports, 3.5 mm, wired NIC, etc.) with config.txt statements, but the Linux software is still quite foreign to me. I used
systemctl list-dependencies [-reverse]
and
systemd-analyze blame
to scout for possible candidates and I made a few adjustments to services configuration files
[Unit]
section
After=
statement by adding
camilladsp
, but I'm unsure about their effects. The real problem is in the long dependency trees.
*) The choice to use Ubuntu Server is strange. I noticed that the Raspberry Pi OS Lite (tailored for headless) offers least amount of unnecessary features and thus best power saving and speed out-of-box. So instead of cutting branches of a server OS, I'd suggest using a lighter OS by default.