Install snapserver/snapclient.
Create /etc/systemd/system/snapfifo.service
with contents:
[Unit]
Description=Pipes line-in to /tmp/snapfifo pipe
After=snapserver.service
[Service]
Type=simple
Restart=always
# restart every hour, having stability issues (TODO try removing this)
RuntimeMaxSec=3600
# give snapserver time to create /tmp/snapfifo pipe
ExecStartPre=/bin/bash -c 'while true; do if [ -e /tmp/snapfifo ]; then break; fi; sleep 1; done'
ExecStart=/usr/bin/arecord -c 2 -D hw:CARD=CODEC,DEV=0 -f S16_LE -r 48000 /tmp/snapfifo
[Install]
WantedBy=multi-user.target
Run at boot:
sudo systemctl enable snapfifo