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

Author
Timur
Max Output Level: -87 dBFS
  • Total Posts : 179
  • Joined: 2008/07/05 05:01:49
  • Status: offline
2009/01/13 14:45:23 (permalink)

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

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.
post edited by Timur - 2009/01/23 08:22:54

We're all mad in here...
#1

16 Replies Related Threads

    Timur
    Max Output Level: -87 dBFS
    • Total Posts : 179
    • Joined: 2008/07/05 05:01:49
    • Status: offline
    RE: HOWTO: Low DPC latencies (&lt;100 us) on bootcamped Macbooks (Pro) 2009/01/13 14:46:45 (permalink)
    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):



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



    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...
    #2
    Timur
    Max Output Level: -87 dBFS
    • Total Posts : 179
    • Joined: 2008/07/05 05:01:49
    • Status: offline
    RE: HOWTO: Low DPC latencies (&lt;100 us) on bootcamped Macbooks (Pro) 2009/01/13 14:47:50 (permalink)
    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...
    #3
    tarsier
    Max Output Level: -45 dBFS
    • Total Posts : 3029
    • Joined: 2003/11/07 11:51:35
    • Location: 6 feet under
    • Status: offline
    RE: HOWTO: Low DPC latencies (&lt;100 us) on bootcamped Macbooks (Pro) 2009/01/13 16:34:13 (permalink)
    Wow! excellent research and info. Thanks!
    #4
    Timur
    Max Output Level: -87 dBFS
    • Total Posts : 179
    • Joined: 2008/07/05 05:01:49
    • Status: offline
    RE: HOWTO: Low DPC latencies (&lt;100 us) on bootcamped Macbooks (Pro) 2009/01/14 18:21:31 (permalink)
    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=50aa59cdf782d18a4d043cdd3baa920a

    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...
    #5
    Timur
    Max Output Level: -87 dBFS
    • Total Posts : 179
    • Joined: 2008/07/05 05:01:49
    • Status: offline
    RE: HOWTO: Low DPC latencies (&lt;100 us) on bootcamped Macbooks (Pro) 2009/01/16 07:55:09 (permalink)
    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.

    Use these steps in RIVATUNER:

    Open RIVATUNER and switch to the "Power User" tab.
    Expand the "RivaTuner\NVIDIA\Overclocking" Tree.
    Set "EnablePerfLevelForcing" to 1.
    Switch to the "Main" tab.
    Under "Driver settings" click on the small arrow left to "Customize..." and chose the first icon "System settings".
    Set "Force constant performance level" to either "low power 3d" (suffient for 2d audio work) or "performance 3d" (used for 3d gaming).
    Click OK and let the computer restart.

    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...
    #6
    Timur
    Max Output Level: -87 dBFS
    • Total Posts : 179
    • Joined: 2008/07/05 05:01:49
    • Status: offline
    RE: HOWTO: Low DPC latencies (&lt;100 us) on bootcamped Macbooks (Pro) 2009/01/16 08:00:40 (permalink)
    By mistake I did not update the original post before I posted it here:

    You need to KILL KBDMGR.EXE, setting affinity to CPU1 is not enough!

    We're all mad in here...
    #7
    Timur
    Max Output Level: -87 dBFS
    • Total Posts : 179
    • Joined: 2008/07/05 05:01:49
    • Status: offline
    RE: HOWTO: Low DPC latencies (&lt;100 us) on bootcamped Macbooks (Pro) 2009/01/21 08:21:46 (permalink)
    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...
    #8
    tarsier
    Max Output Level: -45 dBFS
    • Total Posts : 3029
    • Joined: 2003/11/07 11:51:35
    • Location: 6 feet under
    • Status: offline
    RE: HOWTO: Low DPC latencies (&lt;100 us) on bootcamped Macbooks (Pro) 2009/01/21 10:07:24 (permalink)
    ORIGINAL: Timur
    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).

    How? Is this customization available to the stock bootcamp kbdmgr? My MBP isn't available right now so I can't go investigate it.
    #9
    Timur
    Max Output Level: -87 dBFS
    • Total Posts : 179
    • Joined: 2008/07/05 05:01:49
    • Status: offline
    RE: HOWTO: Low DPC latencies (&lt;100 us) on bootcamped Macbooks (Pro) 2009/01/21 10:09:36 (permalink)
    Here's a small toolkit I put together. Installation instructions are included in the README.TXT for your convinience. ;)

    Boot CampED - Download Page
    post edited by Timur - 2009/01/23 08:22:10

    We're all mad in here...
    #10
    tarsier
    Max Output Level: -45 dBFS
    • Total Posts : 3029
    • Joined: 2003/11/07 11:51:35
    • Location: 6 feet under
    • Status: offline
    RE: HOWTO: Low DPC latencies (&lt;100 us) on bootcamped Macbooks (Pro) 2009/01/21 14:30:53 (permalink)
    ORIGINAL: Timur
    PS: I have to use free file hosters that use ads on their site. Sorry for that.

    Drat. It's blocked here. I'll see if I can pick it up at home...

    Incidentally, I've been following your progress and trying to do my own experiments with my MBP. But mine has the ATI video and Agere wireless, so I can't quite dupicate what you're doing. Plus, I'm swamped with lots of other stuff... (ah, but who isn't...?) Anyway, thanks for the reports.
    #11
    Timur
    Max Output Level: -87 dBFS
    • Total Posts : 179
    • Joined: 2008/07/05 05:01:49
    • Status: offline
    RE: HOWTO: Low DPC latencies (&lt;100 us) on bootcamped Macbooks (Pro) 2009/01/22 05:39:47 (permalink)
    I put up some better download link!

    Boot CampED - Download Page
    post edited by Timur - 2009/01/23 08:23:32

    We're all mad in here...
    #12
    Timur
    Max Output Level: -87 dBFS
    • Total Posts : 179
    • Joined: 2008/07/05 05:01:49
    • Status: offline
    RE: HOWTO: Low DPC latencies (&lt;100 us) on bootcamped Macbooks (Pro) 2009/01/23 08:26:14 (permalink)
    New version of the toolkit v1.1 that fixes a bug with setting priority and affinity.

    We're all mad in here...
    #13
    Timur
    Max Output Level: -87 dBFS
    • Total Posts : 179
    • Joined: 2008/07/05 05:01:49
    • Status: offline
    RE: HOWTO: Low DPC latencies (&lt;100 us) on bootcamped Macbooks (Pro) 2009/03/31 06:00:52 (permalink)
    The following screenshots should help you find the options in Rivatuner that allow you to set the graphic-card to a fixed performance level.

    First you need to unlock the option:



    Then you go to the System Tweaks settings:





    Then you have to set a desired performance level (I advice to use lowpower 3D unless you want to play some performance 3D games):


    We're all mad in here...
    #14
    VigilantSound
    Max Output Level: -81 dBFS
    • Total Posts : 474
    • Joined: 2008/07/06 13:17:59
    • Location: Vancouver,BC
    • Status: offline
    RE: HOWTO: Low DPC latencies (&lt;100 us) on bootcamped Macbooks (Pro) 2009/04/07 19:08:01 (permalink)
    Im glad to see more SONAR users that are on macs. Thanks for the links.
    post edited by VigilantSound - 2009/04/07 19:17:53

    ASUS P5BV-C, Intel Core 2 Quad 2.8 Ghz, Q9300,
    4 gigs Ram, Win7-64 bit OSX 10.6
    ADK 9000 I7, 6 gigs Ram, MacBookPro I7, 4 gigs Ram
    MOTU 828Mk3, MOTU microbookII
    SONAR PE X2A, Pro Tools 9.0.6, StudioOnePro 2.5.4
    Ableton Live 9, Waves V.9, 


    www.jesseahemmanuel.com




    #15
    ninrocket
    Max Output Level: -90 dBFS
    • Total Posts : 1
    • Joined: 2009/12/15 02:14:43
    • Status: offline
    Another thing......... 2009/12/15 02:28:35 (permalink)
    IF.........anyone should stumble into this thread I might be able to help you.

    I'm a PC...not a Mac....and I kept getting the popping and hissing and noise stuff. It didn't matter if I used Cakewalk, Acid Pro 7, Reaper....
    (I am running Windows 7 with all the updates. Everything else works great. No problems.)

    The noise would get really bad whenever I enabled a VST like Amplitube. If I really wanted it to go berserk than all I had to do was minimize a window while the DAW and VST were up and running. Grabbing a window and moving it would do the same thing.

    It did seem to be a video driver issue. If I disabled the video the problem went away....but you can't work when the resolution is set to 1024x768.

    I tried EVERYTHING currently being tried...and nothing really worked great...until I had an idea.

    The BUS is what the video card has to communicate with. DPC errors could cause these problems...if there were something wrong with the BUS.

    I have an Intel 975X board...aka...P5W DH Deluxe. I went to the Intel website. Downloaded the latest Win 7 x64 bit drivers. Rebooted.

    THE FOCKING PROBLEM IS SOLVED!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    I have tried everything to get the noise to come back and no avail. The INF drivers for the Intel hardware were dated 2006. The new ones are dated August 2009.

    Maybe this will help someone else.

    Gonna add some rubbish for anyone searching with Google:

    NVIDIA DPC LATENCY CLICKING NOISE HISSING POPPING DAW RECORDING DRIVER PROBLEMS

    LATER!




    #16
    tarsier
    Max Output Level: -45 dBFS
    • Total Posts : 3029
    • Joined: 2003/11/07 11:51:35
    • Location: 6 feet under
    • Status: offline
    Re:HOWTO: Low DPC latencies (&lt;100 us) on bootcamped Macbooks (Pro) 2010/01/20 14:56:02 (permalink)
    Apple just released v3.1 of the bootcamp driver pack. Now supports XP up to Win7 x64. I installed on my new MacBook Pro XP 32-bit system with MOTU 828mkII firewire and can now run it at a 64 buffer size without crackles or dropouts. I haven't run it through any hard stress tests yet, but this is very encouraging.

    It also appears that KBDMGR.exe is gone.  Looks like it's been replaced by Bootcamp.exe and even with Bootcamp.exe running, my DPC latencies hover at about 90 us, with occasional spikes up in the 1000 us range.  Not ideal, but much better than before.
    #17
    Jump to:
    © 2026 APG vNext Commercial Version 5.1