mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-27 15:32:59 +02:00
-fix CEC (timer record)
This commit is contained in:
@@ -1719,7 +1719,42 @@ void CNeutrinoApp::InitSectiondClient()
|
|||||||
g_Sectionsd->registerEvent(CSectionsdClient::EVT_WRITE_SI_FINISHED, 222, NEUTRINO_UDS_NAME);
|
g_Sectionsd->registerEvent(CSectionsdClient::EVT_WRITE_SI_FINISHED, 222, NEUTRINO_UDS_NAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
extern bool timer_wakeup;//timermanager.cpp
|
#if HAVE_COOL_HARDWARE
|
||||||
|
#include <coolstream/cs_vfd.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
void wake_up( bool &wakeup)
|
||||||
|
{
|
||||||
|
#if HAVE_COOL_HARDWARE
|
||||||
|
#ifndef FP_IOCTL_CLEAR_WAKEUP_TIMER
|
||||||
|
#define FP_IOCTL_CLEAR_WAKEUP_TIMER 10
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define FP_IOCTL_SET_RTC 0x101
|
||||||
|
#define FP_IOCTL_GET_RTC 0x102
|
||||||
|
|
||||||
|
int fd = open("/dev/display", O_RDONLY);
|
||||||
|
if (fd < 0) {
|
||||||
|
perror("/dev/display");
|
||||||
|
} else {
|
||||||
|
wakeup_data_t wk;
|
||||||
|
memset(&wk, 0, sizeof(wk));
|
||||||
|
int ret = ioctl(fd, IOC_VFD_GET_WAKEUP, &wk);
|
||||||
|
if(ret >= 0)
|
||||||
|
wakeup = ((wk.source == WAKEUP_SOURCE_TIMER) /* || (wk.source == WAKEUP_SOURCE_PWLOST)*/);
|
||||||
|
close(fd);
|
||||||
|
}
|
||||||
|
printf("[timerd] wakeup from standby: %s\n", wakeup ? "yes" : "no");
|
||||||
|
if(!wakeup){
|
||||||
|
const char *neutrino_leave_deepstandby_script = CONFIGDIR "/deepstandby.off";
|
||||||
|
printf("[%s] executing %s\n",__FILE__ ,neutrino_leave_deepstandby_script);
|
||||||
|
if (system(neutrino_leave_deepstandby_script) != 0)
|
||||||
|
perror( neutrino_leave_deepstandby_script );
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
int CNeutrinoApp::run(int argc, char **argv)
|
int CNeutrinoApp::run(int argc, char **argv)
|
||||||
{
|
{
|
||||||
CmdParser(argc, argv);
|
CmdParser(argc, argv);
|
||||||
@@ -1788,7 +1823,9 @@ TIMER_START();
|
|||||||
g_Zapit->setStandby(false);
|
g_Zapit->setStandby(false);
|
||||||
|
|
||||||
//timer start
|
//timer start
|
||||||
pthread_create (&timer_thread, NULL, timerd_main_thread, (void *) NULL);
|
bool timer_wakeup = false;
|
||||||
|
wake_up( timer_wakeup );
|
||||||
|
pthread_create (&timer_thread, NULL, timerd_main_thread, (void *) timer_wakeup);
|
||||||
|
|
||||||
init_cec_setting = true;
|
init_cec_setting = true;
|
||||||
if(!(g_settings.shutdown_timer_record_type && timer_wakeup && g_settings.hdmi_cec_mode)){
|
if(!(g_settings.shutdown_timer_record_type && timer_wakeup && g_settings.hdmi_cec_mode)){
|
||||||
|
@@ -461,7 +461,7 @@ bool timerd_parse_command(CBasicMessage::Header &rmsg, int connfd)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
int timerd_main_thread(void */*data*/)
|
int timerd_main_thread(void *data)
|
||||||
{
|
{
|
||||||
pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS, 0);
|
pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS, 0);
|
||||||
|
|
||||||
@@ -474,6 +474,7 @@ int timerd_main_thread(void */*data*/)
|
|||||||
|
|
||||||
// Start timer thread
|
// Start timer thread
|
||||||
CTimerManager::getInstance();
|
CTimerManager::getInstance();
|
||||||
|
CTimerManager::getInstance()->wakeup =(bool)data;
|
||||||
|
|
||||||
timerd_server.run(timerd_parse_command, CTimerdMsg::ACTVERSION);
|
timerd_server.run(timerd_parse_command, CTimerdMsg::ACTVERSION);
|
||||||
printf("timerd shutdown complete\n");
|
printf("timerd shutdown complete\n");
|
||||||
|
@@ -33,9 +33,6 @@
|
|||||||
#include <timerdclient/timerdclient.h>
|
#include <timerdclient/timerdclient.h>
|
||||||
#include <timerdclient/timerdmsg.h>
|
#include <timerdclient/timerdmsg.h>
|
||||||
#include <sectionsdclient/sectionsdclient.h>
|
#include <sectionsdclient/sectionsdclient.h>
|
||||||
#if HAVE_COOL_HARDWARE
|
|
||||||
#include <coolstream/cs_vfd.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
@@ -43,17 +40,10 @@
|
|||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#include "timermanager.h"
|
#include "timermanager.h"
|
||||||
|
|
||||||
#ifndef FP_IOCTL_CLEAR_WAKEUP_TIMER
|
|
||||||
#define FP_IOCTL_CLEAR_WAKEUP_TIMER 10
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define FP_IOCTL_SET_RTC 0x101
|
|
||||||
#define FP_IOCTL_GET_RTC 0x102
|
|
||||||
|
|
||||||
extern bool timeset;
|
extern bool timeset;
|
||||||
time_t timer_minutes;
|
time_t timer_minutes;
|
||||||
bool timer_is_rec;
|
bool timer_is_rec;
|
||||||
bool timer_wakeup;
|
|
||||||
static pthread_mutex_t tm_eventsMutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
|
static pthread_mutex_t tm_eventsMutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
|
||||||
|
|
||||||
void sectionsd_getEventsServiceKey(t_channel_id serviceUniqueKey, CChannelEventList &eList, char search = 0, std::string search_text = "");
|
void sectionsd_getEventsServiceKey(t_channel_id serviceUniqueKey, CChannelEventList &eList, char search = 0, std::string search_text = "");
|
||||||
@@ -72,31 +62,6 @@ void CTimerManager::Init(void)
|
|||||||
m_saveEvents = false;
|
m_saveEvents = false;
|
||||||
m_isTimeSet = false;
|
m_isTimeSet = false;
|
||||||
wakeup = 0;
|
wakeup = 0;
|
||||||
timer_wakeup = false;
|
|
||||||
#if HAVE_COOL_HARDWARE
|
|
||||||
int fd = open("/dev/display", O_RDONLY);
|
|
||||||
|
|
||||||
if (fd < 0) {
|
|
||||||
perror("/dev/display");
|
|
||||||
} else {
|
|
||||||
wakeup_data_t wk;
|
|
||||||
memset(&wk, 0, sizeof(wk));
|
|
||||||
int ret = ioctl(fd, IOC_VFD_GET_WAKEUP, &wk);
|
|
||||||
if(ret >= 0)
|
|
||||||
wakeup = ((wk.source == WAKEUP_SOURCE_TIMER) /* || (wk.source == WAKEUP_SOURCE_PWLOST)*/);
|
|
||||||
close(fd);
|
|
||||||
}
|
|
||||||
printf("[timerd] wakeup from standby: %s\n", wakeup ? "yes" : "no");
|
|
||||||
if(wakeup){
|
|
||||||
creat("/tmp/.wakeup", 0);
|
|
||||||
timer_wakeup = true;
|
|
||||||
}else{
|
|
||||||
const char *neutrino_leave_deepstandby_script = CONFIGDIR "/deepstandby.off";
|
|
||||||
printf("[%s] executing %s\n",__FILE__ ,neutrino_leave_deepstandby_script);
|
|
||||||
if (system(neutrino_leave_deepstandby_script) != 0)
|
|
||||||
perror( neutrino_leave_deepstandby_script );
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
loadRecordingSafety();
|
loadRecordingSafety();
|
||||||
|
|
||||||
//thread starten
|
//thread starten
|
||||||
|
@@ -219,13 +219,13 @@ private:
|
|||||||
bool m_isTimeSet;
|
bool m_isTimeSet;
|
||||||
int m_extraTimeStart;
|
int m_extraTimeStart;
|
||||||
int m_extraTimeEnd;
|
int m_extraTimeEnd;
|
||||||
char wakeup;
|
|
||||||
|
|
||||||
CTimerManager();
|
CTimerManager();
|
||||||
static void* timerThread(void *arg);
|
static void* timerThread(void *arg);
|
||||||
CTimerEvent *nextEvent();
|
CTimerEvent *nextEvent();
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
bool wakeup;
|
||||||
|
|
||||||
static CTimerManager* getInstance();
|
static CTimerManager* getInstance();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user