rme: adjustments to maintain compatibility with the kernel snd-fireface
driver for FF400 devices.
This is a modified version of a patch submitted by Takashi Sakamoto. His
original commit message follows. Changes from the original patch were:
1. Abbreviate comments added to fireface_def.h. This file was never
intended to contain verbose protocol-level descriptions, so a briefer
version is fine.
2. In fireface_def.h, omit the added "Not used in user land." comment
attached to RME_FF400_MIDI_HIGH_ADDR. While FFADO does not utilise this
at present, it doesn't mean that it couldn't in future (at least in
principle). Since this file describes the programming interface
implemented by the device, the proposed annotation could be confusing in
the future.
3. Do not remove the "provide_midi" device field. This infrastructure
field helps document the device's programming interface and could be used
in future to allow FFADO to support MIDI on the FF400 device. In the
meantime, its current setting (0) continues to allow FFADO and the kernel
snd-fireface module (kernel >= 4.12) to co-exist. To this end, the
changes to CR2 requested in the patch are carried out if provide_midi
is 0.
[Takashi Sakamoto's commit message]
As of May 2017, FFADO library has no support for MIDI functionality
as a driver for RME fireface series.
ALSA fireface driver, a.k.a. snd-fireface were added to Linux kernel
v4.12. This driver is designed to just support functionalities to handle
PCM frames and MIDI messages for ALSA userspace applications. The other
features should be implemented in user space to avoid complexity in
kernel land.
Additionally, due to design of target hardware, the driver request
userspace applications to handle some registers. In RME Fireface series,
some registers are write-only. Fortunately, none of the registers is
relevant to packet streaming feature; i.e. isochronous communication on
IEEE 1394 bus, while asynchronous communication is controlled by such
registers. MIDI functionality in ALSA fireface driver gets influences
from this specification. The driver need a care of userspace applications
to set the registers correctly.
For the above reason, this commit changes this library to configure
the registers so that ALSA fireface driver can handle MIDI messages
properly. The issue is an address to which the unit transfers asynchronous
transactions for MIDI messages. 4 byte in MSB of the address is
represented in 0x'0000'8010'03f4 with node ID. This is readable/writable
by ALSA fireface driver. Rest of the address is decided by write
transaction to 0x'0000'8010'051c with bit flags. This register is
write-only, it includes effects for the other features than MIDI
functionality. ALSA fireface driver doesn't touch it but expects userspace
applications to configure the register to transfer MIDI messagess to
a certain address.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>