We are using NAudio to play sound through a USB device and have a problem where the Stop or Dispose methods for out WaveOut object hangs. It seems the problem only happens if the user undocks the USB device while WaveOut is playing a wav file. We are getting no exceptions being throw for us to catch and handle this event.
We have simplified our threading model, but this has not solved anything and still find that NAudio deadlocks on us, with the callback method holding onto a lock. It seems to hold onto the lock because its call to the winmm.dll waveOutWrite method call hangs, or never returns, or throws an exception because the device is not there anymore.
Any suggestions would be appreciated.
Mark