Client interfaces

There exist two type of interfaces for clients: a user-land interface and a kernel mode interface. Which one is to be used depends on the place the client is executing.

Each type has its own strengths and weaknesses:

User-land clients

A user-land client is created at each open() syscall to /dev/snd/seq device. This /dev/sndseq device can be opened r/w by multiple concurrent clients, much like pty's etc. The communication between a user-client and sequencer core is done via read()/write() or ioctl() syscalls just like they used to do with the /dev/music device. The read and write syscalls are used for sending and receiving event packets to/from sequencer. All other controls (e.g. creating/deleting a port, getting/setting client information) are done via ioctl() syscall. Efficient blocking I/O (ie. no polling) can be performed by using the select() call for I/O multiplexing.

Kernel mode clients

The kernel mode clients reside in kernel modules. These can be stand-alone loadable kernel modules, or modules that offer other functionality (eg. MIDI driver, sound card driver).

The module level interface exists of following:

Because the events can be dispatched to kernel mode client immediately, this offers possibilities to provide good midi thru and filtering functions.