FreeLCS User Manual
FreeLCS stands for Free Loudness Correction Server.
FreeLCS lets you automatically correct audio files to EBU R128 target
loudness level.
The software lets you easily set up a server that shares one of it's folders
to the network. Users of your network can then drop audio files to the
server for automatic loudness correction. For each processed file the server
also creates a loudness history graphics file which shows loudness
variations inside the file.
The software is very fast even on modest hardware giving 15 times faster
than realtime processing (16 bit stereo files, TruePeak measurement turned
on) on a server with one Intel Core 2 Duo processor, 4 GB Ram, 3 internal
Sata disks in software RAID 0.
FreeLCS uses other open source programs to get the job done (Linux,
libebur128, gnuplot, FFmpeg / libav-tools (optional), sox, mediainfo). All
software is free and Open Source.
- Automatically loudness corrects audio files to conform with EBU R128
loudness recommendation.
- Very easy to use, just drop in your file and copy back the loudness
corrected version.
- Creates loudness history graphics that allows the user to see how
loudness varies inside a file (example picture below).
- Supports channel counts from mono to 5.1.
- Supports EBU TruePeak measurement.
- Uses a protective limiter to keep peaks in the allowed range where
needed.
- Takes advantage of multiple processor cores to run calculations
simultaneously.
- User is able to define how many audio files are processed at the same
time, limited only by available cpu processing power and hard disk
bandwidth.
- Supports writing loudness measurement results to a machine readable
file.
- Modest hardware requirements, runs fine with only 4 GB of ram.
- Can be run inside a virtual machine, no need for physical hardware.
- Fast processing. On typical hardware you can expect processing to be
10 - 20 faster than realtime.
- Cleans up automatically by deleting all files after a set time delay.
- Sends possible error messages to the admin by email.
- If user installs FFmpeg or libav-tools
then additional features becomes available:
- The wide range of FFmpeg / libav-tools supported formats can be
processed.
- Support for multistream files, all audio streams are extracted and
processed individually.
- Extract audio from wrappers containing both video and audio.
- Remix audio from MXF files to required mixes before loudness
processing.
- All software is free and Open Source. Install in as many computers as
you like.
- Runs on the free Linux operating system, no need to pay for
proprietary os installation.
- Easy to integrate in many workflows.
- Written in Python 3.
- More specific information can be found in the FAQ.
- You need a computer with at least 2 processor cores.
- 4 GB of RAM (there probably is not much advantage in having
more).
- Ubuntu Linux 18.04 LTS, 16.04 LTS, Debian 10 or 9.
- A person that is able to set up and update an Linux server.
- 1 Gbit ethernet is recommended.
- The FAQ discusses things like
supported formats, channel orders, etc.
FreeLCS installation requires either a connection to the internet or access
to a local Debian / Ubuntu package repository.
The installation instructions below apply to Ubuntu Desktop.
This is the most user friendly of the supported operating systems.
Installation on other supported platforms differs from the instructions
below.
If you use Ubuntu Server (Ubuntu version without any
graphical user interface) then the installation
procedure is described here.
If you use Debian Desktop (with a graphical user
interface), then you first need to make
some modifications to the Debian system and then you can follow
installation instructions for Ubuntu Desktop below. Things that needs to be
done differently on Debian are pointed out in the instructions.
- Always use a 64 bit Linux distro. FreeLCS uses external helper
programs and one of those (mediainfo) in it's 32 bit version is not able
to handle big audio files. The 64 bit version of mediainfo works fine
with big files.
- A good starting point for a company server running in a virtual
machine might be assigning 4 GB of ram and 6 processor cores for the
virtual machine running FreeLCS. All cores will only be used when there
are 3 files to process simultaneously. When FreeLCS virtual server is
idle, the cores are available to other virtual machines running on the
same hardware.
- It is recommended to use Ext4 or XFS
filesystems for all disks. These are now very stable and much faster
than the JFS filesystem I used to recommend earlier.
- During the installation of Ubuntu and Debian, you are prompted to
create the first user. It is important to use a password for this
account, do not leave the password empty.
- After installation of Ubuntu, log in as the first user you created
during installation. (Debian: log in as the non root
user you created during installation (the second user you created)).
- Next you must install python3 and idle3
giving a terminal command.
- Press the "windows" key on the keyboard to bring up Ubuntu search
function, write: term
You should now see an icon for "Terminal", start it up by clicking on
it.
- Write the following commands in the terminal window (you can copy and
paste them from below. Note that that keyboard command for paste in
Terminal is: shift + ctrl + v):
sudo apt-get update
sudo apt-get -y install python3 idle3
- Press enter after each line to run the commands.
- The first command will ask for your password. Type it in and press
enter.
- The first command-line (apt-get update) fetches up to
date information about what software package versions are available for
installation. If the package information is out of date then FreeLCS
installation may fail. The second line installs python3 programming
language.
- Now that python3 is installed you can start the FreeLCS installation
program. The installer will ask you some details about how you would
like the loudness correction server to work and installs the rest of the
programs FreeLCS needs.
- Next unzip the FreeLCS - package by clicking it with the right mouse
button and selecting " Extract Here". A new directory
will be created and all FreeLCS files will be unzipped there.
- Next we need to make the installer program executable. Navigate to the
directory that unzip created and right click the "installer.py"
program and select "Properties" from the menu.
- Click the "Permissions" tab and select "Allow
executing file as program" and the click "Close".
The installer program can now be run.
- Double click the "installer.py" - file. A window will
appear, click "Run".
If the installer program opens up in a text editor instead of showing you
the window above, then the file manager you are using prevents the program
from running. This happens at least on Ubuntu 14.04.
- If this happens then you need to change a setting in your file
manager. First open up it's preferences.
- Then open up the tab named "Behavior" and activate "Run
executable text files when they are opened". Now you can run
the installer by double clicking on it.
- The installer
program starts. The first screen asks you to accept the license
agreement.
- FreeLCS is published under a permissive license that lets you use,
modify and distribute the program.
- This license lets you use FreeLCS in your business or home free of any
charges. You are allowed to install FreeLCS in as many computers as you
want. FreeLCS is free software.
- Click "Next" when you have ticked "I accept the
license agreement".
- The next window asks for your password. On Ubuntu type in the password
for the first user that you created during Ubuntu installation.
- (Debian: type in the password for the non privileged
user you created during installation (the second user you created)).
- The installer uses this password to get root - proviledes. Root
permissions are needed when FreeLCS program files are installed into the
Linux system.
- The next screen will ask some details about how you would like
loudness correction to work.
- The first section will allow you to define the path to the target
directory. Some directories are automatically created inside this target
directory, the most important of these is the 'HotFolder'.
HotFolder is the folder where users can drop in files for processing.
HotFolder is by default located in: 'Target Directory /
LoudnessCorrection'. Hotfolder name depends on your selected
target loudness, this if further discussed below.
- The second section allows you to select English or Finnish as the
language for directories and text in loudness history graphics files.
- 'Number of processor cores to use' lets you define
how many processor cores are used in loudness calculation and file
processing. When a file is being processed it always ties up two
processor cores. The speed of processing is most often dependent of the
raw speed of disks. If your HotFolder is on an fast disk for example a
Raid device, then it often speeds up processing if you select here more
processor cores than you actually have. For example for our test server
that has one Intel Core 2 Duo (dual core) processor, 4 GB of Ram, 3 x 1
TB Sata - disks in Raid 0 for HotFolder, the sweet spot for speed is six
cores even though we only have two. See: Optimizing
processing speed.
- The next section of the window lets you define the time files are
allowed to stay on the server before they are automatically deleted. The
default value here is 8 hours (480 minutes).
- The last section lets you define the target loudness level. Files
processed with FreeLCS will be at this loudness level. EBU R128 standard
target loudness is -23 LUFS and the installer defaults to this value. If
you tick the box on this section you can change target loudness in range
of -31 LUFS to -12 LUFS. Note that using high target
loudness levels puts some additional requirements for the source files,
these must be mixed with reduced loudness range or you might introduce
clipping. This
is further discussed here. Hotfolder name will be just "LoudnessCorrection"
when using EBU target level -23 LUFS, but if you change it then the
target level is added to the hotfolder name, for example "LoudnessCorrection_-16_LUFS".
Hotfolder name is part of the mount command and this will help users to
see which target level service they are using in case you have one
instance processing files with -23 LUFS and another instance processing
with -16 LUFS.
- If you tick the box on this section you can change target loudness in
range of -31 LUFS to -12 LUFS.
- Hotfolder name will
be just "LoudnessCorrection" when using EBU target
level -23 LUFS, but if you change it then the target level is added to
the hotfolder name, for example "LoudnessCorrection_-16_LUFS".
Hotfolder name is part of the mount command and this will help users to
see which target level service they are using in case you have one
instance processing files with -23 LUFS and another instance processing
with -16 LUFS.
- The next window lets you select if you want to email possible error
messages to the admin.
- Input your email details here. Smtp - server is the email server you
use to send email out to the world. (Note that if you use Gmail,
the settings to use are displayed printed in light gray on the second
text line in the window).
- You can add max 5 target addresses. When you have filled in email
details, click the "Send" - button to test that email sending really
works. The bottom of the window displays a message if email sending is
succesful.
- IMPORTANT NOTE: Gmail two-factor authentication is
not supported. Google calls this feature two-step verification.
- HeartBeat Checker is a separate program that monitors
the health of the loudness correction program. If Loudness correction
crashes for some reason, HeartBeat Checker sends you email. If your
loudness correction server is mission critical then enable this option.
- (Note that the password you give here is not encrypted when it is
stored in the file "/etc/LoudnessCorrection_Settings.pickle".
Scripts can not securely encrypt anything since the scripts themselves
can be easily read and any encryption method used can be seen by
examining the source code :)
- The next window lets you select if you want "Html
progress report" written to the HotFolder. It is an
html-page that can be viewed with a web-browser and it displays the
loudness calculation queue inside the server. On the page you can see
how many files are waiting to be processed and names of the last 100
processed files and times they were processed. The "html
progress report" is a tool for the admin to see what's going
on inside the server, this feature is not needed by normal users.
Current time is displayed on the page also and if it is advancing then
the server is alive and well :) The default path for the "Html progress
report" is "Target Directory / LoudnessCorrection /
00-Calculation_Queue_Information /
00-Calculation_Queue_Information.html".
- The "Html progress report" is updated once in every 5 seconds. During
heavy file processing the physical harddisk can become so busy that the
progress report can't be written to it often enough. When this happens
the progress report seems to be frozen. This problem can be solved by
creating a ram-disk and writing the "Html progress report" there instead
of the physical hard disk. Ram-disks can be written and read very
quickly and traffic jams on hard disks don't affect them at all.
- If you wan't the progress report to be written on a ram-disk, then you
can select which of the operating systems ram-devices are used to create
the ram disk. You need to change the default setting of "/dev/ram1"
here only if you know you have created other ram-disks for other
purposes and you know that device "/dev/ram1" is already used for
something else.
- Then you can select which user account is used when loudness
correction and heartbeat checker programs are run. These two programs
are always run as an "unprivileged" user. If you only created one user,
then this user is used by default.
- If you are not sure what to select for options described above, then
just leave the defaults as they are. Defaults are ok for most users :)
- The last option on this window lets you select which peak measurement
method you want to use: sample peak or TruePeak.
TruePeak is a method that tries to find invisible peaks that might exist
between audio samples. These peaks can go above the maximum allowed 0
dBFS and cause distortion when the digital signal is converted back to
analog. TruePeak measurement calculates new samples in between existing
audio samples and finds these hidden peaks. EBU R128 recommends always
using TruePeak method to measure audio peaks. TruePeak calculation is
about four time slower than finding the highest existing audio sample in
a file.
- FreeLCS uses peak limiting in cases where loudness is below -23 LUFS
and peaks are so high that distortion would be introduced when file
loudness is adjusted up. If highest peak value after gain correction
would go over a set limit (-4 dBFS for sample peaks and -2 dBFS for
TruePeaks), then a peak limiter is used before loudness correction. The
resulting peaks after gain correction will be max. -3 dBFS when using
sample peak measurement and -1 dBTP when using TruePeak measurement.
Note that if you use sample peak measurement, there will always be 3 dB
headroom for the invisible peaks to exist and distortion is very
unlikely.
- The next window will allow you to define how FreeLCS ouputs its
results. Most users will use the defaults meaning FreeLCS creates
loudness corrected audio files, history graphics files and deletes
multistream files immediately after audiostreams have been extracted
from them (multistream extraction requires you to install FFmpeg or
libav-tools). This is how FreeLCS versions up to 2.4 worked by default.
If you want FreeLCS to work just like it did in versions up to 2.4, then
make sure "Use FreeLCS file output defaults" is "Yes"
and go to the next screen.
- If you however would like to integrate FreeLCS as a loudness
measurement step in your automated file processing workflow, then you
might want to change the defaults. FreeLCS 3.0 is able to output
loudness measurement results in a machine readable file. Read
more about it here.
- The following window allows you to define how you would like audio
inside a MXF wrapped file to be recombined to new mixes before loudness
processing. Read
more about it here. Most users will leave "Enable MXF
Audio Remixing" to "No".
- Starting from FreeLCS 3.0 it is possible to restrict FFmpeg /
libav-tools to only process a small set of formats or allow it to
process all formats it supports. This feature is mainly designed to
allow the user to restrict processing only to patent free formats even
when FFmpeg or libav-tools is installed. Format patentability varies
from country to country, see more about it in FAQ.
- As of 2018 the patents for formats: Dolby AC-3, Mpeg 1 Layers
1, 2 and 3 (mp1, mp2, mp3) have expired. These formats are
now patent free and can be used without paying license fees. More of
this and links to the current patent situation of these format in FAQ
here. These formats are now enabled if you enable free formats in
this window. FFmpeg or libav-tools is required to use these formats.
- Settings for allowed FFmpeg / libav-tools formats are located at the
bottom of this window. These settings will have no effect if you don't
install FFmpeg / libav-tools.
- In the following picture FFmpeg / libav-tools processing has been
restricted to wrapper formats: Wav, Flac, Ogg, Matroska, AC-3,
Mpeg 1 Layers 1, 2 and 3, MXF, Webm and codec formats:
PCM, Flac, Vorbis, Opus, AC-3, Mpeg 1 layers 1, 2 and 3.
- The option "Mp4" enables wrapper formats: mp4,
m4v, m4a and formats based on mp4: mov, 3gp, 3g2,
mj2.
- The next window will let you share the "HotFolder" to the network.
Select "Yes" if you want users to be able to drop in files to the
HotFolder through the network.
- Samba-server is responsible for creating the network share. The
default FreeLCS samba configuration is shown on the window and you can
edit it if you like. Only change the configuration if you know your
settings will work in your network. In all other cases just leave the
configuration as it is and click "Next".
- If you want to disable SMB protocol version 1 (cifs), then remove the
character # from the beginning of line: # server min protocol =
SMB2
- The next window lists all external programs that FreeLCS needs. Just
click the "Install" - button and the installer will
download and install everything for you.
- The "Toggle" button can be used to force
reinstallation of all programs. You might need this if for example
libebur128 has just released an updated version which implements latest
changes in EBU R128 recommendation and you want this version right away.
The Toggle - button changes the state of all programs to "Not Installed"
and clicking it again changes the state back.
- The installation takes a couple of minutes and the window freezes
while the installer launches external programs to do the actual
installation. So don't try to click on anything on the window while the
installation is going on. The installer shows messages on the bottom of
the screen telling what it is doing at the moment.
- When installation has finished successfully the window looks like the
screenshot below. Click the "Next" - button.
- The next window shows how you can install FFmpeg / libav-tools if you
need it.
- The last window shows the terminal command to start LoudnessCorrection
immediately. The picture below is from a systemd based
operating system (Debian 8, Ubuntu 16.04 and later).
- The easiest way to start loudness correction however is to restart the
computer.
FreeLCS writes some files onto your disk. In addition to installing some
programs FreeLCS needs to do it's job, it also writes files that start up
FreeLCS every time the computer starts.
Installed programs:
- Mediainfo
- Sox
- Gnuplot
- samba
- Libebur128
If you want to uninstall FreeLCS you can remove these programs with the
following terminal command:
sudo apt-get remove mediainfo sox gnuplot samba
FreeLCS needs sox 14.4.0 and if you are running an older os version (Ubuntu
12.04), then the sox version available in os package repositories is older
than 14.4.0. In this case FreeLCS installer compiles sox 14.4.0 from source
code. Libebur128 is always compiled from source.
You can find out where the compiled programs are installed with the
following terminal commands:
which loudness
which sox
You can remove these programs with these commands (replace the
"path_to_command" with the output from the "which" command above):
sudo rm path_to_command
FreeLCS needs to start every time the computer starts up, so some start up
scripts are created on your system.
Files created on a systemd based os (Debian 8, Ubuntu 16.04 and newer):
/usr/bin/LoudnessCorrection.py
/usr/bin/HeartBeat_Checker.py
/etc/LoudnessCorrection_Settings.pickle
/etc/samba/smb.conf
/etc/systemd/system/loudnesscorrection_init_script
/etc/systemd/system/freelcs.service
/usr/bin/loudness-freelcs
Some file installation paths depend on the distribution, you can
find these files with the command:
find /usr/lib/ -name "*freelcs*"
The text "brd" is added to /etc/modules
if it is not already there and the brd module is not built into the kernel.
Brd is a ram disk driver.
If you want to remove FreeLCS then stop FreeLCS and delete the files listed
above with these terminal commands:
systemctl stop freelcs.service
systemctl disable freelsc.service
rm path_to_file
Explanation of FreeLCS startup files:
/usr/bin/LoudnessCorrection.py
- This is the main program of FreeLCS. It responsible for processing
all audio files.
/usr/bin/HeartBeat_Checker.py
- HeartBeat Checker monitors the health of the LoudnessCorrection.py -
program and sends email to the admin if LoudnessCorrection.py crashes.
This program is started only if you enabled it in the installer.
/etc/LoudnessCorrection_Settings.pickle
- The settings that you defined when running the FreeLCS installer are
stored in this file. LoudnessCorrection.py and HeartBeat_Checker.py both
read their settings from this file when they start up.
/etc/systemd/system/loudnesscorrection_init_script
- This script is resposible for first setting up things FreeLCS needs
and then starting up FreeLCS. When this program starts it first creates
a ram disk, then creates directories in the HotFolder and sets their
permissions correctly. Then it starts up LoudnessCorrection.py and
HeartBeat_Checker.py - programs.
/etc/systemd/system/freelcs.service
- This file describes what systemd needs to do to start up FreeLCS and
what services needs to be up before starting it. Based on this
information systemd starts: /etc/systemd/system/loudnesscorrection_init_script
/etc/samba/smb.conf
- This is the configuration file for the samba server that shares the
FreeLCS HotFolder to the network. Hotfolder is shared to the network
only if you selected "Share HotFolder to the network with samba"
= "yes" in the installer.
FreeLCS usage is very simple.
- First you mount FreeLCS HotFolder through the network.
- Then you drag some files to the HotFolder .
- A couple of minutes later you can drag loudness corrected files back
from "HotFolder / 00-Corrected_Files" to your computer
.
Mounting of the HotFolder is explained in it's own chapter.
- When you mount the HotFolder your operating system automatically opens
a window that shows the contents of the HotFolder. The examples below
are from Mac OS X, but the same principles apply to all operating
systems.
- The root of HotFolder is where you drag files you want to be loudness
corrected.
- Inside the root - folder there are two other folders: "00-Corrected_Files"
is where corrected files and loudness calculation history graphics
appear. The folder "00-Calculation_Queue_Information"
is used to store two files that normally aren't of interest to normal
users. The first one is "00-Calculation_Queue_Information.html".
That is an html-file that can be opened in a web-browser. The page is
updated every 5 seconds and it shows how many files are waiting to be
processed, which files are currently worked upon and so on. The second
file that is stored in this folder is "00-HeartBeat.pickle".
LoudnessCorrection writes periodically timestamps and other information
in this file and HeartBeat_Checker.py monitors this file. If information
in the file stops updating then LoudnessCorrection has crashed and
HeartBeat_Checker sends email to the admin.
- For normal users the only folders of interest are the root of the
HotFolder and the "HotFolder / 00-Corrected_Files".
- To process a file drag it in the root of the HotFolder.
- The file will be copied over the network to the FreeLCS - server.
- When the file is copied over navigate to "00-Corrected_Files".
- In a while files start to appear there. The first file will be the
loudness calculation history graphics file and some time after that the
loudness corrected sound file appears. Drag the corrected sound files
back to your computer. Each corrected file will have the string "_-23_LUFS"
added at the end of its name.
- All files in the root of the "HotFolder" and "00-Corrected_Files"
will be automatically deleted after a time period that you defined in
the installer program. By default it is 8 hours.
- Source file loudness variations and loudness calculation results are
shown on the loudness history graphics file.
- Short term loudness variations over time are shown on the picture as a
brown line.
- The bright green line represents the target loudness when it is set to
EBU R128 standard -23 LUFS. Color of this line is blue if target
loudness is set to a value lower that -23 LUFS and red if it is set
higher than -23 LUFS.
- The dark green horizontal line shows the integrated loudness of the
source file. Integrated loudness averages loudness across the length of
your whole file into a single number.
Loudness
history graphics when target loudness is set to -16, -23 and -31 LUFS
(from top to bottom)
The color for the line for target loudness is:
- red when target loudness is higher than -23 LUFS
- light green when target loudness is EBU R128 standard -23 LUFS (0 LU)
- blue when target loudness is lower than -23 LUFS
- Note !!!!!!! There are connection problems on OS X 10.7 - 10.10 due to
Apple's broken smb - implementation. Read
more about it here.
- First click an empty spot on your desktop, this activates the Finder -
program.
- The keyboard shortcut to bring up the "Connect to Server" - window is
cmd + k, so keep the cmd pressed and press k.
- Now you need to have your servers ip-address. Write "smb://your
servers ip address" in the prompt and press "Connect".
- The next window lets you choose between logging in anonymously or as a
registered user. The network share on the FreeLCS - server is configured
to accept only anonymous logins. So don't write in any username or
password, just click "Guest".
- Now the window changes and looks like the one below. Click "Connect".
- The FreeLCS network share is mounted and Finder opens a window showing
contents of the HotFolder. Now you can start using the server :)
When you have mounted the HotFolder you can make an alias for it that
stays on your desktop. You can then skip all the steps above and mount the
HotFolder just by double clicking on the alias.
- First you must have mounted the HotFolder.
- Open a Finder - window and scroll to the bottom of the device list on
the left panel. You should see an entry there that has the name of your
computer, by default it is "admin's Mac". Click on it.
- Now you should see all mounted devices in the Finder window and "LoudnessCorrection"
should be among them. Start dragging "LoudnessCorrection" out of the
finder window to the desktop and before you let go of the mouse button
press and hold cmd and alt -
buttons. You should see a curved arrow on top of the LoudnessCorrection
- icon. Keep pressing cmd and alt and let go of the mouse button.
- Now on your desktop there should be a "LoudnessCorrection" - icon with
a curved arrow on top of it. An icon like this is called an alias.
- From now on you can mount the LoudnessCorrection HotFolder just by
double clicking on the alias.
- Click on the "Windows" - button and click on the entrybox on the
bottom of the window. If your installation has a target loudness
different from standard -23 LUFS then the target loudness is part of the
mount path. For example if your FreeLCS installation has a target
loudness of -16 LUFS, then the mount path is something like: \\192.168.100.109\LoudnessCorrection_-16_LUFS
- Windows mounts the HotFolder on the server and opens it in a file
explorer window. Now you can start using the server :)
- Open windows file explorer and right - click on "This PC".
Select "Map Network Drive" from the menu.
- Write the address of the server in the window. If your
installation has a target loudness different from standard -23 LUFS then
the target loudness is part of the mount path. For example if your
FreeLCS installation has a target loudness of -16 LUFS, then the mount
path is something like: \\192.168.100.109\LoudnessCorrection_-16_LUFS.
Make sure that the option "Reconnect at sign-in" is
tagged, without it windows won't make the mount when windows starts up.
Click "Finnish".
If you selected "Write html progress report" = "yes"
in the installer then an html file will appear in "HotFolder /
00-Calculation_Queue_Information / 00-Calculation_Queue_Information.html".
This file can be opend in an web-browser and it shows an view inside the
loudness calculation queue. The html progress report is updated every 5
seconds and it shows how many files are waiting for a processing slot to
open, what files are currently processed and the names of 100 last files
that were processed and the time processing was finished.
The upper part of the window shows the names of next 10 first files that are
coming in for processing and above that the total number of files waiting in
queue is shown. Date and time are also shown and updated every 5 seconds.
You can use the time display to easily check if the server is up and
running.
The middle gray part shows the names of files that are currently being
processed. The number of files that are simultaneously processed depends on
what you selected as the "Number Of Processor Cores To Use"
in the installer. Each file is simultaneously processed by two processor
cores so if you selected six cores to be used, then three files are
processed at the same time (in the example picture below 14 cores are
assigned, so seven files can be processed simultaneously).
The bottom of the page shows the last 100 files that were processed.
The server needs to have an address that does not change. You network
administrator can give you an static ip-address to use.
The following instructions are for Ubuntu Desktop. If your
operating system is Ubuntu Server or Debian
without a graphical desktop, then you need to follow the instructions
here.
- Click on the double arrow on the top right corner of Ubuntu's desktop,
select "Edit Connections".
- (Debian: the icon looks a bit different on
Debian):
- Click on tab "Wired" and activate the "Wired
connection 1" by clicking on it and click "Edit".
- Click the "IPv4 Settings" - tab and then the text "Automatic
(DHCP)".
- Select "Manual" from the drop down list.
- Click "Add" and type in the details of your network
connection. You need to know the following information which the network
admin will be able to give you.
- The static address for the server.
- Network mask.
- The ip-address of the gateway machine. Gateway machine is the
machine that is connected to your internal network and internet.
Gateway routes traffic from the internal network to internet.
- The ip-addresses of your network name servers (DNS).
If you have a fast enough processor, for example 1 x Intel Core 2 Duo, then
the processor is able to process files much quicker than a single hard disk
is able to serve it. When multiple files are processed at the same time,
there will be lots of reading and writing going on and the speed of the disk
becomes the bottleneck of the system. You can get more speed out of you
system by setting up three disks in a raid 0 array and putting the HotFolder
onto the raid.
An alternative to software raid and multiple rotating disks is to use a
single Solid State Disk (SSD) as the HotFolder disk. SSD - disks are very
fast, but they have one disadvantage over traditional rotating disks. SSD -
disks wear out much more quickly than traditional disk. Modern SSDs have
hardware that tries to even out the wear that writing causes to SSD memory
cells. A typical SSD has a life span that is roughly equal to a rotating
disk when the SSD is in an environment that corresponds to typical desktop
usage. If your FreeLCS - server processes lots of audio files all the time,
then the SSD - disk is going to wear out sooner than expected. SSD might be
a good solution if you buy two disks and keep the other as spare.
Another thing that affects processing speed is the setting "Number
Of Processor Cores To Use" in the installer. Each file that is
processed ties up two processor cores, but if you have a fast disk and a
hyper-threading capable processor, you might get more speed by setting the "Number
Of Processor Cores To Use" to a bigger number than you have
actual physical processor cores.
After you have set up raid you can find the sweet spot of your system by
doing a simple test.
First collect a bunch of typical files that the server is going to process
when doing real work. The total size of the files should at minimum be
double the size of ram you have on your server, but more files is better.
Save the files on the server, but don't put them in the HotFolder yet.
- Delete all files from the HotFolder.
- Run the FreeLCS installer and set the "Number Of Processor
Cores To Use" to the number of physical processor cores you
have and reboot.
- Wait for FreeLCS to start up.
- Open the html-progress report in your web-browser and see that the
time displayed on the page is advancing. If not then LoudnessCorrection
is not running yet.
- Now you need to make the test files appear in the HotFolder. The
quickest way to make this happen is to create hard links for the test
files in the HotFolder. This makes the files appear immediately without
making physical copies of the files.
date ; ln
/path_to_test_files/* /path_to_hotfolder/
- This command displays the current time which also is the time files
were linked to the HotFolder, take note of the time.
- Wait for processing to finish and take a look at the html-progress
report and see the time the last files processing finished.
- Calculate the time it took.
- Repeat the process from step 1, but add two to the "Number Of
Processor Cores To Use" in the installer.
You should find the fastest processing time in 2 - 4 rounds of the test.
Our test servers sweet spot is to use six cores even though there is only
two physical processor cores. Our test server specs are:
1 x Intel Core 2 Duo Processor
2 GB Ram
1 TB hard disk for Ubuntu
3 x 1 TB hard disks in a software raid 0 array for the "HotFolder".
1 Gbit Ethernet
The speed test results for our test server were:
- Use 2 Cores: 20 minutes 11 seconds
- Use 4 Cores: 14 minutes 10 seconds
- Use 6 Cores: 13 minutes 09 seconds
With more than 6 cores the processing time started to increase rapidly.
Linux software raid configuration is a bit out of the scope of this
document. Here are the steps that were required to get our server's
raid set up. The steps I followed were mostly from here: http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch26_:_Linux_Software_RAID
Warning !!!!!!! Linux knowledge is required here. If you are not
careful these commands can mess up your system :)
- Install 3 Sata disks in the computer. Ubuntu gave our disks
device-names: sdb, sdc , sdd.
- Get root-permission with the command: sudo su
- Partition each disk as type: Primary, fd
(Linux raid autodetect). If your disks are bigger than 2 TB
then see
here how to partition them.
- Install Linux raid software: apt-get install mdadm
- Create a raid 0 device from the three disks: mdadm --verbose
--create /dev/md0 --level=0 --raid-devices=3 /dev/sdb1 /dev/sdc1
/dev/sdd1 (Warning:
don't give this command on an existing raid, this will wipe out the raid
partition table clearing out all data on the disks)
- If mdadm complains that: "Device Or Resource Busy", then mdadm may
already be using some of the disks and you need to tell it not to. The
command: cat /proc/mdstat lists currently
existing raid-devices, stop them with the command (device name is md127
in the example, check the real device name from the output of: cat
/proc/mdstat): mdadm --stop /dev/md127
now try creating the raid-device again with the command on the previous
line.
- When raid-device creation succeeds without error messages, format the
raid device with Ext4 or XFS
filesystem (in this example we use ext4): mkfs.ext4
/dev/md0 (Warning: this
will wipe out all data on the disks)
- Now the raid device exists, but Linux forgets about it in the next
boot unless we tell it to configure it again when booting up. The next
commands will save the configuration:
cd /etc/mdadm
mv mdadm.conf mdadm.conf.orig
echo "DEVICE partitions" > /etc/mdadm/mdadm.conf
mdadm --detail --scan >> /etc/mdadm/mdadm.conf
- Next make a directory for mounting the raid: mkdir
-p /mountpoint/raid-disk and make it
readable and writable for everyone: chmod -R 777
/mountpoint
- Get the Universally Unique IDentifier (UUID) for the
raid disk with command: blkid /dev/md0
the command will show output like below:
/dev/md0:
UUID="229f0670-c8c2-4145-b2f4-b1100d9cb918" TYPE="ext4"
- Add the device to your /etc/fstab so that it gets
automatically mounted next time the computer starts up. It is important
to use the UUID instead of the device name (/dev/md0)
to identify your raid disk in fstab. When the kernel gets updated then
your raid device number may change (for example from: /dev/md0
to /dev/md127) and if you used the device name +
number in fstab then the disk won't mount anymore. The UUID of a device
will not change and it can be used to identify the disk instead of its
device name. (Your disk gets a randomly selected new UUID every time it
is reformatted).
- Add the following line in /etc/fstab (change the
UUID to match your disk):
UUID=229f0670-c8c2-4145-b2f4-b1100d9cb918
/mountpoint/raid-disk
auto defaults 0 0
- Now reboot the machine and if the raid-disk was successfully mounted
then make the directory structure on the raid-device readable and
writable for everyone: chmod -R 777
/mountpoint
- If you use hard disks bigger than 2 TB, then the disks must be
partitioned using the GPT
format. Use parted to create GPT partitions on the
disks. The easiest way is to install and use the graphical version of
parted called: gparted
- The commandline procedure to use the text based parted
to create a partition spanning the whole disk /dev/sdb
and setting the partition type to Raid is:
sudo parted -a optimal /dev/sdb
mklabel gpt
mkpart primary 0% 100%
set 1 raid on
quit
- Note: the command "set 1
raid on" is used only if you want this disk to be part of an
raid array.
- Never process audio channels from the same mix separately from each
other. Processing left and right channels of a stereo mix separately
results in loudness being 3 dBs too high. All audio channels of a mix
must be in the same file or audiostream of a file.
- Silence does not affect loudness calculation. You can cut off silence
after loudness correction without affecting the integrated loudness of a
file.
- It might sometimes be useful to 'normalize' raw material early in the
video editing phase of a project. You might have a project that is made
up of several independent parts that need to be loudness corrected
separately. An example of this might be a program where a studio host
talks and plays cartoons for kids. The studio sections of the program
and each cartoon will have different loudness characteristics.
After you have loudness corrected each section separately there might
not be any need for audio post production anymore.
- Loudness correction does not affect internal dynamics of a file. If
you have too wide loudness variations in a file they will be there also
after loudness correction. Correction only adjusts the 'main level' of a
file. If integrated loudness of a file is -19 LUFS, loudness correction
will make all parts of the file 4 dBs quieter and relative loudness
variations inside the file will remain the same. This is how EBU R128 is
designed to work, you can still have loud and soft parts in your mix,
but it is your responsibility to use them wisely :)
The server can be made quite maintenance free by:
- Making the server boot automatically after an power outage.
- Making the server install all security updates automatically.
- Making the server automatically reboot weekly so that all security
updates are applied.
To make the server boot automatically after an power outage you need to find
an option in the computers bios that says something like:
"Restart after power failure".
Then tell Ubuntu to install security updates without human intervention. The
following instructions apply to Ubuntu Desktop, if you are
using Ubuntu Server or Debian then you
need to follow instructions
here.
- Press the "windows" key on the keyboard to bring up Ubuntu search
function, write: update
- You should now see an icon for "Update Manager", start it up by
clicking on it.
- Click on "Settings".
- Click on the "Updates" - tab and then on
the box "When there are security updates:".
- Select "Download and install automatically"
from the drop down list.
- (Debian: "Automatically Check For Updates"
is by default "Never". You probably might want to change this to
"Daily", otherwise new updates are never downloaded).
- Next the OS asks for your password.
- Click on "Close".
Now security updates
are downloaded and installed automatically. Some of them are applied
immediately but some of them (new versions of the Linux kernel) may come
into effect only after a reboot.
- Next we need to make the computer restart automatically once a week. A
good time to reboot might be for example: every monday morning
at 07:00 am.
- On Ubuntu 12.04, 14.04 and Debian 7 automatic tasks
are created with Crontab. On Debian 8, Ubuntu
16.04 and newer these tasks are created with systemd.
Below there are instructions for both of these methods.
Automatic weekly reboot with Crontab
- Cron can be used to run commands at preset times.
The configuration for Cron is called Crontab. It is a
simple text file and we add our commands to it using a text editor.
- Open a terminal an write in the command: (asks for root password):
sudo crontab -e
Ubuntu will prompt:
no crontab for root - using an empty one
Select an editor. To change later, run 'select-editor'.
1. /bin/ed
2. /bin/nano
<---- easiest
3. /usr/bin/vim.basic
4. /usr/bin/vim.tiny
Choose 1-4 [2]:
This means that Ubuntu wants to know which text based text editor you
would like to use to edit the crontab - file, press "2". This will select
the "nano" - text editor.
Now the text editor opens up in Terminal and shows some text that Ubuntu
automatically inserted into the crontab, navigate to the bottom of it and
add the following line:
00 07 * * 1 /sbin/reboot
This command will reboot the computer every monday at 07:00 am. Save the
crontab - file with the keyboard command ctrl + o, then
press enter to accept the filename. Now that text is saved, exit the editor
with the keyboard command ctrl + x. The crontab comes into
effect immediately, no need to reboot.
The fields in the crontab commandline mean (from left to right):
Field
Allowed Values
Minutes
0-59
Hours
0-23
Day of month 1-31 (* means every
day)
Month
1-12 (* means every month)
Day of week 0-7 (0 or
7 is Sun)
The last field is the full path to the command we want Cron to run.
Automatic weekly reboot with systemd
With systemd we need to create two text files that instructs systemd for
what to do (reboot) and when (weekly at a specific time).
First create the file "reboot_weekly.service" that
instructs systemd what to do (reboot). Startup the nano - editor to create
the file with the command:
sudo nano
/etc/systemd/system/reboot_weekly.service
Add the following content to the file:
[Unit]
Desciption=Reboot Weekly
[Service]
Type=simple
ExecStart=/sbin/reboot
Now create the file "reboot_weekly.timer" that instructs
systemd when to run the task (every Monday morning at 07:00). Startup the
nano - editor to create the file with the command:
sudo nano
/etc/systemd/system/reboot_weekly.timer
Add the following content to the file:
[Unit]
Description=Reboot Weekly
[Timer]
OnCalendar=Mon *-*-* 00:07:00
Unit=reboot_weekly.service
[Install]
WantedBy=timers.target
Then we need to enable the timer with the command:
sudo systemctl enable reboot_weekly.timer &&
systemctl start reboot_weekly.timer
If you have a NTP - server on your network, you can sync FreeLCS server
clock to it daily using the ntpdate command.
On Ubuntu 12.04, 14.04 and Debian 7 automatic tasks are
created with Crontab. On Debian 8, Ubuntu 16.04
and newer these tasks are created with systemd. Below
there are instructions for both of these methods.
Get time with Crontab
See chapter: Setting
up automatic security updates to see how to edit crontab.
The following line in crontab will sync the clock to timeserver
192.168.1.110 every day at 06:25 am.
25 06 * * * /usr/sbin/ntpdate 192.168.1.110
( Debian: ntpdate is not installed by default, you can
install it with the command: sudo apt-get -y install
ntpdate )
Get time with systemd
With systemd we need to create two text files that instructs systemd for
what to do (get time from a timeserver) and when (daily at a specific time).
First create the file "synchronize_clock.service" that
instructs systemd what to do (get time). Startup the nano - editor to create
the file with the command:
sudo nano /etc/systemd/system/synchronize_clock.service
Add the following content to the file:
[Unit]
Desciption=Synchronize Clock
[Service]
Type=simple
ExecStart=/usr/sbin/ntpdate
192.168.1.110
Now create the file "synchronize_clock.timer" that
instructs systemd when to run the task (every day at 06:25 am). Startup
the nano - editor to create the file with the command:
sudo nano /etc/systemd/system/synchronize_clock.timer
Add the following content to the file:
[Unit]
Description=Synchronize Clock
[Timer]
OnCalendar=*-*-* 00:06:25
Unit=synchronize_clock.service
[Install]
WantedBy=timers.target
Then we need to enable the timer with the command:
sudo systemctl enable synchronize_clock.timer
&& systemctl start synchronize_clock.timer
( Debian: ntpdate is not installed by default, you can
install it with the command: sudo apt-get -y install
ntpdate )
The 2.3 release of FreeLCS introduces a tool that can be used to backup and
restore a FreeLCS installation. This functionality can be used to clone a
installation to any number of machines. Neither the backup nor the restore
scripts requires a graphical desktop and both can be run over a ssh -
connection on a 'headless machine' .
This functionality is targeted at advanced users who know their way around
Linux and the Terminal.
Note: the backup script can be found in FreeLCS zip - file
in location: 'Backup_FreeLCS_configuration / 00-backup_freelcs_configuration.sh'.
Usage
- Install FreeLCS with the normal graphical installer and adjust
settings the way you want.
- Then run '00-backup_freelcs_configuration.sh' to make
a backup of the installation settings. Files needed for restoration and
a restoration script will be created in directory 'freelcs_backup'.
- Copy the contents of dir 'freelcs_backup' to all
machines that you want to have the same configuration and run the
restoration script '00-restore_freelcs_configuration.sh'
on each.
- The restoration script will install all programs and scripts that
FreeLCS needs to function. After restoration all machines will have
identical FreeLCS installation.
- Reboot the machines or start loudness correction scripts manually
(restoration script displays the startup command at the end of the run).
Result: The FreeLCS installation has been cloned to several machines.
Important notes:
- It is very important that you restore FreeLCS onto the same Linux
distro and version that it was originally installed on. There are some
differences between Linux versions and FreeLCS adjusts the installation
according to these differences. FreeLCS might not work correctly if
restored onto a wrong distro or version.
- When you first run the FreeLCS installer you define which user account
is used to run FreeLCS programs. It is important that you create this
same user on all machines where you restore a FreeLCS backup. If the
user account defined during FreeLCS installation does not exist then
FreeLCS programs fail to run.
- FreeLCS installation requires either a connection to the internet or
access to a local Debian / Ubuntu package repository.
If you have found an error in FreeLCS software or documentation please
report it so that it can be corrected.
If you find that FreeLCS software crashes or behaves in ways it should not,
try first to find out if the problem is caused by a file in the HotFolder.
If a certain file or file format causes the problem please make a copy of
the file / files for later use. The files might be needed to confirm that
the bugfix really solves the problem.
When you file a bugreport keep in mind that the developer needs to be able
to reproduce the bug in his own system in order to fix it. So when reporting
a bug report the following:
- The operating system version that you use.
- The version of the FreeLCS - package that you use.
- The steps that needs to be done in order to make the bug appear.
- If a file causes the bug and you want to send the file to the
developer, then store the file in a cloud file storage system for
example DropBox's Public - folder and add the download link to the bug
report.
- Error messages are good sources for information when hunting a bug, so
if you get one please add it to the bug report.
- If a program just stops working, then it has crashed. In most cases
the program is not able to show any error message to the user because
the program runs in the background. An error message holds valuable
information about what went wrong and if you want to help to sort out
the cause of the error you can run the program manually in Terminal.
When a program is run manually in Terminal the user can see all possible
error messages. Click
here to see how a program can be manually run in the Terminal.
Report bugs here (requires creating an free account): https://sourceforge.net/p/freelcs/tickets/
When you have logged in navigate to the link above and click the "Create
Ticket" - button on the left. When you create a ticket, the
developer gets the bugreport in email.
LoudnessCorrection.py
LoudnessCorrection.py is the program that is responsible for processing the
files that appear in the HotFolder. Normally LoudnessCorrection.py runs in
the background and has no way to display error messages to the user. The
program can however be manually started in the Terminal.
- Open the Terminal and stop all FreeLCS programs with the command (asks
for root password): sudo systemctl stop freelcs
Now there are two ways to run LoudnessCorrection.py, the first one
discards all settings user defined in the installer and runs with default
settings. When you run the program in this mode you need to add the full
path to the target directory at the end of the command. The target
directory is the directory which has Hotfolder "LoudnessCorrection"
inside it. Note that running the program like this the language defaults
to english meaning the program expects the HotFolder name to be "LoudnessCorrection".
- Run the program with default settings: /usr/bin/LoudnessCorrection.py
/mountpoint/
Note that when running in this mode the program outputs a lot of text, it
tells all the time what it is doing.
The second way to run LoudnessCorrection.py is to use the settings that
user defined in the installer. The settings are stored in file /etc/Loudness_Correction_Settings.pickle
- Run the program with user defined settings: /usr/bin/LoudnessCorrection.py
-configfile /etc/Loudness_Correction_Settings.pickle
When running in this mode there will be no output unless the program
crashes.
HeartBeat_Checker.py
- If you have not already done so open the Terminal and stop all FreeLCS
programs (asks for root password): sudo systemctl stop freelcs
- Run HeartBeat_Checker manually in Terminal: /usr/bin/HeartBeat_Checker.py
-configfile /etc/Loudness_Correction_Settings.pickle
HeartBeat_Checker does not display anything unless it crashes.
Installer.py
- Open Terminal and navigate to the directory where installer.py is
located.
- Make installer executable with this command: chmod 755
installer.py
- Run installer with command: ./installer.py
Installer only displays something if it crashes.
Typical Python error message
If a program crashes then the Python3 interpreter displays an error message
telling what went wrong. A typical Python error message looks like this:
If you get a message like this please copy it to the bug report. This
message is valuable since it tells the developer exactly on which line of
the program code the error happened.
To copy text from the Terminal first select the text to be copied and then
copy it with the keyboard command: shift + ctrl + c
Paste the text to the bug report.
FreeLCS development happens on Github ( https://github.com/mhartzel/freelcs).
All new versions of software are uploaded there before official release.
Unreleased versions are untested so it is recommended that normal users do
not use these versions on their production servers. The reason for this is
that when new program code is added and old is modified it is possible that
new bugs creep in.
If however you have encountered a bug you can navigate to that webpage and
check the changelog there (Documentation/Changelog.txt) to see if the bug
has already been fixed. If you want to test the latest software versions you
can download all files in the git-repository like this:
- Open the Terminal and get root - permissions (asks for root password):
sudo su
- Install git - software: apt-get -y install git
- Navigate to the directory where you want to Download the latest
FreeLCS files.
- Download the git-repository with the command: git clone
http://github.com/mhartzel/freelcs.git
- This will create a new directory 'freelcs' and put all files inside
it.