Focusrite interface - sound screwed up whenever computer sleeps

Norwoodz

New member
I've been using the Focusrite Scarlett 2i2 on my laptop running Windows 8. The interface runs fine for audio and recording - I've used it and recorded at 44.1 and 96khz and played resampled audio and all that. The problem is that whenever my computer sleeps for more than a few hours, when I start Windows back up the sound is slow and choppy, like what you get when something plays at the wrong sample rate. I always have to unplug and replug the unit to get it working again. I've tried changing the defaults for which sample rate it uses. I've tried reinstalling the driver. It just always seems to have this issue after the computer's been sleeping, and sometimes, if I turn the computer all the way off, Windows won't even recognize the interface when it boots back up. Again I have to unplug and replug. It would be nice if it would just work consistently. Any help is appreciated. Thanks.
 
Are you running the very latest W7/W8 driver?
Downloads | Focusrite

Before you install that get rid of the old driver and run Ccleaner to clean the registry. I would also disable the On Board Sound card in Control Panel and turn off Windows bleeps and bloops (NB I only have W7/64 and so how these things are done in hated 8 I really don't know!)

But! Sorry to say ***t'appen! My NI KA6 will not lock on start up on my HP W7/64 desktop. It does on my HP i3 laptop and also on this Asus W7/64 new build.
I have not spent a 't load of time trying to fix this issue, an hour's Googling etc perhaps, since like your problem, simply re-plugging the AI sorts it.

Did you install the AI TO THE BOOK??? Most USB devices need part of the software in place BEFORE you plug in the hardware.

Dave.
 
As a general rule, sleep mode and USB interfaces don't go well together. Turn off sleep mode when working with your laptop or desktop. That is the only way to cure the issue. I can't tell you why this happens, I just know it seems to be a common problem.
 
The other thing is to go to each USB hub and uncheck the box for sleep mode. Right click on Computer> Manage>Device Manager> USB Hub>Properties>Power Management.

USBPower.JPG
 
A final thing to turn off (if you haven't done so) is all the system sounds. These can sometimes make changes to sample rate and bit depth if the computer tries to beep going into or out of sleep mode.

But, yeah, you're better off shutting down and re-booting if there's going to be a few hour gap in proceedings.
 
I solved the problem by telling the Windows-Task-Scheduler "Restart Interface on every wake-up"

  1. I downloaded the Microsoft DevCon.exe as described here. It does not need to be installed.
  2. I looked in the device manager (Scarlett -> Properties -> Details -> Hardware-IDs) for the ID of my interface (mine has the ID USB\VID_1235&PID_8006)
  3. I created a batch file "restart_focusrite.bat", that restarts my Interface

    Code:
    @echo off
    echo "Restart Focusrite...."
    "D:\MyPrograms\Devcon\devcon.exe" disable "USB\VID_1235&PID_8006"
    "D:\MyPrograms\Devcon\devcon.exe" restart "USB\VID_1235&PID_8006"
    "D:\MyPrograms\Devcon\devcon.exe" enable  "USB\VID_1235&PID_8006"
  4. I created a windows task, that calls my batch file everytime the PC boots up from hibernation
    (Search for "Windows task Scheduler", it's not difficult to set up a task).
    As trigger, i used "On Event", Protocol "System", Source: "Power-Troubleshooter", "Event-ID 1"
    (That's the event that is shown in Windows event viewer when i wake from hibernation)
    As options i used "highest privilegues" (needed by devcon.exe), as Action i used "Start Program" with my .bat file

So far this works for me. Some of my programs (MusicBee) still cannot cope with the interface-reset and crash after waking, but it was the same when unplugging the interface.
Hope that helps some of you.

Edit: After trying this a couple of times: unfortunately it does not work in most cases (when audio is currently playing, devcon cannot disable the interface without the need of a reboot :( )

So i tried another approach which is ugly but works:
I downloaded AutoIt (which is available as a portable Version), and created a Script that replaced the .bat file in my old approach.
It's really hacky and completely tailored to my language, operating system and device (German, Win7 64, Scarlett 2I2). But if you have a basic understanding of programming, you can easily adapt it to your situation. The script does all the steps that i was formerly doing manually after each wake: going to the windows-sound-settings, changing the sample rate to a random rate and back to my old rate. That suffices to make the audio work again.

Code:
#include <WindowsConstants.au3>
#include <GuiTab.au3>
#include <GuiTreeView.au3>
#include <GuiListView.au3>
#include <GuiComboBox.au3>
#include <array.au3>

; 0) Deactivate playing music to avoid programm corruption on later reactivation
Send("{MEDIA_STOP}")

; 1) Close old Sound Control Panel
$windowTitle = "Sound"

$oldwindow = WinGetHandle($windowTitle)
If $oldWindow Then
	WinClose($oldWindow)
Endif

$oldWindow = WinGetHandle($windowTitle)

If $oldWindow Then
	MsgBox(48, "AutoIt Fehler", "Sound Control already opened. Exiting AutoIt Process")
	Exit 1
Endif

; 1b) Open new Sound Control Panel
Run("c:\windows\system32\control.exe mmsys.cpl")
WinActivate($windowTitle)
WinSetOnTop($windowTitle, "", 1)
WinWaitActive($windowTitle)


; 2) Find Tab
$window = WinGetHandle($windowTitle)
$tabBar = ControlGetHandle($window, "", "SysTabControl321")
$tabID = DllCall("user32.dll", "int", "GetDlgCtrlID", "hwnd", $tabBar)
$tabID = $TabID[0]

If Not $tabBar Then 
	MsgBox(48, "AutoIt Fehler", "Error when searching for the OutputDevice Tab")
	Exit 1
Endif

; 3) Select correct Tab Item
_GUICtrlTab_SetCurFocus($tabBar, 0)
$result = _SendMessage($window, $WM_NOTIFY, $tabID, $TCN_SELCHANGE)

If $result <> 0 Then 
	MsgBox(48, "AutoIt Fehler", "Error when selecting the OutputDevice Tab")
	Exit 1
Endif

; 4) Get List View
$listView = ControlGetHandle($window, "", "SysListView321");

If Not $listView Then
	MsgBox(48, "AutoIt Fehler", "Error when finding the list view")
	Exit 1
Endif

; 5) Find and select Scarlett
$scarlettTitle = "Ausgang"
$scarlettIndex = _GUICtrlListView_FindText($listView, $scarlettTitle, 0, True)

If $scarlettIndex == -1 Then
	MsgBox(48, "AutoIt Fehler", "Error when finding the Scarlett device >" & $scarlettTitle & "<")
	Exit 1
Endif

_GUICtrlListView_ClickItem ($listView, $scarlettIndex)

; 6) Hit "Eigenschaften"
ControlClick($windowTitle, "", 1003)

; 7a) Switch to "Advanced" Tab
$propertiesWindowTitle = "Eigenschaften von " & $scarlettTitle
WinWaitActive($propertiesWindowTitle)
$propertiesWindow = WinGetHandle($propertiesWindowTitle)

$advancedTitle = "Erweitert"
$propertiesTabControl = ControlGetHandle($propertiesWindow, "", 12320)
$advancedTabIndex = _GUICtrlTab_FindTab($propertiesTabControl, $advancedTitle)

If $advancedTabIndex == -1 Then
	MsgBox(48, "AutoIt Fehler", "Cannot find Tab index for >" & $advancedTitle & "<")
	Exit 1
Endif

_GUICtrlTab_ClickTab($propertiesTabControl, $advancedTabIndex)

; 7b) Get ComboBox
$sampleRateComboBoxID = 1410
$sampleRateComboBox = ControlGetHandle($propertiesWindow, "", $sampleRateComboBoxID)

If Not $sampleRateComboBox Then
	MsgBox(48, "AutoIt Fehler", "Cannot find Combo-Box in >" & $propertiesWindowTitle & "<")
	Exit 1
Endif

; 8) Set Combo Box items to a shitty samplerate...

; Function to ignore "Gerät zurücksetzen" warning
Func IgnoreWarning()
	$warningWindowTitle = "Gerät wird zurzeit verwendet"
	$warningWindow = WinGetHandle($warningWindowTitle)
	
	If $warningWindow Then
		; click Yes
		WinWaitActive($warningWindow)
		ControlClick($warningWindow, "", 6)
	Endif
EndFunc

; function to manually go through options, as the SetCurSel method does not notify the buttons to change their state -.-
Func SelectComboBoxItem($window, $comboBox, $desiredItemName, $applyButtionID)
	Local $oldIndex = _GUICtrlComboBox_GetCurSel($comboBox)

	WinWaitActive($window)
	ControlFocus($window, "", $comboBox);
	_GUICtrlComboBox_SetCurSel($comboBox, 1)
	Send("{UP}")
	; we are now at first item
	Local $index = 0
	Local $itemName
	_GUICtrlComboBox_GetLBText($comboBox, $index, $itemName)
	While ($itemName <> $desiredItemName)
		Send("{DOWN}")
		$index += 1
		
		If ($index >= _GUICtrlComboBox_GetCount($comboBox)) Then
			MsgBox(48, "AutoIt Fehler", "Cannot find Combo-Box item >" & $desiredItemName & "<")
			Exit 1
		Endif
				
		_GUICtrlComboBox_GetLBText($comboBox, $index, $itemName)
	WEnd
	
	If ($index == $oldIndex) Then
		MsgBox(48, "AutoIt Fehler", "Combo Box Item >" & $desiredItemName & "< already selected")
		Exit 1
	Endif
	
	; Hit "Apply"
	$isControlEnabled = ControlCommand($window, "", $applyButtionID, "IsEnabled")
	ControlClick($window, "", $applyButtionID)

	If Not $isControlEnabled Then
		MsgBox(48, "AutoIt Fehler", "Cannot apply new Combo Box Item (Index " & $index & ")")
		Exit 1
	Endif

	IgnoreWarning()
EndFunc

; Get Old Index and Name
$comboBoxItemIndexOld = _GUICtrlComboBox_GetCurSel($sampleRateComboBox)
$comboBoxItemNameOld  = "Invalid Name"
_GUICtrlComboBox_GetLBText($sampleRateComboBox, $comboBoxItemIndexOld, $comboBoxItemNameOld)

; Select New Index
$comboBoxTmpItemName = "2 Kanal, 16 Bit, 96000 Hz (Studioqualität)"

SelectComboBoxItem($propertiesWindow, $sampleRateComboBox, $comboBoxTmpItemName, 12321);

; 9) ... then back to old one
SelectComboBoxItem($propertiesWindow, $sampleRateComboBox, $comboBoxItemNameOld, 12321);

; 10) Apply by clicking OK
$success = ControlClick($propertiesWindowTitle, "", 1)
$success += ControlClick($windowTitle, "", 1)

If $success <> 2 Then
	MsgBox(48, "AutoIt Fehler", "Could not apply settings")
	Exit 1
Endif

; 11) Show Baloon tip and wait until display time ended
$message = "Resetted Scarlett Sample Rate"
TrayTip("AutoIt-Script", $message, 5)
sleep(5000)
 
Last edited:
Back
Top