Friday, July 11, 2025

Kodi randomly stops playback, logs "source read returned -1!" and "File ended prematurely"

Problem:  As title.  Reboots don't help.

Reason:  Kodi is having problems reading the source file, to the point where it just has to give up.

I know you're pissed at Kodi right now, and I can't blame you.  I don't really get why it doesn't automatically log critical errors for you, or why it can't show an on-screen error, rather than making you manually activate an obtrusive logging system and hope the problem comes back.  It's stupid, honestly.

Unfortunately, the solution can be difficult to track down, especially if the problem is intermittent or random.

As most issues are software, I first looked at my NAS, which had been on for two years straight.  So I tried rebooting it, even though all the resource readouts showed it was fine and there were no other issues.  That (predictably) didn't help, but it was still the most logical place to start.

Afterwards, I mused switching the Kodi PC to Wi-Fi, but that seemed like a dodge.  I rather wanted to keep the wired connection, and there was no reason why I shouldn't.

So, looked at the physical LAN networking, and (very luckily) happened to see that if I jiggled the LAN cable in the hub, it lost the connection.  Score one for readily visible indicator lights on the LAN ports!

The hub in question is a small 8-port Netgear, and I have no idea why that port went bad.  I have multiple identical hubs, and none of the others have ever showed anything similar.  It's not even my most heavily used hub.  And I've also never seen a bad port like this on any device, period.

Anyway, there was (probably) enough movement in the cable due to sound vibrations in my theater room that the connection was randomly intermittent.  Shifting the offending LAN cable from the "bad" port to another port fixed it completely.

I did initially think it was a bad cable, or perhaps the connector on the cable, but they had both been just fine for a long time - and stringing a new cable would have been a bitch.  So I'm just happy it was something easily fixable.

So take it from me, Ethernet ports are not infallible - they can (occasionally) go bad.  

 

(One might be tempted to blame the cable, but I would not start there.  Wire doesn't usually break unless it's vibrated to death, and any Ethernet cable of Cat5 or better is only 30 years old today.  The PVC / LSZH insulation used in those cables will probably last 50 years in most applications.  

Plus you're probably rockin' Cat5e or Cat6, both of which are meaningfully newer - and therefore younger, with potentially better insulation - than the older Cat5. 

But, you can always put a cable tester on if you want to quickly eliminate the cable as the problem, or if you just want to feel better.)


No comments:

Post a Comment