Videos stop playing

Hello,

I’m hoping to get some help on this playback problem because I tried many things, but I’ve not been successful to debug it do far.
For the past few weeks I wasn’t able to see a single video without it stopping multiple times. The systems is almost unusable. I understand that this might be a network issue, but my Linux knowledge is evidently limited.
The server is connected through a wired connection to the vero 4k+ (the vero is connected directly to the router, while the server is connected to an access point that is wired connected to the router. All cables are gigabit cables and iperf3 looks good (constant around 950MB/s). I shutdown all unneeded services on the server.
the server share is nfs mounted through fstab
I started having this problem with the previous 4k a few weeks back, so I switched to the 4k+ that I bought a while ago but never took out of the box, but the problem persists.
The server system monitor looks like this:


At the bottom right you see that the video begins and after a while the sent data rate goes to zero. At that point the video is still playing and will eventually stop after several seconds. This happens many times for each single video sometimes after a few seconds, sometimes after 30-40 minutes. The internet connection is alive at this point. If I ssh to osmc, during the period between the sent data going to zero and the video eventually stopping, I can see the all the server files in the mounted directory.
debug log is at: https://paste.osmc.tv/iqunulekej

Any idea is welcome. I already replaced the two short ethernet cable that connect server and 4k+ to the router. I also bought a replacement cable for the connection router/access point but I’m a little hesitant because the cable is in the wall so it is quite a bit of work to replace it.
Router and access point firmware are all updated.
Server uses Arch Linux

Thanks!

Having the same problem with 2 different 4K’s points to your server or network as the culprit. Have you tried rebooting the Arch server?

Hi,

Thanks for such a comprehensive report. It’s appreciated.
Can you let us know what the source device is (server)?

Did you test iperf speeds against the device you’re streaming from?

Cheers

Sam

rebooting the server seems to make a marginal difference. After reboot the time between stops seems to increase for a while, but after a while the stops become more frequent.

the server is an old Intel i3 with 16gb of ram, the media is inside an external enclosure (mediasonic probox) connected through USB 3.0 to the server. All drives are HGST NAS, pooled through mergerfs. Parity is checked through snapraid and I run a sync and partial scrub every night, so I’m fairly confident that there are no errors on the disks (also, it would be very unlikely that all of the sudden all my videos are corrupted).
yes Iperf is run from the server to the vero, I ssh into both machines from my laptop to monitor. Once I actually paused the video, when I saw that the stop was about to happen (I saw the sent data rate drop to zero) and I ran iperf3 on the vero while the video was paused and the result looked very good, but when I resumed the video, it stopped after a few seconds (I saw the video cache from kodi osd to stay at 100% for a while and then dropping to zero). It seems that after kodi encounters an error, even if the connection is ok, it never refills the cache.

I have now fired up my Shield TV (I almost never use it) that has kodi leia beta 5 and I’m going to watch a few videos using that. If the problem appears also on the shield, then network is the most likely suspect.

With the -R flag?

Have you tried using the -t switch on iperf to lengthen the test to the amount of time the video plays before stopping? There might be an issue with networking that only shows up after enough packets are sent.

Since you are using fstab mounts, another test is to copy a file from the server to the Vero. Even if you don’t have enough disk space on the Vero, you can use something like cat or dd to send the output to /dev/null…the bits will still be sent over the network.

Thanks for the ideas. I’ll do the tests and report back.
P.S.: I just watched the same video of the previous log all the way through without any stop using kodi on the Shield. It might be a coincidence, but in about a month I was never able to watch an entire video without stops on osmc and first try on kodi/shield was a success. One difference, apart from kodi vs leia is that shield connects to the server through SMB, so I’m wondering if something went wrong with my NFS setup. Anyway, I’ll do all the tests that have been suggested and we’ll go from there.

dd result (I will now run a two hours iperf3 test with the -R option)

osmc@osmc:~$ dd if=/mnt/Storage_Pool/Media/Cartoni\ 
Bimbi/The.Smurfs.2.2013.2160p.BluRay.REMUX/The.Smurfs.2.2013.2160p.BluRay.REMUX.mkv 
of=/dev/null status=progress
50855830016 bytes (51 GB, 47 GiB) copied, 561 s, 90.7 MB/s     
99467971+1 records in
99467971+1 records out
50927601651 bytes (51 GB, 47 GiB) copied, 561.81 s, 90.6 MB/s

HI,

this is the result of iperf3 run for 2 hours:

iperf3 -c 192.168.1.144 -i 1 -R -t 7200

[ ID] Interval           Transfer     Bandwidth       Retr
[  4]   0.00-7200.00 sec   788 GBytes   941 Mbits/sec  601             sender
[  4]   0.00-7200.00 sec   788 GBytes   941 Mbits/sec                  receiver

How do Interpret this?
Thanks!

Looks as good as your earlier file transfer. So I guess need to look somewhere else for the problem

It might not be that significant but eth0 on the log is showing a fairly high number of dropped receive packets:

    RX packets 49116376  bytes 72270619784 (67.3 GiB)
    RX errors 0  dropped 175  overruns 0  frame 0

Your sources.xml shows that you’re duplicating the data source, one via fstab and another via Kodi (libnfs)

<path pathversion="1">/mnt/Storage_Pool/</path>
...
<path pathversion="1">nfs://192.168.1.144/srv/nfs/Storage_Pool/Media/</path>

Finally, I see that you’re using PlexKodiConnect, so I assume that the Arch box is running Plex server. How is that (and PKC) configured, since there are plenty of these messages:

WARNING: PLEX.downloadutils: Server unreachable at: https://192-168-1-144.7d15f3cbf4f048fda051fe6013017bff.plex.direct:32400

Edit: I also noticed that there’s no old kodi log, so either you deleted it or the Vero4K+ has never been rebooted - if which case a quick reboot might not be such a bad idea.

This is the same message @WilliamG sees in some logs and he has some issues with playback.

Can you try disabling this add-on temporarily?

Bear in mind my issues are the same with a USB drive, though. Server not even being used.

Yes… but: that will raise CPU usage as explained. In Kodi v17 the render thread is very sensitive.

v18 doesn’t even report them as skips, though, despite it visibly skipping. So I’m at a loss…

Hi, thanks for all the help in this thread. I might have found the problem, more or less, but I need to watch TV for a few more hours to be 100% sure.
The results of yesterday’s tests didn’t show any obvious network issues, and the kodi on the shield was able to play through the same network without issues, so I decided to mount the server share on the Vero using SMB (still in /etc/fstab) instead of NFS. The change gave night and day results.
Earlier today I played on mute more than 3 hours of material (one movie and one TV episode) and I could see from the plex logs that they played all the way through. Also tonight I watched two TV episodes with zero issues.
5 hours without any problem has not happened in many many weeks, so I feel good that the issue is in the NFS connection Vero/Server.
If the issue comes back (that would mean that the issue would not be NFS) I’ll post again.

Regarding few of the questions in the thread:

I added the kodi native mount a few days back to play a video through the file manager to see if it was any different. The result was negative → video stopping frequently in both cases (using nfs through /etc/fst or through kodi)

this is another experiment, I temporarily shutdown the Plex server on the server to reduce CPU and memory utilization on the server, but the problem persisted regardless of the plex server being on or off. The log I uploaded happened to be one when the plex server was stopped.

the first try to upload the log failed because the log was too big, so I deleted the log and restarted mediacenter. I did reboot the Vero many many times with no results.

Finally, some details of the NFS settings, maybe somebody can spot something wrong:

Server Side:

sudo exportfs -v
/srv/nfs/Storage_Pool
            <world>(async,wdelay,hide,no_subtree_check,fsid=1,sec=sys,rw,insecure,root_squash,no_all_squash)
cat /etc/exports
/srv/nfs/Storage_Pool  *(fsid=1,rw,async,insecure,no_subtree_check)

/etc/fstab line on Vero:

192.168.1.144:/srv/nfs/Storage_Pool /mnt/Storage_Pool        nfs     noauto,x-systemd.automount  0  0

Thanks for all the help. While I’m curious to understand why I’m having bad results with NFS, I’m eager to finally enjoy my Vero 4k+ instead of dealing with my wife and kids complaining every few minutes about the videos stopping, so I’m all set with SMB, if things continue to work.

It looks like you are using NFS version 4 on the server. You could try forcing version 4 in fstab (add nfsvers=4 to the options). This will likely do nothing, but I’ve had client/server that both were running NFS 4 not negotiate correctly, and fall back to version 3.

Just checking in to confirm that switching from NFS to SMB fixed all the problem. It has been now a week with absolutely zero videos stopping, down from 2-3 stops per video.

Thanks! I haven’t tried this yet. Maybe in a few days. I’m going to enjoy the weekend without Kodi drama.

1 Like