Initial commit: fcp-support-git v0.5

- Focusrite Control Protocol user-space driver
- Supports Scarlett 4th Gen 16i16, 18i16, 18i20
- Includes systemd service and udev rules
- Auto-starts when device is connected
- Sets required CAP_SYS_RAWIO capability
This commit is contained in:
Sebastian Paul 2025-10-15 12:47:23 +02:00
commit f6628b601a
3 changed files with 155 additions and 0 deletions

27
.SRCINFO Normal file
View file

@ -0,0 +1,27 @@
pkgbase = fcp-support-git
pkgdesc = Focusrite Control Protocol user-space driver for Scarlett 4th Gen big models (16i16, 18i16, 18i20)
pkgver = r21.edae476
pkgrel = 1
url = https://github.com/geoffreybennett/fcp-support
install = fcp-support-git.install
arch = x86_64
arch = i686
license = GPL-3.0-or-later
makedepends = gcc
makedepends = make
makedepends = git
makedepends = pkgconf
depends = alsa-lib
depends = systemd-libs
depends = openssl
depends = zlib
depends = json-c
depends = libcap
optdepends = alsa-scarlett-gui-git: GUI for controlling Focusrite interfaces
optdepends = scarlett4-firmware: Firmware files for Scarlett 4th Gen (required for first-time setup)
provides = fcp-support
conflicts = fcp-support
source = git+https://github.com/geoffreybennett/fcp-support.git
sha256sums = SKIP
pkgname = fcp-support-git

57
PKGBUILD Normal file
View file

@ -0,0 +1,57 @@
# Maintainer: z3n <z3nlabs at proton dot me>
pkgname=fcp-support-git
_pkgname=fcp-support
pkgver=r21.edae476
pkgrel=1
pkgdesc="Focusrite Control Protocol user-space driver for Scarlett 4th Gen big models (16i16, 18i16, 18i20)"
arch=('x86_64' 'i686')
url="https://github.com/geoffreybennett/fcp-support"
license=('GPL-3.0-or-later')
depends=(
'alsa-lib'
'systemd-libs'
'openssl'
'zlib'
'json-c'
'libcap'
)
makedepends=(
'gcc'
'make'
'git'
'pkgconf'
)
optdepends=(
'alsa-scarlett-gui-git: GUI for controlling Focusrite interfaces'
'scarlett4-firmware: Firmware files for Scarlett 4th Gen (required for first-time setup)'
)
provides=("$_pkgname")
conflicts=("$_pkgname")
install=$pkgname.install
source=("git+${url}.git")
sha256sums=('SKIP')
pkgver() {
cd "$_pkgname"
# Get version from git tags
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}
build() {
cd "$srcdir/$_pkgname"
# Build with proper version string and PREFIX
VERSION="$(git describe --abbrev=4 --dirty --always --tags 2>/dev/null || echo 'Unknown')" \
PREFIX=/usr \
make
}
package() {
cd "$srcdir/$_pkgname"
# Install to /usr instead of /usr/local
make install \
PREFIX=/usr \
DESTDIR="$pkgdir"
}

71
fcp-support-git.install Normal file
View file

@ -0,0 +1,71 @@
post_install() {
echo ""
echo "==> Setting required capabilities on fcp-server..."
if ! setcap cap_sys_rawio+ep /usr/bin/fcp-server; then
echo "WARNING: Failed to set capabilities on fcp-server"
echo " You may need to run manually: sudo setcap cap_sys_rawio+ep /usr/bin/fcp-server"
fi
echo "==> Reloading systemd and udev..."
systemctl daemon-reload
udevadm control --reload-rules
echo "==> Triggering udev for Focusrite devices..."
udevadm trigger --action=add --subsystem-match=sound --attr-match=idVendor=1235
echo ""
echo "==> Focusrite Control Protocol Server installed successfully!"
echo ""
echo " The fcp-server service should now be running if your"
echo " Focusrite Scarlett 4th Gen device (16i16/18i16/18i20) is connected."
echo ""
echo "==> Check service status:"
echo " systemctl status fcp-server@*"
echo ""
echo "==> Make sure you are in the 'audio' group:"
echo " sudo usermod -a -G audio \$USER"
echo " (then log out and back in)"
echo ""
echo "==> Install 'alsa-scarlett-gui-git' for a graphical interface:"
echo " yay -S alsa-scarlett-gui-git"
echo ""
echo "==> Firmware update required on first use:"
echo " Install scarlett4-firmware package and run:"
echo " fcp-tool --update-firmware"
echo ""
}
post_upgrade() {
echo ""
echo "==> Setting required capabilities on fcp-server..."
if ! setcap cap_sys_rawio+ep /usr/bin/fcp-server; then
echo "WARNING: Failed to set capabilities on fcp-server"
echo " You may need to run manually: sudo setcap cap_sys_rawio+ep /usr/bin/fcp-server"
fi
echo "==> Reloading systemd and udev..."
systemctl daemon-reload
udevadm control --reload-rules
echo "==> Restarting fcp-server..."
systemctl restart fcp-server@* 2>/dev/null || true
echo ""
echo "==> fcp-support has been updated"
echo " Service status: systemctl status fcp-server@*"
echo ""
}
pre_remove() {
echo ""
echo "==> Stopping fcp-server services..."
systemctl stop 'fcp-server@*' 2>/dev/null || true
}
post_remove() {
echo ""
echo "==> Reloading systemd and udev..."
systemctl daemon-reload
udevadm control --reload-rules
echo ""
}