From 8c8ae9595c331f5c2540289d6b552c81b9a93072 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Mon, 21 Aug 2017 12:53:05 +0200 Subject: [PATCH 1/2] Revert "- neutrino: fix hw_caps init; it must be initialized after zapit start" This reverts commit edb0a5937e30477f633550c18c87cdfa6c2a5827. --- src/neutrino.cpp | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 519ebdfda..99c17645d 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -456,22 +456,14 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.hdd_noise = configfile.getInt32( "hdd_noise", 254); g_settings.hdd_statfs_mode = configfile.getInt32( "hdd_statfs_mode", SNeutrinoSettings::HDD_STATFS_RECORDING); - /* - hw_caps needs CFEManager and CFEManager needs g_settings. - So loadSetup() cannot use hw_caps to init g_settings. - - For this reason we need this workaround. - */ - bool can_shutdown = (cs_get_revision() > 7); - g_settings.shutdown_real = false; - if (can_shutdown) //(g_info.hw_caps->can_shutdown) + if (g_info.hw_caps->can_shutdown) g_settings.shutdown_real = configfile.getBool("shutdown_real" , false ); g_settings.shutdown_real_rcdelay = configfile.getBool("shutdown_real_rcdelay", false ); g_settings.shutdown_count = configfile.getInt32("shutdown_count", 0); g_settings.shutdown_min = 0; - if (can_shutdown) //(g_info.hw_caps->can_shutdown) + if (g_info.hw_caps->can_shutdown) g_settings.shutdown_min = configfile.getInt32("shutdown_min", 180); g_settings.sleeptimer_min = configfile.getInt32("sleeptimer_min", 0); @@ -2158,6 +2150,8 @@ TIMER_START(); cs_new_auto_videosystem(); #endif + g_info.hw_caps = get_hwcaps(); + g_Locale = new CLocaleManager; int loadSettingsErg = loadSetup(NEUTRINO_SETTINGS_FILE); @@ -2245,9 +2239,6 @@ TIMER_START(); CheckFastScan(); - // init hw_caps *after* zapit start! - g_info.hw_caps = get_hwcaps(); - //timer start timer_wakeup = false;//init wake_up( timer_wakeup ); From c307ed5b36178f97f75060147c3c16183f6ee816 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 14 Aug 2017 10:56:45 +0200 Subject: [PATCH 2/2] - hw_caps: remove CFEManager-code; ... the relevant boxmodels are handled now in a "dirty part of hw_caps" in neutrino.cpp after zapit-start --- lib/hardware/coolstream/Makefile.am | 7 ------- lib/hardware/coolstream/hardware_caps.cpp | 13 ++----------- src/neutrino.cpp | 14 ++++++++++++++ 3 files changed, 16 insertions(+), 18 deletions(-) diff --git a/lib/hardware/coolstream/Makefile.am b/lib/hardware/coolstream/Makefile.am index 82f3ab83c..b2a96b31e 100644 --- a/lib/hardware/coolstream/Makefile.am +++ b/lib/hardware/coolstream/Makefile.am @@ -1,13 +1,6 @@ AM_CXXFLAGS = -fno-rtti -fno-exceptions -fno-strict-aliasing AM_CPPFLAGS = \ - -I$(top_builddir) \ - -I$(top_srcdir) \ - -I$(top_srcdir)/src \ - -I$(top_srcdir)/src/zapit/include \ - -I$(top_srcdir)/lib \ - -I$(top_srcdir)/lib/libconfigfile \ - -I$(top_srcdir)/lib/libeventserver \ @HWLIB_CFLAGS@ noinst_LIBRARIES = libhwcaps.a diff --git a/lib/hardware/coolstream/hardware_caps.cpp b/lib/hardware/coolstream/hardware_caps.cpp index 139825c32..0922eb655 100644 --- a/lib/hardware/coolstream/hardware_caps.cpp +++ b/lib/hardware/coolstream/hardware_caps.cpp @@ -11,8 +11,6 @@ #include #include "hardware_caps.h" -#include - static int initialized = 0; static hw_caps_t caps; @@ -21,7 +19,7 @@ hw_caps_t *get_hwcaps(void) { return ∩︀ int rev = cs_get_revision(); int chip = cs_get_chip_type(); - caps.has_fan = (rev < 8 && CFEManager::getInstance()->getFE(0)->hasSat()); // only SAT-HD1 before rev 8 has fan + caps.has_fan = (rev < 8); // see dirty part of hw_caps in neutrino.cpp caps.has_HDMI = 1; caps.has_SCART = (rev != 10); caps.has_SCART_input = 0; @@ -44,14 +42,7 @@ hw_caps_t *get_hwcaps(void) { caps.force_tuner_2G = 1; break; case 8: - if (CFEManager::getInstance()->getFrontendCount() < 2) - { - strcpy(caps.boxname, "Neo"); - } - else - { - strcpy(caps.boxname, "Neo Twin"); - } + strcpy(caps.boxname, "Neo"); // see dirty part of hw_caps in neutrino.cpp strcpy(caps.boxarch, "Nevis"); caps.force_tuner_2G = 1; break; diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 99c17645d..080a31d07 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -2239,6 +2239,20 @@ TIMER_START(); CheckFastScan(); + // dirty part of hw_caps - specify some details after zapit start + if (strcmp(g_info.hw_caps->boxname, "HD1") == 0) + { + // only SAT-HD1 has fan + if (!CFEManager::getInstance()->getFE(0)->hasSat()) + g_info.hw_caps->has_fan = 0; + } + if (strcmp(g_info.hw_caps->boxname, "Neo") == 0) + { + // detecting Neo Twin by counting frontends + if (CFEManager::getInstance()->getFrontendCount() > 1) + strcpy(g_info.hw_caps->boxname, "Neo Twin"); + } + //timer start timer_wakeup = false;//init wake_up( timer_wakeup );