xenolightning / AudioSwitcher_v1

Version 1 of Audio Switcher
Microsoft Public License
894 stars 90 forks source link

SetDefaultDevice times out due to invalid device - Catch Error #2125

Closed Mik3yZ closed 8 years ago

Mik3yZ commented 8 years ago

System.TimeoutException: COM operation 'SetDefaultDevice' did not complete in the requested time period. at AudioSwitcher.AudioApi.CoreAudio.CoreAudioDevice.SetAsDefault(CancellationToken cancellationToken) at FortyOne.AudioSwitcher.AudioSwitcher.Form_Load()

xenolightning commented 8 years ago

Most likely caused by the device being in an invalid state when trying to set it as the default.

I assume you have a start up device set.

The error doesn't mean much, it may have still set the default device, but it took longer than expected.

It's on the fix list for the next version.

And for some reason it's not included in 1.7.1, this issue can track it.

xenolightning commented 8 years ago

Duplicate of #2007

tony-ist commented 7 years ago

@xenolightning I got similar error when I pressed RMB on AudioSwitcher tray icon and selected headphones. Before that it had stopped switching to headphonesmy hotkey. Switching to speakers works fine. Earlier I had installed Audio Repeater and played with channeling (channelled headphones mic and line-in in one channel). Maybe this information could help.

Also I'll post stacktrace here, the report button doesn't seem to work in the report window.

System.TimeoutException: COM operation 'SetDefaultDevice' did not complete in the requested time period.
   at AudioSwitcher.AudioApi.CoreAudio.CoreAudioDevice.SetAsDefault(CancellationToken cancellationToken)
   at FortyOne.AudioSwitcher.AudioSwitcher.notifyIconStrip_ItemClicked(Object sender, ToolStripItemClickedEventArgs e)
   at System.Windows.Forms.ToolStrip.OnItemClicked(ToolStripItemClickedEventArgs e)
   at System.Windows.Forms.ToolStripDropDown.OnItemClicked(ToolStripItemClickedEventArgs e)
   at System.Windows.Forms.ToolStrip.HandleItemClick(ToolStripItem dismissingItem)
   at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
   at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ToolStrip.WndProc(Message& m)
   at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
tony-ist commented 7 years ago

@xenolightning Oops, restart fixed it so nevermind :D