2010/06/02 21:09:39
bitflipper
This came up in another thread, and I thought it might be of general interest. It's an easy technique even if you're not a propellerhead.

As we all know, networks and DAWs do not always play well together. A NIC is very often the culprit when diagnosing excessive DPC latency, for example. Wireless NICs are especially troublesome. Windows exacerbates the matter by assuming that nothing - not even streaming audio data - is more important than network traffic. If all that weren't bad enough, sometimes the network adapter shares an IRQ with the audio interface. Sometimes, the mere presence of a network connection can cause dropouts, limiting how many tracks and effects we can have. It can be so bad that even setting buffers up to very high values won't fix the problem.

This is why some folks go as far as to not even have a network interface in their audio workstations.

The problem with that solution is that sometimes it's darned handy to have your DAW on a network. An internet connection may be required to authorize a plugin, for example. Many audio software products are only available via download. And a LAN connection is very handy for backing up projects.

A nice alternative to having no network at all is to have a convenient way to turn the network off and on. Yes, you could do that via Device Manager, Control Panel or Windows profiles, but these are less than truly convenient.

But picture a desktop icon labeled "Disable Network" and a companion shortcut labeled "Enable Network". Click - network off. Click - network on. That's convenience.

While this does take just a little effort to set up, once in place it'll be ever so convenient to take the network on and off line. Here's how to do it.

Step #1: obtain a copy of devcon.exe
This is a free download from Microsoft. The download includes both 32- and 64-bit versions in a self-extracting zip file. Get them both here. Devcon is a command line tool that gives you the same functionality as Device Manager - but you can use it in batch files and desktop shortcuts.

(Warning: both 32- and 64-bit executables are named devcon.exe. Make sure you pick the right one for your O/S.)

Step #2: determine the device ID of your network adapter
Open Device Manager, scroll down to the network card, right-click and open Properties. The Details tab will show its ID.

These IDs are pretty long, but you can use CTL-C to copy a device ID to the Windows Clipboard so you don't have to type it all out. But it really isn't necessary to use the entire ID. The devcon tool we'll be using accepts wildcards, so you can just use a portion of the ID. For example, my network interface's ID is

PCI\VEN_14E4&DEV_1677&SUBSYS_01AD1028&REV_01\4&117729E2&0&00E0

but I can specify it as *VEN_14*, which is much easier to type.

Step #3: create a desktop shortcut
Right-click in a blank space on your desktop and select New -> Shortcut. In the textbox, enter the full path to the devcon executable followed by the word "disable" followed by your network ID.

For example, on my machine devcon lives in a directory named "tools", so my shortcut command is this:
c:\tools\devcon.exe disable *VEN_14*

Click "Next" and give the shortcut a sensible caption, such as "Disable the Network".

Step #4 repeat step 3 but with "enable" in the command line

Create a second shortcut (or ctl-drag the first one), and substitute "enable" for "disable". This will be what you click on to turn your network back on. So my shortcut's command line reads:

c:\tools\devcon.exe enable *VEN_14*

Lastly, you can optionally assign icons to your shortcuts. Here's what mine look like:




You can use this same technique to disable any device that's causing problems, such as DVD drives. And there are many ways to extend the concept, such as invoking a batch file that not only kills the network but also stops unnecessary background processes. Or starts SONAR at an elevated priority, or runs it as Administrator. Or writes the date and time to a file if you're billing by the hour.


Now, want to see if this really has a measurable effect on your computer? Start up DPC Latency Checker and note the values. Click on your new "stop network" shortcut while the DPC Latency Checker is still running. You'll see a big red spike as the network shuts down, but after that you should see reduced average latencies.

Of course, if your network adapter was never a problem in the first place, you can ignore this entire post.


2010/06/02 21:51:51
ohhey
bitflipper


This came up in another thread, and I thought it might be of general interest. It's an easy technique even if you're not a propellerhead.

As we all know, networks and DAWs do not always play well together. A NIC is very often the culprit when diagnosing excessive DPC latency, for example. Wireless NICs are especially troublesome. Windows exacerbates the matter by assuming that nothing - not even streaming audio data - is more important than network traffic. If all that weren't bad enough, sometimes the network adapter shares an IRQ with the audio interface. Sometimes, the mere presence of a network connection can cause dropouts, limiting how many tracks and effects we can have. It can be so bad that even setting buffers up to very high values won't fix the problem.

This is why some folks go as far as to not even have a network interface in their audio workstations.

The problem with that solution is that sometimes it's darned handy to have your DAW on a network. An internet connection may be required to authorize a plugin, for example. Many audio software products are only available via download. And a LAN connection is very handy for backing up projects.

A nice alternative to having no network at all is to have a convenient way to turn the network off and on. Yes, you could do that via Device Manager, Control Panel or Windows profiles, but these are less than truly convenient.

But picture a desktop icon labeled "Disable Network" and a companion shortcut labeled "Enable Network". Click - network off. Click - network on. That's convenience.

While this does take just a little effort to set up, once in place it'll be ever so convenient to take the network on and off line. Here's how to do it.

Step #1: obtain a copy of devcon.exe
This is a free download from Microsoft. The download includes both 32- and 64-bit versions in a self-extracting zip file. Get them both here. Devcon is a command line tool that gives you the same functionality as Device Manager - but you can use it in batch files and desktop shortcuts.

(Warning: both 32- and 64-bit executables are named devcon.exe. Make sure you pick the right one for your O/S.)

Step #2: determine the device ID of your network adapter
Open Device Manager, scroll down to the network card, right-click and open Properties. The Details tab will show its ID.

These IDs are pretty long, but you can use CTL-C to copy a device ID to the Windows Clipboard so you don't have to type it all out. But it really isn't necessary to use the entire ID. The devcon tool we'll be using accepts wildcards, so you can just use a portion of the ID. For example, my network interface's ID is

PCI\VEN_14E4&DEV_1677&SUBSYS_01AD1028&REV_01\4&117729E2&0&00E0

but I can specify it as *VEN_14*, which is much easier to type.

Step #3: create a desktop shortcut
Right-click in a blank space on your desktop and select New -> Shortcut. In the textbox, enter the full path to the devcon executable followed by the word "disable" followed by your network ID.

For example, on my machine devcon lives in a directory named "tools", so my shortcut command is this:
c:\tools\devcon.exe disable *VEN_14*

Click "Next" and give the shortcut a sensible caption, such as "Disable the Network".

Step #4 repeat step 3 but with "enable" in the command line

Create a second shortcut (or ctl-drag the first one), and substitute "enable" for "disable". This will be what you click on to turn your network back on. So my shortcut's command line reads:

c:\tools\devcon.exe enable *VEN_14*

Lastly, you can optionally assign icons to your shortcuts. Here's what mine look like:




You can use this same technique to disable any device that's causing problems, such as DVD drives. And there are many ways to extend the concept, such as invoking a batch file that not only kills the network but also stops unnecessary background processes. Or starts SONAR at an elevated priority, or runs it as Administrator. Or writes the date and time to a file if you're billing by the hour.


Now, want to see if this really has a measurable effect on your computer? Start up DPC Latency Checker and note the values. Click on your new "stop network" shortcut while the DPC Latency Checker is still running. You'll see a big red spike as the network shuts down, but after that you should see reduced average latencies.

Of course, if your network adapter was never a problem in the first place, you can ignore this entire post.


I wonder if devcon does anything different them using disable in device manager. That seems to do the trick for me.
2010/06/02 23:50:32
bitflipper
I wonder if devcon does anything different them using disable in device manager. That seems to do the trick for me.

It does exactly the same thing. My objective is to make it more convenient, or in my case automatic - I kill the network and start SONAR in one click.
2010/06/03 00:31:11
ShadDOH
It's good information, but I just disable the NIC like ohhey
2010/06/03 01:15:01
gamblerschoice
Zone Alarm has a free firewall with a simple disconnect, it locks the internet out with a single click. I use it all the time. But, even with the above suggestions, you still need to turn off any anti-virus programs, they will continue to work in the background even when disconnected from the net.

Later
Albert
2010/06/03 02:07:09
SeveredVesper
Dave! I can't see where the 32-bit and the 64-bit ones are, there are no indications whatsoever, and it doesn't include Vista (32 nor 64) in the list of applicable systems.
2010/06/03 04:26:16
Philip
+1 (SeveredVesper)
For Windows 7/Vista ... you might consider vscript.

1) A File To Disable Networks and Launch Sonar (copy the code below to notepad and save it to your desktop (or such) as "Sonar With No Networks.VBS"

strComputer = "."
' This adds the Admin Run Function for Windows Vista and 7
' You must put this at the top below computer and End If at the
' very end of the script
If WScript.Arguments.length = 0 Then
Set objShell = CreateObject("Shell.Application")
objShell.ShellExecute "wscript.exe", """" & _
WScript.ScriptFullName & """" &_
" RunAsAdministrator", , "runas", 1
Else
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery( _
"SELECT * FROM Win32_NetworkAdapter Where NetEnabled = 'True'")
For Each objItem in colItems
Wscript.Echo "Name: " & objItem.Name & VbCrLf & _
"Description: " & objItem.Description
objItem.Disable
' Wscript.Echo
Next
MsgBox("All Network Adapters have been Disabled.")
End If
Sub Run(ByVal sFile)
Dim shell
    Set shell = CreateObject("WScript.Shell")
    shell.Run Chr(34) & sFile & Chr(34), 1, false
    Set shell = Nothing
End Sub
Run "C:\Program Files\Cakewalk\SONAR 8.5 Producer\SONARPDR.exe"
2) Make another file: "Re-enable Networks.VBS"
strComputer = "."
' This adds the Admin Run Function for Windows Vista and 7
' You must put this at the top below computer and End If at the
' very end of the script
If WScript.Arguments.length = 0 Then
Set objShell = CreateObject("Shell.Application")
objShell.ShellExecute "wscript.exe", """" & _
WScript.ScriptFullName & """" &_
" RunAsAdministrator", , "runas", 1
Else
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery( _
"SELECT * FROM Win32_NetworkAdapter Where NetEnabled = 'False'")
For Each objItem in colItems
Wscript.Echo " Name: " & objItem.Name & VbCrLf & _
"Description: " & objItem.Description
objItem.Enable
' Wscript.Echo
Next
MsgBox("All Network Adapters have been Enabled.")
End If
2010/06/05 13:56:41
SeveredVesper
Thanks Philip!
2010/06/06 01:03:47
RogerS
Thank you Philip - Your script works perfectly.
2010/06/06 01:59:44
SeveredVesper
Dave ang Philip, by any chance, do you guys work as recording tech-support or something? I'm amazed at your knowledge with these things.
© 2025 APG vNext Commercial Version 5.1

Use My Existing Forum Account

Use My Social Media Account