def get_clock_src(self):
     plugs = self.__get_clock_plugs()
     dst = plugs['input']
     src = AvcCcm.get_signal_source(self.fcp, dst)
     addr = AvcCcm.parse_signal_addr(plugs['output'])
     if AvcCcm.compare_addrs(src, addr):
         return 'Internal'
     for name, addr in self.__CLOCK_SRCS.items():
         if AvcCcm.compare_addrs(src, AvcCcm.parse_signal_addr(addr)):
             return name
     raise OSError('Unexpected state of device.')
Esempio n. 2
0
    def get_avail_connections(cls, fcp, unit_plug_list, subunit_plug_list):
        src_candidates = {}
        dst_candidates = {}
        avail = {}

        for seqid, info in unit_plug_list.items():
            data = info['data']
            addr = AvcCcm.get_unit_signal_addr(data['unit-type'], data['plug'])
            if info['dir'] == 'output':
                target = dst_candidates
            else:
                target = src_candidates
            target[seqid] = addr

        for seqid, info in subunit_plug_list.items():
            data = info['data']
            addr = AvcCcm.get_subunit_signal_addr(data['subunit-type'],
                                                  data['subunit-id'],
                                                  data['plug'])
            # Inverse direction against plugs of unit.
            if info['dir'] == 'output':
                target = src_candidates
            else:
                target = dst_candidates
            target[seqid] = addr

        for dst_seqid, dst_addr in dst_candidates.items():
            try:
                curr_src_info = AvcCcm.get_signal_source(fcp, dst_addr)
            except Exception:
                curr_src_info = None

            for src_seqid, src_addr in src_candidates.items():
                try:
                    AvcCcm.ask_signal_source(fcp, src_addr, dst_addr)
                except Exception:
                    continue

                if dst_seqid not in avail:
                    avail[dst_seqid] = []

                src_info = AvcCcm.parse_signal_addr(src_addr)
                avail[dst_seqid].append((src_seqid, src_info == curr_src_info))

        return avail
Esempio n. 3
0
 def get_clock_source(self):
     dst = AvcCcm.get_subunit_signal_addr('music', 0, 1)
     curr = AvcCcm.get_signal_source(self.unit.fcp, dst)
     for name, addr in self.__clocks.items():
         if AvcCcm.compare_addrs(curr, AvcCcm.parse_signal_addr(addr)):
             return name