2018-04-16, 12:30
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
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?
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?