Merge remote-tracking branch 'upstream/master' into openelec-settings

This commit is contained in:
Stefan Saraev 2013-03-12 14:45:09 +02:00
commit bdf4bbccc2
11 changed files with 13256 additions and 7630 deletions

View File

@ -19,7 +19,7 @@
################################################################################
PKG_NAME="xbmc-theme-Confluence"
PKG_VERSION="12.0.5"
PKG_VERSION="12.0.6"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="GPL"

View File

@ -19,7 +19,7 @@
################################################################################
PKG_NAME="xbmc"
PKG_VERSION="12.0.5"
PKG_VERSION="12.0.6"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="GPL"

View File

@ -0,0 +1,144 @@
From f2faaa846e03cbcc1ba11f09baad690c792035c5 Mon Sep 17 00:00:00 2001
From: fritsch <Peter.Fruehberger@gmail.com>
Date: Thu, 28 Feb 2013 00:17:03 +0100
Subject: [PATCH] AE: Revisit Device Opening. Try to set periodSize of 100 ms
and BufferSize of 800 ms
---
xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp | 98 ++++++++++++++++-----------
1 file changed, 59 insertions(+), 39 deletions(-)
diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp
index fe40d17..821bd2e 100644
--- a/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp
+++ b/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp
@@ -38,7 +38,6 @@
#endif
#define ALSA_OPTIONS (SND_PCM_NONBLOCK | SND_PCM_NO_AUTO_FORMAT | SND_PCM_NO_AUTO_CHANNELS | SND_PCM_NO_AUTO_RESAMPLE)
-#define ALSA_PERIODS 16
#define ALSA_MAX_CHANNELS 16
static enum AEChannel ALSAChannelMap[ALSA_MAX_CHANNELS + 1] = {
@@ -328,59 +327,80 @@ bool CAESinkALSA::InitializeHW(AEAudioFormat &format)
}
}
- unsigned int periods;
-
snd_pcm_uframes_t periodSize, bufferSize;
snd_pcm_hw_params_get_buffer_size_max(hw_params, &bufferSize);
+ snd_pcm_hw_params_get_period_size_max(hw_params, &periodSize, NULL);
+
+ /*
+ We want to make sure, that we have approx 500 to 800 ms Buffer with
+ a periodSize of approx 100 ms.
+ It is calced:
+ periodSize = sampleRate / 10
+ buffersize = periodSize * 1 frame * 8.
+ */
+ periodSize = std::min(periodSize, (snd_pcm_uframes_t) sampleRate / 10);
+ bufferSize = std::min(bufferSize, (snd_pcm_uframes_t) periodSize * 8);
+
+ /*
+ According to upstream we should set buffer size first - so make sure it is always at least
+ double of period size to not get underruns
+ */
+ periodSize = std::min(periodSize, bufferSize / 2);
- bufferSize = std::min(bufferSize, (snd_pcm_uframes_t)8192);
- periodSize = bufferSize / ALSA_PERIODS;
- periods = ALSA_PERIODS;
-
- CLog::Log(LOGDEBUG, "CAESinkALSA::InitializeHW - Request: periodSize %lu, periods %u, bufferSize %lu", periodSize, periods, bufferSize);
+ CLog::Log(LOGDEBUG, "CAESinkALSA::InitializeHW - Request: periodSize %lu, bufferSize %lu", periodSize, bufferSize);
- /* work on a copy of the hw params */
snd_pcm_hw_params_t *hw_params_copy;
snd_pcm_hw_params_alloca(&hw_params_copy);
-
- /* try to set the buffer size then the period size */
- snd_pcm_hw_params_copy(hw_params_copy, hw_params);
- snd_pcm_hw_params_set_buffer_size_near(m_pcm, hw_params_copy, &bufferSize);
- snd_pcm_hw_params_set_period_size_near(m_pcm, hw_params_copy, &periodSize, NULL);
- snd_pcm_hw_params_set_periods_near (m_pcm, hw_params_copy, &periods , NULL);
- if (snd_pcm_hw_params(m_pcm, hw_params_copy) != 0)
+ snd_pcm_hw_params_copy(hw_params_copy, hw_params); // copy what we have and is already working
+
+ // first trying bufferSize, PeriodSize
+ // for more info see here:
+ // http://mailman.alsa-project.org/pipermail/alsa-devel/2009-September/021069.html
+ // the last three tries are done as within pulseaudio
+
+ // backup periodSize and bufferSize first. Restore them after every failed try
+ snd_pcm_uframes_t periodSizeTemp, bufferSizeTemp;
+ periodSizeTemp = periodSize;
+ bufferSizeTemp = bufferSize;
+ if (snd_pcm_hw_params_set_buffer_size_near(m_pcm, hw_params_copy, &bufferSize) != 0
+ || snd_pcm_hw_params_set_period_size_near(m_pcm, hw_params_copy, &periodSize, NULL) != 0
+ || snd_pcm_hw_params(m_pcm, hw_params_copy) != 0)
{
- /* try to set the period size then the buffer size */
- snd_pcm_hw_params_copy(hw_params_copy, hw_params);
- snd_pcm_hw_params_set_period_size_near(m_pcm, hw_params_copy, &periodSize, NULL);
- snd_pcm_hw_params_set_buffer_size_near(m_pcm, hw_params_copy, &bufferSize);
- snd_pcm_hw_params_set_periods_near (m_pcm, hw_params_copy, &periods , NULL);
- if (snd_pcm_hw_params(m_pcm, hw_params_copy) != 0)
+ bufferSize = bufferSizeTemp;
+ periodSize = periodSizeTemp;
+ // retry with PeriodSize, bufferSize
+ snd_pcm_hw_params_copy(hw_params_copy, hw_params); // restore working copy
+ if (snd_pcm_hw_params_set_period_size_near(m_pcm, hw_params_copy, &periodSize, NULL) != 0
+ || snd_pcm_hw_params_set_buffer_size_near(m_pcm, hw_params_copy, &bufferSize) != 0
+ || snd_pcm_hw_params(m_pcm, hw_params_copy) != 0)
{
- /* try to just set the buffer size */
- snd_pcm_hw_params_copy(hw_params_copy, hw_params);
- snd_pcm_hw_params_set_buffer_size_near(m_pcm, hw_params_copy, &bufferSize);
- snd_pcm_hw_params_set_periods_near (m_pcm, hw_params_copy, &periods , NULL);
- if (snd_pcm_hw_params(m_pcm, hw_params_copy) != 0)
+ // try only periodSize
+ periodSize = periodSizeTemp;
+ snd_pcm_hw_params_copy(hw_params_copy, hw_params); // restore working copy
+ if(snd_pcm_hw_params_set_period_size_near(m_pcm, hw_params_copy, &periodSize, NULL) != 0
+ || snd_pcm_hw_params(m_pcm, hw_params_copy) != 0)
{
- /* try to just set the period size */
- snd_pcm_hw_params_copy(hw_params_copy, hw_params);
- snd_pcm_hw_params_set_period_size_near(m_pcm, hw_params_copy, &periodSize, NULL);
- snd_pcm_hw_params_set_periods_near (m_pcm, hw_params_copy, &periods , NULL);
- if (snd_pcm_hw_params(m_pcm, hw_params_copy) != 0)
+ // try only BufferSize
+ bufferSize = bufferSizeTemp;
+ snd_pcm_hw_params_copy(hw_params_copy, hw_params); // restory working copy
+ if (snd_pcm_hw_params_set_buffer_size_near(m_pcm, hw_params_copy, &bufferSize) != 0
+ || snd_pcm_hw_params(m_pcm, hw_params_copy) != 0)
{
- CLog::Log(LOGERROR, "CAESinkALSA::InitializeHW - Failed to set the parameters");
- return false;
+ // set default that Alsa would choose
+ CLog::Log(LOGWARNING, "CAESinkAlsa::IntializeHW - Using default alsa values - set failed");
+ if (snd_pcm_hw_params(m_pcm, hw_params) != 0)
+ {
+ CLog::Log(LOGDEBUG, "CAESinkALSA::InitializeHW - Could not init a valid sink");
+ return false;
+ }
}
}
+ // reread values when alsa default was kept
+ snd_pcm_get_params(m_pcm, &bufferSize, &periodSize);
}
}
-
- snd_pcm_hw_params_get_period_size(hw_params_copy, &periodSize, NULL);
- snd_pcm_hw_params_get_buffer_size(hw_params_copy, &bufferSize);
-
- CLog::Log(LOGDEBUG, "CAESinkALSA::InitializeHW - Got: periodSize %lu, periods %u, bufferSize %lu", periodSize, periods, bufferSize);
+ CLog::Log(LOGDEBUG, "CAESinkALSA::InitializeHW - Got: periodSize %lu, bufferSize %lu", periodSize, bufferSize);
/* set the format parameters */
format.m_sampleRate = sampleRate;
--
1.7.10

View File

@ -0,0 +1,46 @@
From eb4ae32119a83716d7fb930381d2848c02383cea Mon Sep 17 00:00:00 2001
From: fritsch <peter.fruehberger@gmail.com>
Date: Wed, 6 Mar 2013 07:52:59 +0100
Subject: [PATCH] AE: Fix menu sounds by decreasing buffer(max 200 ms) and
periodSize(50 ms)
---
xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp
index 821bd2e..21891a5 100644
--- a/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp
+++ b/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp
@@ -332,18 +332,19 @@ bool CAESinkALSA::InitializeHW(AEAudioFormat &format)
snd_pcm_hw_params_get_period_size_max(hw_params, &periodSize, NULL);
/*
- We want to make sure, that we have approx 500 to 800 ms Buffer with
- a periodSize of approx 100 ms.
- It is calced:
- periodSize = sampleRate / 10
- buffersize = periodSize * 1 frame * 8.
+ We want to make sure, that we have max 200 ms Buffer with
+ a periodSize of approx 50 ms. Choosing a higher bufferSize
+ will cause problems with menu sounds. Buffer will be increased
+ after those are fixed.
+ periodSize = sampleRate / 20
+ bufferSize = periodSize * 1 frame * 4.
*/
- periodSize = std::min(periodSize, (snd_pcm_uframes_t) sampleRate / 10);
- bufferSize = std::min(bufferSize, (snd_pcm_uframes_t) periodSize * 8);
+ periodSize = std::min(periodSize, (snd_pcm_uframes_t) sampleRate / 20);
+ bufferSize = std::min(bufferSize, (snd_pcm_uframes_t) periodSize * 4);
/*
- According to upstream we should set buffer size first - so make sure it is always at least
- double of period size to not get underruns
+ According to upstream we should set buffer size first - so make sure it is always at least
+ double of period size to not get underruns
*/
periodSize = std::min(periodSize, bufferSize / 2);
--
1.7.10

View File

@ -0,0 +1,59 @@
From 95ea48d4353516c59e70c962c4970da0bd511aac Mon Sep 17 00:00:00 2001
From: Anssi Hannula <anssi@xbmc.org>
Date: Mon, 11 Mar 2013 00:05:13 +0200
Subject: [PATCH 1/2] AE: ALSA: Try to get 200ms buffer even if we did not get
50ms periodsize
---
xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp
index 332f305..b905ada 100644
--- a/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp
+++ b/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp
@@ -340,11 +340,9 @@ bool CAESinkALSA::InitializeHW(AEAudioFormat &format)
a periodSize of approx 50 ms. Choosing a higher bufferSize
will cause problems with menu sounds. Buffer will be increased
after those are fixed.
- periodSize = sampleRate / 20
- bufferSize = periodSize * 1 frame * 4.
*/
periodSize = std::min(periodSize, (snd_pcm_uframes_t) sampleRate / 20);
- bufferSize = std::min(bufferSize, (snd_pcm_uframes_t) periodSize * 4);
+ bufferSize = std::min(bufferSize, (snd_pcm_uframes_t) sampleRate / 5);
/*
According to upstream we should set buffer size first - so make sure it is always at least
--
1.7.10
From 39f2487881b6fa2d52c58f7b2452420efc711cd5 Mon Sep 17 00:00:00 2001
From: Anssi Hannula <anssi@xbmc.org>
Date: Mon, 11 Mar 2013 00:12:54 +0200
Subject: [PATCH 2/2] AE: ALSA: Try to get a minimum of 4 periods per buffer
---
xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp
index b905ada..94f6b80 100644
--- a/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp
+++ b/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp
@@ -346,9 +346,9 @@ bool CAESinkALSA::InitializeHW(AEAudioFormat &format)
/*
According to upstream we should set buffer size first - so make sure it is always at least
- double of period size to not get underruns
+ 4x period size to not get underruns (some systems seem to have issues with only 2 periods)
*/
- periodSize = std::min(periodSize, bufferSize / 2);
+ periodSize = std::min(periodSize, bufferSize / 4);
CLog::Log(LOGDEBUG, "CAESinkALSA::InitializeHW - Request: periodSize %lu, bufferSize %lu", periodSize, bufferSize);
--
1.7.10

View File

@ -0,0 +1,51 @@
From 5385b26621a8d966f187f7b63dfaa8f336beb9a5 Mon Sep 17 00:00:00 2001
From: Lars Op den Kamp <lars@opdenkamp.eu>
Date: Tue, 12 Mar 2013 10:20:27 +0100
Subject: [PATCH] [cec] extra guards around m_queryThread
---
xbmc/peripherals/devices/PeripheralCecAdapter.cpp | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/xbmc/peripherals/devices/PeripheralCecAdapter.cpp b/xbmc/peripherals/devices/PeripheralCecAdapter.cpp
index 4cdd3c4..6509c5d 100644
--- a/xbmc/peripherals/devices/PeripheralCecAdapter.cpp
+++ b/xbmc/peripherals/devices/PeripheralCecAdapter.cpp
@@ -99,8 +99,8 @@ class DllLibCEC : public DllDynamic, DllLibCECInterface
m_bStop = true;
}
- SAFE_DELETE(m_queryThread);
StopThread(true);
+ delete m_queryThread;
if (m_dll && m_cecAdapter)
{
@@ -389,7 +389,7 @@ void CPeripheralCecAdapter::Process(void)
Sleep(5);
}
- SAFE_DELETE(m_queryThread);
+ m_queryThread->StopThread(true);
bool bSendStandbyCommands(false);
{
@@ -1105,9 +1105,12 @@ void CPeripheralCecAdapter::OnSettingChanged(const CStdString &strChangedSetting
}
else if (IsRunning())
{
- CLog::Log(LOGDEBUG, "%s - sending the updated configuration to libCEC", __FUNCTION__);
- SetConfigurationFromSettings();
- m_queryThread->UpdateConfiguration(&m_configuration);
+ if (m_queryThread->IsRunning())
+ {
+ CLog::Log(LOGDEBUG, "%s - sending the updated configuration to libCEC", __FUNCTION__);
+ SetConfigurationFromSettings();
+ m_queryThread->UpdateConfiguration(&m_configuration);
+ }
}
else
{
--
1.7.10

View File

@ -0,0 +1,25 @@
From 9526c4ce7da5c70d8ba79a5c21e9d95c918ebadb Mon Sep 17 00:00:00 2001
From: Lars Op den Kamp <lars@opdenkamp.eu>
Date: Tue, 12 Mar 2013 11:08:55 +0100
Subject: [PATCH] [cec] and let's init m_queryThread to NULL so we won't crash
on exit when CEC has been disabled
---
xbmc/peripherals/devices/PeripheralCecAdapter.cpp | 1 +
1 file changed, 1 insertion(+)
diff --git a/xbmc/peripherals/devices/PeripheralCecAdapter.cpp b/xbmc/peripherals/devices/PeripheralCecAdapter.cpp
index 6509c5d..61233bb 100644
--- a/xbmc/peripherals/devices/PeripheralCecAdapter.cpp
+++ b/xbmc/peripherals/devices/PeripheralCecAdapter.cpp
@@ -135,6 +135,7 @@ void CPeripheralCecAdapter::ResetMembers(void)
m_bActiveSourceBeforeStandby = false;
m_bOnPlayReceived = false;
m_bPlaybackPaused = false;
+ m_queryThread = NULL;
m_currentButton.iButton = 0;
m_currentButton.iDuration = 0;
--
1.7.10

View File

@ -0,0 +1,22 @@
From 1a5e251cc4382ad3e918af68072f2ba08e26574b Mon Sep 17 00:00:00 2001
From: ulion <ulion2002@gmail.com>
Date: Tue, 12 Mar 2013 06:40:54 +0800
Subject: [PATCH] Fix code generate problem with binary string.
---
xbmc/interfaces/python/typemaps/python.string.outtm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/xbmc/interfaces/python/typemaps/python.string.outtm b/xbmc/interfaces/python/typemaps/python.string.outtm
index cdfba2e..c396166 100644
--- a/xbmc/interfaces/python/typemaps/python.string.outtm
+++ b/xbmc/interfaces/python/typemaps/python.string.outtm
@@ -22,4 +22,4 @@
%>
${result} = <%
if(method.@feature_python_coerceToUnicode) { %>PyUnicode_DecodeUTF8(${api}.c_str(),${api}.size(),"replace");<% }
- else { %>PyString_FromString(${api}.c_str());<% } %>
+ else { %>PyString_FromStringAndSize(${api}.c_str(), ${api}.length());<% } %>
--
1.7.10

View File

@ -1,34 +0,0 @@
From 88e250d43dcb13ec2a05f64994c57a3d96b024b4 Mon Sep 17 00:00:00 2001
From: Jim Carroll <thecarrolls@jiminger.com>
Date: Mon, 11 Mar 2013 03:19:46 -0400
Subject: [PATCH] [fix] build issue with std::min on some platforms.
---
xbmc/interfaces/legacy/File.h | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/xbmc/interfaces/legacy/File.h b/xbmc/interfaces/legacy/File.h
index d8b5d26..d3c17b3 100644
--- a/xbmc/interfaces/legacy/File.h
+++ b/xbmc/interfaces/legacy/File.h
@@ -27,6 +27,8 @@
#include "LanguageHook.h"
#include "commons/Buffer.h"
+#include <algorithm>
+
namespace XBMCAddon
{
@@ -70,7 +72,7 @@
inline String read(unsigned long numBytes = 0)
{
XbmcCommons::Buffer b = readBytes(numBytes);
- return b.getString(numBytes == 0 ? b.remaining() : std::min(b.remaining(),numBytes));
+ return b.getString(numBytes == 0 ? b.remaining() : std::min((unsigned long)b.remaining(),numBytes));
}
/**
--
1.7.10

View File

@ -20,7 +20,7 @@
################################################################################
PKG_NAME="xbmc"
PKG_VERSION="12.0.5"
PKG_VERSION="12.0.6"
GIT_REPO="-b Frodo git://github.com/xbmc/xbmc.git"
DEST_DIR="$PKG_NAME-frodo"