k-yle/sACN

Bug: Out of order wrap around requires specific sequence value

benjaminauer opened this issue · 7 comments

When sequence does not go up to 255, skips it for any reason, the sequence gets out of order for the remainder of the duration the process is running.

sACN/src/receiver.ts

Lines 65 to 66 in eae3d83

this.lastSequence[packet.universe] =
packet.sequence === 255 ? -1 : packet.sequence;

k-yle commented

Hi @benjaminauer, I've opened #38 which should fix this - only one error will be emitted, then it will use the latest sequence. let me know if that PR works for you. Otherwise I'll release the fix tomorrow

will be able to check it on friday 16.07.21
found the issue when every second packet was always tagged with packetcorruption.
sender is an ETC paradigm processor. i will try to track the issue down and create another issue later on

i could not try it in my theatre today,
but i tried some stuff at home now, they way this lib handles the packet sequence, it will throw an error, when multiple senders are active in a network. it needs a per source / per universe comparsion to check order of packets

Having the same bug with a ETC IonXE20 Eos 3.1.0 Build 282 and sACN Version 4.1.0

My Software is listening to universe 2, Ion is transmitting universe 2, Another Device is transmitting universe 1.

Log looks like this:

Error: Packet significantly out of order in universe 2 (254 -> 27)
at Socket. (D:\technik\software\sACN2Video\server\node_modules\sacn\dist\receiver.js:26:27)
at Socket.emit (node:events:390:28)
at UDP.onMessage [as onmessage] (node:dgram:939:8)
Error: Packet significantly out of order in universe 2 (254 -> 28)
at Socket. (D:\technik\software\sACN2Video\server\node_modules\sacn\dist\receiver.js:26:27)
at Socket.emit (node:events:390:28)
at UDP.onMessage [as onmessage] (node:dgram:939:8)
Error: Packet significantly out of order in universe 2 (254 -> 30)
at Socket. (D:\technik\software\sACN2Video\server\node_modules\sacn\dist\receiver.js:26:27)
at Socket.emit (node:events:390:28)
at UDP.onMessage [as onmessage] (node:dgram:939:8)
Error: Packet significantly out of order in universe 2 (254 -> 31)
at Socket. (D:\technik\software\sACN2Video\server\node_modules\sacn\dist\receiver.js:26:27)
at Socket.emit (node:events:390:28)
at UDP.onMessage [as onmessage] (node:dgram:939:8)
Error: Packet significantly out of order in universe 2 (254 -> 32)
at Socket. (D:\technik\software\sACN2Video\server\node_modules\sacn\dist\receiver.js:26:27)
at Socket.emit (node:events:390:28)
at UDP.onMessage [as onmessage] (node:dgram:939:8)

and so on from 1 to 233

Sometimes I get this error, sometimes not.

I will try to get a log of all the sACN messages.

@hansSchall, it should be fixed with the #38
have you tried it? Should only throw one error and then update the order index.

I've tried out the bugfix and it works.

There are only single frames dropped, which aren't noticed.

But I can imagine this fix could cause strange behavior in case there is a real packet corruption.
It shoud be possible to disable this with a flag like this:

const sACN = new Receiver({
  universes: [1, 2],
  enableFewerOutOfOrderErrors: false,
});

and a notice in the readme.md like this:

this option needs to be enabled for some senders (especially ETC's devices), but could cause strange behavior in some circumstances

k-yle commented

I've updated PR #38 so that there should be no PacketOutOfOrder errors if there are two consoles broadcasting to the same universe. Tested with one laptop running Martin M-PC and another laptop running LightFactory.

I'm going to merge #38 tomorrow since this seems to properly fix the issue.

@hansSchall, this means we won't need the flag you suggested