jellyfin / jellyfin-mpv-shim

MPV Cast Client for Jellyfin
Other
1.59k stars 93 forks source link

Losing connection to the server requires restart #295

Open clearedTakeoff opened 2 years ago

clearedTakeoff commented 2 years ago

Describe the bug I'm not sure if this even is a bug or the behavior is intended but I've been having issues with keeping jellyfin-mpv-shim constantly running. Occasionally the app will lose connection to the server (and there is no shim entry in the cast menu) and then won't reconnect unless I restart the app. This usually happens while the laptop is inactive and the screen gets locked but occasionally also happens immediately after starting the app. In general I don't think this should be a connection issue since after restart everything works almost instantly.

What I'm wondering is what is the expected behavior when shim temporarily loses connection to the server (for example due to power saving settings), as far as I can see it is supposed to attempt and reconnect as soon as the network is back or are there any exceptions to this? Is there anything I can do to make this more robust and keep it "always on"?

Also note that I'm assuming when shim disappears from list of cast clients, it's a sign that it lost its connection to server. Is that correct?

To Reproduce Unfortunately I don't have reliable way to reproduce this. As said above it usually happens after the laptop is inactive for a while but not always.

Expected behavior Ideally I would want to start shim on startup and then not have to touch it at all. If it loses connection to server it would reconnect on its own without having to restart the app.

Desktop (please complete the following information):

Error Messages I saved a few logs when this happened but I'm not able to decode a reason for why this would happen, sadly I don't remember if any of this happened while the screen was locked or not

First log is an example of when this happened on startup of app. Server configuration window opened on startup but it said that connection is ok although log specifically says that client is not connected.

In second log you can see the connection to remote host was lost and the next try should be in 1 second but nothing happened after that. I saved the log about 30 mins after last entry.

Last log initially has some connection issues but it just suddenly seems to stop receiving KeepAlive packets (this one was also saved 15 mins after the last entry)

ghost commented 1 year ago

When I reboot my laptop with shim open it never appears in the list of casts until I manually remove my login credentials from server configuration and add them again. Commenting here since it sounds a lot like it's related to this issue.

tilda commented 1 year ago

Can reproduce what @Hatrask is saying here. Appears that sometime ago I probably rebooted while the shim application was open and started getting this issue - my log basically looks identical to the first one in OP. Removing and readding the server to config fixed it.