Apologies for the multiple postings, I think I posted this to the wrong group
before.

Hi,
I'm new to windows ce and am trying to write a soundcard driver for
windows ce 4.2 which I need to load multiple instances of. and seem to
be running into problems loading more than one instance.
The project is basically a directsound driver for a soundcard with 4
seperate stereo channels and I want to make each stereo 'pair' appear
to the os as a seperate sound card so calling applications can choose
which pair the output is routed to. I have managed to write a driver
that will allow this for one channel but cannot seem to load a second
instance of the driver. I have a 'loader' driver which starts on boot
up, which is listed in the registry under
HKEY_LOCAL_MACHINE\Drivers\BuiltIn\. This 'driver' (if you can call it
that) then calls ActivateDevice(L"Drivers\\custom\\AudDvr",n); where
1<=n<=4 to load the soundcard driver. This call works the first time,
however any subsequent calls fail with GetLastError returning
ERROR_DEVICE_IN_USE. This second call does not enter DllMain or
WAV_Init on the soundcard driver so I assume whatever loads the drivers
is seeing that the audio driver is already loaded and returning a fail.
My question is, does anybody know how I can ensure a new instance of
the driver is loaded on the second call, rather than the os trying to
access the existing instance? Any help/pointers will be greatfuly
received as I have been banging my head against a wall for days with
this one.
Thanks

Carl

RE: Multiple Soundcard Driver Instances by andyraf

andyraf
Mon Dec 13 16:02:14 CST 2004

I'm not very familiar with how ActivateDevice interacts with the audio
device manager, although I imagine you would need to be sure that the
driver's registry entry doesn't include an "Index" parameter to allow the
system to dynamically assign a device name (e.g. wav1:, wave2:, etc.) to
each device.

Wouldn't it be easier to just create a single driver that exposes four
devices (WODM_GETNUMDEVS would return 4)? Alternatively, you could try
creating four separate registry entries, one for each driver instance. My
underlying guess is that ActivateDevice is getting upset that you're trying
to load the exact same device more than once.

-Andy


Re: Multiple Soundcard Driver Instances by Carl

Carl
Tue Dec 14 11:59:57 CST 2004

Hi Andy,
Thanks for the info. I had an Index parameter in the drivers registry
entry, removing that cured the problem.

Carl :-)



Andrew Raffman wrote:
> I'm not very familiar with how ActivateDevice interacts with the audio
> device manager, although I imagine you would need to be sure that the
> driver's registry entry doesn't include an "Index" parameter to allow the
> system to dynamically assign a device name (e.g. wav1:, wave2:, etc.) to
> each device.
>
> Wouldn't it be easier to just create a single driver that exposes four
> devices (WODM_GETNUMDEVS would return 4)? Alternatively, you could try
> creating four separate registry entries, one for each driver instance. My
> underlying guess is that ActivateDevice is getting upset that you're trying
> to load the exact same device more than once.
>
> -Andy
>