Jump to content

Media very slow to start on Raspberry Pi


Guest

Recommended Posts

I have a couple Pi B+es running the latest OSMC (Kodi 15.2-RC2), using the Emby plugin version 1.1.39. Media syncs just fine, but playing any media takes 10-15 seconds before it starts playing. Looking at the logs, it seems that the plugin takes a long time to start up:

<snip>
15:05:02 72559.093750 T:3025760816   DEBUG: OnPlayMedia plugin://plugin.video.emby/movies/9a7157f73151a9a670f35fa7aef238ed/?filename=test.mp4&id=9a7157f73151a9a670f35fa7aef238ed&mode=play
15:05:02 72559.093750 T:3025760816   DEBUG: CAnnouncementManager - Announcement: OnClear from xbmc
15:05:02 72559.093750 T:3025760816   DEBUG: GOT ANNOUNCEMENT, type: 2, from xbmc, message OnClear
15:05:02 72559.101562 T:3025760816   DEBUG: CAnnouncementManager - Announcement: OnAdd from xbmc
15:05:02 72559.101562 T:3025760816   DEBUG: GOT ANNOUNCEMENT, type: 2, from xbmc, message OnAdd
15:05:02 72559.109375 T:3025760816   DEBUG: StartScript - calling plugin Emby('plugin://plugin.video.emby/movies/9a7157f73151a9a670f35fa7aef238ed/','8','?filename=test.mp4&id=9a7157f73151a9a670f35fa7aef238ed&mode=play')
15:05:02 72559.117188 T:2583688224  NOTICE: Thread LanguageInvoker start, auto delete: false
15:05:02 72559.117188 T:3025760816   DEBUG: WaitOnScriptResult - waiting on the Emby (id=18) plugin...
15:05:02 72559.117188 T:2583688224    INFO: initializing python engine.
15:05:02 72559.117188 T:2583688224   DEBUG: CPythonInvoker(18, /home/osmc/.kodi/addons/plugin.video.emby/default.py): start processing
15:05:04 72560.414062 T:2583688224  NOTICE: -->Python Interpreter Initialized<--
15:05:04 72560.414062 T:2583688224   DEBUG: CPythonInvoker(18, /home/osmc/.kodi/addons/plugin.video.emby/default.py): the source file to load is "/home/osmc/.kodi/addons/plugin.video.emby/default.py"
15:05:04 72560.414062 T:2583688224   DEBUG: CPythonInvoker(18, /home/osmc/.kodi/addons/plugin.video.emby/default.py): setting the Python path to /home/osmc/.kodi/addons/plugin.video.emby:/home/osmc/.kodi/addons/script.module.requests/lib:/usr/lib/python2.7:/usr/lib/python2.7/plat-arm-linux-gnueabihf:/usr/lib/python2.7/lib-tk:/usr/lib/python2.7/lib-old:/usr/lib/python2.7/lib-dynload:/usr/local/lib/python2.7/dist-packages:/usr/lib/python2.7/dist-packages:/usr/lib/python2.7/dist-packages/PILcompat:/usr/lib/python2.7/dist-packages/gtk-2.0
15:05:04 72560.414062 T:2583688224   DEBUG: CPythonInvoker(18, /home/osmc/.kodi/addons/plugin.video.emby/default.py): entering source directory /home/osmc/.kodi/addons/plugin.video.emby
15:05:04 72560.421875 T:2583688224   DEBUG: CPythonInvoker(18, /home/osmc/.kodi/addons/plugin.video.emby/default.py): instantiating addon using automatically obtained id of "plugin.video.emby" dependent on version 2.1.0 of the xbmc.python api
15:05:04 72560.632812 T:3025760816   DEBUG: DialogProgress::StartModal called
15:05:04 72560.640625 T:3025760816   DEBUG: ------ Window Init (DialogProgress.xml) ------
15:05:04 72560.640625 T:3025760816   DEBUG: Window DialogProgress.xml was already loaded
15:05:04 72560.640625 T:3025760816   DEBUG: Alloc resources: 0.18ms
15:05:11 72567.953125 T:2583688224  NOTICE: plugin.video.emby started
15:05:11 72567.960938 T:2583688224  NOTICE: Parameter string: ?filename=test.mp4&id=9a7157f73151a9a670f35fa7aef238ed&mode=play
15:05:12 72568.468750 T:2583688224  NOTICE: EMBY DownloadUtils -> logMsg : === ENTER downloadUrl ===
15:05:12 72568.539062 T:2583688224  NOTICE: EMBY DownloadUtils -> logMsg : Header: {'Accept-Charset': 'UTF-8,*', 'Content-type': 'application/json', 'Accept-encoding': 'gzip', 'Authorization': 'MediaBrowser UserId="26c9f756a12c480dba75ed4b73894c6f", Client="Kodi", Device="PreK TV", DeviceId="FC677A3A41594842A2282BA940B41338", Version="1.1.39"', 'X-MediaBrowser-Token': '1c3709f0f98a4d1cb26f5cb759c5a89b'}
15:05:12 72568.601562 T:2583688224  NOTICE: EMBY DownloadUtils -> logMsg : URL: http://10.99.1.252:8096/mediabrowser/Users/26c9f756a12c480dba75ed4b73894c6f/Items/9a7157f73151a9a670f35fa7aef238ed?format=json&ImageTypeLimit=1
15:05:12 72569.085938 T:2583688224  NOTICE: EMBY DownloadUtils -> logMsg : ====== 200 Success ======
15:05:12 72569.101562 T:2583688224  NOTICE: EMBY DownloadUtils -> logMsg : Response: {<snip really long JSON response>}
15:05:12 72569.117188 T:2583688224  NOTICE: PLAY Called
15:05:12 72569.164062 T:2583688224  NOTICE: EMBY DownloadUtils -> logMsg : === ENTER downloadUrl ===
15:05:12 72569.179688 T:2583688224  NOTICE: EMBY DownloadUtils -> logMsg : URL: http://10.99.1.252:8096/mediabrowser/Users/26c9f756a12c480dba75ed4b73894c6f/Items/9a7157f73151a9a670f35fa7aef238ed/Intros?format=json&ImageTypeLimit=1&Fields=Etag
15:05:12 72569.257812 T:2583688224  NOTICE: EMBY DownloadUtils -> logMsg : Header: {'Accept-Charset': 'UTF-8,*', 'Content-type': 'application/json', 'Accept-encoding': 'gzip', 'Authorization': 'MediaBrowser UserId="26c9f756a12c480dba75ed4b73894c6f", Client="Kodi", Device="PreK TV", DeviceId="FC677A3A41594842A2282BA940B41338", Version="1.1.39"', 'X-MediaBrowser-Token': '1c3709f0f98a4d1cb26f5cb759c5a89b'}
15:05:12 72569.328125 T:2583688224  NOTICE: EMBY DownloadUtils -> logMsg : URL: http://10.99.1.252:8096/mediabrowser/Users/26c9f756a12c480dba75ed4b73894c6f/Items/9a7157f73151a9a670f35fa7aef238ed/Intros?format=json&ImageTypeLimit=1&Fields=Etag
15:05:13 72569.429688 T:2583688224  NOTICE: EMBY DownloadUtils -> logMsg : ====== 200 Success ======
15:05:13 72569.453125 T:2583688224  NOTICE: EMBY DownloadUtils -> logMsg : Response: {u'Items': [], u'TotalRecordCount': 0}
15:05:13 72569.515625 T:2583688224  NOTICE: EMBY PlayUtils -> logMsg : Path exists.
15:05:13 72569.539062 T:2583688224  NOTICE: EMBY PlayUtils -> logMsg : File is direct playing.
15:05:13 72569.617188 T:2583688224  NOTICE: plugin.video.emby stopped
15:05:13 72569.617188 T:2583688224    INFO: CPythonInvoker(18, /home/osmc/.kodi/addons/plugin.video.emby/default.py): script successfully run
15:05:13 72569.625000 T:3025760816   DEBUG: WaitOnScriptResult- plugin returned successfully
15:05:13 72569.710938 T:3025760816   DEBUG: Loading settings for nfs://10.99.1.252/raid/shares/ccc/TV Media/Video/Misc/test.mp4
15:05:13 72569.804688 T:3025760816   DEBUG: CPlayerCoreFactory::GetPlayers(nfs://10.99.1.252/raid/shares/ccc/TV Media/Video/Misc/test.mp4)
<snip>

It seems to take several seconds for the Emby plugin to load and tell Kodi the video's URL, after which playback starts quickly. Both playing directly over NFS via Kodi and playing via Emby's UPNP feature starts almost instantly.

 

Is the Pi just too slow for the plugin, or is something else going on? Is there some way I can speed things up?

Link to comment
Share on other sites

Vidman

Yes it is, that is partly why the direct paths option exists, but to try it you must ensure the paths defined in Emby server are accessible to your pi (by using UNC paths or path substitution)

And after changing the setting in the emby for kodi addon you must reset your kodi database

Edited by Vidman
Link to comment
Share on other sites

MSattler

Yes it is, that is partly why the direct paths option exists, but to try it you must ensure the paths defined in Emby server are accessible to your pi (by using UNC paths or path substitution)

And after changing the setting in the emby for kodi addon you must reset your kodi database

 

You should probably state if you are running Emby on Windows/Linux/OSX.

 

And how you add your content.  Via \\hostname\share or c:\Movies or /Movies.

Link to comment
Share on other sites

jonsson

Hi,

My Pi is also slow when starting a movie. It takes about 10-15 seconds with the message "opening stream" before it plays. DirectPlay and alternate paths.

Link to comment
Share on other sites

xnappo

You are positive you reset the db when switching to direct paths?  It should be exactly the same speed as native Kodi with direct paths.  If it is not, post a log.

Link to comment
Share on other sites

Jdiesel

It was taking approximately 10-15 seconds to start a video on my RPi B, since upgrading to a RPi 2 it now takes about 3 seconds. That is with direct paths on both systems and no other changes made between installls. I think the RPi B is just too underpowered.

Link to comment
Share on other sites

jonsson

This seems to be happening when the files are on the network. When I was using Pi and Kodi, without Emby, and the disk with all the movies were attached locally to the Pi it started instantly. I´m using a wired connection.

Link to comment
Share on other sites

Turning on direct paths fixed the problem nicely, thanks! Here's a step-by-step guide for the others with the same issue:

 

1. Go to the Kodi main menu

2. Open the Programs menu

3. Select Emby from the list

4. From Emby's menu, hit Settings

5. From the left-side list, select Sync Options

6. On the right-side menu, turn on the option "Use local paths instead of addon redirect for playback"

7. Press OK to save the settings

8. From Emby's menu, select "Reset local Kodi DB".

9. When asked if you want to reset the database, hit Yes.

10. When asked if you want to reset Emby's settings, hit No.

 

Kodi will restart to apply changes, after which Emby media files should start quickly. Note that a few Emby features won't work, like transcoding.

Edited by isaacsmith
Link to comment
Share on other sites

xnappo

@@Angelblue05 - I think the recent change for using the server for watched needs an exception to be like it was originally when direct paths are enabled?  I am out of town - can't test.

Link to comment
Share on other sites

Angelblue05

@@xnappo the changes to the watch status are only on github. Direct path watch status should work regardless of the play method because it depends on the player.

 

I'll still verify to make sure, :)

 

 

Sent from my iPhone using Tapatalk

Edited by Angelblue05
Link to comment
Share on other sites

Angelblue05

I've just tested and it works fine here. Kodi logs if you are having an issue, thanks. :)

 

 

Kodi will restart to apply changes, after which Emby media files should start quickly. Note that a few Emby features won't work, like watched media tracking.

The only features that will be missing are the ones regarding playback. Since the database points to the direct paths, our add-on can't control what happens at playback. So this means Emby features such as cinema mode, parental access (for schedules only), being able to direct stream and transcode will be missing.

 

However I'm contemplating giving access to them via context menu access - it would only be supported for Isengard + (as a context menu add-on, separate from the main one). I will only start looking into it after first implementing home videos support. 

Edited by Angelblue05
  • Like 1
Link to comment
Share on other sites

Angelblue05

Good, yes it's really important to reset your database after setting to use direct paths, otherwise you will still be using plugin path.

 

 

Sent from my iPhone using Tapatalk

Link to comment
Share on other sites

The only features that will be missing are the ones regarding playback. Since the database points to the direct paths, our add-on can't control what happens at playback. So this means Emby features such as cinema mode, parental access (for schedules only), being able to direct stream and transcode will be missing.

 

I haven't tested, I thought I was going off something I read in another post but guess I misremembered.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...