Jump to content
IGNORED

WASAPI in Vista


nicolePer

Recommended Posts

Hi Ncole,

 

This may not be such an easy task to accomplish, but I can tell you that with 2 channels of 32/192 and no real time mixing etc. 1 ms is achievebale easily. Note though, that I talk Exclusive Mode here, and this just may matter (because Vista's mixer (called Audio Engine) is out of the way).

 

Also, if you'd appraoch it as how it is done in XXHighEnd, you cold just keep this up, but then the mixing etc. should be done in a "pre-processing" step, which will most probably invalidate your reasons of why to want the low latency (read : I can achieve anything with 1 ms, if you only give me the time to pre-process, which obviously can't work for real time music playback (like from MIDI).

 

Not knowing whether your desired low latency can be achieved via Shared Mode (but I guess I see enough headroom with Exclusive Mode to give it a fair chance), you could be using just that (Shared Mode) for all your mixing etc. stuff, but keep in mind that you will be largely dependend on Vista's device settings. You can set those yourself allright, but they cannot be controlled programmatically. For example, if you set a device to output 24/192KHz for Shared Mode, it will be just that, and there is no way you can change that in the program to e.g. 24/88.2. Ok, you can, but Vista will resample to 24/192 in this example.

I assume (but never tested it) this counts the same for mixing settings (e.g. downmix 5.1 to 2 channel), which you again can set in the device settings, but once set ... well, same story (remember, that is what I assume).

 

For Exclusive mode all is the other way around;

Suppose you have an input of 16/44.1, there is no way you can let Vista resample for you to e.g. 24/192. This time, however, you can do it yourself, and whatever you output will be unmangled. Here the latency will be largely dependend on your (C++) programming skills, but again keep in mind : things like downmixing and all has to be created by *you*. If you have some spare time, go ahead, but otherwise quit your normal job first and reserve a year or so. There will be no examples around, and as far as I can see JRiver may be the only one attempting multi channel stuff (and 90% of it does not work).

 

For two channel examples you can download the Vista SDK : http://www.microsoft.com/downloads/details.aspx?familyid=ff6467e6-5bba-4bf5-b562-9199be864d29&displaylang=en

I don't know whether this is the latest version.

 

When you go this route, be prepared to die a couple of times, and know that while the code is at the "user level", it is not C++ but unmanaged C. No big deal if you know how to twist it into .net, but otherwise it may take you a couple of months extra.

All is full of culprits, bugs and not much transparent things, but all can be worked around with just some experience.

 

Did I scare you off ? if so I guess it is just justified.

But if I didn't scare you off I say it is all just great and gives you the maybe only opportunity to build something like ASIO but better (lower latency and all under your own control, once you are there :-).

 

Peter

 

 

 

Lush^3-e      Lush^2      Blaxius^2      Ethernet^2     HDMI^2     XLR^2

XXHighEnd (developer)

Phasure NOS1 24/768 Async USB DAC (manufacturer)

Phasure Mach III Audio PC with Linear PSU (manufacturer)

Orelino & Orelo MKII Speakers (designer/supplier)

Link to comment

Peter,

So you are basically telling me that there is no mixing function in exclusive mode and I will have to write it. Well, that is always a possibility... Would it make sense to use something else to do the mixing for me and then do the playback through exclusive mode or would that really mess up the latency?

Here is really the problem:

I have an application in C++ that is currently running on both Vista and XP. Because of the nature of this app I need low latency. In XP the latency was fine, no problems (using DirectSound) but in Vista because of the architecture there was something like 50ms difference. I need to get rid of this difference and this run the same way on Vista as on XP. The ideal thing would be to use something that's already out there and just rewrite the app so it stays the same for XP and Vista. I haven't found any easy way of doing this. I don't want extra apps sitting on top op WASAPI in Vista to make it even slower than it is... So my other option is to just make a different version for Vista. Would you recommend using WASAPI or is there onything else that might be simpler to use?

Sorry for so many questions, I am very new to all of this and I am just doing some research before I make a decision about what to do.

 

Thanks,

Nicole

 

Link to comment

So you are basically telling me that there is no mixing function in exclusive mode and I will have to write it. Well, that is always a possibility... Would it make sense to use something else to do the mixing for me and then do the playback through exclusive mode or would that really mess up the latency?

 

a. yes. b. that depends on the application. I tend to say "yes" (use something else), but do you want to share what the application is ? If you say "no, rather not" maybe you want to tell it more privately (sales blahblah at phasure.com).

 

Vista is not so bad, but it really needs some experience ...

Peter

 

 

Lush^3-e      Lush^2      Blaxius^2      Ethernet^2     HDMI^2     XLR^2

XXHighEnd (developer)

Phasure NOS1 24/768 Async USB DAC (manufacturer)

Phasure Mach III Audio PC with Linear PSU (manufacturer)

Orelino & Orelo MKII Speakers (designer/supplier)

Link to comment

I rather not share because I am not sure if I can.

But this application creates experiments where timing of events and sounds is crucial. Something like psychological or medical studies that measure responsiveness.

When I said to use something else, I meant to still use WASAPI exclusive mode for playback but link a converter and a mixer (Audio Resampler DSP) to take care of the pre-processing. Obviously I don't know much about this and that's why I am asking so many questions...

 

Nicole

 

Link to comment

If you are prepared to spend some $1600 on a Fireface800 there are options ...

The DSP stuff can be in the loopback of the device. Don't ask me about the lag that causes ... I just don't know.

But if you're interested in this and want to spend that money, I can guide you to software which can do this (I have a couple of users using just that).

 

Peter

 

Lush^3-e      Lush^2      Blaxius^2      Ethernet^2     HDMI^2     XLR^2

XXHighEnd (developer)

Phasure NOS1 24/768 Async USB DAC (manufacturer)

Phasure Mach III Audio PC with Linear PSU (manufacturer)

Orelino & Orelo MKII Speakers (designer/supplier)

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...