Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ganglion firmware v2 packet ordering #664

Merged

Conversation

philippitts
Copy link
Contributor

@philippitts philippitts commented Aug 7, 2023

There was a problem with the packet ordering for the Ganglion firmware v2 decompression. In this firmware, a raw packet is sent every 100Hz to "reset" the delta compression. The previous implementation wrote this raw packet in the wrong order and left the sample package where it should have been unchanged. This didn't change the data stream much (it just wrote the same sample twice), but it would cause the same package index to be written twice. This is an issue for downstream clients that use the package index to check if samples have been lost over the bluetooth connection.

@philippitts
Copy link
Contributor Author

Firmware v3 with native BLE running a 12Hz 4mV sine wave
image

Firmware v3 with native BLE running impedance check (hooked up to signal generator)
image

Firmware v3 with dongle running a 12Hz 4mV sine wave
image

Firmware v3 with dongle running impedance check (hooked up to signal generator)
image

Firmware v2 with native BLE running a 3Hz 1mV sine wave
image

Firmware v2 with native BLE running impedance check (hooked up to signal generator)
image

Firmware v2 with dongle running a 3Hz 1mV sine wave
image

Firmware v2 with dongle running impedance check (hooked up to signal generator)
image

Firmware v2 with dongle running a 3Hz 1mV sine wave on the OpenBCI GUI v5.2.1 (for comparison)
image

@philippitts philippitts marked this pull request as ready for review August 8, 2023 17:58
@Andrey1994
Copy link
Member

actually, in openbci gui if I remember correctly we took into account that package ids are duplicated. At least it was the case for old fw, is it changed now?

@Andrey1994 Andrey1994 merged commit a080a19 into brainflow-dev:master Aug 8, 2023
11 checks passed
@philippitts
Copy link
Contributor Author

actually, in openbci gui if I remember correctly we took into account that package ids are duplicated. At least it was the case for old fw, is it changed now?

I noticed that the GUI would report 200 lost packets about every second (which corresponds with the frequency of sending the raw packet). I assumed that it was missing an index and calculating that it had lost full trip around the buffer (200 samples) because of an indexing problem.

@philippitts philippitts deleted the fix-ganglion-packet-loss branch August 8, 2023 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants