From be9e1e020bb5a32c645688228104d6c69d1ed695 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Wed, 22 Feb 2017 06:21:21 +0100 Subject: [PATCH 01/11] src/system/helpers.cpp: Add function readLink() Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/0c182785e23b5e266338756cb8ba6efe193eefbf Author: Michael Liebmann Date: 2017-02-22 (Wed, 22 Feb 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/system/helpers.cpp | 10 ++++++++++ src/system/helpers.h | 1 + 2 files changed, 11 insertions(+) diff --git a/src/system/helpers.cpp b/src/system/helpers.cpp index e6e4a1e2e..59d64524a 100644 --- a/src/system/helpers.cpp +++ b/src/system/helpers.cpp @@ -1272,3 +1272,13 @@ std::string Lang2ISO639_1(std::string& lang) return ret; } + +string readLink(string lnk) +{ + char buf[PATH_MAX]; + memset(buf, 0, sizeof(buf)-1); + if (readlink(lnk.c_str(), buf, sizeof(buf)-1) != -1) + return (string)buf; + + return ""; +} diff --git a/src/system/helpers.h b/src/system/helpers.h index e117e011e..c7f3ae06a 100644 --- a/src/system/helpers.h +++ b/src/system/helpers.h @@ -148,5 +148,6 @@ bool split_config_string(const std::string &str, std::map Date: Wed, 22 Feb 2017 06:21:25 +0100 Subject: [PATCH 02/11] rcinput: Transfer from neutrino-mp for better compatibility Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/d932a1a32683460d48b14755f303eb07eec53e2b Author: Michael Liebmann Date: 2017-02-22 (Wed, 22 Feb 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/rcinput.cpp | 61 ++++++++++++++++++++++++++++++++++++------ src/driver/rcinput.h | 8 ++++-- 2 files changed, 59 insertions(+), 10 deletions(-) diff --git a/src/driver/rcinput.cpp b/src/driver/rcinput.cpp index 419cd3769..a7a3da9de 100644 --- a/src/driver/rcinput.cpp +++ b/src/driver/rcinput.cpp @@ -4,7 +4,7 @@ Copyright (C) 2001 Steffen Hehn 'McClean' 2003 thegoodguy - Copyright (C) 2008-2012 Stefan Seyfried + Copyright (C) 2008-2014,2016 Stefan Seyfried Copyright (C) 2013-2014 martii License: GPL @@ -65,7 +65,17 @@ #define ENABLE_REPEAT_CHECK +#if HAVE_SPARK_HARDWARE +/* this relies on event0 being the AOTOM frontpanel driver device + * TODO: what if another input device is present? */ +const char * const RC_EVENT_DEVICE[NUMBER_OF_EVENT_DEVICES] = {"/dev/input/nevis_ir", "/dev/input/event0"}; +#elif HAVE_GENERIC_HARDWARE +/* the FIFO created by libstb-hal */ +const char * const RC_EVENT_DEVICE[NUMBER_OF_EVENT_DEVICES] = {"/tmp/neutrino.input"}; +#else +//const char * const RC_EVENT_DEVICE[NUMBER_OF_EVENT_DEVICES] = {"/dev/input/nevis_ir", "/dev/input/event0"}; const char * const RC_EVENT_DEVICE[NUMBER_OF_EVENT_DEVICES] = {"/dev/input/nevis_ir"}; +#endif typedef struct input_event t_input_event; #ifdef KEYBOARD_INSTEAD_OF_REMOTE_CONTROL @@ -535,7 +545,6 @@ void CRCInput::getMsg_us(neutrino_msg_t * msg, neutrino_msg_data_t * data, uint6 //static __u16 rc_last_key = KEY_MAX; static __u16 rc_last_repeat_key = KEY_MAX; - struct timeval tv; struct timeval tvselect; uint64_t InitialTimeout = Timeout; int64_t targetTimeout; @@ -559,7 +568,6 @@ void CRCInput::getMsg_us(neutrino_msg_t * msg, neutrino_msg_data_t * data, uint6 uint64_t getKeyBegin = time_monotonic_us(); while(1) { - /* we later check for ev.type = EV_SYN which is 0x00, so set something invalid here... */ timer_id = 0; if ( !timers.empty() ) { @@ -1228,7 +1236,11 @@ void CRCInput::getMsg_us(neutrino_msg_t * msg, neutrino_msg_data_t * data, uint6 for (int i = 0; i < NUMBER_OF_EVENT_DEVICES; i++) { if ((fd_rc[i] != -1) && (FD_ISSET(fd_rc[i], &rfds))) { + uint64_t now_pressed = 0; t_input_event ev; + memset(&ev, 0, sizeof(ev)); + /* we later check for ev.type = EV_SYN = 0x00, so set something invalid here... */ + ev.type = EV_MAX; int ret = read(fd_rc[i], &ev, sizeof(t_input_event)); if (ret != sizeof(t_input_event)) { if (errno == ENODEV) { @@ -1240,6 +1252,22 @@ void CRCInput::getMsg_us(neutrino_msg_t * msg, neutrino_msg_data_t * data, uint6 } if (ev.type == EV_SYN) continue; /* ignore... */ + if (ev.value) { + /* try to compensate for possible changes in wall clock + * kernel ev.time default uses CLOCK_REALTIME, as does gettimeofday(). + * so subtract gettimeofday() from ev.time and then add + * CLOCK_MONOTONIC, which is supposed to not change with settimeofday. + * Everything would be much easier if we could use the post-kernel 3.4 + * EVIOCSCLOCKID ioctl :-) */ + struct timespec t1; + now_pressed = ev.time.tv_usec + ev.time.tv_sec * 1000000ULL; + if (!clock_gettime(CLOCK_MONOTONIC, &t1)) { + struct timeval t2; + gettimeofday(&t2, NULL); + now_pressed += t1.tv_sec * 1000000ULL + t1.tv_nsec / 1000; + now_pressed -= (t2.tv_usec + t2.tv_sec * 1000000ULL); + } + } SHTDCNT::getInstance()->resetSleepTimer(); if (ev.value && firstKey) { firstKey = false; @@ -1247,8 +1275,8 @@ void CRCInput::getMsg_us(neutrino_msg_t * msg, neutrino_msg_data_t * data, uint6 } uint32_t trkey = translate(ev.code); -#ifdef DEBUG - printf("%d key: %04x value %d, translate: %04x -%s-\n", ev.value, ev.code, ev.value, trkey, getKeyName(trkey).c_str()); +#ifdef _DEBUG + printf("key: %04x value %d, translate: %04x -%s-\n", ev.code, ev.value, trkey, getKeyName(trkey).c_str()); #endif if (trkey == RC_nokey) continue; @@ -1286,15 +1314,22 @@ void CRCInput::getMsg_us(neutrino_msg_t * msg, neutrino_msg_data_t * data, uint6 #ifdef RCDEBUG printf("rc_last_key %04x rc_last_repeat_key %04x\n\n", rc_last_key, rc_last_repeat_key); #endif - uint64_t now_pressed; bool keyok = true; - +#if 0 + uint64_t now_pressed; tv = ev.time; now_pressed = (uint64_t) tv.tv_usec + (uint64_t)((uint64_t) tv.tv_sec * (uint64_t) 1000000); +#endif if (trkey == rc_last_key) { /* only allow selected keys to be repeated */ if (mayRepeat(trkey, bAllowRepeatLR) || - (g_settings.shutdown_real_rcdelay && ((trkey == RC_standby) && (cs_get_revision() > 7))) ) + (g_settings.shutdown_real_rcdelay && + ((trkey == RC_standby) && +#if HAVE_COOL_HARDWARE + (cs_get_revision() > 7)))) +#else + (g_info.hw_caps->can_shutdown)))) +#endif { #ifdef ENABLE_REPEAT_CHECK if (rc_last_repeat_key != trkey) { @@ -1613,6 +1648,16 @@ int CRCInput::translate(int code) return RC_up; case 0x101: // FIXME -- needed? return RC_down; +#ifdef HAVE_AZBOX_HARDWARE + case KEY_HOME: + return RC_favorites; + case KEY_TV: + return RC_stop; + case KEY_RADIO: + return RC_record; + case KEY_PLAY: + return RC_pause; +#endif default: break; } diff --git a/src/driver/rcinput.h b/src/driver/rcinput.h index 5c6458506..4bd580f3f 100644 --- a/src/driver/rcinput.h +++ b/src/driver/rcinput.h @@ -115,8 +115,8 @@ */ -typedef uint32_t neutrino_msg_t; -typedef uint32_t neutrino_msg_data_t; +typedef unsigned long neutrino_msg_t; +typedef unsigned long neutrino_msg_data_t; #define NEUTRINO_UDS_NAME "/tmp/neutrino.sock" @@ -147,7 +147,11 @@ class CRCInput int fd_pipe_high_priority[2]; int fd_pipe_low_priority[2]; int fd_gamerc; +#ifdef HAVE_SPARK_HARDWARE +#define NUMBER_OF_EVENT_DEVICES 2 +#else #define NUMBER_OF_EVENT_DEVICES 1 +#endif int fd_rc[NUMBER_OF_EVENT_DEVICES]; int fd_keyb; int fd_event; From 3c7aca79492d026dd7343ac7211d4ef86a4fe7cc Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Wed, 22 Feb 2017 06:21:29 +0100 Subject: [PATCH 03/11] Fix compiler format warnings Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/e35969afe26c6e1f42c0ea976804bfad2299b958 Author: Michael Liebmann Date: 2017-02-22 (Wed, 22 Feb 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/cam_menu.cpp | 2 +- src/gui/scan.cpp | 10 +++++----- src/gui/widget/listhelpers.cpp | 4 ++-- src/neutrino.cpp | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/gui/cam_menu.cpp b/src/gui/cam_menu.cpp index 1ea62fc18..9b2a9755a 100644 --- a/src/gui/cam_menu.cpp +++ b/src/gui/cam_menu.cpp @@ -502,7 +502,7 @@ int CCAMMenuHandler::doMenu(int slot, CA_SLOT_TYPE slotType) g_Locale->getText(slotType == CA_SLOT_TYPE_CI ? LOCALE_CI_WAITING : LOCALE_SC_WAITING)); g_RCInput->getMsgAbsoluteTimeout (&msg, &data, &timeoutEnd); - printf("CCAMMenuHandler::doMenu: msg %x data %x\n", msg, data); + printf("CCAMMenuHandler::doMenu: msg %lx data %lx\n", msg, data); if (msg == CRCInput::RC_timeout) { printf("CCAMMenuHandler::doMenu: menu timeout\n"); hideHintBox(); diff --git a/src/gui/scan.cpp b/src/gui/scan.cpp index 6f894ffe3..5a6213853 100644 --- a/src/gui/scan.cpp +++ b/src/gui/scan.cpp @@ -386,7 +386,7 @@ int CScanTs::handleMsg(neutrino_msg_t msg, neutrino_msg_data_t data) break; case NeutrinoMessages::EVT_SCAN_NUM_TRANSPONDERS: - sprintf(buffer, "%u", data); + sprintf(buffer, "%ld", data); paintLine(xpos2, ypos_transponder, w - (8*fw), buffer); total = data; snprintf(str, sizeof(buffer), "scan: %d/%d", done, total); @@ -426,22 +426,22 @@ int CScanTs::handleMsg(neutrino_msg_t msg, neutrino_msg_data_t data) break; case NeutrinoMessages::EVT_SCAN_NUM_CHANNELS: - sprintf(buffer, " = %u", data); + sprintf(buffer, " = %ld", data); paintLine(xpos1 + 3 * (6*fw), ypos_service_numbers + mheight, width - 3 * (6*fw) - 10, buffer); break; case NeutrinoMessages::EVT_SCAN_FOUND_TV_CHAN: - sprintf(buffer, "%u", data); + sprintf(buffer, "%ld", data); paintLine(xpos1, ypos_service_numbers + mheight, (6*fw), buffer); break; case NeutrinoMessages::EVT_SCAN_FOUND_RADIO_CHAN: - sprintf(buffer, "%u", data); + sprintf(buffer, "%ld", data); paintLine(xpos1 + (6*fw), ypos_service_numbers + mheight, (6*fw), buffer); break; case NeutrinoMessages::EVT_SCAN_FOUND_DATA_CHAN: - sprintf(buffer, "%u", data); + sprintf(buffer, "%ld", data); paintLine(xpos1 + 2 * (6*fw), ypos_service_numbers + mheight, (6*fw), buffer); break; diff --git a/src/gui/widget/listhelpers.cpp b/src/gui/widget/listhelpers.cpp index 45af70358..9d3adf3ab 100644 --- a/src/gui/widget/listhelpers.cpp +++ b/src/gui/widget/listhelpers.cpp @@ -33,7 +33,7 @@ static int upDownKey(int size, neutrino_msg_t msg, int lines, int sel) return -1; if (msg >= CRCInput::RC_MaxRC) { - printf("CListHelpers:%s: invalid key? 0x%X\n", __func__, msg); + printf("CListHelpers:%s: invalid key? 0x%lx\n", __func__, msg); return -1; } int key = (int)msg; @@ -46,7 +46,7 @@ static int upDownKey(int size, neutrino_msg_t msg, int lines, int sel) else if (msg == CRCInput::RC_down) step = 1; else { - printf("CListHelpers:%s: invalid key? 0x%X\n", __func__, msg); + printf("CListHelpers:%s: invalid key? 0x%lx\n", __func__, msg); return -1; } // printf("CListHelpers:%s: key 0x%04lx lines %d size %d sel %d\n", __func__, msg, lines, size, sel); diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 86b8d6d34..a1ae72747 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -2404,7 +2404,7 @@ void CNeutrinoApp::RealRun() m_idletime = time(NULL); if (m_screensaver) { - printf("[neutrino] CSreenSaver stop; msg: %X\n", msg); + printf("[neutrino] CScreenSaver stop; msg: %lX\n", msg); screensaver(false); frameBuffer->stopFrame(); @@ -3421,7 +3421,7 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) return messages_return::handled; } else if( msg == NeutrinoMessages::CHANGEMODE ) { - printf("CNeutrinoApp::handleMsg: CHANGEMODE to %d rezap %d\n", data & mode_mask, (data & norezap) != norezap); + printf("CNeutrinoApp::handleMsg: CHANGEMODE to %d rezap %d\n", (int)(data & mode_mask), (data & norezap) != norezap); if((data & mode_mask)== mode_radio) { if( mode != mode_radio ) { radioMode((data & norezap) != norezap); From b5ec2b42dfe5ec8c6b29ea031a28f2e6da887961 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 19 Feb 2017 23:16:09 +0100 Subject: [PATCH 04/11] rcinput: use a dynamic list of input devices Instead of the fixed, static list of input devices, scan /dev/input/ for proper event devices. A "good" input device is one that supports the EVIOCGBIT ioctl and at least the EV_KEY event type. This probably needs further fixes, e.g. in repeat rate setting code. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/7b3aa2b181753f5963859a4d63436eb113367143 Author: Stefan Seyfried Date: 2017-02-19 (Sun, 19 Feb 2017) ------------------ This commit was generated by Migit --- src/driver/rcinput.cpp | 180 ++++++++++++++++++++++++++++------------- src/driver/rcinput.h | 25 ++++-- 2 files changed, 139 insertions(+), 66 deletions(-) diff --git a/src/driver/rcinput.cpp b/src/driver/rcinput.cpp index a7a3da9de..bbcfbb2b7 100644 --- a/src/driver/rcinput.cpp +++ b/src/driver/rcinput.cpp @@ -4,7 +4,7 @@ Copyright (C) 2001 Steffen Hehn 'McClean' 2003 thegoodguy - Copyright (C) 2008-2014,2016 Stefan Seyfried + Copyright (C) 2008-2014,2016-2017 Stefan Seyfried Copyright (C) 2013-2014 martii License: GPL @@ -33,7 +33,6 @@ #include #include -#include #include #include #include @@ -50,6 +49,8 @@ #include #include +#include + #include #include @@ -65,17 +66,6 @@ #define ENABLE_REPEAT_CHECK -#if HAVE_SPARK_HARDWARE -/* this relies on event0 being the AOTOM frontpanel driver device - * TODO: what if another input device is present? */ -const char * const RC_EVENT_DEVICE[NUMBER_OF_EVENT_DEVICES] = {"/dev/input/nevis_ir", "/dev/input/event0"}; -#elif HAVE_GENERIC_HARDWARE -/* the FIFO created by libstb-hal */ -const char * const RC_EVENT_DEVICE[NUMBER_OF_EVENT_DEVICES] = {"/tmp/neutrino.input"}; -#else -//const char * const RC_EVENT_DEVICE[NUMBER_OF_EVENT_DEVICES] = {"/dev/input/nevis_ir", "/dev/input/event0"}; -const char * const RC_EVENT_DEVICE[NUMBER_OF_EVENT_DEVICES] = {"/dev/input/nevis_ir"}; -#endif typedef struct input_event t_input_event; #ifdef KEYBOARD_INSTEAD_OF_REMOTE_CONTROL @@ -83,6 +73,13 @@ static struct termio orig_termio; static bool saved_orig_termio = false; #endif /* KEYBOARD_INSTEAD_OF_REMOTE_CONTROL */ static bool input_stopped = false; +static struct timespec devinput_mtime = { 0, 0 }; + +#ifdef RCDEBUG +#define d_printf printf +#else +#define d_printf(...) +#endif /********************************************************************************* * Constructor - opens rc-input device, selects rc-hardware and starts threads @@ -146,13 +143,9 @@ CRCInput::CRCInput() perror("[neutrino] listen failed...\n"); exit( -1 ); } - - for (int i = 0; i < NUMBER_OF_EVENT_DEVICES; i++) - { - fd_rc[i] = -1; - } clickfd = -1; repeat_block = repeat_block_generic = 0; + checkdev(); open(); rc_last_key = KEY_MAX; firstKey = true; @@ -162,21 +155,93 @@ CRCInput::CRCInput() set_rc_hw(); } -/* if dev is given, open device with index , if not (re)open all */ -void CRCInput::open(int dev) +bool CRCInput::checkdev() { - if (dev == -1) - close(); - - for (int i = 0; i < NUMBER_OF_EVENT_DEVICES; i++) - { - if (dev != -1) { - if (i != dev || fd_rc[i] != -1) - continue; + /* stat()ing the directory is fast and cheap. If a device gets added or + * removed, the mtime of /dev/input/ will change, which in turn + * warrants a more thorough investigation */ + struct stat st; + if (stat("/dev/input/", &st) == 0) { + if (st.st_mtim.tv_sec != devinput_mtime.tv_sec || + st.st_mtim.tv_nsec != devinput_mtime.tv_nsec) { + devinput_mtime.tv_sec = st.st_mtim.tv_sec; + devinput_mtime.tv_nsec = st.st_mtim.tv_nsec; + printf("[rcinput:%s] /dev/input mtime changed\n", __func__); + return true; + } + return false; /* still the same... */ + } + printf("[rcinput:%s] stat /dev/input failed: %m\n", __func__); + return true; /* need to check anyway... */ +} + +bool CRCInput::checkpath(in_dev id) +{ + for (std::vector::iterator it = indev.begin(); it != indev.end(); ++it) { + if ((*it).path == id.path) { + printf("[rcinput:%s] skipping already opened %s\n", __func__, id.path.c_str()); + return true; + } + } + return false; +} + +/* if recheck == true, only not already opened devices are opened, if not, close then (re)open all */ +void CRCInput::open(bool recheck) +{ + if (recheck == false) + close(); + /* close() takes the lock, too... */ + OpenThreads::ScopedLock m_lock(mutex); + + unsigned long evbit; + struct in_dev id; + DIR *dir; + struct dirent *dentry; + dir = opendir("/dev/input"); + if (! dir) { + printf("[rcinput:%s] opendir failed: %m\n", __func__); + return; + } + + while ((dentry = readdir(dir)) != NULL) + { + if (dentry->d_type != DT_CHR) { + d_printf("[rcinput:%s] skipping '%s'\n", __func__, dentry->d_name); + continue; + } + d_printf("[rcinput:%s] considering '%s'\n", __func__, dentry->d_name); + id.path = "/dev/input/" + std::string(dentry->d_name); + if (checkpath(id)) + continue; + id.fd = ::open(id.path.c_str(), O_RDWR|O_NONBLOCK|O_CLOEXEC); + if (id.fd == -1) { + printf("[rcinput:%s] open %s failed: %m\n", __func__, id.path.c_str()); + continue; + } + if (ioctl(id.fd, EVIOCGBIT(0, EV_MAX), &evbit) < 0) { + ::close(id.fd); /* not a proper input device, e.g. /dev/input/mice */ + continue; + } + if ((evbit & (1 << EV_KEY)) == 0) { + printf("[rcinput:%s] %s is bad; no EV_KEY support (0x%lx)\n", __func__, id.path.c_str(), evbit); + ::close(id.fd); + continue; + } + printf("[rcinput:%s] opened %s (fd %d) ev 0x%lx\n", __func__, id.path.c_str(), id.fd, evbit); + indev.push_back(id); + } + closedir(dir); + id.path = "/tmp/neutrino.input"; + if (! checkpath(id)) { + id.fd = ::open(id.path.c_str(), O_RDWR|O_NONBLOCK|O_CLOEXEC); + if (id.fd == -1) { + /* debug, because it only matters for HAVE_GENERIC_HARDWARE */ + d_printf("[rcinput:%s] open %s failed: %m\n", __func__, id.path.c_str()); + } else { + printf("[rcinput:%s] opened %s (fd %d)\n", __func__, id.path.c_str(), id.fd); + indev.push_back(id); } - if ((fd_rc[i] = ::open(RC_EVENT_DEVICE[i], O_RDWR|O_NONBLOCK|O_CLOEXEC)) == -1) - perror(RC_EVENT_DEVICE[i]); - printf("CRCInput::open: %s fd %d\n", RC_EVENT_DEVICE[i], fd_rc[i]); } //+++++++++++++++++++++++++++++++++++++++ @@ -224,12 +289,10 @@ void CRCInput::open(int dev) void CRCInput::close() { - for (int i = 0; i < NUMBER_OF_EVENT_DEVICES; i++) { - if (fd_rc[i] != -1) { - ::close(fd_rc[i]); - fd_rc[i] = -1; - } - } + OpenThreads::ScopedLock m_lock(mutex); + for (unsigned int i = 0; i < indev.size(); i++) + ::close(indev[i].fd); + indev.clear(); #ifdef KEYBOARD_INSTEAD_OF_REMOTE_CONTROL if (saved_orig_termio) { @@ -251,9 +314,9 @@ void CRCInput::calculateMaxFd() { fd_max = fd_event; - for (int i = 0; i < NUMBER_OF_EVENT_DEVICES; i++) - if (fd_rc[i] > fd_max) - fd_max = fd_rc[i]; + for (unsigned int i = 0; i < indev.size(); i++) + if (indev[i].fd > fd_max) + fd_max = indev[i].fd; if(fd_pipe_high_priority[0] > fd_max) fd_max = fd_pipe_high_priority[0]; @@ -558,10 +621,8 @@ void CRCInput::getMsg_us(neutrino_msg_t * msg, neutrino_msg_data_t * data, uint6 * TODO: real hot-plugging, e.g. of keyboards and triggering this loop... * right now it is only run if some event is happening "by accident" */ if (!input_stopped) { - for (int i = 0; i < NUMBER_OF_EVENT_DEVICES; i++) { - if (fd_rc[i] == -1) - open(i); - } + if (checkdev()) + open(true); } // wiederholung reinmachen - dass wirklich die ganze zeit bis timeout gewartet wird! @@ -595,10 +656,10 @@ void CRCInput::getMsg_us(neutrino_msg_t * msg, neutrino_msg_data_t * data, uint6 tvselect.tv_usec = targetTimeout%1000000; FD_ZERO(&rfds); - for (int i = 0; i < NUMBER_OF_EVENT_DEVICES; i++) + for (unsigned int i = 0; i < indev.size(); i++) { - if (fd_rc[i] != -1) - FD_SET(fd_rc[i], &rfds); + if (indev[i].fd != -1) + FD_SET(indev[i].fd, &rfds); } #ifdef KEYBOARD_INSTEAD_OF_REMOTE_CONTROL if (true) @@ -1234,19 +1295,19 @@ void CRCInput::getMsg_us(neutrino_msg_t * msg, neutrino_msg_data_t * data, uint6 } } - for (int i = 0; i < NUMBER_OF_EVENT_DEVICES; i++) { - if ((fd_rc[i] != -1) && (FD_ISSET(fd_rc[i], &rfds))) { + for (std::vector::iterator i = indev.begin(); i != indev.end(); ++i) { + if (((*i).fd != -1) && (FD_ISSET((*i).fd, &rfds))) { uint64_t now_pressed = 0; t_input_event ev; memset(&ev, 0, sizeof(ev)); /* we later check for ev.type = EV_SYN = 0x00, so set something invalid here... */ ev.type = EV_MAX; - int ret = read(fd_rc[i], &ev, sizeof(t_input_event)); + int ret = read((*i).fd, &ev, sizeof(t_input_event)); if (ret != sizeof(t_input_event)) { if (errno == ENODEV) { /* hot-unplugged? */ - ::close(fd_rc[i]); - fd_rc[i] = -1; + ::close((*i).fd); + indev.erase(i); } continue; } @@ -1436,11 +1497,11 @@ void CRCInput::clearRCMsg() { t_input_event ev; - for (int i = 0; i < NUMBER_OF_EVENT_DEVICES; i++) + for (unsigned int i = 0; i < indev.size(); i++) { - if (fd_rc[i] != -1) + if (indev[i].fd != -1) { - while (read(fd_rc[i], &ev, sizeof(t_input_event)) == sizeof(t_input_event)) + while (read(indev[i].fd, &ev, sizeof(t_input_event)) == sizeof(t_input_event)) ; } } @@ -1694,9 +1755,12 @@ void CRCInput::play_click() void CRCInput::set_rc_hw(ir_protocol_t ir_protocol, unsigned int ir_address) { int ioctl_ret = -1; - + if (indev.empty()) { + printf("[rcinput:%s] indev is empty!\n", __func__); + return; + } //fixme?: for now fd_rc[] is hardcoded to 0 since only fd_rc[0] is used at the moment - ioctl_ret = ::ioctl(fd_rc[0], IOC_IR_SET_PRI_PROTOCOL, ir_protocol); + ioctl_ret = ::ioctl(indev[0].fd, IOC_IR_SET_PRI_PROTOCOL, ir_protocol); if(ioctl_ret < 0) perror("IOC_IR_SET_PRI_PROTOCOL"); else @@ -1706,7 +1770,7 @@ void CRCInput::set_rc_hw(ir_protocol_t ir_protocol, unsigned int ir_address) if(ir_address > 0) { //fixme?: for now fd_rc[] is hardcoded to 0 since only fd_rc[0] is used at the moment - ioctl_ret = ::ioctl(fd_rc[0], IOC_IR_SET_PRI_ADDRESS, ir_address); + ioctl_ret = ::ioctl(indev[0].fd, IOC_IR_SET_PRI_ADDRESS, ir_address); if(ioctl_ret < 0) perror("IOC_IR_SET_PRI_ADDRESS"); else diff --git a/src/driver/rcinput.h b/src/driver/rcinput.h index 4bd580f3f..9a859b929 100644 --- a/src/driver/rcinput.h +++ b/src/driver/rcinput.h @@ -39,6 +39,9 @@ #include #include +#include +#include + #ifdef BOXMODEL_CS_HD2 #ifdef HAVE_COOLSTREAM_CS_IR_GENERIC_H #include @@ -138,6 +141,12 @@ class CRCInput bool correct_time; }; + struct in_dev + { + int fd; + std::string path; + }; + uint32_t timerid; std::vector timers; @@ -147,21 +156,19 @@ class CRCInput int fd_pipe_high_priority[2]; int fd_pipe_low_priority[2]; int fd_gamerc; -#ifdef HAVE_SPARK_HARDWARE -#define NUMBER_OF_EVENT_DEVICES 2 -#else -#define NUMBER_OF_EVENT_DEVICES 1 -#endif - int fd_rc[NUMBER_OF_EVENT_DEVICES]; + std::vector indev; int fd_keyb; int fd_event; int fd_max; int clickfd; __u16 rc_last_key; + OpenThreads::Mutex mutex; void set_dsp(); - void open(int dev = -1); + void open(bool recheck = false); + bool checkpath(in_dev id); + bool checkdev(); void close(); int translate(int code); void calculateMaxFd(void); @@ -280,7 +287,9 @@ class CRCInput inline int getFileHandle(void) /* used for plugins (i.e. games) only */ { - return fd_rc[0]; + if (indev.empty()) + return -1; + return indev[0].fd; } void stopInput(const bool ext = false); void restartInput(const bool ext = false); From 7345242772ed9efedaa56d9ca794a52bb6b3e167 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Wed, 22 Feb 2017 06:21:33 +0100 Subject: [PATCH 05/11] rcinput: Add exception handling for cs hd2 - Supplement to previous commit Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/1b79faff780befa63a04be86560e7183d7a663aa Author: Michael Liebmann Date: 2017-02-22 (Wed, 22 Feb 2017) ------------------ This commit was generated by Migit --- src/driver/rcinput.cpp | 54 +++++++++++++++++++++++++++++++++++++++++- src/driver/rcinput.h | 6 +++++ 2 files changed, 59 insertions(+), 1 deletion(-) diff --git a/src/driver/rcinput.cpp b/src/driver/rcinput.cpp index bbcfbb2b7..250b9744f 100644 --- a/src/driver/rcinput.cpp +++ b/src/driver/rcinput.cpp @@ -178,6 +178,27 @@ bool CRCInput::checkdev() bool CRCInput::checkpath(in_dev id) { for (std::vector::iterator it = indev.begin(); it != indev.end(); ++it) { +#ifdef BOXMODEL_CS_HD2 + if ((id.type == DT_LNK) || ((*it).type == DT_LNK)) { + std::string check1, check2; + if (id.type == DT_LNK) + check1 = readLink(id.path); + else + check1 = id.path; + + if ((*it).type == DT_LNK) + check2 = readLink((*it).path); + else + check2 = (*it).path; + + if ((!check1.empty()) && (!check2.empty()) && (check1 == check2)) { + printf("[rcinput:%s] skipping already opened %s => %s\n", __func__, id.path.c_str(), check1.c_str()); + return true; + } + else + return false; + } +#endif if ((*it).path == id.path) { printf("[rcinput:%s] skipping already opened %s\n", __func__, id.path.c_str()); return true; @@ -186,6 +207,25 @@ bool CRCInput::checkpath(in_dev id) return false; } +#ifdef BOXMODEL_CS_HD2 +bool CRCInput::checkLnkDev(std::string lnk) +{ + static struct stat info; + if (lstat(lnk.c_str(), &info) != -1) { + if (S_ISLNK(info.st_mode)) { + std::string tmp = readLink(lnk); + if (!tmp.empty()) { + if (lstat(tmp.c_str(), &info) != -1) { + if (S_ISCHR(info.st_mode)) + return true; + } + } + } + } + return false; +} +#endif + /* if recheck == true, only not already opened devices are opened, if not, close then (re)open all */ void CRCInput::open(bool recheck) { @@ -206,10 +246,22 @@ void CRCInput::open(bool recheck) while ((dentry = readdir(dir)) != NULL) { - if (dentry->d_type != DT_CHR) { + if ((dentry->d_type != DT_CHR) +#ifdef BOXMODEL_CS_HD2 + && (dentry->d_type != DT_LNK) +#endif + + ) { d_printf("[rcinput:%s] skipping '%s'\n", __func__, dentry->d_name); continue; } +#ifdef BOXMODEL_CS_HD2 + if ((dentry->d_type == DT_LNK) && (!checkLnkDev("/dev/input/" + std::string(dentry->d_name)))) { + d_printf("[rcinput:%s] skipping '%s'\n", __func__, dentry->d_name); + continue; + } + id.type = dentry->d_type; +#endif d_printf("[rcinput:%s] considering '%s'\n", __func__, dentry->d_name); id.path = "/dev/input/" + std::string(dentry->d_name); if (checkpath(id)) diff --git a/src/driver/rcinput.h b/src/driver/rcinput.h index 9a859b929..502dc259f 100644 --- a/src/driver/rcinput.h +++ b/src/driver/rcinput.h @@ -145,6 +145,9 @@ class CRCInput { int fd; std::string path; +#ifdef BOXMODEL_CS_HD2 + int type; +#endif }; uint32_t timerid; @@ -169,6 +172,9 @@ class CRCInput void open(bool recheck = false); bool checkpath(in_dev id); bool checkdev(); +#ifdef BOXMODEL_CS_HD2 + bool checkLnkDev(std::string lnk); +#endif void close(); int translate(int code); void calculateMaxFd(void); From 475c8878f84457f0825eb9b4397a745fcff50b86 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Mon, 20 Feb 2017 20:20:54 +0100 Subject: [PATCH 06/11] rcinput: add setKeyRepeatDelay() function this allows to get rid of the broken getFileHandle function later Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/0df5a8df7fd05e8fac7119e201587420c51ec887 Author: Stefan Seyfried Date: 2017-02-20 (Mon, 20 Feb 2017) ------------------ This commit was generated by Migit --- src/driver/rcinput.cpp | 35 +++++++++++++++++++++++++++++++++++ src/driver/rcinput.h | 1 + 2 files changed, 36 insertions(+) diff --git a/src/driver/rcinput.cpp b/src/driver/rcinput.cpp index 250b9744f..51ea3a570 100644 --- a/src/driver/rcinput.cpp +++ b/src/driver/rcinput.cpp @@ -1801,6 +1801,41 @@ void CRCInput::play_click() { } +void CRCInput::setKeyRepeatDelay(unsigned int start_ms, unsigned int repeat_ms) +{ + for (std::vector::iterator it = indev.begin(); it != indev.end(); ++it) { + int fd = (*it).fd; + std::string path = (*it).path; + if (path == "/tmp/neutrino.input") + continue; /* setting repeat rate does not work here */ +#ifdef HAVE_COOL_HARDWARE + /* this is ugly, but the driver does not support anything advanced... */ + if (path == "/dev/input/nevis_ir") { + d_printf("[rcinput:%s] %s(fd %d) using proprietary ioctl\n", __func__, path.c_str(), fd); + ioctl(fd, IOC_IR_SET_F_DELAY, start_ms); + ioctl(fd, IOC_IR_SET_X_DELAY, repeat_ms); + continue; + } +#endif + d_printf("[rcinput:%s] %s(fd %d) writing EV_REP (%d->%d)\n", + __func__, path.c_str(), fd, start_ms, repeat_ms); + /* if we have a good input device, we don't need the private ioctl above */ + struct input_event ie; + memset(&ie, 0, sizeof(ie)); + ie.type = EV_REP; + /* increase by 10 ms to trick the repeat checker code in the + * rcinput loop into accepting the key event... */ + ie.value = start_ms + 10; + ie.code = REP_DELAY; + if (write(fd, &ie, sizeof(ie)) == -1) + printf("[rcinput:%s] %s(fd %d) write %s: %m\n", __func__, path.c_str(), fd, "REP_DELAY"); + + ie.value = repeat_ms + 10; + ie.code = REP_PERIOD; + if (write(fd, &ie, sizeof(ie)) == -1) + printf("[rcinput:%s] %s(fd %d) write %s: %m\n", __func__, path.c_str(), fd, "REP_PERIOD"); + } +} #ifdef IOC_IR_SET_PRI_PROTOCOL // hint: ir_protocol_t and other useful things are defined in cs_ir_generic.h diff --git a/src/driver/rcinput.h b/src/driver/rcinput.h index 502dc259f..ce220bb43 100644 --- a/src/driver/rcinput.h +++ b/src/driver/rcinput.h @@ -341,6 +341,7 @@ class CRCInput void reset_dsp(int rate); void setLongPressAny(bool b) { longPressAny = b; }; + void setKeyRepeatDelay(unsigned int start_ms, unsigned int repeat_ms); }; From 8071a9d51b0d4d61328b991fdb9d56ea3b0d5bea Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Mon, 20 Feb 2017 20:22:32 +0100 Subject: [PATCH 07/11] rcinput: fix set_rc_hw() after dynamic devices patch ...this could use some tests... :-) Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/41958cc0296b656673d5a61056333ed3e32488e0 Author: Stefan Seyfried Date: 2017-02-20 (Mon, 20 Feb 2017) ------------------ This commit was generated by Migit --- src/driver/rcinput.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/driver/rcinput.cpp b/src/driver/rcinput.cpp index 51ea3a570..1193e2f5b 100644 --- a/src/driver/rcinput.cpp +++ b/src/driver/rcinput.cpp @@ -1846,8 +1846,18 @@ void CRCInput::set_rc_hw(ir_protocol_t ir_protocol, unsigned int ir_address) printf("[rcinput:%s] indev is empty!\n", __func__); return; } - //fixme?: for now fd_rc[] is hardcoded to 0 since only fd_rc[0] is used at the moment - ioctl_ret = ::ioctl(indev[0].fd, IOC_IR_SET_PRI_PROTOCOL, ir_protocol); + int fd = -1; + for (std::vector::iterator it = indev.begin(); it != indev.end(); ++it) { + if ((*it).path == "/dev/input/nevis_ir") { + fd = (*it).fd; + break; + } + } + if (fd == -1) { + printf("[rcinput:%s] no nevis_ir input device found??\n", __func__); + return; + } + ioctl_ret = ::ioctl(fd, IOC_IR_SET_PRI_PROTOCOL, ir_protocol); if(ioctl_ret < 0) perror("IOC_IR_SET_PRI_PROTOCOL"); else @@ -1857,7 +1867,7 @@ void CRCInput::set_rc_hw(ir_protocol_t ir_protocol, unsigned int ir_address) if(ir_address > 0) { //fixme?: for now fd_rc[] is hardcoded to 0 since only fd_rc[0] is used at the moment - ioctl_ret = ::ioctl(indev[0].fd, IOC_IR_SET_PRI_ADDRESS, ir_address); + ioctl_ret = ::ioctl(fd, IOC_IR_SET_PRI_ADDRESS, ir_address); if(ioctl_ret < 0) perror("IOC_IR_SET_PRI_ADDRESS"); else From bfcc110fd77b80e884da76146e9f5336ae601871 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Mon, 20 Feb 2017 20:25:57 +0100 Subject: [PATCH 08/11] keybind_setup: use rcinput->setKeyRepeatDelay() Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/8b8b4ce0e26b06e2b98fa15d29fd6abd422c4de6 Author: Stefan Seyfried Date: 2017-02-20 (Mon, 20 Feb 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/keybind_setup.cpp | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/src/gui/keybind_setup.cpp b/src/gui/keybind_setup.cpp index 4985536fa..1e835cc30 100644 --- a/src/gui/keybind_setup.cpp +++ b/src/gui/keybind_setup.cpp @@ -571,28 +571,7 @@ bool CKeybindSetup::changeNotify(const neutrino_locale_t OptionName, void * /* d g_RCInput->repeat_block = fdelay * 1000; g_RCInput->repeat_block_generic = xdelay * 1000; - - int fd = g_RCInput->getFileHandle(); -#ifdef HAVE_COOL_HARDWARE - ioctl(fd, IOC_IR_SET_F_DELAY, fdelay); - ioctl(fd, IOC_IR_SET_X_DELAY, xdelay); -#else - /* if we have a good input device, we don't need the private ioctl above */ - struct input_event ie; - memset(&ie, 0, sizeof(ie)); - ie.type = EV_REP; - /* increase by 10 ms to trick the repeat checker code in the - * rcinput loop into accepting the key event... */ - ie.value = fdelay + 10; - ie.code = REP_DELAY; - if (write(fd, &ie, sizeof(ie)) == -1) - perror("CKeySetupNotifier::changeNotify REP_DELAY"); - - ie.value = xdelay + 10; - ie.code = REP_PERIOD; - if (write(fd, &ie, sizeof(ie)) == -1) - perror("CKeySetupNotifier::changeNotify REP_PERIOD"); -#endif + g_RCInput->setKeyRepeatDelay(fdelay, xdelay); } return false; } From 3c678d45cf2b8bd11303203f8772c8e6123eff62 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Mon, 20 Feb 2017 20:26:39 +0100 Subject: [PATCH 09/11] rcinput: remove now unused (and broken) getFileHandle() Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/dceb6989a8e81b8c93bd8cf29a872ae8cd173237 Author: Stefan Seyfried Date: 2017-02-20 (Mon, 20 Feb 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/rcinput.h | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/driver/rcinput.h b/src/driver/rcinput.h index ce220bb43..848e54cf6 100644 --- a/src/driver/rcinput.h +++ b/src/driver/rcinput.h @@ -291,12 +291,6 @@ class CRCInput }; void set_rc_hw(void); - inline int getFileHandle(void) /* used for plugins (i.e. games) only */ - { - if (indev.empty()) - return -1; - return indev[0].fd; - } void stopInput(const bool ext = false); void restartInput(const bool ext = false); bool isLocked(void); From 85b82bd12f1d4c715c93a613f2b0287dc49a8879 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Mon, 20 Feb 2017 20:36:45 +0100 Subject: [PATCH 10/11] rcinput: remove unused/unimplemented click functions Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/f45456d7a8b7a6f9b818e725856e272adec39eca Author: Stefan Seyfried Date: 2017-02-20 (Mon, 20 Feb 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/audioplay.cpp | 3 --- src/driver/rcinput.cpp | 26 -------------------------- src/driver/rcinput.h | 6 ------ src/gui/scan.cpp | 2 -- src/neutrino.cpp | 2 -- src/system/settings.h | 1 - 6 files changed, 40 deletions(-) diff --git a/src/driver/audioplay.cpp b/src/driver/audioplay.cpp index 956319297..494eb9baf 100644 --- a/src/driver/audioplay.cpp +++ b/src/driver/audioplay.cpp @@ -90,7 +90,6 @@ void* CAudioPlayer::PlayThread( void* /*dummy*/ ) { int soundfd = -1; set_threadname("audio:play"); - g_RCInput->close_click(); /* Decode stdin to stdout. */ CBaseDec::RetCode Status = CBaseDec::DecoderBase( &getInstance()->m_Audiofile, soundfd, @@ -109,8 +108,6 @@ void* CAudioPlayer::PlayThread( void* /*dummy*/ ) "unknown" ); } - g_RCInput->open_click(); - getInstance()->state = CBaseDec::STOP; pthread_exit(0); return NULL; diff --git a/src/driver/rcinput.cpp b/src/driver/rcinput.cpp index 1193e2f5b..6161fb941 100644 --- a/src/driver/rcinput.cpp +++ b/src/driver/rcinput.cpp @@ -143,7 +143,6 @@ CRCInput::CRCInput() perror("[neutrino] listen failed...\n"); exit( -1 ); } - clickfd = -1; repeat_block = repeat_block_generic = 0; checkdev(); open(); @@ -335,7 +334,6 @@ void CRCInput::open(bool recheck) //+++++++++++++++++++++++++++++++++++++++ #endif /* KEYBOARD_INSTEAD_OF_REMOTE_CONTROL */ - open_click(); calculateMaxFd(); } @@ -396,7 +394,6 @@ CRCInput::~CRCInput() if(fd_event) ::close(fd_event); - close_click(); } /************************************************************************** @@ -1474,8 +1471,6 @@ void CRCInput::getMsg_us(neutrino_msg_t * msg, neutrino_msg_data_t * data, uint6 *msg = trkey; *data = 0; /* <- button pressed */ - if(g_settings.key_click) - play_click(); return; } } /*if keyok */ @@ -1780,27 +1775,6 @@ int CRCInput::translate(int code) return (int)RC_nokey; } -void CRCInput::close_click() -{ -} - -void CRCInput::open_click() -{ -} -#if 0 -//never used -void CRCInput::reset_dsp(int /*rate*/) -{ -} - -void CRCInput::set_dsp() -{ -} -#endif -void CRCInput::play_click() -{ -} - void CRCInput::setKeyRepeatDelay(unsigned int start_ms, unsigned int repeat_ms) { for (std::vector::iterator it = indev.begin(); it != indev.end(); ++it) { diff --git a/src/driver/rcinput.h b/src/driver/rcinput.h index 848e54cf6..37cfd4b8a 100644 --- a/src/driver/rcinput.h +++ b/src/driver/rcinput.h @@ -164,10 +164,8 @@ class CRCInput int fd_event; int fd_max; - int clickfd; __u16 rc_last_key; OpenThreads::Mutex mutex; - void set_dsp(); void open(bool recheck = false); bool checkpath(in_dev id); @@ -329,10 +327,6 @@ class CRCInput void clearRCMsg(); int messageLoop( bool anyKeyCancels = false, int timeout= -1 ); - void open_click(); - void close_click(); - void play_click(); - void reset_dsp(int rate); void setLongPressAny(bool b) { longPressAny = b; }; void setKeyRepeatDelay(unsigned int start_ms, unsigned int repeat_ms); diff --git a/src/gui/scan.cpp b/src/gui/scan.cpp index 5a6213853..d26ea9229 100644 --- a/src/gui/scan.cpp +++ b/src/gui/scan.cpp @@ -278,7 +278,6 @@ int CScanTs::exec(CMenuTarget* /*parent*/, const std::string & actionKey) success = false; if(!manual) { - g_RCInput->close_click(); if (my_system(NEUTRINO_SCAN_START_SCRIPT) != 0) perror(NEUTRINO_SCAN_START_SCRIPT " failed"); } @@ -344,7 +343,6 @@ int CScanTs::exec(CMenuTarget* /*parent*/, const std::string & actionKey) if(!manual) { if (my_system(NEUTRINO_SCAN_STOP_SCRIPT) != 0) perror(NEUTRINO_SCAN_STOP_SCRIPT " failed"); - g_RCInput->open_click(); } if(!test) { CComponentsHeaderLocalized header(x, y, width, hheight, success ? LOCALE_SCANTS_FINISHED : LOCALE_SCANTS_FAILED); diff --git a/src/neutrino.cpp b/src/neutrino.cpp index a1ae72747..1844b0276 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -4386,7 +4386,6 @@ void CNeutrinoApp::loadKeys(const char * fname) /* options */ g_settings.menu_left_exit = tconfig.getInt32( "menu_left_exit", 0 ); - g_settings.key_click = tconfig.getInt32( "key_click", 1 ); g_settings.repeat_blocker = tconfig.getInt32("repeat_blocker", 150); g_settings.repeat_genericblocker = tconfig.getInt32("repeat_genericblocker", 100); g_settings.longkeypress_duration = tconfig.getInt32("longkeypress_duration", LONGKEYPRESS_OFF); @@ -4469,7 +4468,6 @@ void CNeutrinoApp::saveKeys(const char * fname) tconfig.setInt32( "key_pic_size_active", g_settings.key_pic_size_active ); tconfig.setInt32( "menu_left_exit", g_settings.menu_left_exit ); - tconfig.setInt32( "key_click", g_settings.key_click ); tconfig.setInt32( "repeat_blocker", g_settings.repeat_blocker ); tconfig.setInt32( "repeat_genericblocker", g_settings.repeat_genericblocker ); tconfig.setInt32( "longkeypress_duration", g_settings.longkeypress_duration ); diff --git a/src/system/settings.h b/src/system/settings.h index 2c91416f6..64b6423c4 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -504,7 +504,6 @@ struct SNeutrinoSettings int key_list_end; int key_power_off; int menu_left_exit; - int key_click; int timeshift_pause; int auto_timeshift; int temp_timeshift; From abe232fc6c5968859cf053013a6a80662b4cc006 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Wed, 22 Feb 2017 06:21:38 +0100 Subject: [PATCH 11/11] CRCInput::set_rc_hw: Fix device check for cs hd2 Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/5cac45ccb837955bd03b9b2cc41e415c983139d7 Author: Michael Liebmann Date: 2017-02-22 (Wed, 22 Feb 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/rcinput.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/driver/rcinput.cpp b/src/driver/rcinput.cpp index 6161fb941..b7974a09c 100644 --- a/src/driver/rcinput.cpp +++ b/src/driver/rcinput.cpp @@ -1822,7 +1822,11 @@ void CRCInput::set_rc_hw(ir_protocol_t ir_protocol, unsigned int ir_address) } int fd = -1; for (std::vector::iterator it = indev.begin(); it != indev.end(); ++it) { - if ((*it).path == "/dev/input/nevis_ir") { + if (((*it).path == "/dev/input/nevis_ir") +#ifdef BOXMODEL_CS_HD2 + || ((*it).path == "/dev/input/input0") +#endif + ){ fd = (*it).fd; break; }