Nerixyz / current-song2

Display the currently playing song/audio.
https://currentsong.nerixyz.de
89 stars 7 forks source link

Every time I play a new video I get the following error in current_song2.log (WARN gsmtc::manager: Could not get current sessions, error) #148

Open gwin7ok opened 2 years ago

gwin7ok commented 2 years ago

When playing a youtube video on chrome and using currentsong2 to display the video information on OBS, Every time I play a new video I get the following error in current_song2.log

2022-09-27T21:56:40.347934Z WARN gsmtc::manager: Could not get current sessions, error: この操作を正しく終了しました。 2022-09-27T21:56:40.348248Z WARN gsmtc::manager: Could not get current sessions, error: この操作を正しく終了しました。 2022-09-27T21:56:40.348439Z WARN gsmtc::manager: Could not get current sessions, error: この操作を正しく終了しました。 2022-09-27T21:56:40.350553Z WARN gsmtc::manager: Could not get current sessions, error: この操作を正しく終了しました。 2022-09-27T21:56:40.350577Z WARN gsmtc::manager: Could not get current sessions, error: この操作を正しく終了しました。

However, it does not mean that something is wrong with the operation Also, this error will not be output if OBS is not started

currentsong2 is running with administrator privileges

Version of current_song2: v0.1.0-alpha.7

chrome version: バージョン: 105.0.5195.127(Official Build) (64 ビット)

OBS version: 28.0.02 ss002 - Properties for 'current song2 info' ss003 - OBS 28 0 2 (64-bit, windows) - Profile: ニコニコ生放送 - Scenes: RemotePlay ss004 - C:¥CurrentSong2¥current_song2 log * - EmEditor

Nerixyz commented 2 years ago

The error you're seeing is probably because I'm not checking for null/None when sessions are updated, I'll try to do that. Though I'm not sure if that's the root of the problem.

Nerixyz commented 2 years ago

So the spam is only an indicator that the current session is null i.e. there's no current session (i fixed that in #154). You can observe this by checking the media overlay when e.g. pressing volume up/down or play/pause. There shouldn't be any application listed.

GSMTC uses the information Windows provides. It's 1:1 the information displayed in the media overlay I mentioned. If an application isn't listed there, it can't be picked up by current-song. We don't use the CurrentSessionChanged event however since it's inaccurate. We use the events from each session to compute the current session.