Difference between revisions of "Multichannel Recording"

From Audacity Wiki
Jump to: navigation, search
(very minor tidy and a few typos)
(Linux Sound Interfaces: about ALSA and OSS)
Line 33: Line 33:
 
== Linux ==
 
== Linux ==
 
=== Linux Sound Interfaces ===
 
=== Linux Sound Interfaces ===
'''OSS'''
+
The oldest sound driver interface in the Linux kernel is the '''OSS''' standard. This was the first serious attempt to provide a unified sound interface for *nix systems, and is also used on *BSD and some other Unix systems. It was designed in 1992 provide an extended version of the card-specific SoundBlaster 16 interface. It made it into the Linux kernel, however in 1998 the creator handed over maintenance to the kernel maintainers, and a commercial-licensed fork was produced by [http://www.opensound.com/ 4Front Technologies]. This was closed source and cost money to install, so attracted very little enthusiasm from the open source community. The OSS drivers in the kernel source continued to be available, but few new drivers were being added, and many did not work very well.
'''ALSA'''
+
 
 +
A decision was made to start again from scratch, to address some of the limitations of the OSS interface (which although it was being developed commercially, was stuck in 1998 as far as open source was concerned). Thus the [http://www.alsa-project.org/main/index.php/Main_Page Advanced Linux Sound Architecture] or
 +
'''ALSA''' was born. This was designed to be able to provide all the functionality of OSS, whilst also making it easier to support the increasing number of high sample rate, high bit depth, multichannel sound cards. Latency was also a concern, with increasing demands for low-latency full-duplex operation from users. The majority of new sound development for Linux now uses ALSA rather than OSS, although code for other Unixes often still uses OSS, and for some reason developers of binary-only software for Linux always seem to use OSS. ALSA has been included in the Linux kernel since version 2.5.0, as well as independent releases from the alsa project.
 +
 
 +
'''JACK'''
 +
 
 
=== Recording With Audacity ===
 
=== Recording With Audacity ===

Revision as of 20:25, 29 August 2007

Multi-channel recording means recording more than two separate channels of audio at once on the same computer, synchronised to each other. This needs support at several levels in order for it to work successfully:

  • Hardware support - you need a sound card or external sound device which actually has enough analogue to digital converters to do multi-channel recording. Most consumer cards only have one stereo pair of analogue to digital converters that is switched between Line In, Aux In, Mic etc. You need at least a semi-professional device which actually supports recording multiple channels at once.
  • Driver support - the drivers for the device must make it possible to record from more than two channels at once. This is more problematic that it might seem because the standard sound interfaces for many operating systems were designed long before multi-channel recording was possible, and so only allow for up to two channels of recording. Also, consumer-level systems are not designed to achieve the low latencies and high throughputs needed for high quality multi-channel recordings.
  • Application support - the application you are recording in needs to support working with multiple channels of audio. Audacity supports recording up to 16 simultaneous channels of audio, but only plays back two channels (stereo). Multiple channel files can be exported from audacity 1.3.0 onwards. Offers to help add support for multi-channel playback would be welcome.

The status of driver and application support depends on the operating system you are using, as described in the sections below.

Windows

Windows Sound Interfaces

The standard windows MME (Multi Media Extensions) sound interface has been around since Windows 3.1. It supports up to two channels of recording, sample depths up to 16 bits, and sample rates up to 44100Hz. On playback, multiple applications can use the sound device at the same time, with all the audio being mixed and sample rate converted to 44100Hz in Windows before being sent to the sound card. Nice and simple for going ping and utterly hopeless for multi-channel music production.

It's also not very much use for writing games with, which is why after the release of Windows 95, it became necessary to offer the games manufacturers something better to persuade them off DOS. So DirectSound was born. This provided more flexible playback of audio, and later added multi-channel and surround sound playback for immersive game audio. Recording support was also only added later, and DirectSound is still rarely used for recording audio. Multi-channel recording is now theoretically possible, but with significant latency.

This all left serious audio recording and playback rather out in the cold, so proprietary solutions stepped into the gap, and Steinberg created the ASIO  interface for bypassing the operating system entirely, and connecting audio applications direct to the sound card. This gives very low latencies (because all the mixing and conversion involved in the MME interface is avoided), but means that only one application can use a sound card at a time (no sharing between multiple applications, no system sounds).

GSIF also arrived about this time, but is proprietary and completely playback-only, so doesn't affect us.

Finally, Microsoft wanted to provide a way to do what ASIO did but that they controlled, and integrated better with existing MME drivers. So Windows Driver Model Kernel Streaming (WDM KS) and Enhanced Windows Driver Model (EWDM) drivers were invented. These provided a unified way of writing drivers for Windows 2000 onwards, as well as more direct access into the audio hardware for applications that needed it. Cakewalk's SONAR was the first major application to use this, and it still lags behind ASIO in terms of market penetration on the application side. Drivers are more widespread, because providing any kind of WDM driver automatically provides DirectSound and MME support through Windows. But WDM drivers not specifically designated as WDM KS or EWDM generally won't provide multi-channel recording support - as this isn't needed for DirectSound or MME, many driver writers omit it.

For more on how Windows sound drivers work, try this page .

Recording With Audacity

Out of the box Audacity comes with support for windows MME drivers. These work fine for simple stereo recording and playback, and are available on all versions of Windows where Audacity will run. However, neither these nor most WDM drivers are going to provide multi-channel recording; if you try to send multiple inputs to Audacity with these, you will only be presented with a series of separate two-channel "recording devices" from which you can choose one, instead of the number of input channels there actually are. If you're lucky, and your sound card manufacturer provides full EWDM support, Audacity will just work - select up to 16 channels of recording (depends on your hardware) and away you go. ESI  is one manufacturer whose devices are reported to provide multi-channel recording in Audacity.

Unfortunately most manufacturers of soundcards for the semi-professional or studio market see Windows drivers as for consumer stuff, and assume all their users will use ASIO. So they provide either a basic stereo MME driver or no Windows driver at all, and ASIO drivers for multi-channel functions. The problem is that ASIO is proprietary, so Audacity cannot support it in the released builds. More information on the problems with ASIO is on our ASIO Audio Interface page.

Mac OS X

OS X sound interfaces

CoreAudio ASIO

Recording With Audacity

Linux

Linux Sound Interfaces

The oldest sound driver interface in the Linux kernel is the OSS standard. This was the first serious attempt to provide a unified sound interface for *nix systems, and is also used on *BSD and some other Unix systems. It was designed in 1992 provide an extended version of the card-specific SoundBlaster 16 interface. It made it into the Linux kernel, however in 1998 the creator handed over maintenance to the kernel maintainers, and a commercial-licensed fork was produced by 4Front Technologies. This was closed source and cost money to install, so attracted very little enthusiasm from the open source community. The OSS drivers in the kernel source continued to be available, but few new drivers were being added, and many did not work very well.

A decision was made to start again from scratch, to address some of the limitations of the OSS interface (which although it was being developed commercially, was stuck in 1998 as far as open source was concerned). Thus the Advanced Linux Sound Architecture or ALSA was born. This was designed to be able to provide all the functionality of OSS, whilst also making it easier to support the increasing number of high sample rate, high bit depth, multichannel sound cards. Latency was also a concern, with increasing demands for low-latency full-duplex operation from users. The majority of new sound development for Linux now uses ALSA rather than OSS, although code for other Unixes often still uses OSS, and for some reason developers of binary-only software for Linux always seem to use OSS. ALSA has been included in the Linux kernel since version 2.5.0, as well as independent releases from the alsa project.

JACK

Recording With Audacity