Skip to contentSkip to conversation

userspace pcm/midi for firewire based cards

DISCUSSION Pieter Palmers 2 participants 2 messages Nov 15, 2004 – Nov 16, 2004

lore
Share & tools
lore
#0 lore raw

Hi all,

I'm working on the development of DM1000 based firewire based devices (ESI QuataFire 610, M-Audio FireWire devices, ...).
The question that arises is: userspace driver or kernel driver. Personally I favor the userspace driver, because we can use the FW libs that are already present for some of the stuff. On the other hand it seems to me that programming a kernel driver would be ?easier? than implementing a plugin. If I'm right, that would require providing all interfaces/capabilities the alsa-lib middle layer provides. What are the thoughts about this on this list? I've already seen some small discussions about this (e.g. bluetooth), but I'm not completely convinced... what about the latency/realtime behaviour of the two options?

From a development perspective I do think that it's nice to work in userland. I still remember the numerous reboots when working on the isis kernel driver... Would it be interesting to construct userland code in such a way that it is easy to migrate it to kernel space? Or isn't it worth the effort?

And finally a practical question: The PCM part can be implemented as a plugin, for which I should look at pcm_jack.c. Is there an equivalent plugin mechanism for MIDI stuff? I've googled around, but I couldn't find a clear answer.

Greets,

Pieter Palmers
FreeBoB project
freebob.sourceforge.net

-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE FREE OODBMS DOWNLOAD - A multidimensional database that combines robust object and relational technologies, making it a perfect match for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8

#1 lore raw
Quoted 7 lines · Pieter Palmers

I'm working on the development of DM1000 based firewire based devices (ESI QuataFire 610, M-Audio FireWire devices, ...).
The question that arises is: userspace driver or kernel driver. Personally I favor the userspace driver, because we can use the FW libs that are already present for some of the stuff. On the other hand it seems to me that programming a kernel driver would be ?easier? than implementing a plugin.

Probably not, both plugins and kernel drivers implement more or less the same stuff.

Quoted 2 lines

If I'm right, that would require providing all interfaces/ capabilities the alsa-lib middle layer provides.

No, the PCM plugin interface isn't that big. Look at the plugins in the alsa-lib/src/pcm directory (pcm_null.c is very simple).

Quoted 1 line

what about the latency/realtime behaviour of the two options?

You get the function calls made by the applications, the latency depends on what your plugin does with the data. I'd guess the bottleneck would be the userspace firewire library.

Quoted 1 line

Is there an equivalent plugin mechanism for MIDI stuff?

rawmidi devices are implemented as plugins (currently, there are "hw" and "virtual" plugins). Or you could implement a sequencer client (see <http://www.informatik.uni-halle.de/~ladischc/usbmidid_old.html>
for an (obsolete) userspace USB MIDI driver).

Best regards,
Clemens

-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE FREE OODBMS DOWNLOAD - A multidimensional database that combines robust object and relational technologies, making it a perfect match for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8