TobyTentakel 24 Posted March 30 Posted March 30 For quite some time I have a strange problem that I am not sure if it's caused in the Emby server or the Embycon client. I have the latest Emby beta server running on a Synology and the latest Embycon unter the latest Libreelec/Kodi on a Raspberry Pi, connected via ethernet. Browsing is relatively fast, but whenever I start a video or stop it, I have a delay of 2 to 3 minutes. While the video is playing, there are no problems, delays, lag, etc. This happens consistently and independently of the video source (with or without transcoding, low or high resolution, etc.) I did an analysis of the log file on the server and saw that for the most part, responses to requests came within a few milliseconds, as expected. However, updating or querying the playstate for the selected item (PlaystateService/ItemsService) always takes long (20+40+60 seconds in the example below). Any idea what could be causing this and where I should look? Quote 2025-03-30 15:24:36.298 Info VideoService-0HNAPK35QSV1L:00000002: http/1.1 Response 200 to host2. Time: 7ms. HEAD http://192.168.2.112:8096/emby/videos/1882857/original.mp4?DeviceId=b83a444759034c548f87352c5907ad07&MediaSourceId=mediasource_1882857&PlaySessionId=ba911d6896ed445587606eb89bb4488a&api_key=x_secret2_x 2025-03-30 15:24:40.434 Info PlaystateService-0HNAPK35QSV1M:00000001: http/1.1 POST http://192.168.2.112:8096/emby/Sessions/Playing/Stopped?. Source Ip: host2, UserAgent: EmbyCon-1.11.37 2025-03-30 15:24:40.435 Info SessionManager: Playback stopped reported by app Kodi EmbyCon 1.11.37 on EmbyCon playing Mr. Bean: The Animated Series - S4, Ep16 - Bei den Pfadfindern. Position: 646152 ms. PlaySessionId: ba911d6896ed445587606eb89bb4488a 2025-03-30 15:24:40.456 Info SessionManager: Removed playSession ba911d6896ed445587606eb89bb4488a from session 34d22dd6ead21231e106c222ca701b27 2025-03-30 15:24:40.456 Info PlaystateService-0HNAPK35QSV1M:00000001: http/1.1 Response 204 to host2. Time: 23ms. POST http://192.168.2.112:8096/emby/Sessions/Playing/Stopped? 2025-03-30 15:24:40.525 Info HlsSegmentService-0HNAPK35QSV1O:00000001: http/1.1 DELETE http://192.168.2.112:8096/emby/Videos/ActiveEncodings?DeviceId=b83a444759034c548f87352c5907ad07. Source Ip: host2, Host=192.168.2.112:8096, User-Agent=EmbyCon-1.11.37, Accept-Charset=UTF-8,*, Accept-Encoding=gzip, X-Emby-Authorization=MediaBrowser UserId="7fc799abad1e4981ab174ff0d8a690ec",Client="Kodi EmbyCon",Device="EmbyCon",DeviceId="b83a444759034c548f87352c5907ad07",Version="1.11.37", X-MediaBrowser-Token=x_secret2_x 2025-03-30 15:24:40.525 Info HlsSegmentService-0HNAPK35QSV1O:00000001: http/1.1 Response 204 to host2. Time: 4ms. DELETE http://192.168.2.112:8096/emby/Videos/ActiveEncodings?DeviceId=b83a444759034c548f87352c5907ad07 2025-03-30 15:24:40.571 Info PlaystateService-0HNAPK35QSV1P:00000001: http/1.1 POST http://192.168.2.112:8096/emby/Users/7fc799abad1e4981ab174ff0d8a690ec/PlayedItems/1882857?. Source Ip: host2, UserAgent: EmbyCon-1.11.37 2025-03-30 15:24:59.792 Info PlaystateService-0HNAPK35QSV1P:00000001: http/1.1 Response 200 to host2. Time: 19220ms. POST http://192.168.2.112:8096/emby/Users/7fc799abad1e4981ab174ff0d8a690ec/PlayedItems/1882857? 2025-03-30 15:25:38.653 Info ItemsService-0HNAPK35QSV1R:00000001: http/1.1 Response 500 to host2. Time: 38762ms. GET http://192.168.2.112:8096/emby/Users/7fc799abad1e4981ab174ff0d8a690ec/Items?Recursive=True&limit=1&Fields=DateCreated,Etag&SortBy=DatePlayed&SortOrder=Descending&IncludeItemTypes=Movie,Episode,Audio&ImageTypeLimit=0&format=json 2025-03-30 15:25:57.612 Info ItemsService-0HNAPK35QSV1S:00000001: http/1.1 Response 500 to host2. Time: 57721ms. GET http://192.168.2.112:8096/emby/Users/7fc799abad1e4981ab174ff0d8a690ec/Items?Recursive=True&limit=1&Fields=DateCreated,Etag&SortBy=DateCreated&SortOrder=Descending&IncludeItemTypes=Movie,Episode,Audio&ImageTypeLimit=0&format=json 2025-03-30 15:25:57.745 Info TvShowsService-0HNAPK35QSV1T:00000001: http/1.1 Response 500 to host2. Time: 48066ms. GET http://192.168.2.112:8096/emby/Shows/7606/Seasons?userId=7fc799abad1e4981ab174ff0d8a690ec&Fields=DateCreated,EpisodeCount,SeasonCount,Path,Genres,Studios,Etag,Taglines,SortName,RecursiveItemCount,ChildCount,ProductionLocations,CriticRating,OfficialRating,CommunityRating,PremiereDate,ProductionYear,AirTime,Status,Tags,MediaStreams,Overview&format=json 2025-03-30 15:27:20.534 Info MediaInfoService-0HNAPK35QSV29:00000001: http/1.1 POST http://192.168.2.112:8096/emby/Items/8979/PlaybackInfo?MaxStreamingBitrate=75000000. Source Ip: host2, UserAgent: EmbyCon-1.11.37 2025-03-30 15:27:20.538 Info App: User policy for O. EnablePlaybackRemuxing: True EnableVideoPlaybackTranscoding: True EnableAudioPlaybackTranscoding: True 2025-03-30 15:27:20.538 Info SessionManager: Adding playSession 0395d225141f487ab4cbcbb695148013 to session 34d22dd6ead21231e106c222ca701b27 2025-03-30 15:27:20.538 Info MediaInfoService-0HNAPK35QSV29:00000001: http/1.1 Response 200 to host2. Time: 4ms. POST http://192.168.2.112:8096/emby/Items/8979/PlaybackInfo?MaxStreamingBitrate=75000000
TeamB 2412 Posted March 30 Posted March 30 so what is the actual delay, is it when you start playback, i.e you hit play and then there is a 3 min delay before the video starts? can you explain a little more exactly what you are seeing. i am not sure what is going on in the server logs, the best place to look for the delay cause would be on the client, turn on embycon debug logging in the embycon settings under advanced in the plugin settings, restart embycon and reproduce the problem. if there is nothing obvious you could try turning on kodi wide debug logging in the kodi setting. if you have both a full debug log for both the server and client you can compare some timings to try to work out if it is the server or client causing the issue.
TobyTentakel 24 Posted March 31 Author Posted March 31 Yes, I hit play, then wait several minutes, then playback starts. I have full Embycon and Kodi logs as well. The timeout setting is 30 seconds, so the first request (with 20s) comes through, the second and third commands with 40 and 60 seconds will run into a timeout on the client. I assume the issue is on the server as the commands are all received there but take a long processing time there.
TobyTentakel 24 Posted March 31 Author Posted March 31 No, all other operations except play start/stop work relatively normal, i.e. maximum a second delay or so in Embycon. When using the web browser interface or the Emby Android app, there are also no delays, not even for start/stop Could it be that there is too much data to synchronize for movie watched state, i.e. the database queries/updates take too long on the server?
TeamB 2412 Posted March 31 Posted March 31 that should effect all clients not just embycon though. it looks like there are some 500 responce codes in the original server log file, are there any errors in your server logs?
TobyTentakel 24 Posted March 31 Author Posted March 31 But it only happens with Embycon I think the 500 response happens when the client timeout of 30 seconds is reached and the server takes longer and can then no longer send back the response.
TeamB 2412 Posted March 31 Posted March 31 On 3/31/2025 at 5:46 AM, TobyTentakel said: 2025-03-30 15:25:57.745 Info TvShowsService-0HNAPK35QSV1T:00000001: http/1.1 Response 500 to host2. Time: 48066ms. GET http://192.168.2.112:8096/emby/Shows/7606/Seasons?userId=7fc799abad1e4981ab174ff0d8a690ec&Fields=DateCreated,EpisodeCount,SeasonCount,Path,Genres,Studios,Etag,Taglines,SortName,RecursiveItemCount,ChildCount,ProductionLocations,CriticRating,OfficialRating,CommunityRating,PremiereDate,ProductionYear,AirTime,Status,Tags,MediaStreams,Overview&format=json i have no idea why you queries are taking so long, the above one is just getting a season list. you could try appending a api_key= to the end and trying it in your browser, you would need to create an api key in the server bashboard. @Luke any idea why the requests like the one above is taking so long? luke will probably need a full server log
quickmic 1602 Posted Sunday at 11:12 AM Posted Sunday at 11:12 AM Server request can trigger metadata pulls from the internet and this could take very long. Impossible to say without a full server log.
TobyTentakel 24 Posted Sunday at 11:32 AM Author Posted Sunday at 11:32 AM server logs are available in the other thread I opened:
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now