Solved Video/audio stop for a second or two every couple of minutes
#1
I'm using Kodi v16.7 via OSMC on a Raspberry Pi 3.

All videos I'm playing are on NAS, which is mounted via NFS on the filesystem. The NAS is powerful and fast, and it can easily fill the Raspberry Pi's network pipe (i.e. sustained transfer of 11.2MiB/s; way faster than that when transferring to a system with a gigabit NIC).

Everything was great for the year or so I've had this setup until a month or two ago, when I started seeing problems.

Now, every minute or two, sometimes more frequently, sometimes less, I get a freeze in video and audio which lasts a second or two, and then things continue. I usually have missed part of the video and audio once it continues, and so I have to back up to see what I missed.

I don't think anything has changed other than possibly updates to OSMC/Kodi. At some point I did install a Hifiberry Amp2 on the Raspberry Pi, but I'm not sure if this coincided. I see the issue whether the sound is played through HDMI or through the Amp2. Though oddly when played through the Amp2 the sound keeps playing while the video has frozen for maybe half the glitch's duration, while with HDMI the sound stops immediately with the video. Not sure if that's a clue or not.

I have looked at logs with debug mode switched on during these glitches. Sometimes there is a message such as

Code:

01:49:28.644 T:1149227776   ERROR: CDVDAudio::AddPacketsRenderer - timeout adding data to renderer
01:49:56.038 T:1660752640 WARNING: CRenderManager::WaitForBuffer - timeout waiting for buffer

but these are not always present, and I haven't seen anything else interesting around the time of such a glitch.

There's nothing weird in any system logs I can find.

I've tried monitoring CPU/memory, network activity, disk IO activity, and nothing looks out of the ordinary at all when such a glitch is happening. It *is* during one of the spikes of network traffic where presumably it's refilling the buffer. CPU usage *does* spike, but that's just *after* the giltch when we're catching back up, and it's not even close to 100% usage even at peak, so that's also as I'd expect.

The glitches seem more frequent on higher-bitrate videos, which would be as expected if it's when the buffer is empty.
The glitches do not occur if I first copy a video file to the machine's SD card.

I've tried various combinations of cache settings, but I'm working somewhat blind. I've tried the default settings, default but with lower readfactor (I tried 1.5 for example), default but higher readfactor (6), all of the above with buffermode 1 rather than the default 0, and some combinations of all of the previous with a memorysize of 128M rather than the defoult. None of them seem to make a difference.

What I would like to do is have an on-screen readout of exactly how full the cache is, so that I could see both that it's definitely to do with the cache getting empty, and that the cache settings I'm tweaking are actually taking effect. But I can't find any way to see that information. When debug logging is on, some stuff is on screen but I don't see cache info there, and there's also another bunch of info I can get by pressing "option" on my remote during playback which brings up a blue overlay with some details, and says I can press OK to toggle more, which puts more text on the screen outside the overlay. I don't see cache info in either of those blocks either.

Any advice?
Reply
#2
No one can offer any meaningful support without complete logs.
Reply
#3
Try and reproduce the issue with local playback.
Reply
#4
(2018-04-16, 17:50)Sam.Nazarko Wrote: Try and reproduce the issue with local playback.

I have. From my original post:

(2018-04-16, 12:30)tremby Wrote: The glitches do not occur if I first copy a video file to the machine's SD card.
Reply
#5
(2018-04-16, 13:53)ActionA Wrote: No one can offer any meaningful support without complete logs.
 OK, here is a log.

I noticed a glitch immediately after playback started (though that doesn't particularly bother me), and then at about

- 21:52:56
- 21:53:09
- 21:53:31
- 21:55:13

https://pastebin.com/X4YeXk9v
Reply
#6
Code:
21:52:30.109 T:1372582656 INFO: CFileCache:Tonguerocess - Source read didn't return any data! Hit eof(?)

Your network connection looks like it is flaking out. Try a different network cable and/or different ports on your router/switch.
Reply
#7
But that happens just once, right when the file is opened. The file opens and plays. There are several freezes later than that which don't have such a message.

I'll try what you suggest when I'm back home, but in the mean time, is there a more rigorous diagnostic which would highlight such network issues than changing physical ports? I could log in and run tcpdump or something, but I'm not sure what I'd be looking for.
Reply
#8
I tried three different network ports and two different cables; I get the glitches in every configuration.

I've also never seen such glitches like this while watching internet streams like Youtube, so I would be surprised if it's the network.
Reply
#9
(2018-04-16, 12:30)tremby Wrote: Now, every minute or two, sometimes more frequently, sometimes less, I get a freeze in video and audio which lasts a second or two, and then things continue. I usually have missed part of the video and audio once it continues, and so I have to back up to see what I missed.

Sounds very similar to my problems. Especially during the start of a video, I stream via SMB, videos have "hickups". They didn't have these a couple of months ago. Also, my fanart and posters keep breaking, see https://forum.kodi.tv/showthread.php?tid=331702 .

I read some rumors about problematic SMB on the Raspberry Pi, but I don't have any further info on that unfortunatelly. Might be related to that problem.
Reply
#10
A friend with a very similar setup to mine is also experiencing the same issue now. She is loading media from NAS via OS-mounted NFS (just like I am).
Reply
#11
For now, the problem seems to have been solved by switching to Kodi's own NFS client, where previously I had been mounting the NFS share at the system level. This was incredibly frustrating for the last six months! Hopefully this is a permanent fix.
Reply
#12
(2018-04-16, 12:30)tremby Wrote: I'm using Kodi v16.7 via OSMC on a Raspberry Pi 3.

And hopefully will get a full Debug Log next time with correct informations. As there has never been a Kodi 16.7 release Wink

The log you provided is edited/not complete. We always need full logs. If you have issues with the OS in use, please head over to OSMC forums.

Thread marked solved
Reply
#13
Quote:there has never been a Kodi 16.7 release

I guess that was a typo; it's version 17.6.

Quote:The log you provided is edited/not complete. We always need full logs.

If the log I gave six months ago was insufficient, it would have been nice to know then rather than now.

As far as I remember I only edited the name of the file being played. Though maybe I cut it down to the time period of interest. For future reference what could you not find which may have been interesting? Just the correct version number as part of what's logged when Kodi starts?

Quote:If you have issues with the OS in use, please head over to OSMC forums.

I don't know how I'm supposed to know if it's an OSMC issue or a Kodi issue or neither.
Reply
#14
Hey @tremby , thanks for the thread Smile I was changing cables, switching routers and testing various options until I stumbled on your thread... exact same issue, and it was fixed the exact same way - using NFS directly via Kodi. Probably some settings were of in my fstab file...
Reply

Logout Mark Read Team Forum Stats Members Help
Video/audio stop for a second or two every couple of minutes0