Skip to content

157. A protocol family's durations are the family's, so a stated code can be emitted with no sibling

The gap this closes. Logitech's device database states a code as a protocol name and a number, G:Sony 12 Bit:()(0x910)():3, and never as a rhythm: Raw was null on all 419 commands ever fetched from it, section 132. A config holds durations. Section 152 measured that a code's durations can be read off any other code of the same appliance, exactly, on 3502 of 3502 records, and 52 of 58 device groups carry one set for every code. That serves a config which already drives the appliance and it cannot serve a document starting from nothing, because there is no sibling code to read from. So the question is whether the durations belong to the family instead of to the appliance.

They do, and the measurement is per family at a carrier frequency. 347 codes across 15 configs were put to Logitech's own analyser by bin/analyze.ts, which named a protocol for 232 of them. 177 of those have a reading of ours carrying the number they returned, and those 177 fall into six entries:

family kHz codes duration sets frame period reproduced exactly tightest band
MemorexO1 32 Bit 38.0 108 3 n/a 81 of 108 2.0%
SharpO1 48 Bit 38.0 33 1 n/a 33 of 33 exact
Pioneer 32 Bit 40.0 12 1 n/a 12 of 12 exact
SharpO1 48 Bit 36.4 12 1 n/a 12 of 12 exact
Sony 15 Bit 40.0 9 1 45000 us 9 of 9 exact
Sony 12 Bit 40.0 3 1 45000 us 3 of 3 exact

"Reproduced exactly" is the entry's own durations put through pulsesOfFrame with the code's number and compared pulse for pulse against what the config actually holds. So five of six entries emit every one of their codes to the microsecond, and 150 of 177 codes overall.

Three of those six family names are wrong and every duration in the table is right, section 227. The names came from Logitech's analyser; their catalogue states the rhythm, and looked up in it the first row is Toshiba 32 Bit plus Roku 32 Bit 1 plus the real MemorexO1 32 Bit, the second is Sharp 48 Bit 2 and the fourth is PanasonicV2 48 Bit. The rows are left as measured, since what this section measured was durations.

Two things had to be separated before any of that appeared, and both were found by the measurement refusing to be tidy.

The closing space is not a protocol constant, it is a pad. On a pulse width protocol the space that closes the last pair takes whatever is left of the protocol's frame period, so it is shorter by one bit's worth for every one bit the code carries. Keyed with it in the table, Sony 12 Bit came out as three duration sets over three codes and Sony 15 Bit as three over nine, which reads as a protocol whose timings are per code and would have killed the whole idea. Computed from a frame period instead, each is one set. And the period is the independent closure: it is not a field anywhere, it is the sum of a code's own header, bits and closing space, computed per code and then found identical across the family, and it lands on exactly 45000 microseconds, which is the documented frame period of that protocol. Nothing here was fitted to 45 ms.

The carrier is part of the key, and the reason given here was a mis-attribution, corrected by section 227. It said SharpO1 48 Bit's codes arrive at 36.4 and 38 kHz so a family needs splitting by carrier. Those were two families, Sharp 48 Bit 2 and PanasonicV2 48 Bit, named by Logitech's analyser and named wrongly, and their catalogue states one carrier per family. No family here arrives at two. The carrier stays in the key because a rhythm is only a rhythm at a frequency and that is how a family is looked up in their catalogue. The entry stores it as the period in nanoseconds the record itself carries, 26315 and 27472, rather than a frequency, because section 92 measured the field as floor(1e9 / f) and a round trip through the frequency would not always land back on the byte.

The one loose entry is named rather than tolerated, and the conclusion drawn from it was wrong while the measurement was right, corrected by section 227. MemorexO1 32 Bit at 38 kHz, which is NEC, carries three duration sets across the corpus: 8990/4490/568/552/1662 on five arch 8 configs and two Harmony One ones, 9000/4500/562/562/1688 on both Harmony 700 configs, and 9000/4500/560/560/1690 on three records of one arch 8 config. The third is nominal NEC exactly.

That was read as variation per appliance within a family, section 152 seen from the other side, and the commonest set reproducing 81 of 108 exactly with all 108 inside 2% was reported as the entry's worth. They are three families: Logitech's own definitions state 8990/4490/568/552/1662 for Toshiba 32 Bit, 9000/4500/562/562/1688 for Roku 32 Bit 1 and 9000/4500/560/560/1690 for the real MemorexO1 32 Bit. Every duration listed above is unchanged; only the name over each set moved. Two things should have raised it at the time. From 568/552 to 562/562 the mark goes down while the clear space goes up, which a recording tolerance cannot do, and this paragraph already said the third set was nominal NEC exactly, which is a statement that it is a protocol of its own rather than a drift off another one. The table now has no entry with a spread at all.

What is not in the table and must not be guessed. 55 of the 232 named codes have no reading of ours carrying their number, and they are the biphase ones: 48 Microsoft 30 Bit, which is RC6, 4 Logitech 24 Bit and 3 Makita 10 Bit. framesOfPulses models pulse distance and pulse width and not Manchester, section 153, so no durations were ever derived for them and pulsesOfStatedCode returns nothing for that family. A guessed rhythm there would be a command that does nothing, presented as one that works. A further 115 codes their own analyser declined to name at all.

Where this stopped, and it has moved twice since. A record holds the frame several times over with gaps between the copies and a closing silence, and none of that follows from the bits. The figure here was 151 distinct shapes and section 152 was cited for it, which that section does not state; it is 140 since section 164, which took a reading away from 45 records by merging adjacent durations of one kind. And the second half is no longer true either: section 171 gave 29 of the table's 37 entries a per family tail, so the encoder produces whole blocks for those and the caller decides the rest only for the eight that have no rule. Those two figures were 31 of 38 until section 227 named every rhythm by Logitech's catalogue, which merged two entries away and left one new family with no measured tail. Both corrections are recorded here rather than in the later sections alone, because this is the paragraph that states the boundary.

packages/codec/src/protocols.ts is the generated table, src/stated.ts the lookup and the encoder, bin/protocols.ts the measurement, make protocols prints it and --write regenerates it, and test/stated.test.ts asserts the counts, the 45 ms closure, the refusal for a family that is not there, and that no family is at two carriers, section 227 having found that the one that appeared to be was two families.


Section 156 | the archive | section 158. Section 157 of the findings archive, which is frozen; the reference holds the current answer. The archive on GitHub.