Kodi Community Forum

Full Version: Buffering stops and video crashes
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello everyone,

tl;dr : Kodi crashes when reading video file over Samba protocol, Samba "server" is a Windows 10 connected on Wifi. Version is 15.2, installed with OpenElec 6.0.3 on a Raspberry Pi 3 over cable. Very few packets dropped may be linked to the crash. Buffering changes do not help except for small files. OpenElec was reinstalled from zero, no change

I'm reaching to you to get some help on the issue I'm having with Kodi 15.2 on OpenElec 6.0.3 on a Raspberry Pi 3 recently.
Every movie I watch ends up crashing randomly. I'm using a Windows 10 desktop as a server over Samba for all movie files. After checking, I think I can relate this to packets dropped on the network interface. I was using cable on eth0 at first but tried with wifi just in case and it crashes the same.

I only have one RX packet dropped every now and then (<5 per hour, compared to 1million+ received correctly) but it looks like everytime the packets dropped counter is incrementing by 1 (I checked with ifconfig), Kodi stops buffering and never starts back, despite the network getting fine again nearly instantly. I tested that by sshing with Putty to the Raspberry, everytime I lose ssh connexion, I connect again immediately and I see an increase of 1 in packets drop with ifconfig.

Since I cannot determine yet why I have those drops (don't have tcpdump, netstat -s neither apt-get on Openelec...). I tried to look into better buffering, and created file : /storage/.kodi/userdata/advancedsettings.xml.

I tried different ones with more or less of ram or buffering speed.
The final one looks like this :

<advancedsettings>
<network>
<buffermode> 1 </buffermode>
<readbufferfactor> 50 </readbufferfactor>
<cachemembuffersize> 0 </cachemembuffersize>
</network>
</advancedsettings>

tl;dr : buffering workaround does not work well, except with files that would actually have time to buffer completely on the disk (the smaller, the luckier I am)

Since I don't have lots of ram but wanted to try to buffer as much as I could before any packet drop, I configured the zero buffering (no flash memory killing problem here, I installed the openelec system on an external USB disk thanks to BerryBoot). This is difficult to confirm 100% but I think everytime I have a packet drop, the buffering stops and the movie crashes as soon as it reaches the end of the buffering (here I managed to load ~1.3G of the movie before the drop, so I could watch 2/3 of the movie before it crashed).

What I changed recently : I created a web server for myself, for which I'm using an unused registered port (47886) and is protected by username/password. This is redirected with a ddns as I still have a dynamic IP from my provider (even though it's not changing often). Previously, I was already using Yatse as a remote on my Android phone (Which is the 192.168.10.30 you see in the logs afterwards), I had to change the config with port and username/password since it's using the webserver feature of OpenElec.

Here is the logs I have from /storage/.kodi/temp/kodi.log

10:05:12 132.968399 T:1966727168 NOTICE: DVDPlayer: Opening: smb://DESKTOP/Films/Test.mkv
10:05:12 132.968582 T:1652548672 NOTICE: Thread DVDPlayer start, auto delete: false
10:05:12 132.968735 T:1652548672 NOTICE: Creating InputStream
10:05:12 132.983902 T:1671427136 NOTICE: Thread FileCache start, auto delete: false
10:05:12 133.025604 T:1652548672 NOTICE: Creating Demuxer
10:05:12 133.048538 T:1652548672 NOTICE: Opening stream: 0 source: 256
10:05:12 133.067047 T:1652548672 NOTICE: Creating video thread
10:05:12 133.067276 T:1652548672 NOTICE: Opening stream: 1 source: 256
10:05:12 133.067337 T:1626338368 NOTICE: Thread OMXPlayerVideo start, auto delete: false
10:05:12 133.068375 T:1652548672 NOTICE: Creating audio thread
10:05:12 133.068604 T:1615852608 NOTICE: Thread OMXPlayerAudio start, auto delete: false
10:05:12 133.176590 T:1626338368 NOTICE: Display resolution DESKTOP : 1920x1080 (1920x1080) @ 60.00i - Full Screen (16)
10:06:44 224.972900 T:1725363264 NOTICE: ES: Client from 192.168.10.30 timed out
10:13:29 629.886780 T:1671427136 NOTICE: Previous line repeats 1 times.
10:13:29 629.887024 T:1671427136 ERROR: Read - Error( -1, 22, Invalid argument ) - Retrying
10:13:59 659.915955 T:1671427136 ERROR: Read - Error( -1, 22, Invalid argument )
--> Looks like the moment of the crash
10:17:06 846.960693 T:1725363264 NOTICE: ES: Client from 192.168.10.30 timed out
10:31:46 1727.065308 T:1671427136 NOTICE: Previous line repeats 2 times.
10:31:46 1727.065552 T:1671427136 NOTICE: Thread BackgroundLoader start, auto delete: false
10:31:50 1730.623779 T:1671427136 NOTICE: Previous line repeats 1 times.
10:31:50 1730.623901 T:1671427136 NOTICE: Thread JobWorker start, auto delete: true
10:31:50 1730.643677 T:1800401984 NOTICE: Thread BackgroundLoader start, auto delete: false
10:31:52 1733.359497 T:1800401984 NOTICE: Thread JobWorker start, auto delete: true
10:33:11 1812.354492 T:1725363264 NOTICE: Previous line repeats 2 times.
10:33:11 1812.354736 T:1725363264 NOTICE: ES: Client from 192.168.10.30 timed out
10:45:59 2580.234131 T:1671427136 NOTICE: Previous line repeats 1 times.
10:45:59 2580.234375 T:1671427136 NOTICE: Thread JobWorker start, auto delete: true
10:47:34 2674.394287 T:1725363264 NOTICE: ES: Client from 192.168.10.30 timed out
10:51:17 2898.177246 T:1586492480 NOTICE: Thread JobWorker start, auto delete: true
10:52:26 2966.790771 T:1725363264 NOTICE: ES: Client from 192.168.10.30 timed out
11:21:21 4702.235352 T:1876026432 NOTICE: Thread RSSReader start, auto delete: false
11:21:32 4712.672363 T:1586492480 NOTICE: Thread LanguageInvoker start, auto delete: false
11:21:32 4712.861816 T:1586492480 NOTICE: -->Python Interpreter Initialized<--
11:21:32 4713.181152 T:1966727168 ERROR: Control 1000 in window 13001 has been asked to focus, but it can't
11:22:07 4747.741699 T:1775694912 NOTICE: Thread JobWorker start, auto delete: true
11:23:07 4807.397461 T:1725363264 NOTICE: ES: Client from 192.168.10.30 timed out
11:30:30 5250.424316 T:1652548672 NOTICE: OMXClock using video as reference --> This is when the video reached the end of the buffer, but it was not the end of the movie
11:30:31 5251.717773 T:1626338368 WARNING: CRenderManager::WaitForBuffer - timeout waiting for buffer
11:30:52 5272.783691 T:1652548672 WARNING: Previous line repeats 29 times.
11:30:52 5272.783691 T:1652548672 NOTICE: OMXClock using audio as reference
11:30:52 5272.915039 T:1626338368 WARNING: CRenderManager::WaitForBuffer - timeout waiting for buffer
11:30:59 5280.078613 T:1652548672 NOTICE: OMXClock using video as reference
11:30:59 5280.204102 T:1626338368 WARNING: CRenderManager::WaitForBuffer - timeout waiting for buffer



ifconfig :

eth0 Link encap:Ethernet HWaddr B8:27:EB:37:08:80
inet addr:192.168.10.13 Bcast:192.168.10.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1042120 errors:0 dropped:4 overruns:0 frame:0
TX packets:514943 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1499367412 (1.3 GiB) TX bytes:43161329 (41.1 MiB)


I was suspecting Yatse timeouts but there are a lot more timeouts than packets dropped so it does not look like the culprit.

Here are all my questions, thanks for your patience reading all of this already Big Grin

How can I investigate those packets dropped on Openelec since I don't have classic tools and cannot install new ones ?
Why isn't Kodi starting to buffer again when the network gets back ? Is it intended ?
Is there a workaround to get Kodi to start buffering again when network is back ?


Thanks a lot for any help and don't hesitate to ask more information if I wasn't complete enough,

AcidBurn