| RE: [AD] standing Windows issues | 
[ Thread Index | 
Date Index
| More lists.liballeg.org/allegro-developers Archives
] 
> Can you test with the old DirectX mixer driver? It's still there,
though
> you need to explicitly ask for it in the config file (DXA? where ? is
> the device letter (A is the first device, B is second, etc)). Though I
> am trying to get rid of that driver since it gets in the way so much
of
> the core mixer code. I also can't see why it would work and AllegMix
not..
OK - first off I found the problem to the hang when the fileopen dialog
comes up.  Basically, I traced it all the way down to 
      _CoInitializeEx(NULL, _COINIT_MULTITHREADED);
in thread_init.
COINIT_MULTITHREADED isn't defined for win2k, and evidently isn't meant
to be used - since it is the cause of the hang.
A value that DOES prevent the hang is COINIT_APARTMENTTHREADED.
----
OK - now for the sound problem.
Thanks for the config file note - I changed it to use the directsound
mixer.
Now it FAILS starting up, at this point -
   hr = IDirectSoundBuffer_Lock(prim_buf, 0, 0,
                                &lpvPtr1, &dwBytes1, 
                                &lpvPtr2, &dwBytes2,
                                DSBLOCK_FROMWRITECURSOR |
DSBLOCK_ENTIREBUFFER);
   if (FAILED(hr)) {
      _TRACE("Can't lock primary buffer (%s)\n", ds_err(hr));
      return -1;
   }
It can't lock the primary buffer.  The built-in error-to-string
(ds_err) returns DSERR_UNKNOWN, but I put in the one I use
static char *ds_err(long err)
{
   static char err_str[64];
#define DXEH(m) \
    if (err == m) \
   {\
   _al_sane_strncpy(err_str, #m, sizeof(err_str));\
   return err_str;\
   }
    DXEH(DSERR_ALLOCATED );
    DXEH(DSERR_ALREADYINITIALIZED );
    DXEH(DSERR_BUFFERLOST);
    DXEH(DSERR_CONTROLUNAVAIL );
    DXEH(DSERR_GENERIC );
    DXEH(DSERR_NOAGGREGATION );
    DXEH(DSERR_NODRIVER);
    DXEH(DSERR_NOINTERFACE);
    DXEH(DSERR_OTHERAPPHASPRIO );
    DXEH(DSERR_UNINITIALIZED );
    DXEH(DSERR_OUTOFMEMORY);
    DXEH(DSERR_UNSUPPORTED);
    DXEH(DSERR_PRIOLEVELNEEDED);
    DXEH(DSERR_INVALIDPARAM);
    DXEH(DSERR_INVALIDCALL);
    DXEH(DSERR_BADFORMAT);
    _al_sane_strncpy(err_str, "DSERR_UNKNOWN", sizeof(err_str));
   return err_str;
}
and it returned DSERR_BUFFERLOST.
Ryan