[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference decwet::visual

Title:Microsoft Visual C++ bug reports and kits
Notice:Register in Topic 2. 5.Last for latest Kit
Moderator:DECWET::THOMASN
Created:Tue May 17 1994
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:521
Total number of notes:2938

473.0. "waveOutClose() never returns" by ALLOUT::STEWART (Bob Stewart) Fri Feb 28 1997 10:55

    I have a program that fails under VC++4.1 Alpha. The program is from a
    CD, it presumably runs on windows95. The program hangs after playing a
    .wav file. I have narrowed the problem down to the following sequence
    
    waveOutUnprepareHeader(m_hWaveOut, m_lpWaveHdr, sizeof(WAVEHDR));
    // execution gets here OK
    waveOutClose(m_hWaveOut);
    // never gets here
    m_bPlaying = FALSE;
    
    The waveOutClose() routine seems to be a roach motel, execution goes
    in, but it never comes out. The program stays hung and has to be killed
    with the task manager.
    
    To me this seems like a bug, but it is also possible that I am missing
    something. If so, please enlighten me.
    
    I will be out for two weeks, so don't get irritated if I don't respond
    to a suggestion immediately.
    
T.RTitleUserPersonal
Name
DateLines
473.1BGSDEV::MORRISTom Morris - Light & Sound EngineeringMon Mar 03 1997 19:5117
It's impossible to guess what the problem is from the
brief description, but I'd hazard a guess that the problem
is with the program, not waveOutClose.

We've got plenty of programs that call it without problem
and the examples that I've compiled off the SDK appear
to work fine (try 'reverse' for example).

Some things to look for:

	- does the sound play?
	- are all the messages passed to the callback
	  window/function getting posted and processed correctly?
	- does doing a waveOutReset before the close help at all?
	- do you have a race someplace among multiple threads?

Tom
473.2more detailALLOUT::STEWARTBob StewartTue Mar 18 1997 11:2231
    >
    
    Some things to look for:
    
            - does the sound play?
    
    ********** yes
    
            - are all the messages passed to the callback
              window/function getting posted and processed correctly?
    
    ********** I think so, I looked, in particular the code gets here
    because of a DONE message. That was what I first thought was the cause
    of the hang, but the message arrives.
    
            - does doing a waveOutReset before the close help at all?
    
    ********** Haven't tried that yet.
    
            - do you have a race someplace among multiple threads?
    
    ********** What multiple threads? This program is fairly simple, it
    doesn't even do double buffering. 
    
    >
    
    So, do you mean "It is expected behavior that execution can go into
    waveOutClose and never come out." ??? How could the program cause that?
    I thought waveOutClose was supposed to return with an error if it
    didn't like something.
    
473.3works on intelALLOUT::STEWARTBob StewartMon Mar 24 1997 14:492
    The program runs fine on Intel Windows95 VC++ 4 Standard Edition...
    
473.4sorry, no good suggestionsDECWET::PETERSONMon Mar 24 1997 20:2516
    to debug it, you might try catching all exceptions in the debugger just
    before you call waveOutClose
    to do it, select exceptions in the debug menu, and then select all
    exceptions, set them to debugger catch always, and then select change
    before you exit.  when you hit an exception, type go and the debugger
    will prompt you whether you want user handlers to handle it (answer
    yes).
    
    you might also try the VC++ V5.0 kit.  it might be better (although it
    requires NT 4.0)
    what version of NT are you running, and does it run on Intel Windows NT
    as well as Windows 95?
    
    this doesn't sound like a compiler issue, so you might have better luck
    asking in thedecwet:: nt-developer conference or in the humane:visualc
    conference. 
473.5fails with Intel NT too, works with 95ALLOUT::STEWARTBob StewartTue Apr 08 1997 08:5512
    The program also fails with the same external symptoms on Intel NT 4.0
    with VC++ 5.0. So I guess it is an NT bug not an Alpha bug, and is not
    fixed by C++ 5.
    
    My current GUESS is that the wave close routine thinks that the buffer
    has not been released, and is waiting for it instead of returning an
    error, but I don't really know.
    
    If anyone wants to try it, it is on the CD from the book "Visual C++ 4
    Masterclass" from WROX press. The program name is Wavescope. Build it,
    start it, find a WAV file, play it, then try to close the program.
    
473.6reset no help, no exceptions eitherALLOUT::STEWARTBob StewartTue Apr 08 1997 13:364
    waveOutReset does not help, it just hangs in reset instead of in close
    
    The debugger does not report any exceptions.