<commit_before># Recording
As stated on the [RAAR Import Recordings section](import.md#recordings), RAAR
is not responsible for the actual recording of the audio files. It simply
assumes that recordings are placed within directories defined by
`IMPORT_DIRECTORIES` waiting for the [RAAR Importer](import.md) to pick them
up.

But don't panic :-) we've got you covered in case you haven't your own
recording solution already in place.

The following sections describe a recording solution based on
[JACK](http://www.jackaudio.org/), [Rotter](https://www.aelius.com/njh/rotter/)
and some systemd service units, which plays nicely together with RAAR.

## Overview
[Rotter](https://www.aelius.com/njh/rotter/) is a Recording of Transmission /
Audio Logger for [JACK](http://www.jackaudio.org/). It captures audio from
`jackd`, encodes it in a specified format and creates a new recording file
every hour by default. This makes it ideal to use together with RAAR.

In the following deployment walk-through `rotter` will be configured to capture
the audio from the first two JACK input ports found, while storing the
recordings into the `/var/lib/rotter/raar` directory in the lossless
[FLAC](https://xiph.org/flac/) format. A separate recording-handler will move
the finished recordings from the `/var/lib/rotter/raar` directory to a final
RAAR import directory. Of course, the JACK configuration, audio codec and
directory locations can be customized to meet the requirements of your
environment.

Also note, that the deployment was tested on [CentOS
7](#deployment-on-centos-7-systems), but should work on [other
distributions](#deployment-on-other-distributions) as well (with some minor
modifications).

## Deployment
### Deployment on CentOS 7 systems
There are pre-built binary packages for CentOS 7 available from
[EPEL](https://fedoraproject.org/wiki/EPEL) (jack) and [RaBe APEL package
repository](https://build.opensuse.org/project/show/home:radiorabe:audio)
(rotter), which can be installed as follows:
```bash
# Add EPEL repository
yum install epel-release

# Install jackd and helper tools (from EPEL)
yum install -y jack-audio-connection-kit \
               jack-audio-connection-kit-example-clients

# Add RaBe APEL repository
curl -o /etc/yum.repos.d/home:radiorabe:audio.repo \
     http://download.opensuse.org/repositories/home:/radiorabe:/audio/CentOS_7/home:radiorabe:audio.repo
 
# Install rotter (which will also install "jack-audio-connection-kit" and
# "jack-audio-connection-kit-example-clients")
yum install rotter
```

Install the [raar jackd systemd service instance
override](../config/systemd/jackd@raar.service.d/override.conf):
```bash
# Install the jackd@raar service instance unit override
mkdir "/etc/systemd/system/jackd@raar.service.d"
wget -O "/etc/systemd/system/jackd@raar.service.d/override.conf" \
     https://raw.githubusercontent.com/radiorabe/raar/master/config/systemd/jackd%40raar.service.d/override.conf 

# You might need to adapt the jackd service instance unit override to suite
# your environment
vi /etc/systemd/system/jackd@raar.service.d/override.conf

# Reload systemd manager configuration
systemctl daemon-reload
```

Install the [raar rotter systemd service instance
override](../config/systemd/rotter@raar.service.d/override.conf):
```bash
# Install the rotter@raar service instance unit override
mkdir "/etc/systemd/system/rotter@raar.service.d"
wget -O "/etc/systemd/system/rotter@raar.service.d/override.conf" \
     https://raw.githubusercontent.com/radiorabe/raar/master/config/systemd/rotter%40raar.service.d/override.conf 

# You might need to adapt the rotter service instance unit override to suite
# your environment
vi /etc/systemd/system/rotter@raar.service.d/override.conf

# Reload systemd manager configuration
systemctl daemon-reload
```

You can now enable and start the `raar@rotter.service` instance, which will
also trigger the start of the `raar@jackd.service` instance.
```bash
# Enable and start the service unit instance
systemctl enable raar@rotter.service
systemctl start raar@rotter.service

# Check the status
systemctl status ra<EMAIL>
systemctl status raar@jackd.service

# In case of problems, inspect the systemd journal
journalctl -u raar@rotter.service
journalctl -u raar@jackd.service
```

The recordings should appear in the `/var/lib/rotter/raar` directory.

As a final step, install the [RAAR Record Handler](#raar-record-handler).

### Deployment on other distributions
#### Dedicated system user for recording
First, a dedicated system user and group will be created under which all
involved processes will run. The user and group is named `rotter` (you might
need to adapt the supplementary groups, `audio` and `jackuser`, to match with
your distribution).
```bash
# Create a dedicated audio recording user which belongs to the audio and
# jackuser groups. The later is required in order to gain real-time priority
# see also /etc/security/limits.d/95-jack.conf
useradd --comment "rotter system user" \
        --home-dir "/var/lib/rotter" \
        --create-home \
        --groups audio,jackuser \
        --password '*' \
        --system \
        --shell /sbin/nologin \
        --user-group \
        rotter
```

#### ALSA device configuration and testing
In case you want to use an [ALSA](http://www.alsa-project.org) device (such as
an USB or PCI audio interface, or a virtual AoIP device) as your `jackd`
backend, you have to configure it beforehand. Afterwards test that you're able
to record from its capture device, with the help of `arecord`:
```bash
# Capture 10 seconds via arecord directly from the first ALSA device as the
# rotter user
su -l -s /bin/bash \
   -c 'arecord -D hw:0 -c 2 -d 10 -r 48000 -f S32_LE -v /tmp/test-arecord.wav' \
   rotter
```

Keep in mind, that you will have to change the jack configuration later on, if
your device isn't available as `hw:0` (refer to `arecord -L`).  Also note, that
you might have to adapt the sample format `-f ...` option according to your
device's capabilities (refer to `arecord -D hw:0 --dump-hw-params`).

If the recorded test file can be played as expected, continue with the next
section.

#### Jack
Install `jackd` ([jack2](https://github.com/jackaudio/jack2)) and the helper
tools
([example-clients](https://github.com/jackaudio/jack2/tree/master/example-clients))
from the packages provided by your distribution or compile it from source
([jack2 releases](https://github.com/jackaudio/jack2/releases)).

Allow headless operation of `jackd` by allowing users of the `rotter` group to
own the first audio device service (you might have to adapt
`org.freedesktop.ReserveDevice1.Audio0` according to your device):
```bash
wget -O /etc/dbus-1/system.d/rotter.conf \
     https://raw.githubusercontent.com/radiorabe/centos-rpm-rotter/master/dbus-rotter.conf

# Reload the D-Bus configuration
systemctl reload dbus
```

Install the [jackd systemd service unit
template](https://github.com/radiorabe/centos-rpm-rotter/blob/master/jackd%40.service)
and [raar jackd systemd service instance
override](config/systemd/jackd@raar.service.d/override.conf):
```bash
# Install the jackd system service unit template
wget -O "/etc/systemd/system/jackd@.service" \
     https://raw.githubusercontent.com/radiorabe/centos-rpm-rotter/master/jackd%40.service

# Install the jackd@raar service instance unit override
mkdir "/etc/systemd/system/jackd@raar.service.d"
wget -O "/etc/systemd/system/jackd@raar.service.d/override.conf" \
     https://raw.githubusercontent.com/radiorabe/raar/master/config/systemd/jackd%40raar.service.d/override.conf 

# You might need to adapt the jackd service instance unit override to suite
# your environment
vi /etc/systemd/system/jackd@raar.service.d/override.conf

# Reload systemd manager configuration
systemctl daemon-reload
```

#### Rotter
Install `rotter` from the packages provided by your distribution or [compile it
from source](https://github.com/njh/rotter/blob/master/INSTALL).

Install the [rotter systemd service unit
template](https://github.com/radiorabe/centos-rpm-rotter/blob/master/rotter%40.service)
and [raar rotter systemd service instance
override](config/systemd/rotter@raar.service.d/override.conf):
```bash
# Install the rotter system service unit template
wget -O "/etc/systemd/system/rotter@.service" \
     https://raw.githubusercontent.com/radiorabe/centos-rpm-rotter/master/rotter%40.service

# Install the rotter@raar service instance unit override
mkdir "/etc/systemd/system/rotter@raar.service.d"
wget -O "/etc/systemd/system/rotter@raar.service.d/override.conf" \
     https://raw.githubusercontent.com/radiorabe/raar/master/config/systemd/rotter%40raar.service.d/override.conf 

# You might need to adapt the rotter service instance unit override to suite
# your environment
vi /etc/systemd/system/rotter@raar.service.d/override.conf

# Reload systemd manager configuration
systemctl daemon-reload
```

You can now enable and start the `ra<EMAIL>` instance, which will
also trigger the start of the `raar@jackd.<EMAIL>` instance.
```bash
# Enable and start the service unit instance
systemctl enable raar@rotter.<EMAIL>
systemctl start raar@rotter.<EMAIL>

# Check the status
systemctl status ra<EMAIL>
systemctl status raar@jackd.service

# In case of problems, inspect the systemd journal
journalctl -u <EMAIL>
journalctl -u ra<EMAIL>
```

The recordings should appear in the `/var/lib/rotter/raar` directory:
```bash
ls -la /var/lib/rotter/raar
```

```
total 717844
drwxr-xr-x. 2 rotter rotter      4096 Feb  6 16:59 .
drwxr-xr-x. 3 rotter rotter        17 Feb  6 15:45 ..
-rw-r--r--. 1 rotter rotter 120309610 Feb  6 16:00 2018-02-06T154512+0100_60.flac
-rw-r--r--. 1 rotter rotter 230000737 Feb  6 16:28 2018-02-06T160000+0100_60.flac
-rw-r--r--. 1 rotter rotter 250600686 Feb  6 16:59 2018-02-06T162851+0100_60.flac
-rw-r--r--. 1 rotter rotter 127717296 Feb  6 17:16 2018-02-06T170000+0100_60.flac

```

#### RAAR Record Handler
The [RAAR Record Handler](bin/raar-record-handler.sh) will move the finished
recordings from the `/var/lib/rotter/raar` directory to a final RAAR import
directory (`IMPORT_DIRECTORIES`) for the [RAAR Importer](import.md) to pick
them up.

Install the [RAAR Record Handler](bin/raar-record-handler.sh) and its
corresponding systemd service unit
([raar-record-handler.service](config/systemd/raar-record-handler.service)):
```bash
wget -O /usr/local/bin/raar-record-handler.sh \
     https://raw.githubusercontent.com/radiorabe/raar/master/bin/raar-record-handler.sh

chmod 755 /usr/local/bin/raar-record-handler.sh


wget -O /etc/systemd/system/raar-record-handler.service \
     https://raw.githubusercontent.com/paraenggu/raar/feature/recording/config/systemd/raar-record-handler.service
```

You might want to adapt the destination directory, which defaults to
`/var/tmp/raar/import` (this must match with a directory from
`IMPORT_DIRECTORIES` of the RAAR importer):
```bash
systemctl edit raar-record-handler.service
```

```
[Service]
# Use a different destination directory
Environment="RAAR_RECORD_HANDLER_DEST_DIR="/path/to/my/raar-import/dir"
```

Make sure the `rotter` user has read/write access to the destination directory:
```bash
# Adapt to your import directory
chown rotter:rooter /var/tmp/raar/import
```

Enable and start the `raar-record-handler.service`: 
```bash
# Enable and start the service unit
systemctl enable raar-record-handler.service
systemctl start raar-record-handler.service

# Check the status and logs
systemctl status raar-record-handler.service
journalctl -u raar-record-handler.service
```

At every hour, the service should move the finished recordings to
`/var/tmp/raar/import` (or whatever directory you have configured).

## Troubleshooting
The following commands and logs might be helpful for troubleshooting.

ALSA:
* List all audio devices

   `arecord -l`
   
* List all PCMs

  `arecord -L`
* Dump the capabilities of a device

  `arecord -D <device> --dump-hw-params`
  
* List hardware parameters of an active capture device

 `cat /proc/asound/card0/pcm0c/sub0/hw_params`

Jackd:
* List Jack ports
  
  `su -l -s /bin/bash -c "jack_lsp -s raar -c -p" rotter`

* Status of the `jack<EMAIL>` systemd service instance unit

  `systemctl status j<EMAIL>`

* Systemd journal of `<EMAIL>`

   ```
   journalctl -u <EMAIL>
   journalctl -u <EMAIL> -f
   ```

Rotter:
* Status of the `rot<EMAIL>` systemd service instance unit

  `systemctl status rotter@<EMAIL>`

* Systemd journal of `rot<EMAIL>`

   ```
   journalctl -u rot<EMAIL>
   journalctl -u rot<EMAIL> -f
   ```


RAAR Record Handler:
* Status of the `raar-record-handler.service` systemd service unit

  `systemctl status raar-record-handler.service`

* Systemd journal of `raar-record-handler.service`

   ```
   journalctl -u raar-record-handler.service
   journalctl -u raar-record-handler.service -f
   ```

## Links
* [Jack Audio Connection Kit](http://www.jackaudio.org/)
* [Rotter](https://www.aelius.com/njh/rotter/)
* [CentOS 7 RPM Specfile for
  Rotter](https://github.com/radiorabe/centos-rpm-rotter)
* [Jack and Rotter Systemd service unit templates
  explained](https://github.com/radiorabe/centos-rpm-rotter#systemd-service-unit-templates-explained)
<commit_msg>Recording doc - Fix wording and typos<commit_after># Recording
As stated on the [RAAR Import Recordings section](import.md#recordings), RAAR
is not responsible for the actual recording of the audio files. It simply
assumes that recordings are placed within directories defined by
`IMPORT_DIRECTORIES` waiting for the [RAAR Importer](import.md) to pick them
up.

But don't panic :-) we've got you covered in case you don't have your own
recording solution already in place.

The following sections describes a recording solution based on
[JACK](http://www.jackaudio.org/), [Rotter](https://www.aelius.com/njh/rotter/)
and some systemd service units, which plays nicely together with RAAR.

## Overview
[Rotter](https://www.aelius.com/njh/rotter/) is a Recording of Transmission /
Audio Logger for [JACK](http://www.jackaudio.org/). It captures audio from
`jackd`, encodes it in a specified format and creates a new recording file
every hour by default. This makes it ideal to use together with RAAR.

In the following deployment walk-through `rotter` will be configured to capture
the audio from the first two JACK input ports found, while storing the
recordings into the `/var/lib/rotter/raar` directory in the lossless
[FLAC](https://xiph.org/flac/) format. A separate recording-handler will move
the finished recordings from the `/var/lib/rotter/raar` directory to a final
RAAR import directory. Of course, the JACK configuration, audio codec and
directory locations can be customized to meet the requirements of your
environment.

Also note, that the deployment was tested on [CentOS
7](#deployment-on-centos-7-systems), but should work on [other
distributions](#deployment-on-other-distributions) as well (with some minor
modifications).

## Deployment
### Deployment on CentOS 7 systems
There are pre-built binary packages for CentOS 7 available from
[EPEL](https://fedoraproject.org/wiki/EPEL) (jack) and [RaBe APEL package
repository](https://build.opensuse.org/project/show/home:radiorabe:audio)
(rotter), which can be installed as follows:
```bash
# Add EPEL repository
yum install epel-release

# Install jackd and helper tools (from EPEL)
yum install -y jack-audio-connection-kit \
               jack-audio-connection-kit-example-clients

# Add RaBe APEL repository
curl -o /etc/yum.repos.d/home:radiorabe:audio.repo \
     http://download.opensuse.org/repositories/home:/radiorabe:/audio/CentOS_7/home:radiorabe:audio.repo
 
# Install rotter (which will also install "jack-audio-connection-kit" and
# "jack-audio-connection-kit-example-clients")
yum install rotter
```

Install the [raar jackd systemd service instance
override](../config/systemd/jackd@raar.service.d/override.conf):
```bash
# Install the jackd@raar service instance unit override
mkdir "/etc/systemd/system/jackd@raar.service.d"
wget -O "/etc/systemd/system/jackd@raar.service.d/override.conf" \
     https://raw.githubusercontent.com/radiorabe/raar/master/config/systemd/jackd%40raar.service.d/override.conf 

# You might need to adapt the jackd service instance unit override to suite
# your environment
vi /etc/systemd/system/jackd@raar.service.d/override.conf

# Reload systemd manager configuration
systemctl daemon-reload
```

Install the [raar rotter systemd service instance
override](../config/systemd/rotter@raar.service.d/override.conf):
```bash
# Install the rotter@raar service instance unit override
mkdir "/etc/systemd/system/rotter@raar.service.d"
wget -O "/etc/systemd/system/rotter@raar.service.d/override.conf" \
     https://raw.githubusercontent.com/radiorabe/raar/master/config/systemd/rotter%40raar.service.d/override.conf 

# You might need to adapt the rotter service instance unit override to suite
# your environment
vi /etc/systemd/system/rotter@raar.service.d/override.conf

# Reload systemd manager configuration
systemctl daemon-reload
```

You can now enable and start the `raar@rotter.service` instance, which will
also trigger the start of the `raar@jackd.<EMAIL>` instance.
```bash
# Enable and start the service unit instance
systemctl enable raar@rotter.<EMAIL>
systemctl start raar@rotter.service

# Check the status
systemctl status raar@rotter.<EMAIL>
systemctl status raar@jackd.service

# In case of problems, inspect the systemd journal
journalctl -u <EMAIL>
journalctl -u <EMAIL>
```

The recordings should appear in the `/var/lib/rotter/raar` directory.

As a final step, install the [RAAR Record Handler](#raar-record-handler).

### Deployment on other distributions
#### Dedicated system user for recording
First, a dedicated system user and group will be created under which all
involved processes will run. The user and group is named `rotter` (you might
need to adapt the supplementary groups, `audio` and `jackuser`, to match with
your distribution).
```bash
# Create a dedicated audio recording user which belongs to the audio and
# jackuser groups. The later is required in order to gain real-time priority
# see also /etc/security/limits.d/95-jack.conf
useradd --comment "rotter system user" \
        --home-dir "/var/lib/rotter" \
        --create-home \
        --groups audio,jackuser \
        --password '*' \
        --system \
        --shell /sbin/nologin \
        --user-group \
        rotter
```

#### ALSA device configuration and testing
In case you want to use an [ALSA](http://www.alsa-project.org) device (such as
an USB or PCI audio interface, or a virtual AoIP device) as your `jackd`
backend, you have to configure it beforehand. Afterwards test that you're able
to record from its capture device, with the help of `arecord`:
```bash
# Capture 10 seconds via arecord directly from the first ALSA device as the
# rotter user
su -l -s /bin/bash \
   -c 'arecord -D hw:0 -c 2 -d 10 -r 48000 -f S32_LE -v /tmp/test-arecord.wav' \
   rotter
```

Keep in mind, that you will have to change the jack configuration later on, if
your device isn't available as `hw:0` (refer to `arecord -L`).  Also note, that
you might have to adapt the sample format `-f ...` option according to your
device's capabilities (refer to `arecord -D hw:0 --dump-hw-params`).

If the recorded test file can be played as expected, continue with the next
section.

#### Jack
Install `jackd` ([jack2](https://github.com/jackaudio/jack2)) and the helper
tools
([example-clients](https://github.com/jackaudio/jack2/tree/master/example-clients))
from the packages provided by your distribution or compile it from source
([jack2 releases](https://github.com/jackaudio/jack2/releases)).

Allow headless operation of `jackd` by allowing users of the `rotter` group to
own the first audio device service (you might have to adapt
`org.freedesktop.ReserveDevice1.Audio0` according to your device):
```bash
wget -O /etc/dbus-1/system.d/rotter.conf \
     https://raw.githubusercontent.com/radiorabe/centos-rpm-rotter/master/dbus-rotter.conf

# Reload the D-Bus configuration
systemctl reload dbus
```

Install the [jackd systemd service unit
template](https://github.com/radiorabe/centos-rpm-rotter/blob/master/jackd%40.service)
and [raar jackd systemd service instance
override](config/systemd/jackd@raar.service.d/override.conf):
```bash
# Install the jackd system service unit template
wget -O "/etc/systemd/system/jackd@.service" \
     https://raw.githubusercontent.com/radiorabe/centos-rpm-rotter/master/jackd%40.service

# Install the jackd@raar service instance unit override
mkdir "/etc/systemd/system/jackd@raar.service.d"
wget -O "/etc/systemd/system/jackd@raar.service.d/override.conf" \
     https://raw.githubusercontent.com/radiorabe/raar/master/config/systemd/jackd%40raar.service.d/override.conf 

# You might need to adapt the jackd service instance unit override to suite
# your environment
vi /etc/systemd/system/jackd@raar.service.d/override.conf

# Reload systemd manager configuration
systemctl daemon-reload
```

#### Rotter
Install `rotter` from the packages provided by your distribution or [compile it
from source](https://github.com/njh/rotter/blob/master/INSTALL).

Install the [rotter systemd service unit
template](https://github.com/radiorabe/centos-rpm-rotter/blob/master/rotter%40.service)
and [raar rotter systemd service instance
override](config/systemd/rotter@raar.service.d/override.conf):
```bash
# Install the rotter system service unit template
wget -O "/etc/systemd/system/rotter@.service" \
     https://raw.githubusercontent.com/radiorabe/centos-rpm-rotter/master/rotter%40.service

# Install the rotter@raar service instance unit override
mkdir "/etc/systemd/system/rotter@raar.service.d"
wget -O "/etc/systemd/system/rotter@raar.service.d/override.conf" \
     https://raw.githubusercontent.com/radiorabe/raar/master/config/systemd/rotter%40raar.service.d/override.conf 

# You might need to adapt the rotter service instance unit override to suite
# your environment
vi /etc/systemd/system/rotter@raar.service.d/override.conf

# Reload systemd manager configuration
systemctl daemon-reload
```

You can now enable and start the `raar<EMAIL>` instance, which will
also trigger the start of the `raar@jackd.service` instance.
```bash
# Enable and start the service unit instance
systemctl enable ra<EMAIL>
systemctl start ra<EMAIL>

# Check the status
systemctl status raar@rot<EMAIL>.<EMAIL>
systemctl status raar@jackd.service

# In case of problems, inspect the systemd journal
journalctl -u <EMAIL>
journalctl -u raar@jackd.<EMAIL>
```

The recordings should appear in the `/var/lib/rotter/raar` directory:
```bash
ls -la /var/lib/rotter/raar
```

```
total 717844
drwxr-xr-x. 2 rotter rotter      4096 Feb  6 16:59 .
drwxr-xr-x. 3 rotter rotter        17 Feb  6 15:45 ..
-rw-r--r--. 1 rotter rotter 120309610 Feb  6 16:00 2018-02-06T154512+0100_60.flac
-rw-r--r--. 1 rotter rotter 230000737 Feb  6 16:28 2018-02-06T160000+0100_60.flac
-rw-r--r--. 1 rotter rotter 250600686 Feb  6 16:59 2018-02-06T162851+0100_60.flac
-rw-r--r--. 1 rotter rotter 127717296 Feb  6 17:16 2018-02-06T170000+0100_60.flac

```

#### RAAR Record Handler
The [RAAR Record Handler](bin/raar-record-handler.sh) will move the finished
recordings from the `/var/lib/rotter/raar` directory to a final RAAR import
directory (`IMPORT_DIRECTORIES`) for the [RAAR Importer](import.md) to pick
them up.

Install the [RAAR Record Handler](bin/raar-record-handler.sh) and its
corresponding systemd service unit
([raar-record-handler.service](config/systemd/raar-record-handler.service)):
```bash
wget -O /usr/local/bin/raar-record-handler.sh \
     https://raw.githubusercontent.com/radiorabe/raar/master/bin/raar-record-handler.sh

chmod 755 /usr/local/bin/raar-record-handler.sh


wget -O /etc/systemd/system/raar-record-handler.service \
     https://raw.githubusercontent.com/paraenggu/raar/feature/recording/config/systemd/raar-record-handler.service
```

You might want to adapt the destination directory, which defaults to
`/var/tmp/raar/import` (this must match with a directory from
`IMPORT_DIRECTORIES` of the RAAR importer):
```bash
systemctl edit raar-record-handler.service
```

```
[Service]
# Use a different destination directory
Environment="RAAR_RECORD_HANDLER_DEST_DIR="/path/to/my/raar-import/dir"
```

Make sure the `rotter` user has read/write access to the destination directory:
```bash
# Adapt to your import directory
chown rotter:rooter /var/tmp/raar/import
```

Enable and start the `raar-record-handler.service`: 
```bash
# Enable and start the service unit
systemctl enable raar-record-handler.service
systemctl start raar-record-handler.service

# Check the status and logs
systemctl status raar-record-handler.service
journalctl -u raar-record-handler.service
```

At every hour, the service should move the finished recordings to
`/var/tmp/raar/import` (or whatever directory you have configured).

## Troubleshooting
The following commands and logs might be helpful for troubleshooting.

ALSA:
* List all audio devices

   `arecord -l`
   
* List all PCMs

  `arecord -L`
* Dump the capabilities of a device

  `arecord -D <device> --dump-hw-params`
  
* List hardware parameters of an active capture device

 `cat /proc/asound/card0/pcm0c/sub0/hw_params`

Jackd:
* List Jack ports
  
  `su -l -s /bin/bash -c "jack_lsp -s raar -c -p" rotter`

* Status of the `<EMAIL>` systemd service instance unit

  `systemctl status <EMAIL>`

* Systemd journal of `<EMAIL>`

   ```
   journalctl -u <EMAIL>
   journalctl -u j<EMAIL> -f
   ```

Rotter:
* Status of the `rot<EMAIL>` systemd service instance unit

  `systemctl status <EMAIL>`

* Systemd journal of `<EMAIL>`

   ```
   journalctl -u <EMAIL>
   journalctl -u <EMAIL> -f
   ```


RAAR Record Handler:
* Status of the `raar-record-handler.service` systemd service unit

  `systemctl status raar-record-handler.service`

* Systemd journal of `raar-record-handler.service`

   ```
   journalctl -u raar-record-handler.service
   journalctl -u raar-record-handler.service -f
   ```

## Links
* [Jack Audio Connection Kit](http://www.jackaudio.org/)
* [Rotter](https://www.aelius.com/njh/rotter/)
* [CentOS 7 RPM Specfile for
  Rotter](https://github.com/radiorabe/centos-rpm-rotter)
* [Jack and Rotter Systemd service unit templates
  explained](https://github.com/radiorabe/centos-rpm-rotter#systemd-service-unit-templates-explained)

{'fraction_non_alphanumeric': 0.10995317927805467, 'fraction_numerical': 0.01638725268086392, 'mean_word_length': 4.280103668261563, 'pattern_counts': {'":': 0, '<': 45, '<?xml version=': 0, '>': 45, 'https://': 46, 'lorem ipsum': 0, 'www.': 14, 'xml': 0}, 'pii_count': 45, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4285559', 'n_tokens_mistral': 8894, 'n_tokens_neox': 8322, 'n_words': 2656}