HOWTO: Low DPC latencies (<100 us) on bootcamped Macbooks

Configure and optimize you computer for Audio.
RELATED
PRODUCTS

Post

Here is a small HOWTO for getting the lowest possible DPC latencies (<100 us) on bootcamped Macbooks Pro (late 2008):

Disclaimer: I did all tests on my late 2008 Macbook Pro Unibody 2.8 GHz model with NVidia chipset and graphic. Most of the following suggestions should apply to standard Macbook models and likely older generation as well.

First of all Intel Speedstep leads to dropouts and higher DPC latencies on small load! Unfortunately all tools that are supposed to manually switch Speedstep off don't seem to run on the late Macbooks (Pro) while on OS X you can use "Coolbook".

Your only way to make sure your processor is clocked high enough and not dynamically switching is to put up a constant load (like running your DAW pretty hot or running Prime95 at "Idle/Lowest" process Priority in the background). I will keep investigating if I can find a tool to switch Speedstep off.

Most importantly (to get rid of really bad DPC latency spikes):

Kill the process "KBDMGR.EXE"!

That's Apple's driver for controlling brightness and keyboard lighting via the function keys and setting tap options for the trackpad. It seems to have broken multithreading! You can also the CPU affinity of KBDMGR.EXE to CPU1 (not CPU0!) which will help decreasing DPC Latencies alot, but there will still be Audio dropouts.

Here's a small toolkit I put together that allows you to conviniently enable/disable Apple's "Boot Camp" tray application (KBDMGR.EXE) via an icon link and/or keyboard shortcut. Optionally it will switch the function of the F-Keys automatically for you depending on whether Boot Camp is loaded or not.

Furthermore it automatically turns Boot Camp's CPU priority to "Idle" and CPU affinity to CPU1 in order to turn down the bug induced DPC Latencies and prevent dropouts with Windows sounds and Media Player playback. Professional Audio users will find that only turning off Boot Camp will allow low audio latency usage. Installation instructions are included in the README.TXT for your convinience. ;)

Boot CampED - Download Page

Turn off the Broadcom 802.11N WLAN driver via Device-Manager or update to the latest drivers via Microsoft Update Catalog.

Like on OS X the Airport module can lead to audio dropouts. The DPC Latencies produced by the Broadcom driver are less regular than the KBDMGR thing, alot higher in value. Best thing is to try for your own needs.

Update:Meanwhile a new Broadcom drivers was published via Microsoft's Update Catalog named "Broadcom - Network - Broadcom 4322AG 802.11a/b/g/draft-n Wi-Fi Adapter " (4322 is the chip used). This one comes with both low DPC latencies and finally the ability to use the full rate upto 300 mbit/s. Go get it! For safety you might still want to turn WLAN off during critical audio work though.

Change the graphic-card driver to "Standard VGA Driver" via Device-Manager or use RIVATUNER to enforce a fixed clock-rate and performance mode.

Update:The dynamic clock-rate switching happening with NVidia drivers in order to save power and keep temperatures low leads to extreme DPC spikes for each switch and constantly high DPC latencies when it settles in low performance 2D mode. RIVATUNER's "Enforce Performance Mode" option can be used to set the card to a fixed clock-rate. I recommend using "Low Power 3D" for audio work.

User of XP might think that they don't need this, but be aware that on XP the NVidia driver keeps running at highest clock-rates in "Performance 3D Mode" all the time. Via RIVATUNER you can switch to "Low Power 3D".

Turn off the ACPI compliant Battery driver via Device-Manager

This driver polls the battery for its current load status and produces a small, single, short spike exactly every 15 seconds. In my own tests I found that it doesn't seem to affect low latency audio performance. Furthermore turning it off will remove monitoring of your current battery status. But if you are running on power-chord anyway and want to make absolutely sure you can turn it off.

All other devices don't add much if anything to DPC latencies, but can savely be turned off if you don't need them (like Nvidia LAN, Bluetooth, Onboard High Definition Audio).

Attention: Removing the Battery while the power chord is connected results in permanently reduced CPU clock (downto the lowest clock setting possible). According to Apple this is done to prevent overloading the power-supply during heavy load as it needs the assistance of the battery from time to time.
Last edited by T1mur on Fri Jan 23, 2009 1:24 pm, edited 2 times in total.
We're all mad in here...

Post

There is some good news: Because of the Windows 7 Beta that will be published in the near future Microsoft has put up a new "Microsoft Update-Catalog" at: http://catalog.update.microsoft.com/v7/site/Home.aspx

This includes many updated drivers for hundreds of hardware interfaces including Broadcom WLAN drivers and Nvidia 9600M GT drivers that are found on the current Macbook (Pro) models.

Especially the Broadcom driver is very interesting:

1. It finally enables full 300 mbit/s 802.11n support, whereas older drivers (including OS X) only connect upto 130 mbit/s with many routers. Whatever the driver does to switch 300 mbit on it even stays on when you reinstall the older drivers!

As a drawback you cannot use channels 12 and 13 anymore (in Germany) as this driver seems to be made for the USA only.

2. It dramatically improves DPC latencies

From this (Bootcamp Broadcom driver version 4.170.77.3/03-21-08):

Image

To this (Broadcom driver version 5.10.38.26/10-22-08):

Image

I would still advice to turn off WLAN when doing critical Audio work, but at least you only have to do it for special circumstances now.

The Nvidia 9600M GT drivers are version 177.48 and thus slightly newer than the Bootcamp ones. Unfortunately they shows about the same DPC Latency behavior as before. So for critical Audio work you still have to fall back to the "Standard VGA Drivers".

PS: Curiously the new driver version of the Broadcom drivers resembles what OS X reports as "Firmware Version: 5.10.38.24". Even more strange Windows 7 Beta comes with a driver version 4.176.75.11/10-23-08 that is one day younger, but less performing than the version 5 drivers.
We're all mad in here...

Post

what is this bootcamped talk?

bootcamp is ONLY a driver set, no need to use it to have xp/vista/7 running, it's just a GUI for the partition(which you can easily do in terminal(and do 3 instead of the forced 2 of the soft)

Bootcamp IS NOT needed to install M$ on a mac
Image

Post

The Bootcamp Setup on the OS X Installation CD provides the drivers necessary to run Windows on the Macbook. While some of these drivers can easily be updated (like the Broadcom drivers) others cannot be found anywhere else (like all Apple drivers for the Touchpad, function buttons and the Nvidia 9400M chipset drivers and graphic-card drivers).

Maybe you should have read through my posts before replying, because it includes hints on where to find more current drivers without needing to wait for Bootcamp updates. :smack:
We're all mad in here...

Post

I will try some of these out T1mur- thanks...

Post

im just tired of people reffering to xp on a mac as bootcamped like it was an emulator, its just another gui layer for things people should be doing manually, and a set of drivers, not some important application, one could choose to have only xp on a mac without even touching bootcamp

so you downlaod bootcamp, look in the package, brn the drivers and delete that crap, you then partition/format the drive by hand and install xp by hand like on a normal computer

anyway, i had nothing against your post, it's just the drop of water that made the bowl overflow of people calling bootcamped xp like ot was another application needed to use xp(when its clearly not)
Image

Post

Using the term "bootcamped Windows" seems to make perfect sense in that every reader knows instantly that you are talking about a bootable/standalone Windows installation on its own partition on an Apple computer.

Besides, it also includes the process of creating a legacy BIOS Master Boot Record on an otherwise EFI driven computer. :P

What you don't seem to like is the fancy Bootcamp (TM) name that Apple's public relations came up with to describe a mundane process of providing hardware drivers. That's OK with me, but not worth to hijack this thread with. :borg: :wink:
We're all mad in here...

Post

So I have managed to get the range from 5000-8000 µs to 500-1000µs by updating the broadcom drivers, the 9600 drivers and setting processor affinity in Vista. Looks like disabling my bluetooth radio helped a bit as well. That has made the audio glitch free, and since its my dev lappy, that is good enough for me, I do wish that the apple drivers would get updated a bit more frequently, but its nice to know that there is a workaround to get it working...

Post

Also I managed to fix my MAc Pros ~3000µs DPC latency caused by the intel Pro/1000 EB drivers included with bootcamp 2.1. I supposed since my Mac Pro has 8 cores, I never noticed any issues with low latency audio, but Im hoping to try and take it lower than the 192 sample latency I use currently and see what happens... If any of you have a Mac Pro, running vista 64, download the

Company: Intel Corporation
Driver Manufacturer: Intel
Driver Class: Other Hardware
Driver Model: Intel(R) PRO/1000 EB1 Network Connection with I/O Acceleration
Driver Provider: Intel
Version: 9.12.36.0
Version Date: 12/4/2008

driver. Interestingly the "architecture" specifies AMD64, and not x64. However, the drivers install and lowered the DPC latency to an average of 40-60 µs. I also updated the Intel 5000 series chipset drivers from the update catalog site, but it didnt make any difference in DPC latency...

Post

looks like a 2.2ms buffer is possible at 44.1khz on my ua-1000 now :)

Post

Some Updates:

1. NVidia now officially offers graphic-drivers for their mobile line of GPU including the 9400M/9600M that are found in the Macbook (Pro). So you can just download the latest drivers directly from NVidia now without any need to mess with INF files or any other hack.

2. I have found the source for the DPC Latency spikes that are happening with NVidia graphic-drivers installed. Actually there are two reasons for this happening.

a) The Nvidia driver dynamically changes the GPU clock-rate (including GPU memory) up and down depending on current graphic-load. Everytime the clock-rate changes (especially when it changes down) a huge DPC Latency spike happens. This has been reported with Geforce-8 based GPU on other forums and unfortunately the 9600M is more of a Geforce-8 than Geforce-9.

b) When graphic-load is low (like with most 2D based DAWs) the GPU memory is clocked down to only 100 MHz (from a max of over 700 MHz), this leads to regular and ongoing DPC Latency spikes when many dymanic elements are displayed by a DAW.

I have already managed to temporarily get rid of NVidia based DPC Latency spikes and I'm working on finding a solution that allows to permanently get rid of those during DAW work. I will report back on that.

Until then the best performing option that leads to the lowest average DPCs is still to switch the graphic-driver to "VGA Standard Driver" (minimum power draw will be upto 5W higher though).

3. Nvidia also offers an application called Ntune at version 6. NTune allows you to overclock/underclock the Frontsidebus (and thus the CPU and RAM), modify RAM timings and overclock/underclock the GPU. Only experienced people who know what they are doing should mess with it, but it's nice to have for those of us who like messing around anyway. ;)
We're all mad in here...

Post

I have one bad news and two lightly good news:

Bad news: I was not able to keep the Nvidia 9600M GT from switching down to 2D mode sooner or later. Even when it is possible to keep it from switching clock-rates in performance-3D and low-power-3D by setting those to the same clock-rates once it goes down to 2D the performance is rather bad aka DPC latencies are regular high enough to make it unusable for low latency audio work. It seems that the lower the memory clock the higher the DPC latencies.

1. good news: "For a limited time, provide your feedback on Rel 179 notebook drivers."

http://surveys.nvidia.com/index.jsp?pi= ... dd3baa920a

So for the first time they offer us end-users to tell them what we think about the performance of their drivers. I will use that opportunity to tell them about bad DPC behavior! ;)

2. good news: NVidia not only officially offers drivers for the graphic-card but also for the system chipset. You can find it under "NForce -> NForce7 -> 730i/Geforce 9400m/9300m mGPU". The current version is already a bit more up-to-date than the ones on the Bootcamp disc.

3. good news: I forgot what it was, but I'm sure there was a third good news. :)
We're all mad in here...

Post

Update: I didn't give up and finally found a way to keep the NVidia graphic from producing DPC Latencies on Vista/W7 while NVidia drivers are used (instead of just using VGA Standard drivers).

Furthermore I found that the only reason why Windows XP is not affected by NVidia induced DPC Latencies is because the graphic card's clock-rates are never changed but keep running at the highest settings (Performance 3D), not even when installing the latest drivers. This is a bug! The obvious drawback is that power drain and likely GPU temperatures are somewhat higher compared to Vista/W7.

Actually I found two ways to stop NVidia DPC Latencies from happening on Vista/W7. Since the reason for the DPC Latencies are:

1. dynamically switching clock-rates
2. running at low performance 2D mode most of the time

We need to get rid of both! One way is to switch to the Microsoft VGA Standard driver which makes the 9600M run at fixed "medium" clock-rates for both GPU and memory. But since this not only means to abandon Aero, but also Nvidia video-playback acceleration and other driver goodies it's only the second best option.

The best option I found is to use an application called Rivatuner that offers a somewhat hidden option called "Force Performance Mode". This allows to set the NVidia driver to one of it's three modes: "Standard 2D" (we don't want that!), "Low Power 3D" (comparable to Standard VGA driver clock-rates), "Performance 3D" (that's what XP gets stuck at).

I recommend enforcing the "Low Power 3D" mode for audio work. You need to restart the computer in order to switch the "Force Performance Mode" on and off in case you need to get the old behavior back or need the full "Performance 3D" mode for gaming, but that's not too much of an inconvenience. It also works on XP by the way.

The second method I found is a bit too geeky and needs too much work to setup so I wont explain that in detail. The general idea of that second idea is that once a DAW GUI is loaded any switching of GPU clock-rates forces the GPU back to "Performance 3D" mode (even when the rate doesn't actually change). So a regular occurring switch every few seconds would keep the rate constant. I prefer method 1 even when that means to reboot for changing it.
We're all mad in here...

Post

I spent some time to get more convinient control over KBDMGR and the corresponding settings application (the one you configure the trackpad and F-keys behavior besides other stuff).

Right ALT-. will switch KBDMGR on and off now. Additionally the F-keys are automatically switched to their special Macbook functions (like controlling brightness) when KBDMGR is on and to normal F-keys function when KBDMGR is off.

Furthermore when Windows boots up and when enabling it via ALT-. then KBDMGR is set to "Idle" priority and CPU1 affinity. That helps for normal desktop audio output, but for professional audio work it still needs to be turned off.

Right ALT-, will open up the settings dialog now. It also works with KBDMGR being disabled including setting brightness via the slider.

PS: While I was at it I also remapped the key left to the backspace to act as DEL (it's the never used key '' on german keyboards) and the right CMD key to act as CTRL (so I can use it like on the OS X).
We're all mad in here...

Post

Here's a small toolkit I put together that allows you to conviniently enable/disable Apple's "Boot Camp" tray application (KBDMGR.EXE) via an icon link and/or keyboard shortcut. Optionally it will switch the function of the F-Keys automatically for you depending on whether Boot Camp is loaded or not.

Furthermore it automatically turns Boot Camp's CPU priority to "Idle" and CPU affinity to CPU1 in order to turn down the bug induced DPC Latencies and prevent dropouts with Windows sounds and Media Player playback. Professional Audio users will find that only turning off Boot Camp will allow low audio latency usage. Installation instructions are included in the README.TXT for your convinience. ;)

Boot CampED - Download Page
We're all mad in here...

Post Reply

Return to “Computer Setup and System Configuration”