Hi,

 

I've done some work on Windows Vista and have attached a patch that fixes
the sound problems. The problem is in the Windows Vista Wave API.

 

It turns out that the WOM_DONE messages are sent in a batch rather than
individually for each waveOutWrite call. I can only assume this is a bug in
Vista. Essentially what happened is that we call waveOutWrite 8 times (as
defined in N_OUT_PRIME). When these have all played we receive 8
WOM_MESSAGES, we then proceed to call waveOutWrite 8 more times but only
after a break in the sound.

 

Investigating this further it turns out if we make 16 calls to waveOutWrite
then we receive the WOM_DONE messages in batches of 5. This leaves
sufficient time for us to react and provide more data to play. I have no
idea why calling waveOutWrite 8 times results in a batch of 8 WOM_DONE and
16 calls result in a batch of 5! I did try 32 calls and that worked as well.
I have also tested on Windows XP, where we receive WOM_MESSAGES at regular
intervals (presumably once each data block has finished playing!!) I known
sipXtapi to work on Windows 2000 in the past so I guess this is okay also.

 

Once I made the patch I found that some calls to waveOutUnprepareHeader were
failing as waveOutReset hadn't yet removed all blocks from the queue. There
was code for 'Sleep(100)' that looks like it was designed to give enough
time. I've replaced these with a function that polls the queue state every
10ms and returns once complete. My tests indicate it took around 150ms to
160ms to complete (on XP SP2). If this time wasn't sufficient then the code
could later exception so this could have caused problems on slower
processors in the past.

 

I've tested this patch on Windows XP SP2 and Windows Vista.

 

Thanks,

Alex

 

=====
Alex Boreham
Development Engineer
Redwood Technologies Limited
The Redwood Building, Broad Lane, Bracknell, Berkshire, RG12 9GU, U.K.
Registered in England No. 2817863
T +[44] (0)1344 304 344
F +[44] (0)1344 304 345
E [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>    
W www.redwoodtech.com <http://www.redwoodtech.com> 
=====
 
Email Disclaimer

 

The information in this email is confidential and may be legally privileged.
It is intended solely for the addressee. Access to this email by anyone else
is unauthorised. If you are not the intended recipient, any disclosure,
copying, distribution or any action taken or omitted to be taken in reliance
on it is prohibited and may be unlawful. When addressed to our clients any
opinions or advice contained in this email are subject to the limitations of
Redwood Technologies Limited's standard terms and conditions of contract.

 

Attachment: vista.patch
Description: Binary data

_______________________________________________
sipxtapi-dev mailing list
[email protected]
List Archive: http://list.sipfoundry.org/archive/sipxtapi-dev/

Reply via email to