Skip to content

Commit

Permalink
[rbp] Experimental limit libass cache size depending on arm memory size
Browse files Browse the repository at this point in the history
  • Loading branch information
popcornmix committed Apr 3, 2020
1 parent 21aff82 commit ad61386
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion xbmc/platform/linux/RBP.cpp
Expand Up @@ -90,6 +90,8 @@ void CRBP::InitializeSettings()
{
if (m_initialized && CServiceBroker::GetSettingsComponent()->GetAdvancedSettings()->m_cacheMemSize == ~0U)
CServiceBroker::GetSettingsComponent()->GetAdvancedSettings()->m_cacheMemSize = m_arm_mem < 256 ? 1024 * 1024 * 2 : 1024 * 1024 * 20;
if (m_initialized && CServiceBroker::GetSettingsComponent()->GetAdvancedSettings()->m_libAssCache == ~0U)
CServiceBroker::GetSettingsComponent()->GetAdvancedSettings()->m_libAssCache = m_arm_mem < 256 ? 21 : m_arm_mem < 512 ? 42 : 96;
}

bool CRBP::Initialize()
Expand Down Expand Up @@ -145,7 +147,7 @@ void CRBP::LogFirmwareVersion()
response[sizeof(response) - 1] = '\0';
CLog::Log(LOGNOTICE, "Raspberry PI firmware version: %s", response);
CLog::Log(LOGNOTICE, "ARM mem: %dMB GPU mem: %dMB MPG2:%d WVC1:%d", m_arm_mem, m_gpu_mem, m_codec_mpg2_enabled, m_codec_wvc1_enabled);
CLog::Log(LOGNOTICE, "cache.memorysize: %dMB", CServiceBroker::GetSettingsComponent()->GetAdvancedSettings()->m_cacheMemSize >> 20);
CLog::Log(LOGNOTICE, "cache.memorysize: %dMB libass.cache: %dMB", CServiceBroker::GetSettingsComponent()->GetAdvancedSettings()->m_cacheMemSize >> 20, CServiceBroker::GetSettingsComponent()->GetAdvancedSettings()->m_libAssCache);
m_DllBcmHost->vc_gencmd(response, sizeof response, "get_config int");
response[sizeof(response) - 1] = '\0';
CLog::Log(LOGNOTICE, "Config:\n%s", response);
Expand Down
3 changes: 2 additions & 1 deletion xbmc/settings/AdvancedSettings.cpp
Expand Up @@ -389,10 +389,11 @@ void CAdvancedSettings::Initialize()
#ifdef TARGET_RASPBERRY_PI
// want default to be memory dependent, but interface to gpu not available yet, so set in RBP.cpp
m_cacheMemSize = ~0;
m_libAssCache = ~0;
#else
m_cacheMemSize = 1024 * 1024 * 20; // 20 MiB
#endif
m_libAssCache = 0;
#endif

m_cacheBufferMode = CACHE_BUFFER_MODE_INTERNET; // Default (buffer all internet streams/filesystems)
m_cacheChunkSize = 128 * 1024; // 128 KiB
Expand Down

0 comments on commit ad61386

Please sign in to comment.