I recently discovered a bug in waveOutGetPosition on some (maybe all?)
Pocket PC's.

The bug is the following:

When position.wType = TIME_MS, a call to waveOutGetPosition(wave_handle,
&position, sizeof(position)) is supposed to return the output wave position
in milli-seconds in position.u.ms.

See the documentation for waveOutGetPosition and MMTIME.

But the value returned in position.u.ms is NOT the wave buffer position in
milliseconds (e.g. on the e800, the value seems to be expressed in 1/100,000
sec).

This problem likely comes from the fact that MSFT provided no test for the
OEM to check the correct implementation of their audio driver with regard to
this function.

When position.wType = TIME_SAMPLES, position.u.sample is the correct number
of un-played samples in the wave driver's queue. The TIME_SAMPLES case is
well tested because that's how all the video applications get correct
audio/video sync, so this case is in essence tested by WMP.

I suspect that waveOutGetPosition with position.wType = TIME_MS (or values
other than TIME_SAMPLES) is bogus or un-reliable on most (all?) Pocket PC's
and Smartphone.

It would be nice to document this "bug" or "feature", i.e. to indicate that
on WinCE, only position.wType = TIME_SAMPLES is supported (and other values
of position.wType will return random results).

Re: waveOutGetPosition bug with TIME_MS by riki

riki
Sun Mar 13 15:09:55 CST 2005

The PocketTV Team wrote:
> It would be nice to document this "bug" or "feature", i.e. to indicate that
> on WinCE, only position.wType = TIME_SAMPLES is supported (and other values
> of position.wType will return random results).
As you state, if the OEM/ODM does implement it, then it works, so
therefor it's not a bug in WinCE. It's just another case of a function
thats untested by the CETK. Perhaps a note that this feature is
dependant on OEM support would be helpful.

Riki


main(){printf("%d != %d, why?", sizeof('"')["'"],(sizeof('"'))["]\"\0["]);}
By Night:
ThemeChanger for Smartphone : http://homepages.inspire.net.nz/~gambit/
AbstractStart for Smartphone :
http://homepages.inspire.net.nz/~gambit/AbstractStart/
By Day: http://www.EmbeddedFusion.com

Re: waveOutGetPosition bug with TIME_MS by dave

dave
Mon Mar 14 04:48:10 CST 2005

Hi all,

Is using TIME_BYTES unreliable too ?

bye
Dave (Parys Technografx)


"The PocketTV Team" <support@pockettv.com> wrote in message
news:e5f66wiJFHA.1528@TK2MSFTNGP09.phx.gbl...
> I recently discovered a bug in waveOutGetPosition on some (maybe all?)
> Pocket PC's.
>
> The bug is the following:
>
> When position.wType = TIME_MS, a call to waveOutGetPosition(wave_handle,
> &position, sizeof(position)) is supposed to return the output wave
position
> in milli-seconds in position.u.ms.
>
> See the documentation for waveOutGetPosition and MMTIME.
>
> But the value returned in position.u.ms is NOT the wave buffer position in
> milliseconds (e.g. on the e800, the value seems to be expressed in
1/100,000
> sec).
>
> This problem likely comes from the fact that MSFT provided no test for the
> OEM to check the correct implementation of their audio driver with regard
to
> this function.
>
> When position.wType = TIME_SAMPLES, position.u.sample is the correct
number
> of un-played samples in the wave driver's queue. The TIME_SAMPLES case is
> well tested because that's how all the video applications get correct
> audio/video sync, so this case is in essence tested by WMP.
>
> I suspect that waveOutGetPosition with position.wType = TIME_MS (or values
> other than TIME_SAMPLES) is bogus or un-reliable on most (all?) Pocket
PC's
> and Smartphone.
>
> It would be nice to document this "bug" or "feature", i.e. to indicate
that
> on WinCE, only position.wType = TIME_SAMPLES is supported (and other
values
> of position.wType will return random results).
>
>



Re: waveOutGetPosition bug with TIME_MS by The

The
Tue Mar 15 00:34:52 CST 2005

"riki" <see_my_home@page> wrote in message
news:%23sgDPCBKFHA.2428@TK2MSFTNGP10.phx.gbl...
> The PocketTV Team wrote:
>> It would be nice to document this "bug" or "feature", i.e. to indicate
>> that on WinCE, only position.wType = TIME_SAMPLES is supported (and
>> other values of position.wType will return random results).
> As you state, if the OEM/ODM does implement it, then it works, so

In fact, no:

Some OEM Implement it but they implement it wrong, so it does not work.

The correct statement is:

if the OEM/ODM does implement it CORRECTLY, then it works

> therefor it's not a bug in WinCE.

It's a driver issue, but this is a WinCE library routine that is documented,
so it should work.

If not implements, it should return the NOT-IMPLEMENTED error code, not
random values.

> It's just another case of a function thats untested by the CETK.

Yes, and from my experience, everytime something is un-tested by the CETK,
you can bet it's broken. Look at QueryPerformanceCounter : it's not tested
by CETK, and it's broken on several WinCE Platforms!

> Perhaps a note that this feature is dependant on OEM support would be
> helpful.

I certainely call this a bug, as long as it returns no error and incorrect
values.

In fact MSFT is now investigating it, from what I have heard.



Re: waveOutGetPosition bug with TIME_MS by The

The
Tue Mar 15 00:35:24 CST 2005

> Is using TIME_BYTES unreliable too ?

I've not tried that one.



Re: waveOutGetPosition bug with TIME_MS by riki

riki
Tue Mar 15 14:41:27 CST 2005

The PocketTV Team wrote:
> "riki" <see_my_home@page> wrote in message
> news:%23sgDPCBKFHA.2428@TK2MSFTNGP10.phx.gbl...
>
>>The PocketTV Team wrote:

> Yes, and from my experience, everytime something is un-tested by the CETK,
> you can bet it's broken. Look at QueryPerformanceCounter : it's not tested
> by CETK, and it's broken on several WinCE Platforms!
Actually it is tested. It's tested against GetTickCount() which is also
tested against GetSystemTime(), and they are not aloud to drift more
than a few seconds over 9 minutes odd.

Riki

main(){printf("%d != %d, why?", sizeof('"')["'"],(sizeof('"'))["]\"\0["]);}
By Night:
ThemeChanger for Smartphone : http://homepages.inspire.net.nz/~gambit/
AbstractStart for Smartphone :
http://homepages.inspire.net.nz/~gambit/AbstractStart/
By Day: http://www.EmbeddedFusion.com

Re: waveOutGetPosition bug with TIME_MS by The

The
Tue Mar 15 22:56:08 CST 2005

> Actually it is tested. It's tested against GetTickCount() which is also
> tested against GetSystemTime(), and they are not aloud to drift more than
> a few seconds over 9 minutes odd.

Maybe now it is tested, but earlier it was not.

The first SPV Smartphone from Orange had a totally broken
QueryPerformanceCounter that had time elapsing at an incorrect rate.

That was fixed in later releases, but I doubt this test was there 2 years
ago (and before).

If the test was present since the beginning of WinCE, then something is
wrong, and the SPV should not have had this bug.