OK, well I've been ambling through some of the device and instrument=20
management code in the sequencer and have at least convinced myself=20
that the situation is indeed reasonably complicated.
The relationship between Instruments and ALSA ports is particularly=20
interesting, especially the way the MappedInstrument's DeviceId isn't=20
actually used to determine the ALSA port for an output -- there's=20
instead a direct mapping from ALSA ports in the port list to=20
instrument numbers, in which the instruments are looked up each time=20
they're needed. I'm not sure I like that.
Anyway, I've committed a couple of very simply and vaguely exploratory=20
bits and pieces. They're guarded with the portentious #ifdef=20
EXPERIMENTAL_ALSA_DRIVER, so they will NOT show up in a default=20
build. That's very intentional, 'cos I don't know what I'm doing. =20
If you want them, do
CXXFLAGS=3D'-DEXPERIMENTAL_ALSA_DRIVER' ./configure <config-args>
then make clean. But I recommend that you don't bother replying to=20
this unless you happen to be Rich and have strong opinions about=20
implementation stuff rather than where the design itself is going.
These changes attempt the following:
* Make a one-to-one correspondence between Devices and ALSA ports,=20
rather than corresponding Devices and ALSA clients. Hence (writable)=20
ports show up directly on the top level of the instrument dropdown=20
and the word "port" doesn't need to be used in the GUI.
* Ignore the m_alsaPorts map in the AlsaDriver, and instead store a=20
map between device IDs and ALSA port/client pairs (the idea I guess=20
is that this is the thing that would be changed by edits in the=20
Manage Devices dialog, as opposed to the current misnamed Manage=20
* Ignore port stuff in the instrument dropdown, and pretend every=20
device has only one port (because it does, now -- the need to ignore=20
the port is still there because otherwise the ports submenu would=20
still show up if there was a single port with non-zero port id, as in=20
fact happens with my Evolution -- see below).
Also I included a couple of fixes to Studio (it was failing to ignore=20
read-only devices when looking up an instrument index in the=20
presentation instrument list, even though they'd been ignored when=20
creating the list) and the bank editor (again, omitting read-only=20
I've finally worked out how my keyboard presents itself to ALSA, btw:=20
it seems it actually shows up as a client with two ports (port 0=20
write only, port 1 read only) rather than a single duplex port. So=20
we _do_ need to show the write port on the instrument dropdown, but=20
only the read port on the record selection dropdown. With the=20
experimental setup I can actually record from the keyboard, which I=20
couldn't before (possibly because of some confusion over associating=20
read/write-ness with the ALSA client, which contains both sorts of=20
ports, rather than with the port).
I wanted to test with iiwusynth as well, but it doesn't seem to be=20
working for me at the moment -- doesn't even show up as an ALSA=20
client (i.e. nothing to do with RG). Weird.
Anyhow. See also docs/discussion/device_rework.txt.