diff --git a/projects/imx6/kodi/advancedsettings.xml b/projects/imx6/kodi/advancedsettings.xml
index e19d88653c..e29381ee2f 100644
--- a/projects/imx6/kodi/advancedsettings.xml
+++ b/projects/imx6/kodi/advancedsettings.xml
@@ -1,16 +1,21 @@
false
-
-
-
30
+
+ 20971520
+ 4.0
+
+
+ 1000
+ 1
+
diff --git a/projects/imx6/patches/RTL8812AU/RTL8812AU-010-compile-3.14.patch b/projects/imx6/patches/RTL8812AU/RTL8812AU-010-compile-3.14.patch
new file mode 100644
index 0000000000..b955621d8c
--- /dev/null
+++ b/projects/imx6/patches/RTL8812AU/RTL8812AU-010-compile-3.14.patch
@@ -0,0 +1,36 @@
+--- a/os_dep/linux/ioctl_cfg80211.c 2016-10-04 15:18:32.405995229 +0200
++++ b/os_dep/linux/ioctl_cfg80211.c 2016-10-04 15:18:37.653865585 +0200
+@@ -649,20 +649,16 @@ void rtw_cfg80211_ibss_indicate_connect(
+ struct wlan_network *cur_network = &(pmlmepriv->cur_network);
+ struct wireless_dev *pwdev = padapter->rtw_wdev;
+ struct cfg80211_bss *bss = NULL;
+-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0))
+ struct wiphy *wiphy = pwdev->wiphy;
+ int freq = 2412;
+ struct ieee80211_channel *notify_channel;
+-#endif
+
+ DBG_871X(FUNC_ADPT_FMT"\n", FUNC_ADPT_ARG(padapter));
+
+-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0))
+ freq = rtw_ch2freq(cur_network->network.Configuration.DSConfig);
+
+ if (0)
+ DBG_871X("chan: %d, freq: %d\n", cur_network->network.Configuration.DSConfig, freq);
+-#endif
+
+ if (pwdev->iftype != NL80211_IFTYPE_ADHOC)
+ {
+@@ -713,12 +709,8 @@ void rtw_cfg80211_ibss_indicate_connect(
+ DBG_871X_LEVEL(_drv_always_, FUNC_ADPT_FMT" BSS not found !!\n", FUNC_ADPT_ARG(padapter));
+ }
+ //notify cfg80211 that device joined an IBSS
+-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0))
+ notify_channel = ieee80211_get_channel(wiphy, freq);
+ cfg80211_ibss_joined(padapter->pnetdev, cur_network->network.MacAddress, notify_channel, GFP_ATOMIC);
+-#else
+- cfg80211_ibss_joined(padapter->pnetdev, cur_network->network.MacAddress, GFP_ATOMIC);
+-#endif
+ }
+
+ void rtw_cfg80211_indicate_connect(_adapter *padapter)
diff --git a/projects/imx6/patches/kodi/kodi-050-from-openbricks.patch b/projects/imx6/patches/kodi/kodi-050-from-openbricks.patch
new file mode 100644
index 0000000000..812ab1cd6f
--- /dev/null
+++ b/projects/imx6/patches/kodi/kodi-050-from-openbricks.patch
@@ -0,0 +1,3711 @@
+https://github.com/OpenBricks/openbricks/tree/krypton-glibc
+https://github.com/OpenBricks/openbricks/tree/krypton-glibc/packages/multimedia/kodi/patches
+https://github.com/OpenBricks/openbricks/tree/32da31689ba04a94d1a08bfc04f69d6c1a3c848a/packages/multimedia/kodi/patches
+
+==============================================================
+file 0010-IMX-add-Supports-ERENDERFEATURE.patch
+==============================================================
+
+From 5d60b324b6297b0f3355000cd65c10015c18798a Mon Sep 17 00:00:00 2001
+From: Matus Kral
+Date: Thu, 25 Aug 2016 21:52:39 +0200
+Subject: [PATCH] [IMX] add Supports(ERENDERFEATURE)
+
+---
+ xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecIMX.cpp | 3 ++-
+ xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecIMX.h | 2 ++
+ .../VideoPlayer/VideoRenderers/HwDecRender/RendererIMX.cpp | 12 ++++++++++++
+ .../VideoPlayer/VideoRenderers/HwDecRender/RendererIMX.h | 1 +
+ 4 files changed, 17 insertions(+), 1 deletion(-)
+
+diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecIMX.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecIMX.cpp
+index 4aae4c3..6b31ca5 100644
+--- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecIMX.cpp
++++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecIMX.cpp
+@@ -1709,6 +1709,7 @@ void CIMXContext::PrepareTask(IPUTaskPtr &ipu, CIMXBuffer *source_p, CIMXBuffer
+ bool CIMXContext::TileTask(IPUTaskPtr &ipu)
+ {
+ int pad = ipu->task.input.height == 1080 && ipu->current->iHeight>ipu->task.input.height ? 16*ipu->current->iWidth : 0;
++ m_zoomAllowed = true;
+
+ if (ipu->current->iFormat != _4CC('T', 'N', 'V', 'F') && ipu->current->iFormat != _4CC('T', 'N', 'V', 'P'))
+ {
+@@ -1725,13 +1726,13 @@ bool CIMXContext::TileTask(IPUTaskPtr &ipu)
+ // Use band mode directly to FB, as no transformations needed (eg cropping)
+ if (m_fps >= 49 && m_fbWidth == 1920 && ipu->task.input.width == 1920 && !ipu->task.input.deinterlace.enable)
+ {
++ m_zoomAllowed = false;
+ ipu->task.output.crop.pos.x = ipu->task.input.crop.pos.x = 0;
+ ipu->task.output.crop.pos.y = ipu->task.input.crop.pos.y = 0;
+ ipu->task.output.crop.h = ipu->task.input.height = ipu->task.input.crop.h = ipu->current->iHeight;
+ ipu->task.output.paddr += m_fbLineLength * (m_fbHeight - ipu->task.input.crop.h)/2;
+ return true;
+ }
+-
+ // rasterize from tile (frame)
+ struct ipu_task vdoa;
+
+diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecIMX.h b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecIMX.h
+index bde21ac..9b9f068 100644
+--- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecIMX.h
++++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecIMX.h
+@@ -116,6 +116,7 @@ public:
+ void SetVideoPixelFormat(CProcessInfo *m_pProcessInfo);
+
+ void SetBlitRects(const CRect &srcRect, const CRect &dstRect);
++ bool IsZoomAllowed() const { return m_zoomAllowed; }
+
+ // Blits a buffer to a particular page (-1 for auto page)
+ // source_p (previous buffer) is required for de-interlacing
+@@ -212,6 +213,7 @@ private:
+ CEvent m_waitFlip;
+ CProcessInfo *m_processInfo;
+
++ bool m_zoomAllowed;
+ CCriticalSection m_pageSwapLock;
+ public:
+ void *m_g2dHandle;
+diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererIMX.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererIMX.cpp
+index 73fc323..01272ff 100644
+--- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererIMX.cpp
++++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererIMX.cpp
+@@ -80,6 +80,18 @@ bool CRendererIMX::IsGuiLayer()
+ return false;
+ }
+
++bool CRendererIMX::Supports(ERENDERFEATURE feature)
++{
++ if (!g_IMXContext.IsZoomAllowed())
++ return false;
++
++ if (feature == RENDERFEATURE_PIXEL_RATIO ||
++ feature == RENDERFEATURE_ZOOM)
++ return true;
++
++ return false;
++}
++
+ bool CRendererIMX::Supports(EINTERLACEMETHOD method)
+ {
+ if(method == VS_INTERLACEMETHOD_AUTO)
+diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererIMX.h b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererIMX.h
+index 440badb..e2582a6 100644
+--- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererIMX.h
++++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererIMX.h
+@@ -44,6 +44,7 @@ public:
+ // Feature support
+ virtual bool Supports(EINTERLACEMETHOD method);
+ virtual bool Supports(ESCALINGMETHOD method);
++ virtual bool Supports(ERENDERFEATURE feature);
+
+ virtual bool WantsDoublePass() override;
+
+--
+1.9.1
+
+
+==============================================================
+file 0011-IMX-update-to-fps-detect.patch
+==============================================================
+
+From e2ac3ebc6bebd2dfdf4ad7d3bea5d5c629e85189 Mon Sep 17 00:00:00 2001
+From: Matus Kral
+Date: Fri, 26 Aug 2016 00:56:03 +0200
+Subject: [PATCH] [IMX] update to fps detect
+
+---
+ .../DVDCodecs/Video/DVDVideoCodecIMX.cpp | 27 +++++---
+ xbmc/linux/imx/IMX.cpp | 80 ++++++++++------------
+ xbmc/linux/imx/IMX.h | 16 ++---
+ 3 files changed, 62 insertions(+), 61 deletions(-)
+
+diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecIMX.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecIMX.cpp
+index 6b31ca5..bfb9a3f 100644
+--- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecIMX.cpp
++++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecIMX.cpp
+@@ -744,21 +744,23 @@ int CIMXCodec::Decode(BYTE *pData, int iSize, double dts, double pts)
+ int ret = 0;
+ if (!g_IMXCodec->IsRunning())
+ {
+- if ((!m_decInput.full() || !ptrn.Recalc()) && m_decInput.size() < 40)
++ if (!m_decInput.full())
+ {
+- if (m_decInput.full())
+- m_decInput.setquotasize(m_decInput.getquotasize()+1);
+-
+- if (dts != DVD_NOPTS_VALUE)
+- ptrn.Add(dts);
+- else if (pts != DVD_NOPTS_VALUE)
++ if (pts != DVD_NOPTS_VALUE)
+ ptrn.Add(pts);
++ else if (dts != DVD_NOPTS_VALUE)
++ ptrn.Add(dts);
+
+ ret |= VC_BUFFER;
+ }
+ else
+ {
+- m_fps = DVD_TIME_BASE / ptrn.GetFrameDuration();
++ double fd = ptrn.GetFrameDuration(true);
++ if (!fd && m_hints.fpsscale)
++ m_fps = (double)m_hints.fpsrate / m_hints.fpsscale;
++ else if (fd)
++ m_fps = DVD_TIME_BASE / fd;
++
+ m_decOpenParam.nMapType = 1;
+
+ ptrn.Flush();
+@@ -940,9 +942,12 @@ void CIMXCodec::Process()
+ m_decOpenParam.nMapType = 0;
+ Dispose();
+ VpuOpen();
+- m_fps /= 2;
+ continue;
+ }
++
++ if (m_initInfo.nInterlace && m_fps <= 30)
++ m_fps *= 2;
++
+ m_processInfo->SetVideoFps(m_fps);
+
+ CLog::Log(LOGDEBUG, "%s - VPU Init Stream Info : %dx%d (interlaced : %d - Minframe : %d)"\
+@@ -1277,7 +1282,7 @@ bool CIMXContext::AdaptScreen(bool allocate)
+ m_fbVar.xoffset = 0;
+ m_fbVar.yoffset = 0;
+
+- if (!allocate && (fbVar.bits_per_pixel == 16 || m_currentFieldFmt || (m_fbHeight >= 1080 && m_fps >= 49)))
++ if (!allocate && (fbVar.bits_per_pixel == 16 || m_fps >= 49))
+ {
+ m_fbVar.nonstd = _4CC('Y', 'U', 'Y', 'V');
+ m_fbVar.bits_per_pixel = 16;
+@@ -1724,7 +1729,7 @@ bool CIMXContext::TileTask(IPUTaskPtr &ipu)
+ }
+
+ // Use band mode directly to FB, as no transformations needed (eg cropping)
+- if (m_fps >= 49 && m_fbWidth == 1920 && ipu->task.input.width == 1920 && !ipu->task.input.deinterlace.enable)
++ if (m_fps > 51 && m_fbWidth == 1920 && ipu->task.input.width == 1920 && !ipu->task.input.deinterlace.enable)
+ {
+ m_zoomAllowed = false;
+ ipu->task.output.crop.pos.x = ipu->task.input.crop.pos.x = 0;
+diff --git a/xbmc/linux/imx/IMX.cpp b/xbmc/linux/imx/IMX.cpp
+index e4284ac..ee4e60a 100644
+--- a/xbmc/linux/imx/IMX.cpp
++++ b/xbmc/linux/imx/IMX.cpp
+@@ -36,14 +36,10 @@
+ #include "windowing/WindowingFactory.h"
+ #include "utils/log.h"
+ #include "guilib/GraphicContext.h"
+-#include "utils/MathUtils.h"
+-#include "DVDClock.h"
+ #include "cores/VideoPlayer/DVDCodecs/DVDCodecUtils.h"
+-
+-#include
++#include "utils/StringUtils.h"
+
+ #define DCIC_DEVICE "/dev/mxc_dcic0"
+-#define FB_DEVICE "/dev/fb0"
+
+ CIMX::CIMX(void) : CThread("CIMX")
+ , m_change(true)
+@@ -162,7 +158,6 @@ void CIMX::OnResetDisplay()
+ m_change = true;
+ }
+
+-
+ bool CIMXFps::Recalc()
+ {
+ double prev = DVD_NOPTS_VALUE;
+@@ -175,54 +170,57 @@ bool CIMXFps::Recalc()
+ m_hgraph.clear();
+ for (auto d : m_ts)
+ {
+- if (d != 0.0 && prev != DVD_NOPTS_VALUE)
+- m_hgraph[MathUtils::round_int(d - prev)]++;
++ if (prev != DVD_NOPTS_VALUE)
++ {
++ frameDuration = CDVDCodecUtils::NormalizeFrameduration((d - prev), &hasMatch);
++ if (fabs(frameDuration - rint(frameDuration)) < 0.01)
++ frameDuration = rint(frameDuration);
++
++ m_hgraph[(unsigned long)(frameDuration * 100)]++;
++ }
+ prev = d;
+ }
+
+- unsigned int patternLength = 0;
+ for (auto it = m_hgraph.begin(); it != m_hgraph.end();)
+ {
+- if (it->second > 1)
++ if (it->second > 2)
+ {
+- count += it->second;
+- frameDuration += it->first * it->second;
++ double duration = CDVDCodecUtils::NormalizeFrameduration((double)it->first / 100, &hasMatch);
++
+ ++it;
+ }
+ else
++ {
++ for (auto iti = m_hgraph.begin(); it != iti; iti++)
++ {
++ if (!iti->first)
++ continue;
++ int dv = it->first / iti->first;
++ if (dv * iti->first == it->first)
++ {
++ m_hgraph[it->first] += dv;
++ break;
++ }
++ }
+ m_hgraph.erase(it++);
++ }
+ }
+
+- if (count)
+- frameDuration /= count;
+-
+- double frameNorm = CDVDCodecUtils::NormalizeFrameduration(frameDuration, &hasMatch);
+-
+- if (hasMatch && !patternLength)
+- m_patternLength = 1;
+- else
+- m_patternLength = patternLength;
+-
+- if (!m_hasPattern && hasMatch)
+- m_frameDuration = frameNorm;
+-
+- if ((m_ts.size() == DIFFRINGSIZE && !m_hasPattern && hasMatch))
+- m_hasPattern = true;
+-
+- if (m_hasPattern)
+- m_ptscorrection = (m_ts.size() - 1) * m_frameDuration + m_ts.front() - m_ts.back();
+-
+- if (m_hasPattern && m_ts.size() == DIFFRINGSIZE && m_ptscorrection > m_frameDuration / 4)
++ frameDuration = 0.0;
++ for (auto h : m_hgraph)
+ {
+- m_hasPattern = false;
+- m_frameDuration = DVD_NOPTS_VALUE;
++ count += h.second;
++ frameDuration += h.first * h.second;
+ }
+
+- return m_hgraph.size() <= 2;
+- bool ret = m_hgraph.size() <= 2;
+- if (!m_hasPattern && ret)
+- m_frameDuration = frameNorm;
+- return ret;
++ if (count)
++ frameDuration /= (100 * count);
++
++ frameDuration = CDVDCodecUtils::NormalizeFrameduration(frameDuration, &hasMatch);
++
++ if (hasMatch)
++ m_frameDuration = frameDuration;
++ return true;
+ }
+
+ void CIMXFps::Add(double tm)
+@@ -235,8 +233,6 @@ void CIMXFps::Add(double tm)
+
+ void CIMXFps::Flush()
+ {
++ m_frameDuration = DVD_NOPTS_VALUE;
+ m_ts.clear();
+- m_frameDuration = 0.0;
+- m_ptscorrection = 0.0;
+- m_hasPattern = false;
+ }
+diff --git a/xbmc/linux/imx/IMX.h b/xbmc/linux/imx/IMX.h
+index 1c5f15e..c0a13cd 100644
+--- a/xbmc/linux/imx/IMX.h
++++ b/xbmc/linux/imx/IMX.h
+@@ -24,6 +24,7 @@
+ #include "threads/Thread.h"
+ #include "guilib/DispResource.h"
+ #include "utils/log.h"
++#include "cores/VideoPlayer/DVDClock.h"
+
+ #include
+ #include
+@@ -32,9 +33,12 @@
+ #include
+ #include
+ #include