Linux Issues

From Audacity Wiki
Revision as of 07:26, 8 October 2008 by Galeandrews (talk | contribs) (add description of JACK connection only available during playback)
Jump to: navigation, search

Compiling Audacity

If you have issues trying to compile Audacity from source code, take a look at Developing On Linux, Compiling Audacity Step by Step Guide and Audacity_1.3_beta_testing for an example of compilation on Ubuntu Dapper.

Instead of compiling Audacity, you may prefer to use a pre-compiled package supplied by your distribution. A listing of these (except for Gentoo) is here .


One issue with using Audacity on Linux is that there are two different audio systems:

  • OSS (Open Sound System) has been around for a long time and is built-in to most Linux kernels. It works fine for 44100 Hz, stereo, 16-bit audio with ordinary sound cards and typical requirements. It's rather inadequate for professional audio work*1. Audacity fully supports OSS by default.
  • ALSA (Advanced Linux Sound Architecture) is newer, and doesn't support quite as many older sound cards, but it supports many newer ones and supports many advanced and professional features*1. It is standard in the current 2.6 kernel. Audacity supports ALSA in two ways:
  • ALSA comes with an OSS emulation layer. This is what Audacity will use by default if you don't do anything special. Unfortunately the OSS emulation layer is buggy on some systems, and so performance will typically be worse than if you use ALSA or OSS natively. If your system doesn't load OSS emulation at boot-up, you may have to load it manaually by running audacity as:

      $ aoss audacity

    Note:you can install aoss by installing alsa-oss package on Ubuntu (or Debian, if it is not already installed).
  • Audacity can use ALSA natively if you compile it to use PortAudio v19 instead of the default, v18. Note that v19 is still evolving and not as well tested, but it is the only way that Audacity supports ALSA. Many users have reported good experiences with it. To use it, reconfigure Audacity like this:
./configure --with-portaudio=v19 --without-portmixer
  • For normal playback, the correct device to use on out-of-the-box ALSA setups is Dmix . This provides software mixing and resampling of multiple streams as found on other operating systems, and is a good alternative sound server (better for example than ESD ). For ALSA 1.0.9rc2 and higher you don't need to setup Dmix - it is enabled as default for sound cards which don't support hardware mixing.

*1 - This is actually incorrect, ALSA does not provide support, yet, for high end professional audio cards that have both 4dB and 10dB stepping. ALSA only currently supports 10dB stepping, this is a well known ALSA mixer issue and frequently addressed on ALSA's forums. Search for envy24 or any of the M-Audio cards)

  • Audacity 1.3.5-beta has ALSA support builtin.
 Edit--> Preferences--> Playback|Device: ALSA: default
 Edit--> Perferences--> Recording|Device: ALSA: default

Configuration errors

If configure fails, with errors like:

$ configure: warning: CC=gcc: invalid host type
$ configure: error: can only configure for one host and one target at a time
$ configure: error: /bin/sh './configure' failed for lib-src/portaudio-v19

then put "env -i" in front of the command to supress the CC and CXX environment variables.

$ env -i ./configure --with-portaudio=v19 --without-portmixer

You may also need to make clean before re-compiling if you have already built audacity with different configure options.

$ make clean

Portaudio v19 from repository

If you are having issues, try a newer Portaudio snapshot:

  • clear audacity-src-1.2.x/lib-src/portaudio-v19/
  • download pa_snapshot_v19.tar.gz from 
  • untar into directory mentioned above
  • go back to audacity-src and run ./configure..., make, make install again

Please post your experiences with Audacity and PortAudio v19 directly to Audacity_PortAudio_v19. As noted there, known issues currently exist with v19 if playing audio with OSS emulation enabled under ALSA.

Error Initializing or Opening Sound Device

If you see the following error message while launching Audacity:
"Error Initializing Audio: There was an error initializing the audio i/o layer. You will not be able to play or record audio. Error: Host error."
then Audacity cannot access your sound card properly. There could be a number of reasons for this:

  • Audacity cannot use the audio I/O layer when it is in use by another application. If you are running a sound server such as eSound (ESD)  (often used with GNOME desktops) or aRts  (often used with KDE), or some other player application is using the sound device, you will often have to disable it before using Audacity.

    For users with OSS builds of Audacity and aRts, use the wrapper provided by aRts and run:

      $ artsdsp audacity

    to launch Audacity. If you use Ubuntu and the GNOME desktop and receive this error, navigate to "System" > "Preferences" > "Sound". Click on the "Sounds" tab, uncheck "Enable software sound mixing (ESD)" and hit "Close".

    If you have a recent version of ALSA that enables Dmix , try setting the conflicting application to use the ALSA default device as well as Audacity. This may let Audacity share the device via dmix rather than you having to shut it down before using Audacity.

To check what devices are using the sound device, use the list open files (lsof) tool:

  lsof | grep '/dev/snd/'    # for devices using ALSA

  lsof | grep '/dev/dsp'    # for devices using OSS

  • On IBM ThinkPad there is a BIOS option to disable modem. If modem is disabled then Ubuntu 6.06 will give the same error message as above, and other applications also will have no sound. Uninstalling and reinstalling Audacity (using Synaptic) has also been found to fix this in two cases on Ubuntu laptops (Thinkpad T23 running GNOME, Compaq Evo N410c running KDE).
  • Somehow, the link to /dev/dsp, or its permissions, were changed without your knowledge by an unknown process. What you should do (as root) is:

      $ rm /dev/dsp;ln -s /dev/dsp0 /dev/dsp #also try /dev/dsp1,2,etc.
      $ chmod 666 /dev/dsp0
      $ chmod 666 /dev/dsp

    If you are using udev in the 2.6 kernel then you may need to alter /etc/udev/rules.d/*.rules to set the correct permisions up permanently. Not to forget the obvious, some distributions (Debian, Gentoo, etc.) have an audio group that has the appropriate permissions. Make certain that Audacity users are members of this group.
  • Another possibility is you are using the ALSA device with a version of Audacity built with PortAudio v18, but don't have the OSS emulation modules installed, which you will need to do. See OSS vs ALSA above.
  • If you receive this error:
    "Error opening sound device. Please check the input device settings and the Project Sample Rate" or "Please check the output device settings and the Project Sample Rate"
    even when no other device is using the sound card, and your permissions are correct, it simply means there's a problem with your Audacity settings. You may have a sample rate selected that your sound card does not support. You can alter this by changing the Project Rate at the bottom left of the Audacity window. If you receive the "check the input device settings" message, try setting the "recording channels" in the Audio I/O tab of Preferences to mono or stereo, and if you are recording something playing on the computer, turn off "software playthrough".

Playing whilst recording

Playing the existing tracks in your project whilst recording new ones should work on any hardware that is supported by the Linux drivers, and is capable of full-duplex recording, i.e. playing back and and recording at the same time. For instructions on how to enable playback see the Audacity FAQ .

There is however a Linux-specific issue caused by the way audacity 1.2.x communicates with the sound card. This means that for recording in audacity 1.2.6, (or audacity 1.3.x using portaudio-v18) you have to set audacity to record in stereo, as mono recordings come out too low pitched and very poor quality. To do this see this FAQ . If you only want a mono track you can split the stereo track into two mono tracks and then delete one of them.

This problem only shows up when using the OSS emulation layer for ALSA, and trying to record with a different number of channels to the number being played back. So if you were to play back in mono, then you would be able to record in mono, but audacity doesn't support that. If you actually have native OSS drivers then this won't be a problem for you.

If you use audacity 1.3.2 or newer you are strongly recommended to compile using portaudio-v19 so you have native ALSA support, and use that in preference to the OSS option. Recording in mono then works normally.

USB microphone

If you have troubles with recording audio through your USB-microphone, see USB_mic_on_Linux.

VST plugins in Linux

If you are really keen on trying VST plugins in Linux, you should check out this site:

Although it is a little outdated, perhaps it is possible to get something up and running.

Also check out .

Project Rates

  • If the Audacity Project Rate is set to a sample rate that your sound card does not support, (including ones in the project rate list which might also be unsupported) Audacity will try to choose a supported sample rate for recording and playback, resampling on the fly. This does not always work correctly, though 1.3.5 Beta has been much improved in this regard and should rarely have problems with invalid rates.
  • When importing a first audio file, 1.3.3 Beta and later will try to set the Project Rate to the rate of that imported file, even if that rate is unsupported by the audio hardware. This does not always work, however.


JACK  is a low-latency audio server, written for POSIX operating systems such as GNU/Linux and Apple's OS X. It can connect a number of different applications to an audio device, as well as allowing them to share audio between themselves. It's one way to get multichannel support in Linux and also a decent low latency sound server.

Audacity now supports interfacing with JACK. It can be enabled by configuring PortAudio with JACK and ALSA, although in practice JACK gets enabled whenever the JACK headers are present on the build system. JACK has not been extensively tested, and is known to have a number of issues with both reliability and usability. Issues you may find include:

  • When opening jackd and Audacity, the Audacity connection in qjackctl is not permanently available until Audacity is exited, but only when playback is started, and ceases when playback is stopped. As a workaround, try patchbay on qjackctl?
  • dropouts in playback and/or recording (raising the frame size to 4096 samples from the default 1024 has been found to help)
  • crashes when recording in duplex (i.e. with "Play other tracks while recording new one" enabled on the Audio I/O tab of Preferences)

If JACK causes problems, disable it specifically when configuring PortAudio. We'd welcome comments and especially patches to improve JACK support.

MP3 Import and Export

  • If you see the message "Audacity was compiled without MP3 support" when trying to import an MP3, this means you do not have libmad  installed. To fix this, install libmad (including development packages) before compiling Audacity. Once libmad is installed, compile with libmad and you should see a message like this at the end of ./configure, indicating that libmad has been found and Audacity built with MP3 import support:

Finished configure:
with libresample
with libid3tag
with libmad <<<
with LADSPA plug-ins
with Nyquist plug-ins
with vorbis
with portmixer
with portaudio v18
with soundtouch
with help
  • MP3 export requires you to have the LAME package already installed. For help, see the Linux section of our LAME instructions. There is a known problem that when exporting MP3s, Audacity release builds look for "". However, the normal symlink is "". The "" target is only available if users install packages for software development or build LAME from source code. This is now fixed in our development source code. If you need to, simply rename "" to "" (that is, add a dot and a zero) to have Audacity accept it.
  • A few users of Audacity 1.3 packages supplied by their distributions have reported that they don't have an MP3 option in the "Save as type" dropdown after clicking File > Export, or that the MP3 option is only available with Export Multiple. See this thread  on the Audacity forum . If this is the case, either the package has not been built correctly, or has been compiled with MP3 support disabled. A few distributions take this view for licensing reasons. You can verify the position by looking clicking Help > About Audacity and looking at the "Build Information" tab. This is independent of whether LAME exists on the system, and depends on the options when Audacity was compiled. If you have installed a package compiled without MP3 support, look for an alternative package, or compile Audacity from source.