Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash on startup #10

Closed
ValMenn opened this issue Mar 26, 2016 · 4 comments
Closed

Crash on startup #10

ValMenn opened this issue Mar 26, 2016 · 4 comments

Comments

@ValMenn
Copy link

ValMenn commented Mar 26, 2016

Windows 10 - tried both built and downloaded versions:
Message: Element not found. (Exception from HRESULT: 0x80070490)
Detail: System.Runtime.InteropServices.COMException (0x80070490): Element not found. (Exception from HRESULT: 0x80070490)
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
at NAudio.CoreAudioApi.MMDeviceEnumerator.GetDefaultAudioEndpoint(DataFlow dataFlow, Role role)
at SWYH.Audio.WasapiProvider..ctor() in c:\Users\Val\SWYH\SWYH\Audio\WasapiProvider.cs:line 59
at SWYH.App.Application_Startup(Object sender, StartupEventArgs e) in c:\Users\Val\SWYH\SWYH\App.xaml.cs:line 98
at System.Windows.Application.OnStartup(StartupEventArgs e)
at System.Windows.Application.<.ctor>b__1_0(Object unused)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
at System.Windows.Application.RunDispatcher(Object ignore)
at System.Windows.Application.RunInternal(Window window)
at System.Windows.Application.Run(Window window)
at SWYH.App.Main() in d:\SWYH\SWYH\obj\x86\Release\App.g.cs:line 0

@sebastienwarin
Copy link
Member

@ValMenn
Copy link
Author

ValMenn commented Mar 28, 2016

What you suggested did not work, but I found the problem. IMMDeviceEnumerator::GetDefaultAudioEndpoint retuen ERROR_NOT_FOUND when there are no devices. I have Bluetooth earphones that are off when I'm not listening. When I turn them on, the program starts fine. To repro, disable all playback devices.

@SaiYuen
Copy link
Contributor

SaiYuen commented Dec 16, 2016

Hello,
I reproduce is issues and I check the error log. It seems that you do not have a working sound device.please check your sound device is fully working. Make sure you have working devices in your playback devices in Control Panel and set it as default. If it shows not plugged in. Please try to plug a earphone or cable to let your sound card working.

@sebastienwarin
Copy link
Member

SaiYuen fixes this application crash by showing an error message if no audio interface is detected #15
You need to check your playback device in the Windows Control Panel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants