[wdmaudiodev] Re: MSVAD: synchronization of MSVAD and WMP with a real soundcard

  • From: Bosser Frédéric <frederic_bosser@xxxxxxxx>
  • To: wdmaudiodev@xxxxxxxxxxxxx
  • Date: Tue, 18 Oct 2005 11:00:40 +0200 (CEST)

hello,
 
I have tested the fonctionalities of the original MSVAD with WMP and I have 
measured the same delays. Sometimes the delay is 21ms delay in getting data 
from WMP.
 
Can you explain me what is happenning ? The notification is sent to WMP each 
10.44 ms to WMP. Why WMP sometimes adds a delay of 10 ms?
 
I have another question. I have tried to use in MSVAD the master clock of the 
sound. I Have sent the notifications from my visio application but the delay 
between each notification was lower than 10 ms and WMP does not send 10 ms of 
data in this case. Is it possible to send notifications to WMP with an interval 
between each notification lower than 10 ms ( and for each notification WMP must 
send us 10 ms of data)? Or if it is not possible, is it possible that WMP sends 
us 20 ms of data each 10 ms (interval of 10 ms between each notification)?? 
 
thanks
 
fred


Richard Fricks <Richard.Fricks@xxxxxxxxxxxxx> a écrit :

In your scenerio, that master clock is the clock on the physical sound card. 
MSVad?s clock needs to be synchronized with that. Regardless of how accurate of 
clock you are using in terms of ?world time? if it does not match the playback 
rate of your audio card, you will end up not being fed by WMP at the correct 
rate. Ideally, you would query the position of the card that is playing back 
the audio and return those values to WMP since that reflects the true position 
of the audio. Regarding the other issue you describe below (21ms delay in 
getting data from WMP), you can always check functionality against the original 
msvad and confirm that it is working correctly with WMP. This will help you 
determine if a problem you are seeing is something introduced by changes you 
have made or not.

 

-Rich

 

-----Original Message-----
From: wdmaudiodev-bounce@xxxxxxxxxxxxx 
[mailto:wdmaudiodev-bounce@xxxxxxxxxxxxx] On Behalf Of Bosser Frédéric
Sent: Monday, October 17, 2005 7:13 AM
To: wdmaudiodev@xxxxxxxxxxxxx
Subject: [wdmaudiodev] Re: MSVAD: synchronization of MSVAD and WMP with a real 
soundcard

 

hi all,


 


I have measured the delay between timer notifications of MSVAD. It is 10.742 ms 
(instead of 10 ms).this delay is constant. I don't think that the problem is 
here. The timer is constant and simulates a notification esach 10.742 ms.


 


But regularly, it seems that WMP misses a notification and therefore sends 10 
ms of data with a delay of 21.48 ms! 


I suppose (but it is just an idea) that WMP thinks it has sent too many data 
before, but it is not true! 


 


does anyone know an explanation for this? why WMP misses a notification or 
ignore it?


 


thanks


 


fred

Marc Titinger <titinger@xxxxxxxxxxxx> a écrit :


I'm not sure this is related, but we where using a timer DPC  
(KeInitializeTimerEx) of 10ms in a driver, until we figured out that on some 
systems it would occure every 15ms instead of the expected 10ms. So we had to 
move back to using a real PCI IRQ to trigger the service routines. Have you 
actually measured 10ms between your timer notifications ?


 


Marc.


 


-----Message d'origine-----
De : wdmaudiodev-bounce@xxxxxxxxxxxxx 
[mailto:wdmaudiodev-bounce@xxxxxxxxxxxxx]De la part de Bosser Frédéric
Envoyé : vendredi 14 octobre 2005 11:16
À : wdmaudiodev@xxxxxxxxxxxxx
Objet : [wdmaudiodev] Re: MSVAD: synchronization of MSVAD and WMP with a real 
soundcard

hello Richard,

 

I am agree with you when you say that WMP will send the data based on the clock 
time returned by the driver it has opened. And there is no problem when WMP 
opens the driver of a REAL soundcard.

 

And what you have described then sounds exactly like my scenario. The clock 
time returned by the driver that WMP has opened is running at a different rate 
then the clock that represents actual audio playback. 

 

I join a diagram of my software with this mail.

 

To  be more accurate, WMP is synchronized with a VIRTUAL driver MSVAD. So WMP 
will send the data based on the clock time returned by the MSVAD driver. You 
must know that, in MSVAD, the REAL interrupt notifications are simulated with a 
periodic timer each 10 ms. So WMP is synchronized with this timer.

 

If you look at the diagram I have joined, you will see that I send then these 
sound data in a proprietary software (visioconference). This proprietary 
software is synchronized with the real soundcard. And my problem is that my 
MSVAD driver and the proprietary software are not synchronized.

 

So, how can I simulate in a very accurate way (more accurate that the one in 
MSVAD sample), in the MSVAD driver, the clock of the real soundcard? As I have 
said in my last email, I think WMP does not really send the data each 10ms.

 

I hope that you understand my explanation. It is a very blocking problem.

 

Thank you

 

fred



Richard Fricks <Richard.Fricks@xxxxxxxxxxxxx> a écrit : 

WMP will send the data based on the clock time returned by the driver it has 
opened. If that clock is running at a different rate then the clock that 
represents actual audio playback I could see where you would get the condition 
you are describing below. Is what I am describing sound like your scenario?

 

Richard Fricks

Technical Lead, Microsoft DDK

 

 

-----Original Message-----
From: wdmaudiodev-bounce@xxxxxxxxxxxxx 
[mailto:wdmaudiodev-bounce@xxxxxxxxxxxxx] On Behalf Of Bosser Frédéric
Sent: Wednesday, October 12, 2005 8:38 AM
To: wdmaudiodev@xxxxxxxxxxxxx
Subject: [wdmaudiodev] MSVAD: synchronization of MSVAD and WMP with a real 
soundcard

 

hello,


 


I am developping a virtual audio driver based on the MSVAD sample. The goal is 
to get the sound coming from windows media player (for example...) in the 
driver and add it to the speech in a visioconference application. I have 
modified the CopyTo function and I have the sound buffers in my application ( I 
used shared buffer between kernel and user mode). In my visioconference 
application, I put the sound buffer in a FIFO and add the "music" sound buffer 
with the speech coming from the visioconference.


 


My problem is that my driver seems to not be synchronized! If I play a sound 
file at the same frequency that the one used by the real soundcard (used by the 
visioconference application) my FIFO becomes nearly EMPTY! Then I miss some 
"music" sound buffers when I add the speech samples (from visioconference) with 
the music samples*. 


So my conclusion is that WMP sends the sound data (10 ms. We cannot change this 
value, can we?) too slowly. Since MSVAD is virtual, the interrupt notification 
are not hardware but software with a timer. Each 10 ms this timer simulates the 
real harware interrupt. This timer doesn't seem to be accurate enougth... 


 


So, here are my questions:


- Can I use multimedia timers in the driver? I think they are more accurate.I 
would like to use them in my driver in order to tell WMP to send 10ms of sound 
date EACH 7ms (for example). Is it possible?


- How can I synchronize WMP with my soundcard? but it is important to know that 
the sound coming from WMP passes by my virtual driver , THEN by my 
visioconference application, and FINALLY by the soundcard.


 


Tell me if you want more details.


 


thank you for your answers.


 


Fred


Software engineer


---------------------------------



Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger
Téléchargez le ici ! 



---------------------------------


Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger
Téléchargez le ici ! 

You can find Digigram at:
Integrated Systems Asia, Suntec, Singapore, October 12-14, 2005, Booth number: 
F110

---------------------------------


---------------------------------


Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger
Téléchargez le ici ! 


                
---------------------------------
 Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger
 Téléchargez le ici !  

Other related posts: