Skip to content
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

MPV shim needs to reconfigured server on every startup #344

Open
karserasl opened this issue Jul 23, 2023 · 4 comments
Open

MPV shim needs to reconfigured server on every startup #344

karserasl opened this issue Jul 23, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@karserasl
Copy link

Describe the bug
The mpv shim on every startup, needs to reconfigure the server to be able to connect.
It does not shown in the cast menu of Jellyfin.
There are sometimes that if i open a second instance of mpv shim on top of the first one, the 2nd one is connected.
To Reproduce
Steps to reproduce the behavior:

  1. Jellyfin is running and mpv shim has a working connection
  2. Close mpv shim and reopen it
  3. Now it needs to reconfigured the server to get a new connection

Expected behavior
It should reconnect on reopen, if the Jellyfin server wasnt restarted before.

Desktop (please complete the following information):

  • OS: Windows (mpv-shim), Linux (Jellyfin)
  • Version 2.6.0. latest for Jellyfin

Error Messages

2023-07-23 16:17:05,784 [ WARNING] clients: Partially connected. Retrying 3/3.
2023-07-23 16:17:06,797 [ DEBUG] JELLYFIN.jellyfin_apiclient_python.client: JellyfinClient initializing...
2023-07-23 16:17:06,797 [ DEBUG] JELLYFIN.jellyfin_apiclient_python.configuration: Configuration initializing...
2023-07-23 16:17:06,797 [ DEBUG] JELLYFIN.jellyfin_apiclient_python.configuration: Begin http constructor.
2023-07-23 16:17:06,797 [ DEBUG] JELLYFIN.jellyfin_apiclient_python.ws_client: WSClient initializing...
2023-07-23 16:17:06,797 [ DEBUG] JELLYFIN.jellyfin_apiclient_python.connection_manager: ConnectionManager initializing...
2023-07-23 16:17:06,797 [ DEBUG] JELLYFIN.jellyfin_apiclient_python.credentials: Credentials initializing...
2023-07-23 16:17:06,797 [ DEBUG] JELLYFIN.jellyfin_apiclient_python.configuration: Begin app constructor.
2023-07-23 16:17:06,797 [ INFO] JELLYFIN.jellyfin_apiclient_python.connection_manager: Begin connect
2023-07-23 16:17:06,797 [ INFO] JELLYFIN.jellyfin_apiclient_python.connection_manager: Begin getAvailableServers
2023-07-23 16:17:06,797 [ DEBUG] JELLYFIN.jellyfin_apiclient_python.credentials: credentialsupdated
2023-07-23 16:17:06,797 [ INFO] JELLYFIN.jellyfin_apiclient_python.connection_manager: connect has 1 servers
2023-07-23 16:17:06,797 [ INFO] JELLYFIN.jellyfin_apiclient_python.connection_manager: begin connect_to_server
2023-07-23 16:17:06,797 [ INFO] JELLYFIN.jellyfin_apiclient_python.api: Sending get request to system/info/public
2023-07-23 16:17:06,797 [ DEBUG] JELLYFIN.jellyfin_apiclient_python.api: 5
2023-07-23 16:17:06,797 [ DEBUG] JELLYFIN.jellyfin_apiclient_python.api: {'Accept': 'application/json', 'Content-type': 'application/x-www-form-urlencoded; charset=UTF-8', 'X-Application': 'Jellyfin MPV Shim/2.6.0', 'Accept-Charset': 'UTF-8,', 'Accept-encoding': 'gzip', 'User-Agent': 'Jellyfin-MPV-Shim/2.6.0', 'x-emby-authorization': 'MediaBrowser Client=Jellyfin MPV Shim, Device=desk, DeviceId=71e96c66-c531-42ff-8393-f1e78331418b, Version=2.6.0'}
2023-07-23 16:17:06,798 [ DEBUG] urllib3.connectionpool: Starting new HTTP connection (1): 192.168.xxx.xxx:8097
2023-07-23 16:17:06,802 [ DEBUG] urllib3.connectionpool: http://192.168.xxx.xxx:8097 "GET /system/info/public HTTP/1.1" 200 None
2023-07-23 16:17:06,802 [ INFO] JELLYFIN.jellyfin_apiclient_python.connection_manager: calling onSuccessfulConnection with server Tzelly
2023-07-23 16:17:06,802 [ INFO] JELLYFIN.jellyfin_apiclient_python.api: Sending get request to system/info
2023-07-23 16:17:06,802 [ DEBUG] JELLYFIN.jellyfin_apiclient_python.api: 5
2023-07-23 16:17:06,802 [ DEBUG] JELLYFIN.jellyfin_apiclient_python.api: {'Accept': 'application/json', 'Content-type': 'application/x-www-form-urlencoded; charset=UTF-8', 'X-Application': 'Jellyfin MPV Shim/2.6.0', 'Accept-Charset': 'UTF-8,
', 'Accept-encoding': 'gzip', 'User-Agent': 'Jellyfin-MPV-Shim/2.6.0', 'x-emby-authorization': 'MediaBrowser Client=Jellyfin MPV Shim, Device=desk, DeviceId=71e96c66-c531-42ff-8393-f1e78331418b, Version=2.6.0', 'X-MediaBrowser-Token': 'REDACTED'}
2023-07-23 16:17:06,803 [ DEBUG] urllib3.connectionpool: Starting new HTTP connection (1): 192.168.xxx.xxx:8097
2023-07-23 16:17:06,832 [ DEBUG] urllib3.connectionpool: http://192.168.xxx.xxx:8097 "GET /system/info HTTP/1.1" 200 None
2023-07-23 16:17:06,833 [ DEBUG] JELLYFIN.jellyfin_apiclient_python.credentials: credentialsupdated
2023-07-23 16:17:06,833 [ DEBUG] JELLYFIN.jellyfin_apiclient_python.connection_manager: resolving connect with result: {'Servers': "[{'address': 'http://192.168.xxx.xxx:8097', 'Name': 'Tzelly', 'Id': '6f36b8a495fb46ba9b9af34aa7c6dd23', 'DateLastAccessed': '2023-07-23T16:17:06Z', 'UserId': '0e428c4cff3d4adcb1288ec84d4165e1', 'AccessToken': 'REDACTED', 'Users': [{'Id': '0e428c4cff3d4adcb1288ec84d4165e1', 'IsSignedInOffline': True}], 'uuid': '8f1e2218-7505-479b-b780-d8af240602ea', 'username': 'lam', 'connected': True}]", 'State': 3}
2023-07-23 16:17:06,833 [ INFO] JELLYFIN.jellyfin_apiclient_python.client: User is authenticated.
2023-07-23 16:17:06,833 [ DEBUG] urllib3.util.retry: Converted retries value: 3 -> 'Retry(total=3, connect=None, read=None, redirect=None, status=None)'
2023-07-23 16:17:06,833 [ DEBUG] urllib3.util.retry: Converted retries value: 3 -> 'Retry(total=3, connect=None, read=None, redirect=None, status=None)'
2023-07-23 16:17:06,833 [ INFO] JELLYFIN.jellyfin_apiclient_python.ws_client: Websocket url: ws://192.168.xxx.xxx:8097/socket?api_key=REDACTEDREDACTED&device_id=71e96c66-c531-42ff-8393-f1e78331418b
2023-07-23 16:17:06,834 [ DEBUG] urllib3.connectionpool: Starting new HTTP connection (1): 192.168.xxx.xxx:8097
2023-07-23 16:17:06,841 [ INFO] websocket: Websocket connected
2023-07-23 16:17:06,841 [ INFO] JELLYFIN.jellyfin_apiclient_python.ws_client: --->[ websocket ]
2023-07-23 16:17:06,841 [ DEBUG] event_handler: Unhandled Event WebSocketConnect: None
2023-07-23 16:17:07,628 [ DEBUG] JELLYFIN.jellyfin_apiclient_python.ws_client: ForceKeepAlive received from server.
2023-07-23 16:17:07,628 [ DEBUG] JELLYFIN.jellyfin_apiclient_python.ws_client: KeepAlive received from server.
2023-07-23 16:17:08,653 [ DEBUG] urllib3.connectionpool: http://192.168.xxx.xxx:8097 "POST /Sessions/Capabilities/Full HTTP/1.1" 204 0
2023-07-23 16:17:08,657 [ DEBUG] urllib3.connectionpool: http://192.168.xxx.xxx:8097 "GET /Sessions?ControllableByUserId=0e428c4cff3d4adcb1288ec84d4165e1 HTTP/1.1" 200 None
2023-07-23 16:17:08,657 [ WARNING] clients: Client is not actually connected. (It does not show in the client list.)

@karserasl karserasl added the bug Something isn't working label Jul 23, 2023
@vincejv
Copy link

vincejv commented Dec 31, 2023

Desktop (please complete the following information):
OS: Windows (mpv-shim), Linux (Jellyfin)

Same issue on MPV-Shim for Linux, on Ubuntu 22.04.03 LTS, Kernel 6.6.8, MPV Shim 2.6.0, it does not happen consistently though, sometimes it needs to be reconfigured, sometimes it does not

@G2COMMANDER
Copy link

G2COMMANDER commented Feb 10, 2024

as mentioned by Izzie in Issue 331, it appears to have been "enable_osc" being enabled which causes this bug. My fix was to change "enable_osc" to false which solved my "reconnecting" problem.

I'm currently running MPV Shim 2.6.0 on kernel 6.1.0-13-amd64 Debian 6.1.55-1 (2023-09-29) (MX Linux)

@willforde
Copy link

Unfortunately disabling "enable_osc" did not fix it for me. 😞
I have tried a few other things but no go.

@vincejv
Copy link

vincejv commented May 29, 2024

Does shim need this fix?
jellyfin/jellyfin-web#5566

It fixes itself after a couple of restarts (restart of mpv shim), seems to exhibit the same behavior before that bug was fixed in jellyfin-web

Having an address that is not always connectable causes our Android users to be unable to reliably connect to the server. It also breaks many reverse-proxy setups, as this address exposed by the server usually bypasses the proxy unless explicitly configured by the user. This has far more negative impact than the benifit it brings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants