robvdpol / RaceControl

Race Control is a standalone, open source F1TV client for Windows, written in C# on the .NET platform.
GNU General Public License v3.0
1.19k stars 95 forks source link

[BUG] Internal player freezes when sound output changes #169

Open fvannee opened 3 years ago

fvannee commented 3 years ago

Describe the bug Race Control freezes/crashes when internal player is playing and sound output changes from speaker to just-connected Bluetooth headset.

To Reproduce Steps to reproduce the behavior:

  1. Play a stream with internal player
  2. Connect a Bluetooth headset (not sure if it's relevant that it's Bluetooth or not - could well be the case that any change in sound output device triggers this)
  3. The stream freezes and becomes unresponsive

Expected behavior Sound output changes from speakers to headset

Desktop (please complete the following information):

Additional context Couldn't find anything interesting in the .log file when it occurs

larsk2009 commented 3 years ago

For me the stream does not actually freeze when connecting a BT headset, but it does not transfer the audio to it. I have to close the feed and open it again. This is happening when I just use the watch button to watch the stream. I think that would be the internal player.

If this is something you want to fix @robvdpol, I can have a look at it if you want.

larsk2009 commented 3 years ago

@robvdpol @fvannee The issue might be in Flyleaf, I have created this issue there to track it.

Jacco011 commented 3 years ago

I got the problem but it worked fine last week. Any Windows Update that cause this problem?

2021-06-28 11:32:45.1423 ERROR An unhandled exception occurred. System.TypeInitializationException: The type initializer for 'FlyleafLib.Master' threw an exception. ---> System.Runtime.InteropServices.COMException (0x80070490): Element not found. (0x80070490) at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode) at NAudio.CoreAudioApi.MMDeviceEnumerator.GetDefaultAudioEndpoint(DataFlow dataFlow, Role role) at FlyleafLib.AudioMaster.Initialize() at FlyleafLib.AudioMaster..ctor() at FlyleafLib.Master..cctor() --- End of inner exception stack trace --- at FlyleafLib.Master.RegisterFFmpeg(String absolutePath, Int32 verbosity) at RaceControl.App.Initialize() in D:\Projects\RaceControl\RaceControl\RaceControl\App.xaml.cs:line 63 at Prism.PrismApplicationBase.InitializeInternal() at Prism.PrismApplicationBase.OnStartup(StartupEventArgs e) at RaceControl.App.OnStartup(StartupEventArgs e) in D:\Projects\RaceControl\RaceControl\RaceControl\App.xaml.cs:line 56 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)