Skip to content

Commit

Permalink
Nimmanager: Solve the FBC tuner detection
Browse files Browse the repository at this point in the history
It seems a manufacturer has a new dual tuner that fits init a fbc tuner
slot. But the procs are indicting such tuners are still fbc tuners. By
adding a check that an fbc tuner should at least have 8 further tuners I
treid to solve this.
  • Loading branch information
littlesat committed Jul 26, 2019
1 parent 6ddc696 commit 6efcfcc
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/python/Components/NimManager.py
Expand Up @@ -475,7 +475,7 @@ def __init__(self, nimmgr):
self.update()

class NIM(object):
def __init__(self, slot, type, description, has_outputs = True, internally_connectable = None, multi_type = {}, frontend_id = None, i2c = None, is_empty = False, supports_blind_scan = False):
def __init__(self, slot, type, description, has_outputs=True, internally_connectable=None, multi_type={}, frontend_id=None, i2c=None, is_empty=False, supports_blind_scan=False, number_of_slots=0):
nim_types = ["DVB-S", "DVB-S2", "DVB-S2X", "DVB-C", "DVB-T", "DVB-T2", "ATSC"]

if type and type not in nim_types:
Expand All @@ -485,6 +485,7 @@ def __init__(self, slot, type, description, has_outputs = True, internally_conne
self.slot = slot
self.type = type
self.description = description
self.number_of_slots = number_of_slots
self.has_outputs = has_outputs
self.internally_connectable = internally_connectable
self.multi_type = multi_type
Expand Down Expand Up @@ -624,7 +625,7 @@ def getMultiTypeList(self):
return self.multi_type

def isFBCTuner(self):
return (self.frontend_id is not None) and os.access("/proc/stb/frontend/%d/fbc_id" % self.frontend_id, os.F_OK)
return self.frontend_id is not None and (self.frontend_id/8 + 1) * 8 <= self.number_of_slots and os.access("/proc/stb/frontend/%d/fbc_id" % self.frontend_id, os.F_OK)

def isFBCRoot(self):
return self.isFBCTuner() and (self.slot % 8 < (self.getType() == "DVB-C" and 1 or 2))
Expand All @@ -651,7 +652,7 @@ def getFriendlyFullDescriptionCompressed(self):
if self.isFBCTuner():
return "%s-%s: %s" % (self.getSlotName(self.slot & ~7), self.getSlotID((self.slot & ~7) + 7), self.getFullDescription())
#compress by combining dual tuners by checking if the next tuner has a rf switch
elif self.frontend_id is not None and len(nimmanager.nim_slots) > self.frontend_id + 1 and os.access("/proc/stb/frontend/%d/rf_switch" % (self.frontend_id + 1), os.F_OK):
elif self.frontend_id is not None and self.number_of_slots > self.frontend_id + 1 and os.access("/proc/stb/frontend/%d/rf_switch" % (self.frontend_id + 1), os.F_OK):
return "%s-%s: %s" % (self.slot_name, self.getSlotID(self.slot + 1), self.getFullDescription())
return self.getFriendlyFullDescription()

Expand Down Expand Up @@ -870,7 +871,7 @@ def enumerateNIMs(self):
entry["multi_type"] = {}
if "supports_blind_scan" not in entry:
entry["supports_blind_scan"] = False
self.nim_slots.append(NIM(slot = id, description = entry["name"], type = entry["type"], has_outputs = entry["has_outputs"], internally_connectable = entry["internally_connectable"], multi_type = entry["multi_type"], frontend_id = entry["frontend_device"], i2c = entry["i2c"], is_empty = entry["isempty"], supports_blind_scan = entry["supports_blind_scan"]))
self.nim_slots.append(NIM(slot=id, description=entry["name"], type=entry["type"], has_outputs=entry["has_outputs"], internally_connectable=entry["internally_connectable"], multi_type=entry["multi_type"], frontend_id=entry["frontend_device"], i2c = entry["i2c"], is_empty = entry["isempty"], supports_blind_scan = entry["supports_blind_scan"], number_of_slots=len(entries.keys())))

def hasNimType(self, chktype):
return any(slot.canBeCompatible(chktype) for slot in self.nim_slots)
Expand Down

2 comments on commit 6efcfcc

@AbuBaniaz
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just so you are aware, this commit also fixed the GB UE 4K PnP tuner. It was getting a no SID found in PAT error for all Cable channels owing to the previous commit. It is not an FBC tuner card, it is a conventional tuner card.

@RobvanderDoes
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The slot shouldn't be named 'FBC-tuner slot' at all.
VU+ uses two different types of slots: type 1 is for old (legacy(??) but still available) tuners, type 2 is for new tuners.

Please sign in to comment.