1. IMPORTANT:
    We launched a new online community and this space is now closed. This community will be available as a read-only resources until further notice.
    JOIN US HERE

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

Discussion in 'Computer Technology and Setup' started by Timursen, Jan 6, 2009.

Thread Status:
Not open for further replies.
  1. Timursen

    Timursen Forum Member

    Messages:
    151
    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". But it seems as if using "Rightmark CPU Clock Utility" makes Speedstep clock down less aggressively at least.

    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 has broken multithreading as pointed out by this website:

    http://alexpopovich.wordpress.com/2...udio-skipping-in-vista-analisys-and-solution/

    You can also change the CPU affinity of KBDMGR.EXE to CPU 1 (not 0) which will help DPC Latencies alot, but there will still be Audio dropouts. There is a patched version of KBDMGR.EXE for download at the link above that will do this automatically. But for professional Audio applications you need to kill the process for the time being.

    Turn off the Broadcom 802.11N WLAN driver via Device-Manager.

    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.

    Change the graphic-card driver to "Standard VGA Driver" via Device-Manager or update to latest Nvidia driver via modified driver package and INF file.

    This again is a thing to try with your specific setup. The 9600M GT driver can produce single but long spikes from time to time if the system is under load, especially if Aero is activated and you are moving around a window. When Idle (Speedstep decreasing the CPU clock) DPC Latencies under Aero will be going towards yellow regulary with single spikes, while without Aero latencies stay low but again with single spikes. Using the Standard VGA Driver wont allow you to use Aero anymore though, but therefor there will be no more DPC latencies spikes.

    The described behavior is that of both the driver coming with Bootcamp and the latest version 180.84 beta which can be installed via a modified driver package + INF file. Unfortunately you might be missing the new control panel when using non Bootcamp drivers. You can find the modified files for installing the latest Nvidia driver here: www.laptopvideo2go.com

    The Nvidia driver shows some quirks apart from the already described behavior. When Aero is turned off: higher idle DPC latencies, more spikes when GUI elements are moved (like moving a window or (un)folding a subtree of the device-manager) and somewhat erratic movement when moving a window. When Aero is turned on it seems to run better, but some actions like maximizing the DPC Latency Checker window can lead to whole blocks of bad latency spikes.

    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 that much. 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.

    Windows XP specific

    On XP (in contrast to Vista) you can access PowerMizer settings, but they don't have any effect on the late 2008 MBP, neither DPC wise nor battery/power wise.

    Furthermore the NVidia driver produces no relevant DPC/load spikes on XP, but it's a good idea to deactivate "Cursor Acceleration" (set the Troubleshooting setting one tick down). The standard VGA driver on XP (only accessible by uninstalling the NVidia driver) shows lousy performance and should be avoided altogether.

    It's also not mandatory to deactivate the ACPI Battery service on XP, because it produces smaller spikes in irregular intervals only.

    All in all the lowest DPC latencies I could measure on XP are downto 2 us, but with the tweaks listed in this thread performance of Vista is roughly on par with XP if not even slightly better on my MBP 2.8 GHz.
     
  2. Timursen

    Timursen Forum Member

    Messages:
    151
    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):

    [​IMG]

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

    [​IMG]

    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.
     

    Attached Files:

  3. Timursen

    Timursen Forum Member

    Messages:
    151
    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. ;)
     
  4. Timursen

    Timursen Forum Member

    Messages:
    151
    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. :)
     
  5. Timursen

    Timursen Forum Member

    Messages:
    151
    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.
     
  6. Timursen

    Timursen Forum Member

    Messages:
    151
  7. Timursen

    Timursen Forum Member

    Messages:
    151
  8. ew

    ew Moderator Moderator

    Messages:
    21,328
    Nice job, Timur =)

    ew
     
  9. Timursen

    Timursen Forum Member

    Messages:
    151
    Thanks! Not many people around here seem to need it, but it wasn't too much work to post it here, too, once I wrote it for the RME forum.
     
  10. Anudu

    Anudu New Member

    Messages:
    7
    Hi Timursen! I most interested read this thread about DPC latencies with Geforce cards under Windows Vista.

    My problem is quite extreme: after a fresh installation of Vista 64, everything was fine, but as soon as the driver (181.22) was installed the DPC latency went very high.

    DPC Latency Checker tells me constantly (!) 23000 micro-seconds. My whole screen is filled with huge big red bars.

    When I disable the graphics card, everything is fine. But otherwise, I can't listen to music, not to think produce music.

    Picture shows what happens, if I activate the Nvidia card again:
    http://img3.imageshack.us/my.php?image=dpckn2.jpg

    I'm really stuck with that. I read in your thread about the RivaTuner and tried it. I set it to "Performance 3D", but that didn't help at all. I still got 23 ms constant DPC latency.

    Do you have any new insights on that problem? My computer is quite fast, but it's gruesome that it can't even play MP3 files. For I really got an expensive audio card (for doing music stuff)... but I can't use it anymore.

    I'd really appreciate some help.


    Thanks in advance!
     
    Last edited: Feb 4, 2009
  11. Timursen

    Timursen Forum Member

    Messages:
    151
    You could try to use a pre 180 driver (179) or try to uninstall the PhysX driver (should be disabled by default though).

    I also noticed two special icons on the upper right corner of your screenshot-window. Maybe those are the culprit?

    Some people report that turning off all antialiasing helps them.

    Is there any difference between using Aero and Classic?

    If that doesn't help then maybe you need another graphic-card ? I'm using a 7800GT (Vista 32) and a 9600M GT (Vista 64), the 7800 doesn't need any tricks to run on low DPCs and the 9600M GT needs the fixed performance level trick only.
     
  12. Anudu

    Anudu New Member

    Messages:
    7
    Timursen, thanks for the fast reply!

    I tried the 179 driver: it even gives me latencies which are about 3000 to 5000 micro-seconds worse.

    Disabling PhysX didn't make a difference, though it was enabled by default.

    The special icons are from a program called "UltraMon", which basiclly let's you use 2 monitors in an convenient way. Nothing changes in terms of DPC. The high DPCs even appeared when only one monitor was active.

    Anti-Aliasing off and Aero off doesn't make any difference. Still and always 23 ms DPC latency.

    Buying a new graphics card would be a real pain, because I got mine exactly long enough that I can't just send it back: 3 weeks. :(
     
  13. Timursen

    Timursen Forum Member

    Messages:
    151
    This could also be a problem with your mainboard/BIOS. On the RME forum there was a discussion about certain DELL notebooks which cannot be brought down to low DPCs because of some bugs in BIOS as far as I remember.

    Did you try to set power-managment to "Performance" yet? Along other things this will turn off power-managment of the PCI bus.

    Also try to disable all and everything via hardware-manager while using the NVidia drivers. Maybe not the graphic-card is the culprit, but some incompatibilities with other hardware that only happen in combination.

    If this all doesn't help then you should try to return the graphic-card as obviously it doesn't work properly in your system. You can tell the shop that the graphic-card makes your audio stutter once installed and that it stops once you uninstall it. Do you have your old card left so that you can exchange them and try if that solves the problem?
     
  14. Anudu

    Anudu New Member

    Messages:
    7
    Hey Timursen! I read that stuff about the Dell Computers. But these folks were talking about peaks and not that issue I have, where everything is red. :(
    I tried at least the two BIOS updates, which actually know my processor (F3 and F4a for Gigabyet EP35-DS3). No difference.

    I tried Performance Modus withhin Vista and also within Riva Tuner. Nothing helps.

    I tried to turn off each and every device, but no change. As soon as the video card is off, everything is fine. I even pulled out my soundcard, which is the only additional device, apart from the stuff on the mainboard.

    I'm already thinking of buying a new card from another vendor, but I'm reluctant, because I don't know if the problem appears again. As you said, some people might just not notice, that their sound is crappy, and if, then it's still a big step to blame the video card.

    I'm waiting for a support answer from nVidia now. Also posted in their forums. If they tell me that my video card is crappy, then I'll go and buy another one. :confused:

    Maybe you still got another idea. Anyway, I'm quite unhappy with the situation, because I can't even listen to music, without getting hell of a headache. :angry:
     
  15. Timursen

    Timursen Forum Member

    Messages:
    151
    You could try "low-power 3D" instead of performance mode (which is a better choice for 2D audio applications anyway), but likely it wont help.

    And if your mainboard offers another PCI-E slot for the graphic-card you could try switching slots. No more ideads apart from that.
     
  16. Anudu

    Anudu New Member

    Messages:
    7
    Timursen! I had a close look at the power supply unit in my computer. It said "600W", which should be enough.

    Then I noticed, that this "600W" was written on a sticker and removed it. Look how it looked then:
    http://img4.imageshack.us/my.php?image=netzteildp5.jpg

    It's only a 420W psu! :angry: Could that be my problem?

    If so, I'm going to be really mad with my merchant....
     
  17. Timursen

    Timursen Forum Member

    Messages:
    151
    Nope! While it's not nice to have a PSU relabeled you wont hardly ever need 600W nor even 420W unless you are running lots of drives and dual-slot graphic-cards.

    An unstable PSU that doesn't provide enough power can be quite troublesome, but usually that leads to instabilities, freezing and crashing and not higher DPC Latencies. ;)
     
  18. Anudu

    Anudu New Member

    Messages:
    7
    Well, but you said, that a video-card, that's on Performance 3D mode, produces less latency.

    What if my card continously tries to go to that level, but doesn't get enough power? It keeps trying to clock higher, but fails. Couldn't that be the cause?

    Anyway, I'm going to find out, because my seller promised me to send a 600W psu for free. Good for him.
     
  19. Anudu

    Anudu New Member

    Messages:
    7
    You were right, the latencies didn't vanish, once I installed the new psu. So, after psu und mainboard have been changed, my only guess left is that the videocard itself is broke. I have to find a PCIe card somewhere to test that.

    Edit: The computer now runs with the psu for 2 hours. And now the latency is gone. I don't know why it happens and don't know how. But I'm happy! :)
    It seems, that it has been the psu! Can you believe that? I really don't know what happened. It's as like the videocard or something else got aware of enough power... weird....

    Edit 2: After a restart, the situation was bad again. I then thinked hard about what I did last time and came to the conclusion, that I played Far Cry 2. So I started the game again and as soon as the game play started, the DPC latency dropped (got 2 monitors, could see it that way).
    Now, if I want to hear music, I just have to start Far Cry 2? :S
    Obviously, it sets the videocard in another state, now after the new psu is in. Any ideas?
     
  20. Timursen

    Timursen Forum Member

    Messages:
    151
    The game puts the GPU into "Performance 3D" mode. It seems as if you did something wrong when you tried to enforce that via RIVATUNER. You should monitor the GPU clock-rates via Rivatuner's monitoring feature. That will tell you whether something is happening or not.
     
Thread Status:
Not open for further replies.