Linux [SOLVED] First video always hangs system for 30 seconds. Works perfect until rebooted
#1
Kodi 16.1 Git:c327c53 (though issue persisted on 15.X)
Linux: Ubuntu 14.04.5 LTS, kernel: Linux x86 64-bit version 3.13.0-93-generic
Codec: FFmpeg statically linked, version: 2.8.6-kodi-2.8.6-Jarvis-16.0
Hardware: Intel® Core™2 Duo CPU P8700 @ 2.53GHz / x86_64 / 8GB RAM
Debug Log: http://pastebin.com/D2QrNspm

Core issue:
On a fresh Kodi boot-up, the very first video (and only the first video) will lock the system at the selection screen for around 30-seconds to a full minute. During this time, no keystrokes or input works and even the debug log/CPU stats screen will freeze. Once that minute goes by, the video loads like it should and all subsequent videos work perfectly until the Kodi (or the entire system) is restarted.

Background/Troubleshooting:
Issue has persisted for well over a year across both Kodi 15.X and 16.1 Jarvis and prior versions of Ubuntu. I've upgraded, reset settings, pulled suspect add-ons and still haven't tracked it down. It happens on every type of video, of any format, and is always the exact same thing. I've found dozens of posts about a similar issue that affects every video when played but mine is unique in that it's only the FIRST video. Again, it's perfect after that until restarted.

In the log you'll see that I started by loading the first video, titled "Rick and Morty - Adult Swim - State of Georgia Vs. Denver Fenton Allen.mp4". This is where the system hangs for a minute and then eventually plays. I immediately stopped that video and loaded a second video titled "Rogue One_ A Star Wars Story Trailer.mp4" which, as usual, played perfectly. Given how much larger the first video's log entries are, my hunch is there's something obvious in the log file that's going on and I'm too clueless to identify it. Trying to google some of this had me chasing my tail...so for the first time ever, I'm posting here in hopes someone can point me in the right direction. Any help is appreciated!

Solved: While testing to see if thumbnail fetching/cache was causing issue, found about ~5GB worth of temp files in profile. Upon deletion the issue went away.
Reply
#2
Not sure what happens, but if I have to bet my money somewhere I'd guess it is some issue with the NAS, disk spin down, connect to samba server, nmb name resolution, whatever.
Does it also happen when you play a local video first?
Does it also happen when you refresh the library first before you start the video? The whatever-it-is-problem wit smb should appear there, too, and the first video should start up smoothly after the refresh. Unfortunately I did not see your second video in the log, so this is a lot of guessing.
Reply
#3
Thanks for the response. Videos do play just fine locally and off other devices attached to the NAS. No delays to speak of. As for refreshing the library, that doesn't seem to do much either unfortunately. Same issue. As for the second video, it starts on line 533 of the pastebin if that helps.
Reply
#4
Note to self: Rogue != Rouge. Sorry, searching for the wrong word, my bad. There is a big delay between "OnPlayMedia" and the loading of settings in the first case, but not in the second. Weird. Just out of curiosity, Does the same effect also happen with Music? If so, what happens if you start a Music track, and then a video track?
I'd still bet money on Samba, but less :-)

As a last resort, you could try to smbmount smb://NASBOX/NASBOX to /media/NASBOX within Ubuntu via /etc/fstab and see what that gives...
Reply
#5
Interesting idea about trying music, good call. On boot, the test .mp3 played immediately unlike videos usually do. Attempting to play a video next, unfortunately, still took ~45 seconds to load. So while that doesn't solve it, we've narrowed it down a bit.

Regarding the Samba bit, I'm certainly open to anything at this point! I figure just because other devices load quick on first fetch doesn't mean Samba is happy. As for the mount command, I'm a old school Windoze guy getting my feet wet here but some quick google-fu implies that's a config file I can edit. I don't have physical access at the moment to poke around so can you confirm the syntax is literally adding a "smb://NASBOX/NASBOX to /media/NASBOX" line in there or does "to" infer changing an existing setting to /media/NASBOX? Definitely appreciate the help.
Reply
#6
Well, I guess I was too unclear on the mp3 part, so just to cross check: The music file is also on the NASBOX, right? If so, we can skip samba and I lost my money ;-) My thinking was "try load some non-video from the smb-share to do whatever takes long, and then the video should start quickly".

On a similar path, the smbmount would make the files look local to Kodi and leave the network layer to ubuntu. The how-to is on the ubuntu wiki, for testing you should use a passwordless guest folder. As an extra tip, I would add ",nofail" after "guest", that makes your life easier if you do something wrong. But if "sudo mount -a" runs without errors, you should be fine. The Kodi media source of course needs to be changed from an smb:-type to a local disk/directory.
Reply
#7
Ah, I see what you're saying now and yes, the .mp3 was on the NASBOX and in the same folder as the movies.

EDIT: So my friend who helped me build the box had a great idea. He had me copy a file locally to the actual Kodi box to see what happened. I took a 100mb .MP4 file, copied it to the .home/Movies folder and the same issue came up. 42 seconds to start playing the video, worked perfectly after that. Given this, I'm assuming that the whole SMB/network/NASBOX path ideas are probably bust? I was really hoping the debug log would have something obvious in it but I'm starting to fear it's something deeper...
Reply
#8
Yeop, it is not a network timeout, your "Videos do play just fine locally" in an earlier post was actually the term that was misleading me.
Still, that time looks like some kind of time-out. The only thing I can think of is waiting for the audio device, but I cannot find anything in the log that is supporting this I am lost.
Fritsch?
Reply
#9
Anyone else have any ideas? I'd hoped after a year of putting up with this it'd be an easy fix but it's turning out to be quite the nightmare!
Reply
#10
Solved: While testing to see if thumbnail fetching/cache was causing issue, we found about ~5GB worth of temp files in my user profile. Upon deletion of those temp files the issue went away. Updated first post.
Reply
#11
(2016-09-05, 07:31)Morydees Wrote: Solved: While testing to see if thumbnail fetching/cache was causing issue, we found about ~5GB worth of temp files in my user profile. Upon deletion of those temp files the issue went away. Updated first post.

lol xd thanks for sharing the result, did helped me once. XD
Reply

Logout Mark Read Team Forum Stats Members Help
[SOLVED] First video always hangs system for 30 seconds. Works perfect until rebooted0