Comments (4)
Hey @larsk2009, well nice research so far. Unfortunately, I know this kind of issue... I came across a lot times with NAudio. It happens when you initialize a NAudio player from one thread and dispose it from another. I was able to solve the most issue by switching to direct sound and creating the AudioMaster.cs to handle the device removal events etc. So, I guess the difference with the bluetooth device is that I'm missing/not handling properly an event on AudioMaster. I will need to find a bluetooth device for testing it tho.
from flyleaf.
Yeah I did check the events in AudioMaster.cs, and the OnDefaultDeviceChanged
and OnDeviceRemoved
events do get fired when the bluetooth device gets connected or disconnected. I do agree it seems like a threading issue.
To make matters worse, I actually found with more testing that the issue happens every time when disconnecting the device, but only sometimes when connecting it.
from flyleaf.
Hey, as I don't have a bluetooth adapter and device to test if you want try to... test if initializing and disposing happens at the same thread... and if that's the problem.
AudioPlayer.cs:Initialize()
Log($"AudioPlayer initializing on thread {System.Threading.Thread.CurrentThread.ManagedThreadId}");
AudioPlayer.cs:Dispose()
if (player != null) Log($"AudioPlayer disposing on thread {System.Threading.Thread.CurrentThread.ManagedThreadId}");
I get different threads but Dispose is not hanging... maybe it is happening only for the bluetooth device.
I might have to create a thread only for all the naudio players for initializing/playing/disposing at the same thread. I'm afraid that it causes other issues as well. By looking at naudio's issues you will see a lot similar. Seems to be an issue with COM objects.
from flyleaf.
Should be fixed in v3.4.2. I wasn't able to test it so let me know if still not working!
from flyleaf.
Related Issues (20)
- FlyLeaf libraries and DPI challenges HOT 7
- May I ask if it is possible to restore the function of resuming playback without reconnecting the old version after interrupting the stream? HOT 1
- System. AccessionViolationException when ShowFramePrev HOT 2
- When multiple players play the same file, the sound may be louder or softer HOT 1
- Play Delay HOT 1
- Play Delay HOT 9
- if i want to save i frames only how can i do? HOT 1
- To get thumbnail of the video on seek bar HOT 1
- How to send commands directly to FFMPEG engine while video is loaded and playing HOT 3
- about key redefine~ HOT 2
- Audio render should be on different thread HOT 4
- Open/OpenAsync with ClearScreenOnOpen still shows black frame HOT 3
- I would like to print a specific part of the image by blurring it, is this possible? HOT 1
- About ShowFramePrev HOT 2
- Overlaps and Refresh in SharedOverlay
- Stream synchronization issue HOT 7
- Possible handle leak when repeatedly create/play/stop/dispose flyleaf players HOT 13
- Open stream at current position HOT 6
- FlyleafSharedOverlay in wpf ViewBox HOT 3
- Renderer: Level/Gamma Support HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flyleaf.