SOMA Connect + shairport-sync: part 2

Last time I had a sorta-working shairport-sync configuration on my Raspberry Pi, but I didn’t have the SOMA Connect hardware actually working, and I had to make a bunch of compromises in order to get things to even try to start up without reimaging to the 32-bit Raspbian operating system.

Well, somehow the filesystem got corrupted and the device was refusing to boot, so I figure this is as good a time as any to document how I got things working in a much nicer way.

  1. Backing up existing files

    From my Linux desktop, I created a restore tarball to plop the soma-connect software and its configuration back onto the Pi’s filesystem after a reimage:

    cd /media/fluffy/rootfs
    tar czvf ~/soma-restore-overlay.tar.gz \
        var/soma-connect \
        etc/soma-connect-crontab.conf \
        etc/rsyslog.d/soma-connect.conf \
        usr/lib/systemd/system/soma-connect.service \
        usr/lib/soma-connect
    
  2. Imaging the Pi OS

    Using the Raspberry Pi Imager I prepared an SD card with Raspberry Pi 3, making sure to select the 32-bit OS this time, and configured it with ssh and audio.

    Then I mounted rootfs and then applied my overlay again:

    cd /media/fluffy/rootfs
    tar xzvf ~/soma-restore-overlay.tar.gz
    
  3. Booted the Pi and made some configuration changes

    After the first few boots finished (presumably with a multi-stage post-install provisioning thing that had to do some stuff), I had my desktop up. I opened a terminal and verified that /usr/lib/soma-connect/soma-connect works (apparently 32-bit Raspbian actually has all of the required libraries already, go figure!).

    I then ran sudo raspi-config to make the following configuration changes:

    1. Under system > audio, selected “Headphones”
    2. Under system > boot, selected “Console text console” without autologin

    Out of an abundance of caution I also disabled pulseaudio (even though there’s no reason it should be starting up at all now):

    sudo apt remove pipewire pulseaudio
    

    It also appears that soma-connect requires a few other things to be installed:

    sudo apt install ifplugd
    sudo apt autoremove
    
  4. Enabled the SOMA Connect services

    sudo systemctl daemon-reload
    sudo systemctl enable soma-connect
    
  5. Configured shairport-sync:

    /etc/shairport-sync.conf
    general = {
        name = "bedroom";
    }
    alsa = {
        output_device = "hw:Headphones";
    }
    
  6. Rebooted the Pi, ensured that no GUI started at launch and that pulseaudio wasn’t running, shut it down, then moved it back to my bedroom speakers

And now music works again!

I still can’t get the SOMA Connect to work (this time it’s not even appearing in HomeKit for some reason?) but at least I Tried™.

Anyway, next up: figuring out how to stop this dang thing from bricking itself again, and maybe figuring out an easier backup/restore strategy. (I can’t help but wonder if my SD card is filling up with log files or something.)