 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
York Guest
|
Posted: Tue Mar 13, 2007 10:55 pm Post subject: vista and wavoutopen |
|
|
Hello,
In my application (Works fine on XP) I have two threads. Each theard calls
WaveOutOpen function and after that processess some audio buffers using
WaveOutWrite.
Running this on Vista I get the following.
The first thread calls WaveOutOpen and starts to "write" the audio buffers.
So far so good.
As soon as the second thread calls WaveOutOpen the first thread stops and
the second thread "writes" the headers ok.
The error message I get from the WaveOutWrite in the first thread (after the
second starts) is with MMResult = 6 which is "No driver"
Could you help me resolve this in vista.
Thank you so much. |
|
| Back to top |
|
 |
Jens Gruschel Guest
|
Posted: Wed Mar 14, 2007 4:10 am Post subject: Re: vista and wavoutopen |
|
|
| Quote: | In my application (Works fine on XP) I have two threads. Each theard calls
WaveOutOpen function and after that processess some audio buffers using
WaveOutWrite.
|
Although I don't know what specific problem this is, I know that on
Vista sound processing is quite different (more work is done by the OS,
less by the audio driver).
Using older audio hardware your approach might cause problems, too,
because the number of waves that can be played at the same time is
limited (very old soundcards could only play one wave at the same time).
You can avoid this problem by mixing the waves yourself (at the cost of
some more CPU cycles). Why don't you have one WaveOutOpen (let's say in
the main thread), which prepares the buffers and asks the threads to
populate them? Each thread would simply add its wave to the buffer (and
doing some clipping to avoid overflow). Another option might be using
DirectSound, which does the mixing for you (either using the audio
hardware or the CPU).
But as I said I don't know exactly either, so I'm looking forward to see
a real explanation here.
--
Jens Gruschel
http://www.pegtop.net |
|
| Back to top |
|
 |
York Guest
|
Posted: Wed Mar 14, 2007 5:44 pm Post subject: Re: vista and wavoutopen |
|
|
Reserching this in details I noticed the following:
Each time I run Skype for example while my app is running the audio in my
application fails. Same happens with Skype - each time I run my application
when skype is running the audio in skype fails.
Tested this with other pairs - same thing.
It seems that the "famous WASAPI" vista layer has some problems or is still
not documented quite well.
"Jens Gruschel" <nospam (AT) thisurldoesnotexist (DOT) com> wrote in message
news:45f72f6f$1 (AT) newsgroups (DOT) borland.com...
| Quote: | In my application (Works fine on XP) I have two threads. Each theard
calls WaveOutOpen function and after that processess some audio buffers
using WaveOutWrite.
Although I don't know what specific problem this is, I know that on Vista
sound processing is quite different (more work is done by the OS, less by
the audio driver).
Using older audio hardware your approach might cause problems, too,
because the number of waves that can be played at the same time is limited
(very old soundcards could only play one wave at the same time). You can
avoid this problem by mixing the waves yourself (at the cost of some more
CPU cycles). Why don't you have one WaveOutOpen (let's say in the main
thread), which prepares the buffers and asks the threads to populate them?
Each thread would simply add its wave to the buffer (and doing some
clipping to avoid overflow). Another option might be using DirectSound,
which does the mixing for you (either using the audio hardware or the
CPU).
But as I said I don't know exactly either, so I'm looking forward to see a
real explanation here.
--
Jens Gruschel
http://www.pegtop.net |
|
|
| Back to top |
|
 |
Jens Gruschel Guest
|
Posted: Wed Mar 14, 2007 11:05 pm Post subject: Re: vista and wavoutopen |
|
|
| Quote: | Reserching this in details I noticed the following:
Each time I run Skype for example while my app is running the audio in my
application fails. Same happens with Skype - each time I run my application
when skype is running the audio in skype fails.
Tested this with other pairs - same thing.
It seems that the "famous WASAPI" vista layer has some problems or is still
not documented quite well.
|
Exactly what was happening before soundcards could manage more than one
wave at the same time. I guess your soundcard actually isn't the
problem, but Vista or the driver is. Have you tried to update the driver?
--
Jens Gruschel
http://www.pegtop.net |
|
| Back to top |
|
 |
York Guest
|
Posted: Thu Mar 15, 2007 8:12 am Post subject: Re: vista and wavoutopen |
|
|
To be hones, actually I did not try to do update the driver.
My sound card is a pretty new one and as far as I see it is recognized by
Vista correctly but today I'll try to use the driver provided by the vendor.
I'll update you with the results.
Regards
"Jens Gruschel" <nospam (AT) thisurldoesnotexist (DOT) com> wrote in message
news:45f8398c$1 (AT) newsgroups (DOT) borland.com...
| Quote: | Reserching this in details I noticed the following:
Each time I run Skype for example while my app is running the audio in my
application fails. Same happens with Skype - each time I run my
application when skype is running the audio in skype fails.
Tested this with other pairs - same thing.
It seems that the "famous WASAPI" vista layer has some problems or is
still not documented quite well.
Exactly what was happening before soundcards could manage more than one
wave at the same time. I guess your soundcard actually isn't the problem,
but Vista or the driver is. Have you tried to update the driver?
--
Jens Gruschel
http://www.pegtop.net |
|
|
| Back to top |
|
 |
York Guest
|
Posted: Tue Mar 20, 2007 3:12 pm Post subject: Re: vista and wavoutopen |
|
|
Solverd !!!
must do this:
WaveOutOpen(@hWaveHandve, UINT($FFFFFF).....)
i.e. use the system default device without the WAVE_MAPPER flag.
The above works both on Vista and XP
"Jens Gruschel" <nospam (AT) thisurldoesnotexist (DOT) com> wrote in message
news:45f8398c$1 (AT) newsgroups (DOT) borland.com...
| Quote: | Reserching this in details I noticed the following:
Each time I run Skype for example while my app is running the audio in my
application fails. Same happens with Skype - each time I run my
application when skype is running the audio in skype fails.
Tested this with other pairs - same thing.
It seems that the "famous WASAPI" vista layer has some problems or is
still not documented quite well.
Exactly what was happening before soundcards could manage more than one
wave at the same time. I guess your soundcard actually isn't the problem,
but Vista or the driver is. Have you tried to update the driver?
--
Jens Gruschel
http://www.pegtop.net |
|
|
| Back to top |
|
 |
Jens Gruschel Guest
|
Posted: Tue Mar 20, 2007 11:29 pm Post subject: Re: vista and wavoutopen |
|
|
| Quote: | WaveOutOpen(@hWaveHandve, UINT($FFFFFF).....)
i.e. use the system default device without the WAVE_MAPPER flag.
The above works both on Vista and XP
|
What did you use before? Maybe using waveOutGetNumDevs and
waveOutGetDevCaps isn't a bad idea. Maybe your Vista system has the same
default device as your XP system had, but devices are ordered differently.
--
Jens Gruschel
http://www.pegtop.net |
|
| Back to top |
|
 |
York Guest
|
Posted: Wed Mar 21, 2007 8:12 am Post subject: Re: vista and wavoutopen |
|
|
For XP - works with DeviceID = 0 (or any other valid ID)
Params := CALLBACK_FUNCTION or WAVE_MAPPED;
Res := WaveOutOpen(@FWaveOutHandle, DeviceID, FFormat, DWORD(@waveOutPrc),
FWindowHandle, params);
For Vista (though I have a deviceID = 0)
Params := CALLBACK_FUNCTION;
Res := WaveOutOpen(@FWaveOutHandle, UINT($FFFFFFFF), FFormat,
DWORD(@waveOutPrc), FWindowHandle, params);
and it works. (i.e. WAVE_MAPPED flag removed from params)
So though I have a deviceID = 0 if I pass this to the example above it
fails.
Note that it does not fail when I try to open the device but after I try to
use WaveOutWrite.
The examples above work just fine if only a single call is made but in my
application I need to "waveout" several simultaneous independent audio
streams which cannot be mixed.
"Jens Gruschel" <nospam (AT) thisurldoesnotexist (DOT) com> wrote in message
news:46002830$1 (AT) newsgroups (DOT) borland.com...
| Quote: | WaveOutOpen(@hWaveHandve, UINT($FFFFFF).....)
i.e. use the system default device without the WAVE_MAPPER flag.
The above works both on Vista and XP
What did you use before? Maybe using waveOutGetNumDevs and
waveOutGetDevCaps isn't a bad idea. Maybe your Vista system has the same
default device as your XP system had, but devices are ordered differently.
--
Jens Gruschel
http://www.pegtop.net |
|
|
| Back to top |
|
 |
Jens Gruschel Guest
|
Posted: Fri Mar 23, 2007 4:32 am Post subject: Re: vista and wavoutopen |
|
|
| Quote: | and it works. (i.e. WAVE_MAPPED flag removed from params)
So though I have a deviceID = 0 if I pass this to the example above it
fails.
|
Interesting. Thanks for that information.
--
Jens Gruschel
http://www.pegtop.net |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|