Kodi Community Forum

Full Version: Settings for poor wifi coverage
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Kodibuntu running 14.1, but also happened in 14.0 and 13.2. Was also a problem in Windows 7 with at least 13.2, never tested higher versions.

Let me preface this by saying the wifi coverage is the issue, but I have done what I can to improve it. I was hoping Kodi could deal with the wifi dropping if I buffer enough video, but it does not work.

Here is the scenario that happened a few minutes ago.

I start video playback and I have a ping running so I can see when the wifi drops
Kodi starts playing and buffers ~230MB into the cache
wifi drops for ~20 seconds which causes Kodi to stop buffering
Kodi never caches any more data even though Video continues to play what was cached for ~30 minutes until cache runs out
Then Kodi freezes for ~30 seconds and drops back to menu
I can immediately restart video (although it loses my place in video so I have to start from beginning) and it begins caching again

Tried many different video files and all exhibit the same problem

What I had hoped is if I cached enough video, it would give Kodi time to reconnect and start caching again. Problem is Kodi will never resume caching the data even though it has plenty of time to restart caching.

Is there any way Kodi can be configured to restart caching after losing network? I tested with VLC and it works as expected, it will resume caching after network is restored.

Code:
<advancedsettings>
  <network>
    <buffermode>1</buffermode>
    <cachemembuffersize>1048576000</cachemembuffersize>
    <readbufferfactor>20</readbufferfactor>
  </network>
<samba>
    <clienttimeout>120</clienttimeout>
</samba>
</advancedsettings>

Below is what shows in the log file after Kodi stops caching data and these continue long after network has been restored.

Code:
19:50:02 T:140502090946304 WARNING: CRenderManager::WaitForBuffer - timeout waiting for buffer
19:51:02 T:140502082553600 WARNING: Previous line repeats 19 times.
19:51:02 T:140502082553600 WARNING: CDVDMessageQueue(audio)::Get - asked for new data packet, with nothing available
19:51:08 T:140502090946304 WARNING: CRenderManager::WaitForBuffer - timeout waiting for buffer
19:52:36 T:140502082553600 WARNING: Previous line repeats 172 times.

http://pastebin.com/GHk8xq6d
So in case anyone else runs into this I have found UPNP and FTP can both recover after losing network connection. Both will run the cache down to 0 before starting to buffer again even if the network is restored, but they do continue to play and buffer seamlessly as long as network is restored.

UPNP with Plex did not allow me to resume so I am currently using FTP and it is working OK. It would be better if anything would start buffering again as soon as network is restored, but this is better than SMB, which would never recover even after 20 minutes of playing the cache.
Watching this one with interest..., thank you for bringing this up...
so how is FTP helping with Kodi ?

I am interested in this as well , I have the exact same problem ...if you could break it down in lay terms ...thanks
Hello there.

I dont use wifi or these buffer tweaks, so let me start there before proceeding.

If the wifi connection drops/disconnects you cant rely on a buffering system that as far as I know depends on a constant uninterrupted connection of some sort.

If Kodi would be a car and the buffering system would be a hill going down and the connection the fuel, the occupants of said car the file you playing and you ran out of fuel and hoping the hill slope will get you to the next station so you can fill up again and continue on your way, I would say great fantastic, that may even work.

But I dont think it will behave as you expected in this instance, there is no hill, only a precipice and your car just dropped to the bottom and all occupants have jumped out before the car fell and crashed.

Ya, insert coin and try again if I get that right.
From my testing here are how the protocols play out

SMB: Does NOT recover after losing network even with enough buffer. Does allow rename/delete. Does allow resume
FTP: Does recover after losing network. Does NOT allow rename/delete. Does allow resume.
UPNP: Does recover after losing network. Does NOT allow rename/delete. Does NOT allow resume.

From my testing FTP seems like the best choice for uninterrupted playback in poor WIFI conditions. Downside is I need a different method to delete watched shows which is a pain.

Ideally with Kodi either SMB could recover after losing network or FTP could have delete functionality so we wouldn't need to choose which functions we want to work.

uNiversal is close with his analogy of the car on the hill. FTP works like the hill where it will recover if there is enough momentum(cache). SMB in Kodi works like the precipice where it will crash back to the menu no matter what.

Below is a scenario that just happened using FTP

I start video playback and I have a ping running so I can see when the wifi drops
Kodi starts playing and buffers ~100MB into the cache
wifi drops for ~20 seconds which causes Kodi to stop buffering
Kodi continues to play, but stops caching new data
Cache reaches 0 then begins caching again without interruption. (If I wasn't watching the cache, I wouldn't know anything happened)

Obviously this is much better than the SMB functionality because it has a chance to recover as long as network is restored when cache hits 0. Ideally Kodi would start caching again as soon as network is restored on all protocols.
Nothing recovers from a connection loss, things get reset somewhere or may be handled in a way you guys dont expect.
Lets just say for arguments sake that the connection does not drop (my case), the over the air connection is shared with others and at times the bandwidth is not available.
In my example I am not able to attain 40Mbit+ for Bluray streaming. I have a very capable N300 router and (5 meters away) slightly less so NUC 2820..., for the life of me I cannot get into the Bluray speed..., but its close.
My thinking is that the buffering could take a bigger role here as well as perhaps some wifi settings within Ubuntu that will help.

Can anyone think of ways of improving the WiFi situation ?
astropolak

FTP is able to recover after a connection loss without video interruption, but that is not your issue so I am not sure the protocol matters as much. Can you ever stream at a speed needed for bluray when others are not using wifi?

If you can reach the speed needed for bluray, you just need to increase the buffer size to something large enough to compensate for the time during playback it is unable to transfer fast enough. I cannot tell you how big that will need to be. You will just need to test larger and larger sizes until you get smooth playback.

If you cannot ever reach the speed needed for bluray your only options are

1. Wireless with a large enough buffer that the video will be able to finish before the buffer runs out. This would also require a period of buffering before starting the video.
2. Wired connection or local playback
Ok I have a solution that solves all problems at least for Linux. Not sure if you could use mapped drives on Windows to accomplish the same thing.

https://wiki.ubuntu.com/MountWindowsSharesPermanently

Mount the SMB share so it appears as a local folder to Kodi. This may work with FTP also, I just haven't tried.

All the below works
1. Resume
2. Delete/Rename
3. Will begin caching again as soon as network is restored! Yay! This should give an experience that is as good as possible and with a large enough cache, video should never stop unless there are severe network issues.