Akai EWI USB and Linux, part 1

As I've mentioned before, I recently came into posession of an Akai Electronic Wind Instrument, USB edition. To be of any use, this wonderful artifact must be connected to a computer running proper software. That on EWI's companion CD supports only MS Windows and Mac OS X so with my GNU/Linux notebook I was on my own.

I had obviously checked on-line for other people's experiences with the EWI and Linux before purchasing it but all I knew was that yes, it does work. I use a rolling-release Debian-based distro called aptosid (formerly known as sidux) which means I tend to be fairly up-to-date as far as the kernel and drivers are concerned. I wasn't expecting any major problems but I was ready for anything.

I started with the basics: I saved the listing of /dev and /dev/snd into a text file and plugged the EWI in. A bunch of messages in dmesg confirmed that the device was detected and recognized. Comparing the listing of /dev/snd with the previous version yielded /dev/snd/midiC1D0 as a new device and sudo cat /dev/snd/midiC1D0 produced a flurry of line noise as I tried playing the instrument. The low-level set-up, then, was exactly as it should be: pure plug-n'-play.

With my confidence boosted, I turned straight to QSynth which is a GUI front-end for fluidsynth, a powerful SoundFont-based command-line software synthesizer. QSynth has a nice setup dialog with separate tabs for the MIDI side (input) and the audio side (output). Unfortunately, the configuration options accurately reflect the mess that is Linux audio support, with four MIDI drivers and five audio drivers to choose from and fiddle with. To make a long story short, I failed to find a combination of settings that would work.

I needed clarity and precision, hence I turned to working with fluidsynth directly. After reading the manual, the alsa_raw driver looked like the most promising option for MIDI input as I had used ALSA to get a MIDI port on another computer going a few years ago. When I used alsa_raw without specifying a MIDI device path, however, fluidsynth would say "Error opening ALSA raw MIDI port". When I did specify /dev/snd/midiC1D0 as the MIDI device I got "Unknown RawMidi /dev/snd/midiC1D0". I somehow remembered that during my previous MIDI experiments the device was midiC0D0 rather than midiC1D0 so I tried ln -s /dev/snd/midiC1D0 /dev/snd/midiC0D0 and ran fluidsynth without giving it a device path. Bingo! I had sound!

There were two serious problems with this setup. First, the midiC0D0 symlink disappeared at every reboot, forcing me to re-create it over and over. More seriously, the audio lagged some 100 to 300 ms behind MIDI input, making the EWI so sluggish as to be unplayable. What was I to do? I will reveal the dramatic resolution of both issues in another post; stay tuned...

Proudly powered by Pelican, which takes great advantage of Python.