Rixiform Inc.

Csound on Ubuntu (Environmental Variables, etc.)

August 28th 2007

Environmental Variables

After compiling csound 5.06.0 on Ubuntu 7.0.4 I ran into the following informative message when running csound from the command line:

$ csound -odac -iadc test.orc test.sco



Csound requires this environment variable to be set to find its plugin libraries. 
If it is not set, you may experience missing opcodes, audio/MIDI drivers, or utilities.

Ubuntu handles environmental variables differently than other Linux distros. The variables won’t stick if you place them in places like:

  • /etc/profile

  • /etc/bash.bashrc

  • ~/.bashrc

Turns out that environmental variables should be set in /etc/environment for Ubuntu:


You may also need to set this in /etc/environment depending on your setup:


In my case logging out and back in was also necessary.

Real Time Playback Problems with PortAudio

The next issue was that realtime output was not playing:

$ csound -odac -iadc test.orc test.sco

 *** error: unknown rtaudio module: 'PortAudio'
Failed to initialise real time audio input

Csound can use various real time (“rtaudio”) modules. Typically these are PortAudio and ALSA. For whatever reason PortAudio was installed but not available to csound. To use ALSA as the rtaudio module I used this command:

csound -odac -iadc - rtaudio=alsa test.orc test.sco



Since I am lazy (or pragmatic) and don’t like typing. I stored the flags above in ~/.csoundrc

-odac -iadc - rtaudio=alsa

Now Csound can be run with these flags using:

csound test.orc test.sco