dcsimg


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Sound Anomolies

  1. #1
    Guest

    Sound Anomolies

    I have an app I've written in VB5. It works great on Win 9x and NT4. Not so
    great on Win2K.

    The program is fetching data from a digitizer, then is updating a grid on
    the screen.

    Each button press on the digitizer puck creates a beep, bleep or other short
    sound.

    These sounds are stored in a res file. I use the API call:

    Declare Function PlaySound Lib "winmm.dll" Alias "sndPlaySoundA"
    (lpszSoundData As Any, ByVal uFlags As Long) As Long

    Dim m_snd() as Byte

    Function PlaySoundByID(ID as Long)
    m_snd = LoadResData(ID, "SOUND")
    PlaySoundByID = PlaySound(m_snd(0), SND_ASYNC Or SND_NODEFAULT Or
    SND_MEMORY)
    End Function

    If there is a lot of screen activity (grid refresh), then the sounds may
    stutter, sputter or hiccup.

    I checked and Win2K dumps a lot of Plug-n-Pray devices on IRQ9, including
    the sound card.

    Reading the MSDN site, there's no way to prevent this IRQ sharing, which I
    think is the root of my problem.

    On NT4 (same machine, dual boot) each thing has its own IRQ and the sound
    works 100%.

    I've tried two completely different sound cards, one a SB Live!Value with
    the new drivers from their site, and the other a Yamaha chip set, again with
    the mfg's downloaded Win2K drivers. Both cards act the same.

    I'm at a loss... I think something is hosed w/ Win2K, winmm.dll and IRQ
    sharing.

    Just as an aside... originally the API call to winmm was passing a string
    filled by a call:

    StrConv(loadresdata.....),vbFromUnicode) which worked fine in Win9x and NT4.

    The Declare was ByVal lpszSoundData as String

    It caused a Program Error in Win2K, so I converted it to use the byte array
    instead.

    Tom









  2. #2
    Jim Barber Guest

    Re: Sound Anomolies

    Hello Tom,

    >If there is a lot of screen activity (grid refresh), then the sounds may
    >stutter, sputter or hiccup.


    Your problem may be more related to the video driver than to IRQ sharing.
    WDM video drivers are notorious for causing problems of that nature.

    It's an easy theory to test. Find the "Hardware Acceleration" slider in the
    display properties, crank it back to around 50%, then reboot and try your
    app again. If the sounds play normally, you'll have found the culprit.

    It may sound nuts, but we've had a fairly large number of customers suffer
    the same problem when using our streaming DSP libraries and motion control
    interfaces. In all cases to date, the problem was the video driver, not
    anything in the kernel or basic MM. Kudos to the video card vendors for
    thinking they can get away with crippling a system to get *apparently*
    better video performance.

    Regards,
    Jim Barber
    Silicon Pixels




  3. #3
    Guest

    Re: Sound Anomolies

    Jim,

    Thanks for the response...

    The less accelleration I set, the worse it gets.

    Lower screen res is better too.

    Granted, the test machine has a crappy shared memory video card, but you'd
    think that it would perform the same under NT4 and Win2K.

    Tom


    >
    > >If there is a lot of screen activity (grid refresh), then the sounds may
    > >stutter, sputter or hiccup.

    >
    > Your problem may be more related to the video driver than to IRQ sharing.
    > WDM video drivers are notorious for causing problems of that nature.
    >
    > It's an easy theory to test. Find the "Hardware Acceleration" slider in

    the
    > display properties, crank it back to around 50%, then reboot and try your
    > app again. If the sounds play normally, you'll have found the culprit.
    >





Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center