Featured Post

Tuesday, July 12, 2016

Does Your Windows Audio Interface Sometimes Quit Working (Maybe Along With A DAW Crash)?

Mine does all too often! Exasperating!

At first I would just reboot. Time wasted.

Then it hit me that maybe I could disable and then enable the audio interface in the Device Manager (under Sound, video and game controllers). That worked and took a lot less time, but it was still a pain.

Finally I decided that there had to be a way to create a batch file to do this for me.

If you're a power user, you can skip down to the numbered steps. Even then, please don't take offense if some of those steps insult your intelligence.

A batch file is a text file with a .bat extension. It can include commands to run a program and/or computer commands. The .bat  file you create automatically runs in a command prompt window. That's the window you get if you click Start, type "cmd" and Windows suggests cmd.exe. Then press Enter.

The window that opens hearkens back to the early days of the PC. It's what you saw back then when you booted your computer. You had to know the name of any program you wanted to run, or you typed "dir" to get a directory that would remind you of program names. Very barbaric! BUT, it was and is a very powerful, too.

I had no idea how to run the Windows Device Manager from a command prompt. Research told me it was not a simple matter of typing the name of the device manager file. There was more to it which I won't go into here.

Further research revealed a program that works like the Windows Device Manager but is also easy to include in a batch file.

So, here are the steps I took after this discovery. Note that you probably have to have administrator privileges to run the batch file you're going to create:

  1. Go to http://www.nirsoft.net/utils/device_manager_view.html. Scroll to the bottom of the page and download the appropriate version of DevManView. It and the help file and a text file are in the Zip file you download.
  2. For tools like DevManView, I have created a directory C:\Tools. It makes it easy when you go to reference the program in a batch file. But, you can unzip the downloaded file to any directory you wish. So unZip away!
  3. Open Notepad.
  4. Highlight the text in #5 just below. Copy it (Ctrl-c).
  5. @rem batch file to disable and then enable the AUDIO INTERFACE

    @rem DISABLE

    @echo.

    @echo.

    @echo Disabling AUDIO INTERFACE . . .

    @echo.

    @echo.

    @C:\Tools\DevManView\devmanview.exe /disable "AUDIO INTERFACE"

    @rem ENABLE

    @echo Enabling  AUDIO INTERFACE . . .

    @C:\Tools\DevManView\devmanview.exe /enable "AUDIO INTERFACE"
  6. Paste the text into Notepad (Ctrl-v).
  7. Find the name of your Audio Interface as it is listed in Windows Device Manager Start>Control Panel>Device Manager. It will be listed under Sound, video and game controllers. Make sure you write it down exactly as it is listed. Keep the Device Manager window open.
  8. In Notepad, replace each AUDIO INTERFACE in the text above with the exact name of your audio interface.
  9. Replace the path C:\Tools\DevManView\ with the path to where you unzipped devmanview.exe.
  10. Save the file to your desktop. Give it a name that will remind you what it does (Restart Audio Interface.bat, etc.).
  11. Find the batch file on your desktop and right click it. Select Rename.
  12. Change the extension txt to bat, This "tells" Windows that it is a file to be processed by the command prompt.
  13. Click on the new batch file to run it.

     It will open a command prompt window and Disabling AUDIO INTERFACE . . . should appear (with the name of your audio interface instead of the words AUDIO INTERFACE).

    After that command is completed, Enabling  AUDIO INTERFACE . . . should appear.

    After that command is completed, the command prompt window should close.
  14. I am NOT superstitious!
To watch the batch file in action, place the Windows Device Manager window next to where the command prompt window appears when you run this batch file. Make sure to have your device showing in that window. As the batch file runs DevManView you'll see your audio device first marked as disabled and then marked as enabled.

What exactly does the batch file do?

The rem lines are remarks and are there to explain what's happening. Because the output of a batch file includes the path of the batch file before each line of output, the screen output is full of gibberish.

The @ before each line suppresses the gibberish (except lines with echo still show on the screen, but without gibberish).

If you want to see everything that's going on while the batch file runs, you can safely remove all of the @'s.

Kudos to Nir Sofer, the author of DevManView and some other helpful tools that save users a lot of time.

I hope this helps someone!

No comments:

Post a Comment