From: "Ismaïl Bahloul" <i.bahloul01@gmail.com>
To: linux-sound@vger.kernel.org
Cc: linux-usb@vger.kernel.org, alsa-devel@alsa-project.org,
perex@perex.cz, tiwai@suse.com, linux-kernel@vger.kernel.org,
"Ismaïl Bahloul" <i.bahloul01@gmail.com>
Subject: [RFC PATCH v2 0/4] ALSA: usb: add RME Babyface Pro FS driver (proprietary mode)
Date: Tue, 1 Sep 2026 10:06:31 +0100 [thread overview]
Message-ID: <20260901090635.9208-1-i.bahloul01@gmail.com> (raw)
Hi,
Changes since v1:
- Split into a 4-patch series (core+PCM / mixer / front panel / DSP EQ),
per Takashi's note that splitting would help review. Each patch builds
on its own; the control surface in [1/4] is stubbed so the module
links at every step.
- Clarified the volume model: the system volume is PipeWire's host-side
software gain (no hardware write), matching Windows. The only
in-kernel volume work is the dB TLV metadata and the register-law
mapping for the non-1 dB hardware steps.
- Fixed the 32-bit ARM build (undefined refs to __aeabi_ldivmod /
__aeabi_uldivmod) by switching to div_u64/div_s64/div64_s64 from
<linux/math64.h>. Reported-by/Closes from the kernel test robot.
- Added an Assisted-by tag disclosing LLM assistance, per your request.
I'm sending this as an RFC for a driver I've been working on for the
RME Babyface Pro FS in its proprietary USB mode (VID 0x2a39, PID
0x3fc0). In that mode the PCM stream runs on interrupt endpoints
(interface 5, ep 0x01 OUT / 0x82 IN) instead of the class-compliant
isochronous path, so it can't be handled as a quirk on top of
snd-usb-audio. It needs a standalone driver, and I modeled it on
snd-usb-caiaq, which is the existing in-tree precedent for
interrupt-based USB audio streaming. The driver is hardware-validated
on a real unit and the code is checkpatch, sparse and W=1 clean.
The vendor protocol (control requests, register map, front-panel
readback) was reverse-engineered from Windows USB captures and
verified bit by bit on hardware. The capture analysis, the calibrated
laws, and a userspace reference implementation live in the sibling
TuxMix repo (https://github.com/ismail-bahloul/TuxMix). This driver is
the kernel side of that effort.
What's included:
- Interrupt-URB PCM streaming, full-duplex, 2-12 channels, S24_LE,
9 sample rates from 32 to 192 kHz across 3 USB bandwidth classes.
- ALSA mixer: 6 output masters and mutes, the 6x14 crosspoint routing
matrix, 4 mic/instrument preamp gains with phantom power and PAD,
pitch/varispeed, loopback, and a few device-specific toggles
(AN 1>2, input link, MS processor, DIM, width, FX send).
- Front-panel emulation. The unit has no onboard DSP for its own
panel, so the host mirrors TotalMix's role: it translates physical
wheel/button events into mixer writes and exposes the decoded panel
state as read-only ALSA controls.
- A hardware 3-band plus low-cut parametric EQ for the 4 analog-input
strips, computed in fixed-point (no FPU use) and uploaded as
coefficient blocks.
- Mixer-state persistence across interface re-probes and system
suspend/resume, because the firmware has no state readback of its
own.
Validation: a full-duplex sweep across the whole rate x period matrix
with a signal-integrity tap, start/stop stress (30 cycles), mixer-state
restore across an interface unbind/rebind, and a mid-stream disconnect.
All of that runs through the automated regression suite kept in the
driver's development tree.
Known limitations, stated up front:
- USB autosuspend is not supported yet. I disable it explicitly
(usb_disable_autosuspend at probe, balanced at disconnect) rather
than ship something untested. The front-panel poll and keepalive
work items run continuously, and nothing pairs usb_autopm_get/put
around the stream, so an autosuspend request could race a live
stream. S3 suspend/resume works and is tested. Full autosuspend
(pausing the panel/keepalive work plus autopm pairing) is a
follow-up.
- A few protocol items aren't fully pinned down, but they don't affect
the shipped controls; the relevant paths are hardware-verified. They
are documented as open in PROTOCOL.md: the preamp readback index
semantics (0x003F vs 0x0000), a width strip-ownership edge case, and
the exact high-frequency warping of the EQ coefficient computation
versus TotalMix's curve.
- The latency profile is selected at load time via the frames_per_urb
and nurbs module params. Default is 256 frames/URB, matching
TotalMix's 256-sample buffer; frames_per_urb=16 nurbs=16 gives a
0.33 ms monitoring-grade floor. Changing profile currently means a
module reload. A runtime reconfiguration (like RME's own Fireface
USB Settings panel) is a post-merge follow-up.
This is an RFC. I'm mainly after feedback on the interrupt-URB PCM
design, the control naming and topology, the subdirectory layout
(sound/usb/babyfacepro/), and the two-file structure.
Per your note that splitting would help review, I've submitted this as
a 4-patch series instead of one big patch. Each patch builds on its own
(verified in-tree against linux-next):
- [1/4] core driver + PCM streaming (control surface stubbed)
- [2/4] the ALSA mixer (masters, crosspoints, gains, flags)
- [3/4] the front-panel poll + controls
- [4/4] the hardware DSP EQ
The control surface in [1/4] is stubbed (not shipped as written) purely
so the module links at each step; the final patch lands at the complete
driver. Happy to re-cut the boundaries if you'd prefer a different
granularity.
Disclosure: the reverse-engineering (decoding the Windows USB
captures, magic packets, and the hardware/front-panel behavior) and
the substantial portions of the kernel implementation were written
with heavy assistance from an AI coding assistant (DeepSeek V4 Flash,
credited per patch as Assisted-by). The code was additionally re-
reviewed by a separate AI pass for correctness and security issues.
All of it was then verified by hand on real hardware; the human
author remains responsible for the result via Signed-off-by.
Thanks for reading,
Ismaïl
Ismaïl Bahloul (4):
ALSA: usb: add RME Babyface Pro FS driver (proprietary mode) — core +
PCM
ALSA: usb: babyface-pro: add the mixer control surface
ALSA: usb: babyface-pro: add the front-panel poll + controls
ALSA: usb: babyface-pro: add the hardware DSP EQ
MAINTAINERS | 6 +
sound/usb/Kconfig | 18 +
sound/usb/Makefile | 2 +-
sound/usb/babyfacepro/Makefile | 2 +
sound/usb/babyfacepro/babyfacepro-ctl.c | 2853 +++++++++++++++++++++++
sound/usb/babyfacepro/babyfacepro.c | 1451 ++++++++++++
sound/usb/babyfacepro/babyfacepro.h | 391 ++++
7 files changed, 4722 insertions(+), 1 deletion(-)
create mode 100644 sound/usb/babyfacepro/Makefile
create mode 100644 sound/usb/babyfacepro/babyfacepro-ctl.c
create mode 100644 sound/usb/babyfacepro/babyfacepro.c
create mode 100644 sound/usb/babyfacepro/babyfacepro.h
--
2.55.0
next reply other threads:[~2026-09-01 9:07 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-01 9:06 Ismaïl Bahloul [this message]
2026-09-01 9:06 ` [RFC PATCH v2 1/4] ALSA: usb: add RME Babyface Pro FS driver (proprietary mode) — core + PCM Ismaïl Bahloul
2026-09-01 14:07 ` [RFC PATCH v2 1/4] ALSA: usb: add RME Babyface Pro FS driver (proprietary mode) ― " Takashi Iwai
2026-09-01 9:06 ` [RFC PATCH v2 2/4] ALSA: usb: babyface-pro: add the mixer control surface Ismaïl Bahloul
2026-09-01 9:06 ` [RFC PATCH v2 3/4] ALSA: usb: babyface-pro: add the front-panel poll + controls Ismaïl Bahloul
2026-09-01 9:06 ` [RFC PATCH v2 4/4] ALSA: usb: babyface-pro: add the hardware DSP EQ Ismaïl Bahloul
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260901090635.9208-1-i.bahloul01@gmail.com \
--to=i.bahloul01@gmail.com \
--cc=alsa-devel@alsa-project.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=perex@perex.cz \
--cc=tiwai@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox