# ALSA Scarlett Control Panel Installation

## Quick Start

Choose the path that matches your interface. RPM and deb packages
are available from each repository's
[GitHub Releases](https://github.com/geoffreybennett/alsa-scarlett-gui/releases)
page; alternatively, see [Building from Source](#building-from-source)
below.

### Scarlett 2nd/3rd Gen, Small 4th Gen, Clarett, Vocaster

1. Ensure your kernel meets the minimum version (see
   [table below](#linux-kernel)) — all major distros already do
2. Install
   [scarlett2-firmware](https://github.com/geoffreybennett/scarlett2-firmware/releases)
3. Install
   [alsa-scarlett-gui](https://github.com/geoffreybennett/alsa-scarlett-gui/releases)
4. Run `alsa-scarlett-gui` — it will prompt you to update your
   device firmware if needed

### Scarlett 4th Gen 16i16, 18i16, 18i20

1. Ensure you are running Linux 6.14+ (`uname -r` to check)
2. Install
   [fcp-support](https://github.com/geoffreybennett/fcp-support/releases)
   — the `fcp-server` daemon will start automatically when you
   plug in your interface
3. Install
   [scarlett4-firmware](https://github.com/geoffreybennett/scarlett4-firmware/releases)
4. Install
   [alsa-scarlett-gui](https://github.com/geoffreybennett/alsa-scarlett-gui/releases)
5. Run `alsa-scarlett-gui` — it will prompt you to update your
   device firmware if needed

### Scarlett 1st Gen 6i6, 8i6, 18i6, 18i8, 18i20

1. Ensure you are running Linux 3.19+ (any modern distro)
2. Install
   [alsa-scarlett-gui](https://github.com/geoffreybennett/alsa-scarlett-gui/releases)

## Prerequisites

### Linux Kernel

You need to be running a Linux Kernel that contains the appropriate
driver for your interface. Use `uname -r` to check what kernel version
you are running.

Check the following table to see which driver your interface uses and
the first kernel version that the driver was included in:

| Series    | Models | Driver | Kernel Version |
|-----------|--------|--------|:----------------------:|
| Scarlett 1st Gen | Solo, 2i2, 2i4 | N/A* | Any |
| Scarlett 1st Gen | 6i6, 8i6, 18i6, 18i8, 18i20 | Scarlett 1st Gen Mixer Driver | 3.19+ |
| Scarlett 2nd Gen | Solo, 2i2, 2i4 | N/A* | Any |
| Scarlett 2nd Gen | 6i6, 18i8, 18i20 | Scarlett2 Mixer Driver | 6.7+ |
| Scarlett 3rd Gen | Solo, 2i2, 4i4, 8i6, 18i8, 18i20 | Scarlett2 Mixer Driver | 6.7+ |
| Scarlett 4th Gen | Solo, 2i2, 4i4 | Scarlett2 Mixer Driver | 6.8+ |
| Scarlett 4th Gen | 16i16, 18i16, 18i20 | FCP (Focusrite Control Protocol) Driver | 6.14+ |
| Clarett USB and Clarett+ | 2Pre, 4Pre, 8Pre | Scarlett2 Mixer Driver | 6.7+ |
| Vocaster | One, Two | Scarlett2 Mixer Driver | 6.10+ |

\* The small 1st Gen and 2nd Gen models don’t have any proprietary
software controls so they don’t need a driver beyond the standard ALSA
USB Audio driver. This means that this application (alsa-scarlett-gui)
is not needed, useful, or supported for these models.

If your distribution doesn't include a recent-enough kernel for
your interface, update your distribution or kernel. All major
distributions now ship kernels that include the required drivers.

Kernel 6.7 and later have the Scarlett2 driver enabled by default.
The Scarlett 1st Gen driver and the FCP drivers are always enabled.

#### Enabling the Scarlett2 Driver

Some kernels before 6.7 have an earlier version of the Scarlett2
driver which is disabled by default. If this is you, check the driver
status (after plugging your interface in) with this command:

```
dmesg | grep -i -A 5 -B 5 focusrite
```

If all is good you’ll see messages like this:

```
New USB device found, idVendor=1235, idProduct=8215, bcdDevice= 6.0b
Product: Scarlett 18i20 USB
Focusrite Scarlett Gen 3 Mixer Driver enabled (pid=0x8215); ...
```

If you don’t see the “Mixer Driver” message or if it shows “disabled”
then check the [OLDKERNEL.md](OLDKERNEL.md) instructions (or,
preferably, upgrade your distro/kernel!).

### FCP User-Space Driver

The FCP kernel driver requires the user-space driver `fcp-server` in
order to do anything useful. This is available from the
[fcp-support](https://github.com/geoffreybennett/fcp-support) repo.

### Gtk4

You need a Linux distribution with Gtk4 development libraries. If it
doesn’t have them natively, try the Flatpak instructions below.

### Firmware

#### Scarlett2 Driver

As of Linux 6.8, firmware updates of all supported interfaces from the
2nd Gen onwards can be done through Linux. This is mandatory for
Scarlett 4th Gen and Vocaster interfaces (unless you’ve already
updated it using the manufacturer’s software), and optional but
recommended for Scarlett 2nd and 3rd Gen, Clarett USB, and Clarett+
interfaces.

Download the firmware from
https://github.com/geoffreybennett/scarlett2-firmware and place it in
`/usr/lib/firmware/scarlett2` or use the RPM/deb package.

#### FCP Driver

Firmware updates for the big Scarlett 4th Gen interfaces can be done
through `alsa-scarlett-gui` (which will prompt you automatically when
an update is available) or the CLI `fcp-tool` utility from the
[fcp-support](https://github.com/geoffreybennett/fcp-support) repo.
Updating the firmware is mandatory for these interfaces.

Download the firmware from
https://github.com/geoffreybennett/scarlett4-firmware and place it in
`/usr/lib/firmware/scarlett4` or use the RPM/deb package.

## Building from Source

On Fedora, these packages need to be installed:

```
sudo dnf -y install make gcc alsa-lib-devel gtk4-devel openssl-devel
```

On OpenSUSE:

```
sudo zypper in git alsa-devel gtk4-devel libopenssl-devel
```

On Ubuntu:

```
sudo apt -y install git make gcc libgtk-4-dev libasound2-dev libssl-dev
```

On Arch:

```
sudo pacman -S gtk4
```

To download from github:

```
git clone https://github.com/geoffreybennett/alsa-scarlett-gui
cd alsa-scarlett-gui
```

To build:

```
cd src
make -j$(nproc)
```

To run:

```
./alsa-scarlett-gui
```

You can install it into `/usr/local` (binary, desktop file, and icon)
with:

```
sudo make install
```

And uninstall with:

```
sudo make uninstall
```

Continue on to reading [USAGE.md](USAGE.md) for how to use the GUI.

## Flatpak

With Flatpak, in any distro:

```
flatpak-builder --user --install --force-clean flatpak-build \
    vu.b4.alsa-scarlett-gui.yml
```

Be sure to use `flatpak-build` as the directory where the flatpak is
built or hence you risk bundling the artifacts when committing!

If you get messages like these:

```
Failed to init: Unable to find sdk org.gnome.Sdk version 45
Failed to init: Unable to find runtime org.gnome.Platform version 45
```

Then install them:

```
flatpak install org.gnome.Sdk
flatpak install org.gnome.Platform
```

If you get:

```
Looking for matches…
error: No remote refs found for ‘org.gnome.Sdk’
```

Then:

```
flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
```
