I put the working Raspberry Pi code out on github. It is capable of running on a Pi Zero W writing to either a USB stick or a large microsd (64GB) using about 240mA. My power source is ~12v with a stepdown regulator. This draws <100mA at 12 volts.
Recording is controlled by editing a configuration script. The script allows control over the recording format (ogg, flac, opus). I recommend either opus for lossy compression (~100MB/hr) or flac (~600MB/hr) for lossless. The script controls the file chunking, I have used 1 hr files. So far I have run for multiple days, generating up to 120 files on an hourly basis. Script also controls the gain settings of the ADC, currently analog and digital gain settings. Metadata collection settings are also set here.
Following metadata is stored in each audio file (most visible in Rythmbox or other music players)
Date, Title, Artist, Album, Genre, Location, Comment (used for recording gain), tracknumber, tracktotal
A couple odd issues:
- I've needed to run arecord -L before my script, otherwise the ADC is not recognized by ALSA and the script fails.
- There is an automatic shutdown flag in the config file. When using this, I have noticed a bug where shutdown occurs prematurely at random. If I do not have auto shutdown, recordings work the full length every time. The code for shutdown seems straightforward, so not sure why this happens at random.