From bcc3a25ed5ebb40043f1008eaaab1b27c5f83b83 Mon Sep 17 00:00:00 2001 From: TangoCash Date: Sun, 12 Nov 2017 21:21:15 +0100 Subject: [PATCH 1/5] fix 0648 caid issue (dbo!!!) Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/d6d3456368d7e68c01528e3fb99f3fa693120422 Author: TangoCash Date: 2017-11-12 (Sun, 12 Nov 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- libdvbci/dvbci_camgr.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libdvbci/dvbci_camgr.cpp b/libdvbci/dvbci_camgr.cpp index 24917f3..6f1264c 100644 --- a/libdvbci/dvbci_camgr.cpp +++ b/libdvbci/dvbci_camgr.cpp @@ -47,6 +47,13 @@ int eDVBCICAManagerSession::receivedAPDU(const unsigned char *tag, const void *d printf("%04x ", 0x186D); break; } + + if (caids[i] == 0x0648) + { + caids.push_back(0x0650); + printf("%04x ", 0x0650); + break; + } } } std::sort(caids.begin(), caids.end()); From e7740be1e5fae4c0a5a73e95c966453bdad81235 Mon Sep 17 00:00:00 2001 From: TangoCash Date: Mon, 13 Nov 2017 20:20:12 +0100 Subject: [PATCH 2/5] align to changes Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/f7a69a642c8b2b22dbd7d9df5fe6e95f7a74527b Author: TangoCash Date: 2017-11-13 (Mon, 13 Nov 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- include/hardware_caps.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/hardware_caps.h b/include/hardware_caps.h index 1a8952f..92da189 100644 --- a/include/hardware_caps.h +++ b/include/hardware_caps.h @@ -38,6 +38,7 @@ typedef struct hw_caps int display_yres; int display_can_set_brightness; int display_can_deepstandby; + int display_has_statusline; char boxvendor[64]; char boxname[64]; char boxarch[64]; From f3d8b44e60e55386db576140e352802e508f3c5d Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Mon, 13 Nov 2017 09:44:47 +0100 Subject: [PATCH 3/5] try to fix possible race condition Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/3c12a78dddf0d425ee141372a81666fc40232ec3 Author: Jacek Jendrzej Date: 2017-11-13 (Mon, 13 Nov 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- libarmbox/playback_gst.cpp | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/libarmbox/playback_gst.cpp b/libarmbox/playback_gst.cpp index b7a6548..e4b19d9 100644 --- a/libarmbox/playback_gst.cpp +++ b/libarmbox/playback_gst.cpp @@ -72,6 +72,8 @@ GstElement * audioSink = NULL; GstElement * videoSink = NULL; gchar * uri = NULL; GstTagList * m_stream_tags = NULL; +pthread_mutex_t mutex_tag_ist; + static int end_eof = 0; #define HTTP_TIMEOUT 30 // taken from record.h @@ -261,6 +263,8 @@ GstBusSyncReply Gst_bus_call(GstBus *bus, GstMessage *msg, gpointer user_data) if(!GST_IS_TAG_LIST(tags)) break; + pthread_mutex_lock (&mutex_tag_ist); + result = gst_tag_list_merge(m_stream_tags, tags, GST_TAG_MERGE_REPLACE); if (result) { @@ -268,6 +272,8 @@ GstBusSyncReply Gst_bus_call(GstBus *bus, GstMessage *msg, gpointer user_data) { gst_tag_list_unref(tags); gst_tag_list_unref(result); + + pthread_mutex_unlock (&mutex_tag_ist); break; } if (m_stream_tags) @@ -276,6 +282,8 @@ GstBusSyncReply Gst_bus_call(GstBus *bus, GstMessage *msg, gpointer user_data) gst_tag_list_unref(result); } + pthread_mutex_unlock (&mutex_tag_ist); + const GValue *gv_image = gst_tag_list_get_value_index(tags, GST_TAG_IMAGE, 0); if ( gv_image ) { @@ -413,6 +421,8 @@ cPlayback::cPlayback(int num) gst_mpegts_initialize(); + pthread_mutex_init (&mutex_tag_ist, NULL); + if (nano == 1) nano_str = "(CVS)"; else if (nano == 2) @@ -437,8 +447,10 @@ cPlayback::~cPlayback() { lt_info( "%s:%s\n", FILENAME, __FUNCTION__); //FIXME: all deleting stuff is done in Close() + pthread_mutex_lock (&mutex_tag_ist); if (m_stream_tags) gst_tag_list_unref(m_stream_tags); + pthread_mutex_unlock (&mutex_tag_ist); } //Used by Fileplay @@ -530,9 +542,11 @@ bool cPlayback::Start(char *filename, int /*vpid*/, int /*vtype*/, int /*apid*/, mAudioStream = 0; init_jump = -1; + pthread_mutex_lock (&mutex_tag_ist); if (m_stream_tags) gst_tag_list_unref(m_stream_tags); m_stream_tags = NULL; + pthread_mutex_unlock (&mutex_tag_ist); unlink("/tmp/.id3coverart"); @@ -1030,14 +1044,21 @@ void cPlayback::GetMetadata(std::vector &keys, std::vector Date: Wed, 15 Nov 2017 23:25:55 +0100 Subject: [PATCH 4/5] cleanup Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/900dd63a2eda27455d22e5a735ceaf3e21b80163 Author: TangoCash Date: 2017-11-15 (Wed, 15 Nov 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- libarmbox/audio.cpp | 65 ---------------------------------- libarmbox/audio_lib.h | 11 ------ libarmbox/audio_mixer.cpp | 68 ----------------------------------- libarmbox/audio_mixer.h | 36 ------------------- libarmbox/dmx.cpp | 39 ++------------------- libarmbox/pwrmngr.cpp | 74 ++------------------------------------- libarmbox/video.cpp | 5 --- 7 files changed, 4 insertions(+), 294 deletions(-) delete mode 100644 libarmbox/audio_mixer.cpp delete mode 100644 libarmbox/audio_mixer.h diff --git a/libarmbox/audio.cpp b/libarmbox/audio.cpp index 7cbe499..8064633 100644 --- a/libarmbox/audio.cpp +++ b/libarmbox/audio.cpp @@ -27,26 +27,17 @@ cAudio::cAudio(void *, void *, void *) clipfd = -1; mixer_fd = -1; -/* - mixerAnalog = mixerHDMI = mixerSPDIF = NULL; - volumeAnalog = volumeHDMI = volumeSPDIF = 0; - mixersMuted = false -*/ - openDevice(); Muted = false; } cAudio::~cAudio(void) { - //closeMixers(); closeDevice(); } void cAudio::openDevice(void) { - //openMixers(); - if (fd < 0) { if ((fd = open(AUDIO_DEVICE, O_RDWR)) < 0) @@ -60,8 +51,6 @@ void cAudio::openDevice(void) void cAudio::closeDevice(void) { - //closeMixers(); - if (fd > -1) { close(fd); fd = -1; @@ -424,57 +413,3 @@ void cAudio::setBypassMode(bool disable) if (ioctl(fd, AUDIO_SET_BYPASS_MODE, mode) < 0) lt_info("%s AUDIO_SET_BYPASS_MODE %d: %m\n", __func__, mode); } - -#if 0 -void cAudio::openMixers(void) -{ - if (!mixerAnalog) - mixerAnalog = new mixerVolume("Analog", "1"); - if (!mixerHDMI) - mixerHDMI = new mixerVolume("HDMI", "1"); - if (!mixerSPDIF) - mixerSPDIF = new mixerVolume("SPDIF", "1"); -} - -void cAudio::closeMixers(void) -{ - delete mixerAnalog; - delete mixerHDMI; - delete mixerSPDIF; - mixerAnalog = mixerHDMI = mixerSPDIF = NULL; -} - -void cAudio::setMixerVolume(const char *name, long value, bool remember) -{ - if (!strcmp(name, "Analog")) { - mixerAnalog->setVolume(value); - if (remember) - volumeAnalog = value; - } - if (!strcmp(name, "HDMI")) { - mixerHDMI->setVolume(value); - if (remember) - volumeHDMI = value; - } - if (!strcmp(name, "SPDIF")) { - mixerSPDIF->setVolume(value); - if (remember) - volumeSPDIF = value; - } -} - -void cAudio::muteMixers(bool m) -{ - if (m && !mixersMuted) { - mixersMuted = true; - setMixerVolume("Analog", 0, false); - setMixerVolume("HDMI", 0, false); - setMixerVolume("SPDIF", 0, false); - } else if (!m && mixersMuted) { - mixersMuted = false; - setMixerVolume("Analog", volumeAnalog, false); - setMixerVolume("HDMI", volumeHDMI, false); - setMixerVolume("SPDIF", volumeSPDIF, false); - } -} -#endif diff --git a/libarmbox/audio_lib.h b/libarmbox/audio_lib.h index 5fb3e9c..5aad2f5 100644 --- a/libarmbox/audio_lib.h +++ b/libarmbox/audio_lib.h @@ -57,10 +57,6 @@ class cAudio int do_mute(bool enable, bool remember); void setBypassMode(bool disable); - mixerVolume *mixerAnalog, *mixerHDMI, *mixerSPDIF; - int volumeAnalog, volumeHDMI, volumeSPDIF; - bool mixersMuted; - public: /* construct & destruct */ cAudio(void *, void *, void *); @@ -99,13 +95,6 @@ class cAudio void SetSpdifDD(bool enable); void ScheduleMute(bool On); void EnableAnalogOut(bool enable); - -#if 0 - void openMixers(void); - void closeMixers(void); - void setMixerVolume(const char *name, long value, bool remember = true); - void muteMixers(bool m = true); -#endif }; #endif diff --git a/libarmbox/audio_mixer.cpp b/libarmbox/audio_mixer.cpp deleted file mode 100644 index f361209..0000000 --- a/libarmbox/audio_mixer.cpp +++ /dev/null @@ -1,68 +0,0 @@ -/* - * audio_mixer.cpp - * - * (C) 2012 martii - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include - -mixerVolume::mixerVolume(const char *name, const char *card, long volume) { - snd_mixer_selem_id_t *sid = NULL; - elem = NULL; - handle = NULL; - min = 0; - max = 100; - char cardId[10]; - - if (!name || !card) - return; - - int cx = snd_card_get_index(card); - if (cx < 0 || cx > 31) - return; - snprintf(cardId, sizeof(cardId), "hw:%i", cx); - - if (0 > snd_mixer_open(&handle, 0)) - return; - if (0 > snd_mixer_attach(handle, cardId)) - return; - if (0 > snd_mixer_selem_register(handle, NULL, NULL)) - return; - if (0 > snd_mixer_load(handle)) - return; - snd_mixer_selem_id_alloca(&sid); - if (!sid) - return; - snd_mixer_selem_id_set_index(sid, 0); - snd_mixer_selem_id_set_name(sid, name); - elem = snd_mixer_find_selem(handle, sid); - if (elem) { - snd_mixer_selem_get_playback_volume_range(elem, &min, &max); - setVolume(volume); - } -} -mixerVolume::~mixerVolume() -{ - if (handle) - snd_mixer_close(handle); -} - -bool mixerVolume::setVolume(long volume) { - return elem - && (volume > -1) - && (volume < 101) - && !snd_mixer_selem_set_playback_volume_all(elem, min + volume * (max - min)/100); -} diff --git a/libarmbox/audio_mixer.h b/libarmbox/audio_mixer.h deleted file mode 100644 index 2a6f6fc..0000000 --- a/libarmbox/audio_mixer.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * audio_mixer.h - * - * (C) 2012 martii - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifndef __AUDIO_MIXER_H__ -#define __AUDIO_MIXER_H__ -#include - -class mixerVolume -{ - private: - long min, max; - snd_mixer_t *handle; - snd_mixer_elem_t* elem; - public: - mixerVolume(const char *selem_name, const char *Card, long volume = -1); - ~mixerVolume(void); - bool setVolume(long volume); -}; -#endif - diff --git a/libarmbox/dmx.cpp b/libarmbox/dmx.cpp index 687f3b8..dbd5ef4 100644 --- a/libarmbox/dmx.cpp +++ b/libarmbox/dmx.cpp @@ -1,6 +1,6 @@ /* - * cDemux implementation for SH4 receivers (tested on fulan spark and - * fulan spark7162 hardware) + * cDemux implementation for arm receivers (tested on mutant hd51 + * hardware) * * derived from libtriple/dmx_td.cpp * @@ -20,41 +20,6 @@ * along with this program. If not, see . */ -/* - * Theory of operation (or "why is this dmx_source thing so strange and - * what is the _open() good for?") - * - * the sh4 pti driver, driving the /dev/dvb/adapter0/dmxN devices, can - * apparently only map one input to on demux device at a time, so e.g. - * DMX_SOURCE_FRONT1 -> demux0 - * DMX_SOURCE_FRONT2 -> demux0 - * DMX_SOURCE_FRONT1 -> demux1 - * does not work. The driver makes sure that a one-to-one mapping of - * DMX_SOURCE_FRONTn to demuxM is maintained, and it does by e.g changing - * the default of - * FRONT0 -> demux0 - * FRONT1 -> demux1 - * FRONT2 -> demux2 - * to - * FRONT1 -> demux0 - * FRONT0 -> demux1 - * FRONT2 -> demux2 - * if you do a DMX_SET_SOURCE(FRONT1) ioctl on demux0. - * This means, it also changes demux1's source on the SET_SOURCE ioctl on - * demux0, potentially disturbing any operation on demux1 (e.g. recording). - * - * In order to avoid this, I do not change the source->demuxdev mapping - * but instead just always use the demux device that is attached to the - * correct source. - * - * The tricky part is, that the source might actually be changed after - * Open() has been called, so Open() gets a dummy placeholder that just - * sets some variables while the real device open is put into _open(). - * _open() gets called later, whenever the device is actually used or - * configured and -- if the source has changed -- closes the old and - * opens the correct new device node. - */ - #include #include #include diff --git a/libarmbox/pwrmngr.cpp b/libarmbox/pwrmngr.cpp index b5ab30a..f4eff66 100644 --- a/libarmbox/pwrmngr.cpp +++ b/libarmbox/pwrmngr.cpp @@ -14,23 +14,7 @@ void cCpuFreqManager::Down(void) { lt_debug("%s\n", __FUNCTION__); } void cCpuFreqManager::Reset(void) { lt_debug("%s\n", __FUNCTION__); } /* those function dummies return true or "harmless" values */ bool cCpuFreqManager::SetDelta(unsigned long) { lt_debug("%s\n", __FUNCTION__); return true; } -#if HAVE_SPARK_HARDWARE || HAVE_DUCKBOX_HARDWARE -unsigned long cCpuFreqManager::GetCpuFreq(void) { - int freq = 0; - if (FILE *pll0 = fopen("/proc/cpu_frequ/pll0_ndiv_mdiv", "r")) { - char buffer[120]; - while(fgets(buffer, sizeof(buffer), pll0)) { - if (1 == sscanf(buffer, "SH4 = %d MHZ", &freq)) - break; - } - fclose(pll0); - return 1000 * 1000 * (unsigned long) freq; - } - return 0; -} -#else unsigned long cCpuFreqManager::GetCpuFreq(void) { lt_debug("%s\n", __FUNCTION__); return 0; } -#endif unsigned long cCpuFreqManager::GetDelta(void) { lt_debug("%s\n", __FUNCTION__); return 0; } // cCpuFreqManager::cCpuFreqManager(void) { lt_debug("%s\n", __FUNCTION__); } @@ -40,62 +24,8 @@ bool cPowerManager::SetState(PWR_STATE) { lt_debug("%s\n", __FUNCTION__); return bool cPowerManager::Open(void) { lt_debug("%s\n", __FUNCTION__); return true; } void cPowerManager::Close(void) { lt_debug("%s\n", __FUNCTION__); } // -bool cPowerManager::SetStandby(bool Active, bool Passive) -{ - lt_debug("%s(%d, %d)\n", __FUNCTION__, Active, Passive); - return true; -} - -bool cCpuFreqManager::SetCpuFreq(unsigned long f) -{ -#if HAVE_SPARK_HARDWARE || HAVE_DUCKBOX_HARDWARE - if (f) { - FILE *pll0 = fopen ("/proc/cpu_frequ/pll0_ndiv_mdiv", "w"); - if (pll0) { - f /= 1000000; - fprintf(pll0, "%lu\n", (f/10 << 8) | 3); - fclose (pll0); - return false; - } - } -#else - /* actually SetCpuFreq is used to determine if the system is in standby - this is an "elegant" hack, because: - * during a recording, cpu freq is kept "high", even if the box is sent to standby - * the "SetStandby" call is made even if a recording is running - On the TD, setting standby disables the frontend, so we must not do it - if a recording is running. - For now, the values in neutrino are hardcoded: - * f == 0 => max => not standby - * f == 50000000 => min => standby - */ - lt_debug("%s(%lu) => set standby = %s\n", __FUNCTION__, f, f?"true":"false"); -#if 0 - int fd = open("/dev/stb/tdsystem", O_RDONLY); - if (fd < 0) - { - perror("open tdsystem"); - return false; - } - if (f) - { - ioctl(fd, IOC_AVS_SET_VOLUME, 31); /* mute AVS to avoid ugly noise */ - ioctl(fd, IOC_AVS_STANDBY_ENTER); - } - else - { - ioctl(fd, IOC_AVS_SET_VOLUME, 31); /* mute AVS to avoid ugly noise */ - ioctl(fd, IOC_AVS_STANDBY_LEAVE); - /* unmute will be done by cAudio::do_mute(). Ugly, but prevents pops */ - // ioctl(fd, IOC_AVS_SET_VOLUME, 0); /* max gain */ - } - - close(fd); -#endif -#endif - return true; -} - +bool cPowerManager::SetStandby(bool Active, bool Passive) { lt_debug("%s(%d, %d)\n", __FUNCTION__, Active, Passive); return true; } +bool cCpuFreqManager::SetCpuFreq(unsigned long f) { lt_debug("%s(%lu) => set standby = %s\n", __FUNCTION__, f, f?"true":"false"); return true; } // cPowerManager::cPowerManager(void) { lt_debug("%s\n", __FUNCTION__); } cPowerManager::~cPowerManager() { lt_debug("%s\n", __FUNCTION__); } diff --git a/libarmbox/video.cpp b/libarmbox/video.cpp index 8bf87b1..8cbc631 100644 --- a/libarmbox/video.cpp +++ b/libarmbox/video.cpp @@ -83,11 +83,6 @@ static const char *VMPEG_yres[] = { "/proc/stb/vmpeg/1/yres" }; -static const char *VMPEG_dst_all[] = { - "/proc/stb/vmpeg/0/dst_all", - "/proc/stb/vmpeg/1/dst_all" -}; - static const char *VMPEG_dst_height[] = { "/proc/stb/vmpeg/0/dst_height", "/proc/stb/vmpeg/1/dst_height" From 3149aaf537878cd3210f7b8eafb21803b8608efb Mon Sep 17 00:00:00 2001 From: TangoCash Date: Wed, 15 Nov 2017 23:29:19 +0100 Subject: [PATCH 5/5] cleanup Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/680385c20f73a86b8ea282d8174fc75f2093e0d3 Author: TangoCash Date: 2017-11-15 (Wed, 15 Nov 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- include/audio_hal.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/audio_hal.h b/include/audio_hal.h index 6f50cd5..f45ea2d 100644 --- a/include/audio_hal.h +++ b/include/audio_hal.h @@ -9,7 +9,6 @@ #include "../libspark/audio_mixer.h" #elif HAVE_ARM_HARDWARE #include "../libarmbox/audio_lib.h" -#include "../libarmbox/audio_mixer.h" #elif HAVE_AZBOX_HARDWARE #include "../azbox/audio_lib.h" #elif HAVE_GENERIC_HARDWARE