-
Notifications
You must be signed in to change notification settings - Fork 9
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
MTC SessionsChanged and CurrentSessionChanged (FocusedSession) not triggering #6
Comments
Just to clarify:
Currently on Windows 10 Pro 21H2 build 19044.2130
Seems to be working fine, try rebooting/run any pending updates? |
As I mentioned above this behavior also occurs for Chrome and other processes. |
Hmmm, can you try changing that line and making it an asyc start? |
Actually digging more into it, the compiler seemed to be smart enough to replace GetAwaiter().GetResult() to its counterpart WindowsRuntimeSystemExtensions.GetAwaiter(GlobalSystemMediaTransportControlsSessionManager.RequestAsync()).GetResult() So generally, that could be ignored. Rereading this, if How does the UI sample look when doing these tests? |
I googled the issue and found this thread: Bug: Media Sessions are not updating in Windows 10 2004 |
Something I've noticed while I was integrating this library to Artemis and Aurora is: If you don't unsubscribe to the events and close your program the events won't trigger again. Maybe this library needs to use weak events or needs to unsubscribe with dispose methods |
Hmmm, I see, I started running into it now as well, I'll need to test with some reboots to confirm. |
After some testing, The issue goes away for me after logout+login, I haven't been able to purposely trigger it breaking again. |
Unless you guys think otherwise, I think this is more or less a Windows bug. Not quite sure where/how to report/debug it further. After some thinking though, a somewhat jank way around this is to have a background task to check if sessions changed by grabbing sessions and comparing them with the local dictionary. Would that be something you'd be interested in? |
Neither me or any of Aurora's and Artemis plugin users had this issue (reportedly). I think is is more of a Spotify bug. I've used this library for Chrome, Opera GX a lot and a little for Spotify to test library. Even Chrome and opera GX uses media sessions very differently, Spotify might use media sessions very different too. If it would help I can share how I use the library: |
It seems implausible to me that Spotify alone 'breaks' that event entirely. Needs some more research in general and I just need to throw more time into figuring out what event actually causes it to break. |
Also after some more digging, this is a reported issue in Windows Feedback Hub that is marked 'Looking into it' You need to have the 'Feedback Hub' app to be able to see this (which is slightly annoying). Screenshot for those that don't want to bother with the feedback hub: |
Version 2.3.0 adds a method called Until Microsoft fixes the issue, this is the best I can really do. |
Confirmed issue also affects CurrentSessionChanged event (what I named FocusedSession) |
I tried the example project in the repository, I am using Windows 10 Pro 21H2 build 19044.2006.
OnAnySessionOpened
event is raised only when you launch the program, any new media source can not be detected while the program is running.OnAnySessionClosed
event is not raised and instead theOnAnyPlaybackStateChanged
event is being called multiple times:If you try to reopen the closed media source, it is not detected neither.
The text was updated successfully, but these errors were encountered: