Windows 7 USB Sound Problem On PCoIP
I’m working on our USB sound problem in Call Center with virtual machines and PCoIP and found this article that explains DPC and processes latency in Windows 7 and also 8. Of curse we found a solution that using 3.5 mm jack headset and Teradici audio driver.
Sound quality is very good on this solution and Teradici driver can deliver HD sound via PCoIP to users.
I tested many solution about this problem such as PCoIP tuning, virtual machine optimization and also VMware documents about Best Practices for Performance Tuning of Latency-Sensitive Workloads in vSphere VMs but nothing changed in my tests.
I hope this problem will resolve on newer version of vSphere or VMware View.
INTRODUCTION
The list of brands for Windows computers, as well as the possible combination of hardware used in PCs is practically unlimited – this can lead to compatibility issues or undesired interaction of components. Also, many PC computers and their components are designed to deliver good performance for office applications or gaming. The demands placed on a computer used for music production are usually quite different than those for office or gaming computers. As a result, it is often necessary to tune off-the-shelf or self-built computer systems so they perform well enough for real-time audio. This article shows the most important tuning tips. Each tip mentioned here has already helped a lot of users, so in case you have to deal with audio dropouts and artifacts, take the time to print out this article, read it carefully and try one suggestion after another.
USE ASIO DRIVERS
First, download and install the latest driver for your soundcard. From within the audio application you use, make sure you always make use of the ASIO driver for your soundcard, and not the DirectSound or WASAPI driver.
If an ASIO driver is not available for your soundcard, then you can download and install ASIO4ALL, a generic ASIO driver that works with most soundcards. To use this, please download the latest ASIO4ALL driver from the following link:
or
http://download.cnet.com/ASIO4ALL/
Please note that a professional audio device that provides its own ASIO driver usually performs better than when using ASIO4ALL with a generic soundcard. Typically, audio interfaces designed specifically for music recording and production have better audio quality, better performance and ship with ASIO drivers specific to the device. Native Instruments offers a number of professional grade interfaces with ASIO drivers, designed for different purposes, such as AUDIO KONTROL 1 or AUDIO 8 DJ.
LATENCY SETTING
Computers need to use an audio buffer in order to temporarily store audio data, while the computer’s main processor switches between processing different tasks, such as the graphical display, hard drive access, data exchange with connected peripherals such as MIDI controllers and, of course, the processing of audio. Because it can’t do all of these things at once, it needs to buffer data from the various processes – and this is where the audio buffer (also named buffer size, latency, process buffer, sample buffer) comes in. The rule of thumb is, the faster the computer, the more calculations it can handle every second and the smaller the audio buffer can be.
A smaller audio buffer is preferable because there is a direct relation between the audio buffer size and the resulting latency. The term latency describes the delay between performing an action (e.g. singing into a microphone) and hearing a result (e.g. hearing your voice come back out of the speakers). The larger the buffer size the larger the latency, and with it, the longer is the delay between taking an action and hearing a result. This can be distracting when performing.
The downside of using a smaller buffer size is, that the smaller the buffer size/latency, the harder your computer has to work. If your computer can’t handle all the work it is tasked with at the selected buffer size, you will start hearing pops and clicks or other artifacts in your audio. This means that you will have to increase the audio buffer size, so your computer can cope with the workload.
Start out with an ASIO latency setting (buffer size) of 512 and check if this gives you artifact free results. If not, increase the buffer size by one increment at a time and try again.
However, on some modern Multicore CPUs you may get better results with lower latency settings than with higher settings (e.g. there may be crackles with 512, but not with 256 samples set as buffer). Therefore test at least the settings 256 and 512.
TRAKTOR only: Try using multiples of 128 samples first as these settings often deliver the best results for TRAKTOR users; i.e.: 128, 256, 384 and 512.
THIRD-PARTY ANALYZING TOOLS
It can at times be difficult to identify the root cause of PC performance problems. Fortunately, some applications are available online and free of charge, that can be a great help with resolving such issues. The DPC Latency Checker (described below) visually shows if anything that is running on your computer is getting in the way of audio processing, and gives an idea how severe the problem is. Once you identify that there is a problem, the LatencyMon application makes it possible to identify the specific driver or service that is the cause of the issue. Both applications and their general usage are explained below.
DPC LATENCY CHECKER
- Download and run the “dpclat.exe” application from the Thesycon website.
- Start the application (no installation required).
- Let it run for one or two minutes while your audio software is running as well.
Depending on the your computer’s configuration you get only green bars (good) or you get yellow or even red bars (bad):
Good results: The screen shot above shows a computer system which should be well suited for real-time audio.
Bad results: This screen shot indicates that your computer most likely produces dropouts and audio artifacts.
If you see any yellow or even red spikes, they indicate that other (usually non-audio related) processes are occupying your computer’s CPU for too long, with the likely result that this will cause the audio buffer to run empty, resulting in glitches, clicks or distortion in your audio.
While the DPC Latency Checker gives a visual impression if your computer is running efficiently, or if anything is getting in the way of good audio performance, it does not show which specific device or driver is causing the problem. If DPC Latency checker is showing that there is a problem, you can use LatencyMon (described next) to identify which device, driver or service is the cause of the issue.
LATENCYMON
If DPC Latency Checker (see last section) shows any yellow or red spikes, run LatencyMon to identify the exact cause of the problem. The LatencyMon installer can be downloaded from here:
http://resplendence.com/latencymon
After you have launched LatencyMon, you first need to press the green Play button in the upper left corner to generate an analysis of the processes running on your computer. Run the analysis for at least 4 minutes while your audio software is running as well:
Click on the Drivers tab to see the results of the driver monitoring. Then click the column header labeled Highest Execution (ms) twice in order to see the highest values above (you may need to maximize the window to see this column):
In this screenshot you can see no problematic drivers, since everything is significantly lower than 1. All values below 1 are usually not problematic. Anything above may cause crackles and/or dropouts with real-time audio applications.
Note: The individual latencies of single drivers may sum up to more then 1ms overall latency (e.g. if you have drivers with results of 0.9 and 0.5, then those may sum up to 1,4ms which then can also create problems in the same way as if you would have one driver with 1.4ms latency).
If you have values above 1, check to which devices the affected driver(s) belong, then disable the affected device(s) in Windows Device Manager if possible. If you are unsure if the device can be disabled, then you should try to search the web for the driver’s name and/or for the description of the device (as shown in column 2) in order to find out if this device can safely be disabled.
We have compiled a list of drivers often reported to the Native Instruments support as causing high Highest Execution values in Latency Mon. This list and some hints about the related components are attached to this article as PDF document below.
DEACTIVATE DEVICES IN THE WINDOWS DEVICE MANAGER
Most often, the cause of audio dropouts are drivers or background services that are not related directly to audio processing. They task the CPU regularly and take away needed resources required to process audio without interruptions. LatencyMon should have given you an idea which drivers or components on your computer may contribute to your audio performance problems – if necessary, you should have searched the internet to find out which of the file names LatencyMon listed as problematic belong to which devices or drivers on your computer. With the list of names of potential problematic devices or drivers in front of you, start the Windows Device Manager.
Important: Here is a list of devices that you should never deactivate since these are essential components required by Windows: System timer, Keyboard, System CMOS/real time clock, Microsoft ACPI-Compliant System, Numeric data processor, Primary IDE Channel, Secondary IDE Channel, Graphics Controller, Ultra ATA Storage Controllers. In general, you should not deactivate anything which is listed in the branch “System Devices”.
- Right click the Computer icon on your desktop. Then select Properties > Device Manager
- In the Device Manager, locate the device(s) LatencyMon reported as problematic. If this is a device that is not essential for the basic operation of your computer (see note above), right click on the component and choosedeactivate (not uninstall!). Once you disabled the problematic devices (according to LatencyMon), test if this resolved the audio dropouts issue.
- Additional devices that can often be disabled to further preserve system resources (or to test if saving additional resources helps to resolve the problem), even if LatencyMon may not have listed them as problematic, are the following:
-
- Network adapter
- WLAN card
- Bluetooth port
- Infrared Port
- ACPI compliant battery
- Trackpad (only disable, if a mouse is also connected)
- Video camera
- DVD drive
- Any third party component that is not an essential part of the system (be careful and only deactivate components you recognize and that are not required for Windows to function)
- Built-in sound card (only if you are using an external sound card such as TRAKTOR AUDIO 6/10 or another USB sound interface from a third-party manufacturer)
DISCONNECT USB AND FIREWIRE DEVICES
For the purpose of identifying which device or driver may introduce the audio problem you are experiencing, disconnect or remove all USB or FireWire devices attached to your computer, except for your audio interface. Then test if the problems still persist. If not, connect one device at a time and test again. If the problem re-appears after re-connecting a specific device, look for an updated driver or updated firmware for that device or contact its manufacturer. Another possible reason for audio dropouts is if a bus-powered USB audio device does not get enough power from the USB port. A common cause is if other devices connected to the same internal USB root hub are consuming too much of the shared available power. After ensuring the problem goes away when disconnecting all additional devices, connect one device at a time to the various USB ports on your computer and test if any of the ports works better.
BIOS UPDATE
BIOS stands for Basic Input Output System which is a mini-Operating System that runs on a chip on your mainboard. The BIOS controls how the mainboard’s individual components work together (on a hardware management level, before Windows gets added to the mix). BIOS updates typically improve the performance of your mainboard’s components – mostly by fixing bugs. Just like with brand new software, updates for the BIOS are often released after new computers are sold, and resolve bugs or improve performance – sometimes dramatically.
If you have an off-the-shelf brand name computer (e.g. Dell, HP/Compaq, etc.) visit the manufacturer’s homepage and download and install the latest available BIOS update for your exact computer model. Instructions for this are usually posted on the website, or come with the downloaded update. If you have a self-built computer, visit the mainboard manufacturer’s website to find the latest BIOS update. Running the latest BIOS version is very important if you need to get the best performance from your computer!
CHIPSET / COMPONENT DRIVER UPDATE
Chipset refers to a group of important processor chips (aside from the computer’s main processor) on your computer’s mainboard, that are handling essential functions, such as harddrive and USB operation, etc. Some common chipset manufacturers are Intel, AMD, Nvidia, SiS or VIA. Windows usually has a set of generic chipset drivers built-in, however, these are often designed as a one-size-fits-all solution for the purpose of being compatible with as many different models as possible. The custom-tailored drivers provided by the chipset’s manufacturer often get much better performance than Windows’ built-in generic drivers.
If you have an off-the-shelf brand name computer (e.g. Dell, HP/Compaq, etc.) visit the manufacturer’s homepage and download and install the latest available chipset drivers for your exact computer model. Installation instructions are usually posted on the computer manufacturer’s website, or come with the downloaded updates. If you have a self-built computer, visit the mainboard manufacturer’s website to find the latest chipset drivers.
The same applies to all other hardware components installed in your computer: Download and install all available driver updates for components such as network adapters, built-in audio interfaces, FireWire controllers, graphics drivers and any other devices or peripherals installed in, or attached to your computer. For brand name computers, these drivers can usually also be found on the computer manufacturer’s website. For self-built computers, you will need to visit the websites of the manufacturer of each hardware component and download and install their latest available drivers.
ENERGY OPTIONS
Modern computer systems, and especially mobile devices, are engineered for the purpose of saving as much energy as possible. However, this is often at the cost of the computer’s overall performance, making it more likely to experience audio dropouts. The following should be tried to eradicate energy-saving related performance problems.
- Go to Start > Control Panel > System and Security > Power Options.
- Set the Power Scheme to High Performance (if this setting is not available, click on Show additional plansfirst). Then click on Change plan settings. On the next page set both Turn off the display and Put the computer to sleep to Never.
Then click Change advanced power settings. In the window that opens make sure you have the following settings:
- Hard disc > Turn off hard disk after > Setting (Minutes) = Never
- Sleep > Sleep after > Setting (Minutes) = Never
- USB settings > USB selective suspend setting > Setting = Disabled
- Display > Turn off display after > Setting (Minutes) = Never
- Processor power management > Minimum processor state > Setting = 100%
- Processor power management > Maximum processor state > Setting = 100%
GRAPHIC CARD TOOLS
Some graphic card tools like Ati Power Play and Nvidia Powermizer interfere with real-time audio, since they prioritize the graphic card performance over other processes in the system. Try to disable or uninstall these tools.
With some Nvidia laptop graphic chips, simply deactivating the graphic drivers in the Windows device manager can occasionally help to fix audio dropout problems. When you deactivate the graphic driver in the device manager, a standard Windows video driver is used after the next system reboot. This should help to identify if the graphic driver is a possible cause of the problem.
MANUFACTURER’S ENERGY SAVING TOOLS
Many laptop manufacturers install a proprietary application that takes over the control of the energy settings of the CPU and other computer components. As a result the energy settings made in the Windows energy options do not become effective. Deactivate any such application and test if the settings described in the previous section (Energy options) then solve the performance issues you experience.
DISABLE POWER SAVING OPTION OF THE USB PORTS
In the device manager (Start > Control Panel > System and Security > System > Device Manager), in the Universal Serial Bus controllers section, right click each USB Root Hub, choose Properties > Power Management and untick the Allow the computer to turn off this device to save power option.
MICROSOFT HOTFIX FOR USB SPIKES
There is a known issue regarding the functionality of external high-speed USB audio interfaces under Windows 7 or Windows Vista Systems. You can find further info and a hotfix from Microsoft here:
http://support.microsoft.com/kb/981214
In case you experience audible artifacts like crackles and dropouts occurring with the interval of 15 seconds while using a USB audio interface, these should be eliminated after applying this hotfix.
Note: This hotfix will not remove the visible spikes that you see in your Windows Task Manager, since these are caused by the way of measuring the CPU load and do not really reflect the real CPU consumption in the moments those spikes appear.
AERO
Aero is the graphical user interface used by Windows 7 by default. Aero is usually accelerated by the graphic hardware if you use a video card compatible with DirectX 9 or higher. However, it can cause audio dropouts with older video cards, especially when moving the mouse or when any refresh of the graphical user interface is necessary. If you experience audio dropouts due to Aero, you can disable it as follows:
- Right-click on the desktop and choose Personalize.
- Scroll down and select a color scheme from the Basic and High Contrast Themes section, such as Windows Classic.
Note: Video Card model versions earlier than ATI 3800 and Nvidia 8600 series might cause performance issues with some visual features of Windows 7.
PROCESSOR SCHEDULING
The Processor scheduling setting lets you choose if your computer should process Programs with higher priority, or Background Services with higher priority. In this context, Programs refers to applications you can see running on your screen. Background Services refers to software that you don’t directly interface with, but that is running in the background and is taking care of essential invisible tasks. The most important example of a background service in the context of this guide, is the driver for your audio interface.
Most of the time, the reason for dropouts and audio artifacts is because the audio interface driver (or the driver’s buffer) can’t process all data in time. Increasing the processing priority for background services (and with it, the priority of the audio driver) often contributes to better over-all audio performance.
To configure your computer to process background services with higher priority, do the following:
- Right click the Computer icon on your desktop. Then select Properties > Advanced System Settings
- On the Advanced tab under Performance click the Settings… button.
- Again, on the Advanced tab under Performance Options select Background services.
Please note that some applications may work better if the Processor Scheduling parameter remains set toPrograms. If your audio performance worsens after following the steps above, revert the setting back toPrograms. You may also refer to the documentation of the manufacturer of the software for more information on what setting should be used.
Reference: http://www.native-instruments.com/knowledge/questions/847/Windows+7+Tuning+Tips+for+Audio+Processing
[quotes_and_tips]