Vista, launched in an ice house in Toronto. That’s where I want my project studio this winter, for sure. Photo (CC Sam Javanrouh.

On a purely technical level, how does Windows Vista work with a leading pro audio application? A lot of that depends on just how much the developer does to tune their software, and to hook into some of the new audio technologies in the OS.

I wanted to know more about how Cakewalk’s SONAR 8 DAW was specifically optimized for Windows Vista. SONAR 7 was already out in front with support for Vista’s audio plumbing, but SONAR 8 promises quite a bit more. With the help of CTO Noel Borthwick, we were able to go through internal engineering documents and communication and get the full story. (Noel, who has a resume as a Linux programmer as well as leading the top Windows audio developer’s technical efforts, has been very frank in the past about Vista, walking us through changes before launch and real world experiences one year later.)

As Noel puts it, this is “more minute detail than most sane people would care to read,” but that’s just the kind of detail we like. If you just want to know whether your software will work, this is overkill. But for those of you who, like us, are interested in why some things work, this is a good place to start. I also sincerely hope other developers on Windows will start to invest more time in some of these details.

If SONAR 8’s music features are what interest you, see our first look:

SONAR 8 Preview: Instrument Tracks, Beatscape Instrument, Transient Shaper, Enhanced Performance, Other Goodies

I’ll repeat my current recommendation on Windows. If you’ve got a system running XP and you’re happy, I’d stick with it. But I see no reason to avoid SP1, unless you have a specifically incompatible setup, now that SP1 and driver updates have brought some maturity to the platform. I find the new OS more usable and, with the right software and drivers, even more stable. (This is not what I would have said before SP1, especially early after launch.) In fact, this walk-through with Noel demonstrates why, in the case of a SONAR system, you might be happier under Vista, on a point by point basis. I’ll avoid the “versus Mac” or “versus Linux” arguments, as those tend to get more complex and abstract, but there’s some good stuff here for those of you with Windows experience.

And yes, if any developer would like to do a similar tour on the Mac or Linux, I’m all ears. But just in case you think I’m crazy when I say there is some really robust stuff for audio in Vista, now you’ll know just what I mean.

CDM Executive Summary

A Cakewalk SONAR-based studio, with lots of other goodies, (CC) “Cowboy” Ben Alman. And, after all, it’s those little performance details that make a big difference in your software studio.

Okay, here’s the quick run-down.

SONAR 8 involves improved performance optimizations, even relative to previous versions of SONAR. As far as I know, this is unparalleled progress on the Windows platform; few, if any developers are doing this kind of work. That’s not to say you won’t get good performance out of other Windows apps under Vista – certainly, I spend a lot of time in hosts like Ableton Live, Kore, and FL Studio on Vista — just that SONAR is leading here. (Developers out there doing similar work, we’d love to hear from you; developers not doing this kind of work, I hope this can piqué your interest and/or point you in the right direction, and certainly I don’t think anyone on Windows is trying to protect “trade secrets” – the better this stuff works, the better for everyone.)

The upshot of all of this should mean:

  • Reduced audio glitches and performance bottlenecks, thanks to improvements to the audio engine itself, as well as the way the software makes use of the kernel (which impacts drivers also using the kernel)
  • Smoother peformance in the UI as you zoom, draw, and the like
  • More efficient performance, through optimization at the driver level and by better supporting Vista’s new audio API and threading mechanisms
  • Better support for both WDM (Windows Driver Model) and ASIO drivers, and better performance at lower latency (that’s always the measure – you can always reduce latency, the question is whether you can maintain reliable audio performance when you do so)
  • x64 is now, effectively, ready for prime time latency-wise

Now, here’s Noel to say that in more technically precise terms.

Performance Optimizations

Although every version of SONAR we shipped in the past had some degree of optimization work, SONAR 8 is the first version of SONAR to which we applied the same engineering process to performance optimizations as we do with other more user visible features.

i.e. we established goals, built a specification for the optimizations, split up the work into milestones and tracked the progress of these tasks just as we do for other features. To make testing more deterministic, we devised various internal profiling tools in order to track and measure changes in performance across a variety of hardware platforms on XP as well as Vista.

Systems tested included brand new cutting edge platforms from Intel and AMD as well as earlier generation machines.

We split up this work into the following classes of performance enhancements for SONAR 8:

1. CPU and kernel level optimizations – use less of your CPU to do the same amount of work
2. User Interface optimizations – faster drawing, scrolling, zooming
3. Driver level optimizations – more efficient access to drivers, minimizing driver state transitions
4. Vista OS specific optimizations – Better use of MMCSS thread priorities, support for custom MMCSS task profiles, new WASAPI support
5. Audio engine optimizations – optimize "hotspots" in our bussing, streaming and mixing code

As a result of all these changes, SONAR 8 has the following benefits:

  • greatly minimized kernel usage. This helps provide more "kernel bandwidth" to drivers who need it the most. More kernel bandwidth translates into less potential for audio glitches.
  • Lower CPU usage – translates to better performance at low latency
  • More efficient use of audio drivers – esp with ASIO drivers
  • Better performance on Windows Vista esp X64 [64-bit Windows]. Many of the complaints of Vista performance as compared to XP have been solved with SONAR 8. X64 low latency performance should now be on par with X86.
  • Faster application launch
  • Less flicker in GUI. Track view splitters no longer flicker wh
    en resizing.
  • More responsive zoom and scroll with large projects. Zooming with wave files now uses 1/2 the RAM with 24-bit or less stereo or mono files used.
  • Better meter performance.
  • Improved thread scheduling by insuring threads are properly distributed on processors.

Benchmark: Overall benefits of SONAR 8 as compared to SONAR 7

CDM: Will we see these improvements in Project5? What about your instruments, like Rapture and Dimension, running as apps (instead of inside another host)?

Noel: We don’t have any firm plans for P5 at this time. Our “minihosts” for instruments don’t have these enhancements. It’s less relevant since these are far simpler with just a single instrument.

Windows Vista – New WASAPI driver mode

Actually, that’s wasaPi, not wasaBi. That said, Microsoft – how about whipping up a new WASAPI roll at the next Windows audio summit? Could be a good way to get developers to bond. Photo (CC) Zeetz Jones.

WASAPI (Windows Audio Session API) is the new multimedia API to talk to audio devices in Windows Vista. It represents the first real general purpose audio API from Microsoft in over 15 years, since MME from Windows 3.1.

The primary advantages of WASAPI are:

  • Supports a wide variety of audio devices (any device that has a WDM driver should work in WASAPI mode if Windows can use it in exclusive/event mode)
  • Provides low latency access to the device in WASAPI exclusive mode. (unlike older Microsoft API’s like MME or DirectSound)
  • Model that is the closest to the low level WDM kernel streaming approach, while yet providing a higher level of abstraction for the device.
  • Primary audio API for next generation of Windows.

Windows Vista: WaveRT

In WDM mode WaveRT is automatically used internally when SONAR detects a WaveRT capable WDM driver. A [WaveRT] suffix is added to the driver name in this case.

In SONAR 6.2 we first introduced support for Vista-specific WaveRT. Direct WaveRT mode is available in SONAR when you are using WDM as a driver mode and a WaveRT capable device is detected. In Vista SP1, Microsoft made some fundamental changes to WaveRT API’s that return the device sample position,
returning a cyclic position rather than a monotonically increasing position. In SONAR 8 WaveRT support has been updated and enhanced so that it works properly with Vista SP1.

CDM: You talk about using a WaveRT driver. Do you have to do anything to switch to WaveRT?

Noel: You don’t switch to WaveRT. In WDM [Windows Driver Model] mode, there is no choice – if a driver exposes itself as WaveRT, that’s the only mode of communicating with it. The same applies in WASAPI except the difference is that WASAPI itself communicates with the driver in WaveRT mode internally.

CDM: I have to admit, I’m used to working with ASIO. How do I know if a device has a WDM driver?

Noel: Any audio interface that works in Windows itself (i.e. if it shows up as a device in control panel -> sounds and audio devices) HAS to have a WDM driver. Otherwise Windows will not recognise it.

I don’t know of any interface that provides ONLY an ASIO driver. Some provide minimal WDM drivers that aren’t tested very well.

Windows Vista: MMCSS task profile support

The Multimedia Class Scheduler Service (MMCSS) provides Windows multimedia programs, including SONAR, with prioritized access to CPU resources for time-sensitive processing.

By default, SONAR uses the MMCSS task profile named Pro Audio. If desired, you can now instruct SONAR to use a custom user created MMCSS task profile.

CDM: Under what circumstances would you switch task profiles? What profile other than Pro Audio would you want to use?

Noel: You can tweak the MMCSS thread settings via a custom profile. I have a profile I tweaked that works marginally better than Pro Audio. It’s pretty technical stuff – You will have to read this link to get the details.

http://msdn.microsoft.com/en-us/library/ms684247(VS.85).aspx

Ed.: That’s a very technical explanation of a very technical topic; for more resources —

Mark Russinovich tours the enhanced Vista kernel

MMCSS, the Cliff Notes-style version on Wikipedia

Mark Russinovich on the interaction of MMCSS and networking

Interesting thread on the Cakewalk forum

More Information

You’ll want to see, previously…

Overview of Vista

Adieu, XP; How Vista SP1 is Doing, and Why This OS Generation Has Been So Tough

Vista for Audio, 1 Year Later: Talking OS Plumbing with Cakewalk’s CTO

Vista for Music + Pro Audio: Exclusive Under the Hood with Cakewalk’s CTO

Windows Sound Glitches Explained, Plus Glitches and the Fight-or-Flight Response

Compatibility

Cakewalk Vista Musicians’ Resource Page, Lots of Vista Drivers

Digidesign Talks Latest Windows, Mac Releases, Compatibility, Drivers

M-Audio Responds: Update on Driver Situation, New Drivers

Helpful utilities

12 Free and Cheap Must-Have Music Utilities for Windows

10 Free Non-Musical Windows Software Every Musician Should Use