Fixing distorted sound in Windows

Discuss whatever you want here--both QB and non-QB related. Anything from the DEF INT command to the meaning of life!

Moderators: Pete, Mods

Post Reply
User avatar
burger2227
Veteran
Posts: 2466
Joined: Mon Aug 21, 2006 12:40 am
Location: Pittsburgh, PA

Fixing distorted sound in Windows

Post by burger2227 »

For the last few weeks I have had intermittent problems with my sound card. Sound would studder or pop on and off! It is a built-in SoundMax and I never expected it to be fantastic, but it was getting really bad. So I went on Google and started searching...

There were tons of posts about this problem, but nothing seemed to help. Then I found a post that changed all of that immediately! Check your IDE drives to see if they are set to DMA!

In XP go to Control Panel... Performance and Maintenance... System... Hardware...Device Manager...

Click on the IDE ATA/ATAPI Controllers to see a list of your Primary and Secondary Channels. Right click on each and select Properties... Under the Advanced Settings check to see if the Transfer mode is set to DMA if available and that the Current Transfer Mode is NOT PIO. If it is PIO Right click the drive and click Uninstall! This might seem a LITTLE RADICAL, but it will fix the problem.

After you have uninstalled the drive channel, Windows will want to Restart your computer. During that time, it will reset to a DMA setting in most cases. If it does not, then you are stuck with PIO.

I think that my DMA problem was created when I installed a second hard drive. Oddly the Primary was PIO and the newer drive was already set to DMA.

Give it a try! It worked wonders for my sound and the darn thing runs a little faster too!

Ted
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
User avatar
burger2227
Veteran
Posts: 2466
Joined: Mon Aug 21, 2006 12:40 am
Location: Pittsburgh, PA

Post by burger2227 »

I found the following VBS Script that can set the registry for DMA if it keeps reverting back to PIO over time. This can be caused by trying to play scratched or bad CDs too.

Code: Select all

' Visual Basic Script program to reset the DMA status of all ATA drives

' Copyright ? 2006 Hans-Georg Michna

' Version 2007-04-04

' Works in Windows XP, probably also in Windows 2000 and NT.
' Does no harm if Windows version is incompatible.

If MsgBox("This program will now reset the DMA status of all ATA drives with Windows drivers." _
  & vbNewline & "Windows will redetect the status after the next reboot, therefore this procedure" _
  & vbNewline & "should be harmless.", _
    vbOkCancel, "Program start message") _
  = vbOk Then

RegPath = "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E96A-E325-11CE-BFC1-08002BE10318}\"
ValueName1Master = "MasterIdDataChecksum"
ValueName1Slave = "SlaveIdDataChecksum"
ValueName2Master = "UserMasterDeviceTimingModeAllowed"
ValueName2Slave = "UserSlaveDeviceTimingModeAllowed"
ValueName3 = "ResetErrorCountersOnSuccess"
MessageText = "The following ATA channels have been reset:"
MessageTextLen0 = Len(MessageText)
ConsecutiveMisses = 0
Set WshShell = WScript.CreateObject("WScript.Shell")

For i = 0 to 999
  RegSubPath = Right("000" & i, 4) & "\"

  ' Master

  Err.Clear
  On Error Resume Next
  WshShell.RegRead RegPath & RegSubPath & ValueName1Master
  errMaster = Err.Number
  On Error Goto 0
  If errMaster = 0 Then
    On Error Resume Next
    WshShell.RegDelete RegPath & RegSubPath & ValueName1Master
    WshShell.RegDelete RegPath & RegSubPath & ValueName2Master
    On Error Goto 0
    MessageText = MessageText & vbNewLine & "Master"
  End If

  ' Slave

  Err.Clear
  On Error Resume Next
  WshShell.RegRead RegPath & RegSubPath & ValueName1Slave
  errSlave = Err.Number
  On Error Goto 0
  If errSlave = 0 Then
    On Error Resume Next
    WshShell.RegDelete RegPath & RegSubPath & ValueName1Slave
    WshShell.RegDelete RegPath & RegSubPath & ValueName2Slave
    On Error Goto 0
    If errMaster = 0 Then
      MessageText = MessageText & " and "
    Else
      MessageText = MessageText & vbNewLine
    End If
    MessageText = MessageText & "Slave"
  End If

  If errMaster = 0 Or errSlave = 0 Then
    On Error Resume Next
    WshShell.RegWrite RegPath & RegSubPath & ValueName3, 1, "REG_DWORD"
    On Error Goto 0
    ChannelName = "unnamed channel " & Left(RegSubPath, 4)
    On Error Resume Next
    ChannelName = WshShell.RegRead(RegPath & RegSubPath & "DriverDesc")
    On Error Goto 0
    MessageText = MessageText & " of " & ChannelName & ";"
    ConsecutiveMisses = 0
  Else
    ConsecutiveMisses = ConsecutiveMisses + 1
    If ConsecutiveMisses >= 32 Then Exit For ' Don't search unnecessarily long.
  End If
Next ' i

If Len(MessageText) <= MessageTextLen0 Then
  MessageText = "No resettable ATA channels with Windows drivers found. Nothing changed."
Else
  MessageText = MessageText & vbNewline _
    & "Please reboot now to reset and redetect the DMA status."
End If

MsgBox MessageText, vbOkOnly, "Program finished normally"

End If ' MsgBox(...) = vbOk

' End of Visual Basic Script program
Save it in Notepad as RESETDMA.VBS and click on it to run in Windows XP, NT or 2000
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
Post Reply