Linux Issues

From Audacity Wiki
Revision as of 17:53, 15 February 2009 by Richardash1981 (talk | contribs) (major re-write of sound systems, trying to catch up with current state.)
Jump to: navigation, search

For notes on the known bugs and issues with the current beta release of Audacity see the Known Issues page. This page lists other problems commonly encountered with Audacity on Linux which are not bugs or are bugs not in Audacity.

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 can be found on the Linux download page 

OSS, ALSA and other sound systems

Audio on Linux is complicated by the fact that there are a number of different audio systems:

  • OSS (Open Sound System) has been around for a long time and is built-in to older Linux kernels. It works fine for 44100 Hz, stereo, 16-bit audio with ordinary sound cards and typical requirements. It's rather inadequate for low latency and multi-channel recording.
  • 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. Very low latencies and multi-channel audio are possible. It is standard in the current 2.6 kernel, and used by many modern Linux distributions.
  • PulseAudio is a software mixing and control system built on top of the sound card drivers so that many programs can share the same sound device. It does so at the cost of the low latency features of ALSA, and hides the features of a specific sound card behind a generic interface. This is the default audio system on Ubuntu and several other Linux distributions.
  • JACK (Jack Audio Connection Kit) is a very low latency audio routing layer intended for not only accessing sound cards (including Firewire ones that can't be used any other way) but also piping audio between applications in real time (recording the output of one program in another and so on). It is aimed firmly at professional and home studio users, and rarely installed by default.

Audacity stable releases (1.2.6) support OSS only. Audacity beta releases (1.3.x) support ALSA, OSS and JACK to varying degrees. PulseAudio users have to rely on PulseAudio's emulation of ALSA to work, which can be problematic.

Audacity Beta's ALSA support is the default and considered stable. The correct device to use on out-of-the-box ALSA setups is "Default". This provides software mixing and resampling of multiple streams as found on other operating systems, and is a good alternative to a sound server. This is almost always the right sound device to use, and you can ignore the others.

Audacity Beta's OSS support should work but is not heavily tested because native OSS systems are now rare.

Audacity Beta's Jack support is experimental, and may well not work.

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:

  • in 1.3.5 from Ubuntu repository, Audacity crashes as soon as play or record is started if JACK device is selected in preferences (not tested built from CVS)
  • When opening jackd and Audacity, the Audacity connection in qjackctl is not permanently available until Audacity is exited, but only when playback or recording is started, and ceases when either 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)
  • Crashes when recording and playing back at the same time
  • Audacity must have same sample rate as JACK (seen in 1.3.4 Ubuntu repository builds)

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.