Storing recordings as FLAC

RockRecorder can store recordings as FLAC instead of WAV. FLAC is lossless: the audio is exactly what was recorded, sample for sample, in about a third of the space. So the same drive holds about three times as much.

Recordings from Space saved
Radio (MRadio, ETC, Generic RTP) about 65%
Solacom calls about 53%
Cisco BiB calls about 80%

Nothing else changes for the people using RockRecorder. Recordings play and search as before, and downloads, ZIPs and report exports are still WAV files. Inspect shows a recording's format under File.

New and upgraded servers

  • A new server stores recordings as FLAC from the start.
  • An upgraded server keeps storing WAV until you turn FLAC on. The recordings already on disk stay WAV until you convert them.

Turn it on

Over SSH on the RockRecorder server:

sudo nano /etc/rockrecorder/rockrecorder.toml

Under [recordings], add (or change) this line:

flac = true

Save the file and restart the recorders:

sudo systemctl restart rockrecorder.target

From then on, every new recording is stored as FLAC. To go back to WAV, set flac = false and restart again.

Convert the recordings already on disk

Turning FLAC on only affects new recordings. The rockrecorder flac command converts the ones already on the server, so the whole store takes less space. It works one recording at a time while RockRecorder keeps recording, so there's no downtime.

1. See what it would do. This counts the recordings and their size, and converts 20 of them to a temporary folder to measure the saving. Nothing on the server changes:

sudo runuser -u rock -- rockrecorder flac --dry-run --sample 20

2. Try it on a few. Convert 100 recordings, then play a few of them in RockRecorder:

sudo runuser -u rock -- rockrecorder flac --limit 100

3. Convert the rest. Run it in the background, so it carries on after you close your SSH session:

sudo systemd-run --unit=rr-flac --collect --uid=rock --gid=rock -p Nice=10 -p IOSchedulingClass=idle \
  /usr/local/bin/rockrecorder flac --yes

It runs at low priority, so recording and the web pages always come first. Each converted file is checked to have exactly the same audio before the WAV is removed, and a recording whose audio doesn't match the hash taken when it was recorded is left alone. It logs every recording it converts, and a summary at the end: how many, and the size before and after.

To Run
Watch it work sudo tail -f /opt/rockrecorder/logs/flac.log (Ctrl+C stops watching, not the conversion)
See if it's still running systemctl status rr-flac
See the summary when it's done sudo journalctl -u rr-flac
Stop it sudo systemctl stop rr-flac

A restart of the server also stops it. To carry on, run the same systemd-run command again: it picks up where it left off.

Always run it as RockRecorder's own user, as shown (sudo runuser -u rock -- …, or --uid=rock in the background). It stops and says so if run as root.

Options

Option What it does
--dry-run Counts the recordings and their size, and changes nothing. Add --sample 20 to measure the saving on 20 of them
--limit 100 Stops after this many recordings
--channel "Fire Dispatch" Only this channel. Repeat it for several
--older-than 30 Only recordings older than this many days
--newest-first Starts with the newest recordings (the default is the oldest)
--sleep 200 Waits this many milliseconds between recordings, to go easier on a busy disk (the default is 50)
--yes Doesn't ask before starting, for an unattended run
--to-wav Converts FLAC recordings back to WAV

Every recording it converts, and any it skips and why, is written to /opt/rockrecorder/logs/flac.log.

Archiving

  • Network shares and folders still get WAV files, as before, so whoever reads them sees no change.
  • Another RockRecorder (an archive server) gets the FLAC recordings as they are. Update the archive server to the same RockRecorder version first: an older one doesn't accept FLAC, and those recordings are skipped. See Archiving recordings.

Encrypted recordings are stored as encrypted FLAC files, and converting them keeps them encrypted.

Still stuck? Contact us or call 803-930-2500.