some doubts regarding MSVAD

Hello everyone,
I need some clarity on some issues , i hope u guys can help me out :

-> When I play the data that i get from MSVAD on a remote device, I get sound something like machine gun fire ! Why is that ? How can I correct this problem ?

->KSSTATE_RUN implies that active streaming is being done rt ? So when I Pause the sound being played a transition should a transition to KSSTATE_PAUSE is to take place ( so that i can swith to KSSTATE_RUN the instant I run it again) ? If so , i am not getting such a transition when I pause ( i,e from KSSTATE_RUN to KSSTATE_PAUSE and then back to KSSTATE_RUN ) .? Or is there anything wrong in the way I have understood state transitions ?

-> MSVAD inserts the header format i,e RIFF header part , the format chunk and data chunk using FileWriteHeader() and updates the chunksize of RIFF again at the end . Should I send each frame with the header etc when I want to stream it across a network ?

TIA,
Venkatesh.D.N

Sorry for the second question, I got the answer at :

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

TIA,
Venkatesh.D.N

xxxxx@gmail.com wrote:

Hello everyone,
I need some clarity on some issues , i hope u guys can help me out :

-> When I play the data that i get from MSVAD on a remote device, I get sound something like machine gun fire ! Why is that ? How can I correct this problem ?

The most likely answer is that you have a format mismatch. You’re
grabbing 44kHz data and sending it out at 48kHz (so the buffers keep
running dry), or you getting mono and sending stereo, or something like
that. Or, perhaps there are enough delays that the buffers are running
dry for other reasons. How are you sending the format to the other end?

->KSSTATE_RUN implies that active streaming is being done rt ? So when I Pause the sound being played a transition should a transition to KSSTATE_PAUSE is to take place ( so that i can swith to KSSTATE_RUN the instant I run it again) ? If so , i am not getting such a transition when I pause ( i,e from KSSTATE_RUN to KSSTATE_PAUSE and then back to KSSTATE_RUN ) .? Or is there anything wrong in the way I have understood state transitions ?

Not sure what you’re asking. Generally, if the application pauses
closes the output stream, you’ll see PAUSE and then STOP. But if the
application just doesn’t send anything for a while, you’ll stay in RUN
but with no data being transferred, or with silence being inserted.

-> MSVAD inserts the header format i,e RIFF header part , the format chunk and data chunk using FileWriteHeader() and updates the chunksize of RIFF again at the end . Should I send each frame with the header etc when I want to stream it across a network ?

The RIFF header is a FILE format. It would be a silly waste of
bandwidth to send that information with every network packet. You need
SOME way to communicate the format (and you can use whatever scheme you
want), but once you have the format established, you won’t need to send
it again unless the format changes.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Thanks Tim, those tips were helpful .
I have some more doubts , these are not particularly related to MSVAD but I guess would apply to audio drivers :

-> Firstly, is there any directive in inf that would force the system (subsequently any application like Windows Media Player(WMP) )to choose my device as the default device ?

->As I use MSVAD for streaming over a network if the device is not present , i should indicate that my device is down and the application say WMP can choose another device for playing , would setting the power state to say D1 using PcRequestNewPowerState() when I detect that no device is connected in the remote s/m and reverting to D0 when I detect one would help ? If not how should I go about it ?

-> I get 20 ms worth of data each time in CopyTo() right ? (i.e 1764bytes) . Then is there any reason for taking Frame size as PAGE_SIZE*4 , i have been tinkering with the frame size , is there any size which is “optimal” or is it per our convenience ?

TIA,
Venkatesh.D.N

xxxxx@gmail.com wrote:

I have some more doubts , these are not particularly related to MSVAD but I guess would apply to audio drivers :

-> Firstly, is there any directive in inf that would force the system (subsequently any application like Windows Media Player(WMP) )to choose my device as the default device ?

Up through XP, yes, there is. You add a value
“SetupPreferredAudioDevices” to your registry key with a value of 1.
It’s documented, and you’ll find examples in your own \Windows\INF set.

In Vista and beyond, there is not. The decision was made to leave this
up to the user, not to devices. After all, EVERY manufacturer believes
their device will naturally be the “preferred” audio device, thereby
making the entry useless.

->As I use MSVAD for streaming over a network if the device is not present, i should indicate that my device is down and the application say WMP can choose another device for playing , would setting the power state to say D1 using PcRequestNewPowerState() when I detect that no device is connected in the remote s/m and reverting to D0 when I detect one would help ? If not how should I go about it ?

This is a good question, and I’m not entirely sure of the answer. It’s
certainly worth an experiment. You could call KsDeleteFilterFactory
until your device is available again, I suppose.

-> I get 20 ms worth of data each time in CopyTo() right ? (i.e 1764bytes) . Then is there any reason for taking Frame size as PAGE_SIZE*4 , i have been tinkering with the frame size , is there any size which is “optimal” or is it per our convenience ?

It is basically at your convenience. Depending on the operating system,
you should get either 10ms or 4ms worth of data at a time.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Hello again Tim,
Thanks for you previous suggestions, I could not try the solution to the second one which I would and let you know . I found a way around it i.e I load and unload my driver using a service which checks for PnP notifications from remote systems .

-> But I need clarification on one small aspect not necessarily related to MSVAD, Is there any way in which I can access my FDO ( my device extension infact) in routines like say CopyTo which do not get the DeviceObject as parameter ?

-> I want to create a different name for the device for the user name i.e i’m trying create symbolic link using IoCreateSymbolicLink() but DeviceName is a random system alloted name which I am not able to retrieve. How can I retrieve the device name ?

TIA,
Venkatesh.D.N

xxxxx@gmail.com wrote:

-> But I need clarification on one small aspect not necessarily related to MSVAD, Is there any way in which I can access my FDO ( my device extension infact) in routines like say CopyTo which do not get the DeviceObject as parameter ?

It’s a C++ class member function. If you need to carry state
information with you, just add it to the class definition. Your
device’s device extension is already full up with kernel streaming
information.

If you REALLY need the FDO, there is a path. CopyTo is part of
CMiniportWaveCyclicStreamMSVAD. That class has an m_SaveData member
which is an object of type CSaveData, which has a GetDeviceObject()
method. So, m_SaveData.GetDeviceObject().

-> I want to create a different name for the device for the user name i.e i’m trying create symbolic link using IoCreateSymbolicLink() but DeviceName is a random system alloted name which I am not able to retrieve. How can I retrieve the device name ?

I don’t think you really want to do that. The file objects for kernel
streaming devices are used by the kernel streaming system in a
particular way. The file name, for instance, tells the KS framework
whether the caller wants the filter or a pin. Further, the KS framework
intercepts the IRPs so it can process all of the KS IOCTLs.

Are you trying to communicate with your miniport? You can always use
the system device enumerator to find your device, bind it to an
IBaseFilter, and use IKsControl calls to send custom property requests.
Or, you can create a control device object separate from KS and send
ioctls. It IS possible to take over the IRP dispatching after KS has
installed its handlers (as long as you call KS’s handlers afterward),
although it’s ugly.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Thanks for the replies Tim,

-> I somehow missed out GetDeviceObject , my mistake. Thanks for reminding .

-> The reason why I asked second question was , I want to load a new instance of device for each different user (using a service) , to differentiate between the instances i wanted to append his HostName to the device name . I do not want all the IRP dispatching myself for sure ! For that I needed the DeviceName so that I can append hostname to it and create a unique sym link name for that host on that instance . Can something like this be done ? If so how could I go about getting the device name from the device object ?

TIA,
Venkatesh.D.N

Thanks Tim , I figured out a way to solve my other issue also.

-> Just queried the registry and modified it suitably !

I apologize for the unnecessary query .

TIA,
Venkatesh.D.N

Hello again Tim ,
-> This is a general query not particular to MSVAD , when i install msvad multiple times , the device manager shows the same name that is " Microsoft Virtual Audio Device (Simple) " but for some other devices , when I install multiple instances , there is a string appended to the name like #1,#2 or some other thing like port number .

-> My question is when does the system append “an id” as it were to the name and does any particular section in the inf dictates this behavior ?

TIA,
Venkatesh.D.N

xxxxx@gmail.com wrote:

-> This is a general query not particular to MSVAD , when i install msvad multiple times , the device manager shows the same name that is " Microsoft Virtual Audio Device (Simple) " but for some other devices , when I install multiple instances , there is a string appended to the name like #1,#2 or some other thing like port number .

-> My question is when does the system append “an id” as it were to the name and does any particular section in the inf dictates this behavior ?

Device Manager shows the “friendly name” from the registry. The
“friendly name” is mostly the responsibility of the device class
installer. Some class installers append a #2 or #3 to the friendly name
when there are multiple devices. Other classes do not.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Hello all,
I have a simple issue , I need to provide volume control for MSVAD , so I have a few questions about it :

-> Why don’t we get a volume slider in MSVAD ?
In MSVAD , the Basic support for KSPROPERTY_AUDIO_VOLUMELEVEL is enough I guess ; but ValidatePropertyParams fails as the InstanceSize for PropertyRequest I get is lesser than sizeof(KSNODEPROPERTY_AUDIO_CHANNEL) . Is that the reason why the slide bar doesnt come?

-> MSVAD has get and set support inform of stubs , slight alteration of that would be enough for my current requirement which is to send a value when an DeviceIocControl() in user mode seeks the current device volume

-> If a an application is currently using a particular device for playing , will that be reflected in the default device or in the currently chosen device ?

-> On moving the slide bar, set and get routines are called right ? But how do I alter the volume level i.e how will I know how much volume increment or decrement has been sought ?

Pardon my ignorance and please guide me on how to go about this .

TIA,
Venkatesh

I tried calling the ValidatePropertyParams with 0 as the cbinstancesize parmeter and the setting the valuesize in the volume property handler but that also did not work.

make below change to enable volume bar,

in file basetopo.cpp
function:
CMiniportTopologyMSVAD::PropertyHandlerVolume

line: 612

ntStatus =
ValidatePropertyParams
(
PropertyRequest,
sizeof(ULONG),
sizeof(KSNODEPROPERTY_AUDIO_CHANNEL) -sizeof(KSNODEPROPERTY)
// bug fix
);

On Fri, May 14, 2010 at 9:41 AM, wrote:

> I tried calling the ValidatePropertyParams with 0 as the cbinstancesize
> parmeter and the setting the valuesize in the volume property handler but
> that also did not work.
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>

Thanks a lot Dennis ,

Firstly my requirement is that I am using MSVAD to stream the data to a remote device , hence if any volume changes are done in the host device that should be reflected in the remote device .

Now I am able to get the volume faders for Wave,CD Player and MIDI as far the playbacks are concerned but the Microphone and MIDI volume faders appear but are disabled .

-> My question is now altered to what should I do get those Microphone volume fader working ?

-> The device volume slider (control panel’s sound devices) is not working , why is that since the get,set and basicsupport all are supported for KSPROPERTY_AUDIO_VOLUMELEVEL ?

-> I am trying to simulate the volume level so that I can send the latest level whenever a request for the volume is made by the remote device . If you can guide me so as to how to go about this, I would be grateful.

TIA,
Venkatesh

By the way which OS you are targeting,

Prior to Vista OR vista and Win7??

On Fri, May 14, 2010 at 12:23 PM, wrote:

> Thanks a lot Dennis ,
>
> Firstly my requirement is that I am using MSVAD to stream the data to a
> remote device , hence if any volume changes are done in the host device that
> should be reflected in the remote device .
>
> Now I am able to get the volume faders for Wave,CD Player and MIDI
> as far the playbacks are concerned but the Microphone and MIDI volume faders
> appear but are disabled .
>
> -> My question is now altered to what should I do get those Microphone
> volume fader working ?
>
> -> The device volume slider (control panel’s sound devices) is not working
> , why is that since the get,set and basicsupport all are supported for
> KSPROPERTY_AUDIO_VOLUMELEVEL ?
>
> -> I am trying to simulate the volume level so that I can send the latest
> level whenever a request for the volume is made by the remote device . If
> you can guide me so as to how to go about this, I would be grateful.
>
> TIA,
> Venkatesh
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>

The requirement is for Xp and I am working on Xp sp3 . Why are asking you this question ? what changes should I make in order to support it in Vista and above ?

TIA,
Venkatesh