winmm call hangs after unplugging the mic RRS feed

  • Question

  • hi

    i hope this is the rigth forum.

    i'm using winmm to capture recording from a mic.

    everything is working fine until i unplug the mic during recording.

    after i unplug the mic i try to close down the recording, but this makes the winmm call hang.

    i found out the following during diagnostics and debugging. It seems that if i manage to close the recording fast after i get the disconnet event from the mic device, i don't have the problem. but if im slow to close the recording i get the problem that the close call hangs and never returns from the call.

    i'v noticed that it will actually take some time from unplugging a device till winmm will reflect the change.

    my theory is that the reason it goes fine when im fast in closing the recording is that winmm hasn't found out that the device is missing. And when im slow, winmm has found out that the device is missing and thats why it hangs.

    im new to using winmm so my theory might not be very profesional.  

    can anybody help, or has anybody seen this behavior before.

    I really need help on this so don't be shy :0)

    Saturday, April 16, 2011 11:01 PM

All replies

  • Ive got no idea what winmm is but I can help with the microphone scenario. Some audio hardware, if not most these days, will do impedence checks on the soundcard's analog ports. They determine whether or not a device is plugged into particular ports. Although this shouldn't affect the recording and playback of analog signals, some messaging goes on within the sound card driver as a result of plugging devices in-and-out of ports. This will be what's causing your software to hang.

    I absoultely hate this particular feature of sound cards because it can cause OS features to hang as well. I pretty much avoid it by only using digital IO channels. You can't do this with microphones though I'm affraid.

    Sunday, April 17, 2011 2:43 AM