davkean / audio-switcher

App that lets you easily switch Windows audio devices
MIT License
382 stars 53 forks source link

Error upon switching. #30

Closed TravisDean closed 9 years ago

TravisDean commented 9 years ago

I got a dialogue box with an error containing this information when I tried to switch audio devices from my USB headphones to my speakers. I tried to switch right after starting to play a song in Spotify. This also forced spotify to quit.

See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.NotImplementedException: PropVariant VT_EMPTY
   at AudioSwitcher.Audio.Interop.PropVariant.get_Value() in C:\Users\Travis\Projects\_3rdPartySource\audio-switcher\src\AudioSwitcher\Audio\Interop\MMAudio\PropVariant.cs:line 197
   at AudioSwitcher.Audio.PropertyStoreProperty.get_Value() in C:\Users\Travis\Projects\_3rdPartySource\audio-switcher\src\AudioSwitcher\Audio\Interop\MMAudio\PropertyStoreProperty.cs:line 64
   at AudioSwitcher.Audio.PropertyStore.TryGetValue(PropertyKey key, Object& value) in C:\Users\Travis\Projects\_3rdPartySource\audio-switcher\src\AudioSwitcher\Audio\Interop\MMAudio\PropertyStore.cs:line 142
   at AudioSwitcher.Audio.AudioDevice.get_DeviceFriendlyName() in C:\Users\Travis\Projects\_3rdPartySource\audio-switcher\src\AudioSwitcher\Audio\AudioDevice.cs:line 83
   at AudioSwitcher.UI.ViewModels.AudioDeviceViewModel.UpdateStatus(AudioDeviceManager deviceManager) in C:\Users\Travis\Projects\_3rdPartySource\audio-switcher\src\AudioSwitcher\UI\ViewModels\AudioDeviceViewModel.cs:line 80
   at AudioSwitcher.UI.ViewModels.AudioDeviceViewModelManager.OnDefaultDeviceChanged(Object sender, DefaultAudioDeviceEventArgs e) in C:\Users\Travis\Projects\_3rdPartySource\audio-switcher\src\AudioSwitcher\UI\ViewModels\AudioDeviceViewModelManager.cs:line 115
   at AudioSwitcher.Audio.AudioDeviceManager.<>c__DisplayClass6.<AudioSwitcher_Audio_Interop_IMMNotificationClient_OnDefaultDeviceChanged>b__7() in C:\Users\Travis\Projects\_3rdPartySource\audio-switcher\src\AudioSwitcher\Audio\AudioDeviceManager.cs:line 187
   at AudioSwitcher.Audio.AudioDeviceManager.<>c__DisplayClass10.<InvokeOnSynchronizationContext>b__11(Object state) in C:\Users\Travis\Projects\_3rdPartySource\audio-switcher\src\AudioSwitcher\Audio\AudioDeviceManager.cs:line 223

************** Loaded Assemblies **************
mscorlib
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.7.0 built by: NETFXREL1
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
AudioSwitcher
    Assembly Version: 0.1.0.0
    Win32 Version: 0.1.0.0
    CodeBase: file:///C:/Users/Travis/Projects/_3rdPartySource/audio-switcher/src/AudioSwitcher/bin/Debug/AudioSwitcher.exe
----------------------------------------
System.ComponentModel.Composition
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.7.0
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.ComponentModel.Composition/v4.0_4.0.0.0__b77a5c561934e089/System.ComponentModel.Composition.dll
----------------------------------------
System.Core
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.7.0 built by: NETFXREL1
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.7.0 built by: NETFXREL1
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Windows.Forms
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.7.0 built by: NETFXREL1
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.7.0 built by: NETFXREL1
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.7.0 built by: NETFXREL1
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.7.0 built by: NETFXREL1
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
MetadataViewProxies_29a73af8-171c-43e3-8633-4c51b83b5bf3
    Assembly Version: 0.0.0.0
    Win32 Version: 4.6.7.0
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.ComponentModel.Composition/v4.0_4.0.0.0__b77a5c561934e089/System.ComponentModel.Composition.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.

@ByteBlast Thanks!

AlexArchive commented 9 years ago

I cannot speak for @davkean, but I would personally find the error much easier to read if it was formatted properly (perhaps as a code block).

davkean commented 9 years ago

Thanks. This looks similar to: https://github.com/davkean/audio-switcher/issues/24. Basically, I'm not handling the fact that devices appear and disappear.

Do you have a consistent repro? If so, I'll keep this open instead of duplicating it, and get you to test my fix over the weekend.

TravisDean commented 9 years ago

I haven't been able to reproduce the error, sorry. I'll still try it out if you like though.

davkean commented 9 years ago

Okay, I'll dupe it against #24 - I'm pretty sure it's the same issue. Thanks for filing!