... being an account of my adventures in getting Csound 5 up and running on my Ubuntu Linux system.
I've never really moved from Csound 4 to Csound 5 to this point, because for one thing 5 doesn't run on BeOS, which is my main system. (There's no real reason it can't run there, except for getting scons all set up, and probably some updating of the real-time connectivity. I started on scons at one time, but never got all the way there.) Anyway, now that I have Ubuntu Linux on my other box, I thought that I should at least be up-to-date there.
My first approach, a few months ago, was to download the compiled 5.08 package for Ubuntu, but I wasn't happy with this at all. For one thing it was unuseably slow -- unable to play more than a few notes of my Rotor Organ at a time, while my old Csound4 on the same machine had no trouble with anything I could play. I suspected that this was because the only version in the Ubuntu repository is the 'double' version. I don't see any personal need for this, but out of the box I had no choice.
The default PortAudio and PortMidi were very confusing on my system, with some of the listed devices working properly, others not. In any case, I want to simply stick to ALSA on this box, but Csound wouldn't talk to that at all! Setting '-+rtaudio=alsa' always gave the error "Unable to set sample rate on card".
My next step was to get the 5.08 sources, and compile it myself -- the single precision version. I still couldn't get ALSA to work, though, and I put the project aside.
Seeing 5.10 released, I thought it was time to try again. Once more I began by downloading the precompiled (SUSE) package, but after trying to use the installer on that (!) I said to heck with it -- I'll build my own. [I dislike installers at the best of times, but that "Fast Light" one is the worst I've ever seen -- no help, no listing of what it's going to do, where it's going to put files, and so on. Bah!]
The actual build involved some false starts, deciding what options were suitable and so on, but really was pretty smooth. In fact the final command-line was
Everything else I'd tried -- like "useALSA" turned out to be superfluous.
There was just one big problem -- ALSA still didn't work! I always got the "Unable to set sample rate" message. And yet fluidsynth didn't have any trouble with ALSA. So I dug into the sources of both, and found that there are two ALSA API calls one could make to set the rate; Csound used one, fluidsynth the other! The first requires an exact rate value, which apparently "44100" does not qualify as, but the other finds the nearest rate that the card is capable of (which on my es-1371 seems to be still "44100" but I guess not quite...). I rewrote that line of rtalsa.c to match the working code and have had no more problems.
I should report this to the bug-list at sourceforge, I guess. I'm pretty sure the fix doesn't break anything.
One other gotcha I ran into was that -- without the "buildRelease" scons option -- OPCODEDIR has to be set. The source code handling of this seems to be a bit strange (not suitable for Windows for instance), so I just punted and patched that source (csmodule.c) as well to force a default.
After all that, everything I've tried works fine. It's just as fast as C4, ALSA audio and MIDI work as advertised, and I'm happy. The plugin system is a big advance: in fact I didn't really have to compile anything except the modules I changed; everything else can be obtained from the precompiled version and slots straight in. The only thing I wish is that there was some build option to make ALSA the default, so the command-line didn't always have to include "-+rtaudio=alsa -+rtmidi=alsa".
Sorry about the rambling, but then my journey was pretty erratic as well!