Managing Computer Resources and Drivers

From Audacity Wiki
Revision as of 16:17, 30 December 2016 by PeterSampson (talk | contribs) (Mac generalization)
Jump to: navigation, search
Gale 05May14: this is a page that needs flagging as potentially prone to version specifics. Would it be an idea to have a category for such a page?
  • Peter 09Jun14: Yes, such a category could indeed be useful.
This page provides a checklist of essential tips to ensure your computer has sufficient resources, properly tweaked hardware and appropriate drivers to record without dropouts or clicks.
Related article(s):

A computer is not a ready-made recording studio

Recording is a much more demanding activity than playing an audio file in an application like Windows Media Player. Real-time recording is a very resource-intensive task for computers, which in most settings are not recording studios but multi-task machines with many competing demands on their processor. Therefore it's important to take steps to maximise available computer resources when recording.

Also the computer sound device, the drivers it came with and other hardware as shipped may not be up to the job of recording properly. This is especially likely to be true on a laptop or netbook computer. Consider upgrading to better equipment such as a professional microphone and an external USB or Firewire recording interface.

Ensuring sufficient computer resources are available

  1. Close all un-necessary programs and processes while recording. On Windows, two programs which may automate this task are Winsolo and Enditall.
  2. Be aware of background virus scanners and other system tray programs. By default, Norton, Sophos and other anti-virus products scan each Audacity .au file as it is written. This scanning can affect recording as it takes too long. See if the scanner can be configured to ignore files written in Audacity's temporary directory (see point 3 below). Otherwise, consider disconnecting from the internet then disabling your firewall while recording - some common firewalls can consume 30% or more of a slower computer's processor usage.

    Avoid scheduling security updates such as Windows Update during recordings, or allowing the computer to choose its own random times to update. Instead, schedule updates to run overnight or at other times when you know you won't want to record.

  3. Set the path to the Audacity temporary directory to a local drive, not a network or USB drive. Audacity's temporary directory is used for storing audio data whilst recording and needs fast access. The path can be set in the Directories Preferences. Try to avoid data transfers between networked computers while recording is taking place.
  4. You can try setting your Audacity temporary directory in Directories Preferences to use a RAM Drive. Examples of software RAM drives are RAMDisk for Windows and TmpDisk for Mac. If Audacity crashes during recording but the RAM disk does not, the recording should be recoverable.
  5. Set system swap or paging file appropriately. Recordings will stop if the paging file is full. As a working rule:
    • with 128 MB or less RAM, set the paging file to 3 times the amount of RAM to cover the amount of data swapping that will be needed
    • with 256 to 512 MB RAM, set the paging file to 1.5 times the available RAM
    • with 1 GB or more RAM, set the paging file to a low size like 256 MB to prevent the swap file being used in place of the (much faster) RAM

    To change the paging file size on Windows go to "System" in the Control Panel, thence to:

    • Windows 10,8,7: "View amount of RAM and processor speed"
    • Windows Vista: "Advanced System Settings" then "Advanced" tab, then "Performance settings"
    • Windows 2000/XP: "Advanced" tab then "Performance settings"
    • Windows 98/ME: "Performance" tab

  6. Consider installing more RAM if you have 256 MB RAM or less. RAM is relatively inexpensive and extremely cost-effective in improving computer performance. Note: Windows 98 and ME have a bug that may cause problems if you have more than 512 MB installed RAM. There are suggested fixes for this here.
  7. Consider reducing the bit depth for recording and importing from the default 32-bit to 16-bit. This can be done at "Default Sample Format" on the Quality Preferences. Reducing the bit depth halves the amount of data processed and the time taken to write it to the disk.
  8. Set the Project Rate to 44100 Hz at bottom left of the Audacity window or in Quality Preferences as above. Higher rates will significantly increase the data load without proportionately improving the quality.
  9. Don't record stereo unless you have to. Stereo requires your machine to handle twice as much data. A single instrument or solo vocal track should usually be recorded in mono. You can position it in the stereo mix later. To record in mono, set recording channels to "1 (mono)" on the Devices tab in Audacity .
  10. Turn off "Auto-scroll while playing" on the Interface Preferences. This stops the display re-drawing as the recording is made, freeing resources for recording. Alternatively minimise Audacity during the recording.
  11. Disable the Meter Toolbar on the View > Toolbars in Audacity. This prevents resources being used continually refreshing the meters.
  12. Zoom out to the whole length you will be recording.
  13. Consider turning off "software playthrough" on the Recording tab in Audacity. If you need to hear what you are recording, try unmuting and turning up microphone or line-in in the playback section of the Windows system mixer or Linux ALSAmixer. On Mac, try the Audacity "hardware playthrough" option instead of "software playthrough".
  14. Consider increasing the default "Audio to buffer" setting of 100 milliseconds. This can be changed in the "Latency" panel in the Recording Preferences. Doing so will increase the amount of time audio takes to travel through the sound device and will ease the strain on the CPU because the audio will be taken through in larger chunks. The disadvantage is that this will increase the delay in laying down and monitoring recordings.
    On Mac using Mavericks or later, it may be necessary to reduce audio to buffer, possibly to zero.
  15. On slower machines, turn off clipping analysis at View > Show Clipping while recording.
  16. Disable screensavers if you are making a long recording and will be away from the computer. These can freeze recordings. Switch the monitor off instead.
  17. Reboot before a long and important recording, especially on a slower/older computer or one with limited RAM. Computers running Windows versions prior to XP Service Pack 3 are particularly likely to slow up and give poorer performance after a long period of use without reboot.
  18. Make sufficient disk space available. Audacity tells you how much longer you can record for (based on available disk space) in the Status Bar at the bottom of the window.
    • Delete files. Utilities like Ccleaner for Windows can automate removal of un-necessary cached and temporary files.
    • Choose a disk with the most space. Go to the Directories Preferences and set the temporary directory to a disk which has more space. If saving an Audacity Project before starting recording, choose the disk at File > Save Project As....
    • Be aware of any disk quotas which may be in force for your user account. These restrict the amount of disk space you can use and will cause recordings to stop once your quota is exceeded.
  19. Defragment the hard drive (only affects Windows users).This increases the speed your computer can read and write information by ensuring that files are kept close together in a logical manner.
  20. Increase the priority of Audacity:
    • Windows 10/8/7/Vista/XP/2000 users can try Task Manager to increase the priority of Audacity once it has been launched. Access Task Manager by pressing CTRL + ALT + DEL, then click on the Processes tab. Select audacity.exe under "Image name", right-click over it and choose one of the priorities above normal. "Realtime" is not generally recommended. Try "Above normal" or "High". Sometimes, reducing the priority of any other programs you must run can help too.

      To launch Audacity with a particular priority, you can try PsExec from the Windows Sysinternals Suite. Create a shortcut and in its Properties, set the "Target" to contain the path to PsExec, the required priority and the path to Audacity, as in this example (enclose the path in quotes if it includes spaces):

      C:\Windows\System32\PsExec.exe -d -high "D:\Program Files (x86)\Audacity\audacity.exe"
    • Mac users can use the Terminal's "renice" command. Lowering the "nice" level of Audacity will raise its priority if the priority of other devices is unchanged. The default nice level for most applications is 0, in a range between –20 (highest priority) and +20 (lowest priority). To change Audacity's nice value, type:
      sudo renice {nice #} {pid}
      where {nice #} is the nice level and {pid} is the process ID number of Audacity. You can determine a process pid with the "top" command or from Activity Monitor (Process Viewer in OS X 10.2 or earlier).
    • GNU/Linux, *BSD and most other Unix-like systems can also set program priority via the nice level. On Linux you may need to run as root to set very low nice levels. You may want to review additional help on nice for Linux and BSD
  21. Optimize Windows processor scheduling for "background services". Right-click over My Computer or Computer > Properties, then click the "Advanced" or similar link or tab. In the "Performance" section, click "Settings", then the "Advanced" tab. In "Processor Scheduling", choose "Background services" then OK and OK. Note: This may not be the best setting for general computer use; if programs seem slower to launch or respond, change the setting back to "Programs" after recording.
  22. Hardware Profiles can be used to create a recording profile that turns off all hardware not needed during the recording session. This keeps drivers from being loaded, freeing memory and reducing CPU load.
    • Windows 2000 and XP users can consider disabling:
      • network interface
      • serial and parallel ports
      • Firewire
      • CD-ROM
      • USB (unless you're using a USB sound device, mouse or keyboard).
    • Windows Vista and later users have no direct equivalent of hardware profiles. You can:
      • Run a batch file passing commands to devcon.exe (the command-line version of Device Manager}
      • On Windows 7 and later, install only essential hardware to a Virtual Hard Disk then boot from that.
  23. Create a software profile using AlacrityPC. The profile disables your chosen programs and services while Audacity is running.
  24. Enable DMA mode for your hard drive (only affects Windows and Linux). Doing so can increase disk reading and writing speed tenfold and use less resources in doing so.
  25. Be aware of operating system conflicts. Sometimes (mainly on Windows) system conflicts can arise and the operating system can become corrupt or partially corrupt, affecting sound recording and playback even though the sound drivers are properly up-to-date. Unpredictable behaviour and error messages in programs would be strong evidence of this. Try backing up your data and reinstalling the operating system.
  26. Be aware of physical connections to and inside the computer.
    • Make sure the input cable and external audio device (if any) are firmly attached to the computer. Connect USB devices to a separate USB port on the computer, not a USB hub.
    • Make sure that connections inside the computer to the drive(s) and to internal sound devices are tight.

Ensuring proper device and driver performance

  1. Avoid interrupt sharing for your soundcard or Sound Device. This means checking with your motherboard manual which slot is best to put the soundcard in if you are installing a PCI soundcard, and trying to avoid IRQs shared with noisy devices like the graphics card and mouse. If your operating system and hardware support APIC with many more IRQs, then you can avoid interrupt sharing altogether.
  2. Update your hardware drivers to avoid conflicts and get better hardware performance. You should consider updating drivers for your:
    • Video (Graphics) Card - for example, if your graphics card is handling the display of the waveform efficiently in Audacity while recording is taking place, you have more resources available for laying down the recording properly.
    • Hard Drive Controller - this is especially important for RAID and other high performance controllers.
    • Soundcard or sound device. These are of course the most important drivers as regards Audacity. Low quality, generic or outdated sound drivers (mainly but not exclusively on Windows systems) are a common cause of crashes, especially during recording. If your computer reboots spontaneously when launching Audacity, or during recording or playback, it's a sure sign of sound driver problems. Using the latest sound device drivers for your computer model from the manufacturer of the sound device or motherboard will help avoid such problems. See Updating Sound Device Drivers for helpful hints and instructions on this.
  3. Check if Windows can process real-time audio efficiently:
    • DPC Latency Checker checks if your audio/video drivers may be causing excessive Deferred Procedure Call latency. If so, this may cause dropouts in live audio/video streams. This tool is easy to use but does not itself identify which drivers are causing excessive DPC's or test other potential causes of dropouts.
    • LatencyMon analyzes the possible causes of buffer underruns by measuring kernel timer latencies and reporting Deferred Procedure Call (DPC) and Interrupt Service Routine (ISR) execution times as well as hard page faults. This tool is not for novice users but it can identify the kernel modules and processes responsible for causing audio latencies which result in dropouts.