[wdmaudiodev] Re: Vista audio engine sampling rate woes

  • From: "Jeff Pages" <jeff@xxxxxxxxxxxxxxxx>
  • To: <wdmaudiodev@xxxxxxxxxxxxx>
  • Date: Tue, 14 Nov 2006 10:18:03 +1100

The hardware rate setting applies to the card as a whole (which has two AES3 
transceivers on it plus AES11 sync input and output), not just to individual 
endpoints. It's an established product for which I'm making the existing XP 
driver a bit more Vista-friendly, rather than a new product.

The external sync would typically be used in a broadcasting or recording studio 
environment where a master reference source is used to lock everything 
together. In such an environment the frequency would be unlikely to change, but 
from a software point of view I really have to consider that possibility, and 
the existing rate converters in the DSP code cope with it quite nicely.

Jeff
  ----- Original Message ----- 
  From: Frank Yerrace 
  To: wdmaudiodev@xxxxxxxxxxxxx 
  Sent: Tuesday, November 14, 2006 9:56 AM
  Subject: [wdmaudiodev] Re: Vista audio engine sampling rate woes


  May I ask why you need a separate configuration page managed by a coinstaller 
to set this format rather than just relying on the UI in the Vista Sounds 
control panel? If you want, you can still offer a custom checkbox option in 
your own UI "Use external sync instead of Windows audio format" to switch your 
audio driver into a different mode if you need to. That mode might 
enable/disable the different device interfaces or perhaps support only 24-bit, 
96KHz with sample rate converters ready to run in your DSPs when necessary.

   

  For my own edification, can you tell me, how often might the format change 
when using an external sync source? What external events would cause this to 
happen? Is it when external gear is physically reconnected? When the gear is 
reconfigured through front panel controls or software? When different content 
runs through the external gear?

   

  Frank Yerrace

  Microsoft Corporation

   

  This posting is provided "AS IS" with no warranties, and confers no rights.

   

  From: wdmaudiodev-bounce@xxxxxxxxxxxxx 
[mailto:wdmaudiodev-bounce@xxxxxxxxxxxxx] On Behalf Of Jeff Pages
  Sent: Monday, November 13, 2006 2:36 PM
  To: wdmaudiodev@xxxxxxxxxxxxx
  Subject: [wdmaudiodev] Re: Vista audio engine sampling rate woes

   

  Thanks, Frank and Mitch, for your suggestions.

   

  The hardware sampling rate is set from a "Configuration" page managed by a 
coinstaller which is accessed from Device Properties in the Device Manager, but 
one of the rate options is "External" in which case the sampling rate could be 
changed by someone switching the external AES11 sync source (although in 
practice that's pretty unlikely in most of our application environments). My 
driver receives notification from the DSP if that happens.

   

  It's not a major issue for me as I can leave the audio engine running at 
24-bit 96kHz and use the DSPs sampling rate converter to convert down to lower 
hardware rates (and that also automatically takes care of someone switching the 
external sync input). Frank's suggestion sounds like a good one that could be 
fairly easily implemented, though, so I might do that for the internal rate 
settings and leave it running at 96kHz when it's set to external.

   

  Jeff

    ----- Original Message ----- 

    From: Frank Yerrace 

    To: wdmaudiodev@xxxxxxxxxxxxx 

    Sent: Tuesday, November 14, 2006 8:36 AM

    Subject: [wdmaudiodev] Re: Vista audio engine sampling rate woes

     

    Jeff,

     

    When you said, "the user can set the hardware sampling rate as 96kHz, 
48kHz, 44.1kHz" are you implying that there is a physical hardware control on 
your device that allows the user select the sample rate? If so, can your audio 
driver read the current state of this control?

     

    Here is another possible alternative solution that we've talked about here. 
If the number of different configurations is small (such as the three 
alternatives of 44.1, 48,and  96KHz) then your driver can implement a different 
PnP device interface ("subdevice" in portcls terminology) for each of the three 
configurations. Each device interface supports only one sample rate, like you 
said below "create just one entry in the pin data range table and make its 
sampling rate equal to the hardware rate." One device interface supports only 
44.1, another supports only 48, and another supports only 96. Your driver reads 
the state of your hardware's sample rate selector control and enables only the 
one device interface (subdevice) that corresponds to that configuration and 
disables the others.

     

    Frank Yerrace

    Microsoft Corporation

     

    This posting is provided "AS IS" with no warranties, and confers no rights.

     

    From: wdmaudiodev-bounce@xxxxxxxxxxxxx 
[mailto:wdmaudiodev-bounce@xxxxxxxxxxxxx] On Behalf Of Mitchell Rundle
    Sent: Monday, November 13, 2006 9:42 AM
    To: wdmaudiodev@xxxxxxxxxxxxx
    Subject: [wdmaudiodev] Re: Vista audio engine sampling rate woes

     

    Do you install any services with your driver?  If you do, I think the 
following should work (although I haven't tried this out yet):

     

    ·         Constrain your dataintersection handler to only the sample rate 
that the hw is set to, and

    ·         When the hardware sample rate is changed externally, set 
PKEY_AudioEngine_DeviceFormat on the endpoints from the service process.  This 
effectively automates the step of "manually going into the advanced page.".

     

    Regards,

    Mitch Rundle

    Microsoft

     

    This posting is provided "AS IS" with no warranties, and confers no rights.

     

     

    From: wdmaudiodev-bounce@xxxxxxxxxxxxx 
[mailto:wdmaudiodev-bounce@xxxxxxxxxxxxx] On Behalf Of Jeff Pages
    Sent: Sunday, November 12, 2006 8:06 PM
    To: wdmaudiodev@xxxxxxxxxxxxx
    Subject: [wdmaudiodev] Vista audio engine sampling rate woes

     

    One of our products is an AES3 (aka AES/EBU) 24-bit sound card, on which 
the user can set the hardware sampling rate as 96kHz, 48kHz, 44.1kHz or have it 
derived from external AES11 sync reference. While I can do sampling rate 
conversions in the DSP on the card, I was thinking that since Vista runs its 
audio engine at a fixed rate independent of applications, it would be nice if I 
could set that rate to be the same as the card's hardware rate so as to avoid 
an additional sampling rate conversion.

     

    The WDK's discussion of Data-Intersection Handlers speaks of situations 
such as this and recommends creating pin data range entries for all the 
possible sampling rates and then using either the data range intersection 
handler or the format testing in NewStream to reject rates that don't match the 
hardware rate, but this doesn't seem to work under Vista RC2 - it insists on 
using 16-bit 44.1kHz (or whatever other OEM format I specify in the INF file) 
and then refuses to work if that doesn't match the hardware rate, without even 
trying any of the other supported rates.

     

    If I create just one entry in the pin data range table and make its 
sampling rate equal to the hardware rate, I can almost achieve what I want, 
except if the user changes the hardware rate, Vista's audio engine insists on 
still trying to use the original rate, even after a reboot. The only way to 
then make it work again is to manually go into the Advanced page of all the 
render and capture endpoint settings and change them to the new rate.

     

    Is there a way to achieve what I want under Vista (ie. to dynamically 
change the audio engine's sampling rate to match the current hardware rate of 
my card), or do I have to set the OEM format in the INF file to 24-bit 96kHz 
and rely on the sampling rate converter in my DSP to convert that to the 
hardware rate?

     

    Jeff Pages

    Innes Corporation Pty Ltd

Other related posts: