Snapshot changes with a Control Chain device

@Jan, hi! I thought I asked you directly this time.

I’m still trying to get my head around switching snapshots with an arduino-based Control Chain device.
My progress so far:

  • Working Arduino-based prototype on a breadboard with two button-type actuators
  • CC_MODE_TOGGLE works as a charm on both actuators, no issues there, I parse and output assignment parameters on an LCD in an event callback func
  • I created a group out of these two buttons, with CC_MODE_MOMENTARY | CC_MODE_OPTIONS | CC_MODE_GROUP (and | CC_MODE_REVERSE for one of the buttons)
  • Assigned the group to snapshot change (Snapshots → Load/Manage → Assign All → Control Chain → name of the group)
  • I can track the debugging information in the ssh

Now, when I scroll through the snapshots with the buttons, it seems that my Dwarf performs unassignment and assignment at every update from an activator (see the example from the terminal below).
The question is: is it the expected behaviour (unassignment/assignment)?
Also, sometimes switching of snapshots sort of stalls, and the terminal shows [cc-lib] device timeout (device id: 1), as if the devices go out of sync, or don’t keep up with the changes, or something.
Any thoughts what could be the cause of such behaviour?

I’m trying to debug momentary_process routine in actuator.c, but all seems to be smooth there; could it be something on the MOD’s side?

---
[cc-lib] updates received (device_id: 1, count: 1)
[cc-lib] unassignment received (id: 0, ret: 0)
[cc-lib]   requesting unassignment to device (id: 0)
SEND: device: 1, command: unassignment, data size: 1
      data: 00
      text:
---
RECV: device: 1, command: unassignment, data size: 0
      data:
      text:
---
[cc-lib]   unassignment done (id: 0)
[cc-lib] assignment received (id: 0)
[cc-lib]   requesting assignment to device (id: 0)
SEND: device: 1, command: assignment, data size: 79
      data: 00 01 0A 50 45 44 41 4C 42 4F 41 52 44 00 00 00 40 00 00 00 00 00 00 40 40 00 00 00 00 24 00 00
            00 02 00 04 4E 4F 4E 45 03 07 44 45 46 41 55 4C 54 00 00 00 00 08 31 3A 53 4F 4E 47 20 41 00 00
            80 3F 08 32 3A 53 4F 4E 47 20 42 00 00 00 40
      text: PEDALBOARD@@@$NONEDEFAULT1:SONG A?2:SONG B@
---
RECV: device: 1, command: assignment, data size: 0
      data:
      text:
---
[cc-lib]   assignment done (id: 0)
3 Likes

I’m thinking that the stalls can be caused by a teeny-tiny memory on the Arduino Pro Micro that I’m using, that could just overflow. I will need to look into disabling strings usage, the library code is a bit buggy in a sense that when using CC_MODE_OPTIONS with strings disabled it throws compilation errors. I’ll try using a Mega which has bigger memory, or I’ll have to go buy a Duo, if the memory is indeed the root cause, for I do want to enjoy fully informative display, which, in case of disabled strings, is not possible to achieve. Or I’ll hack deeper into the cc-slave code disabling the strings only for OPTIONS mode, which I’d rather not because of lesser compatibility with the future cc-slave updates.

But the fact that there are unassignments/assignments still puzzles me, and I’d like an expert opinion on that.

5 Likes

Hi @TheRedOne,

apologies for the late reply! You actually stumbled upon some preparations we already did for a next update.

In the next ControlChain update, enumeration lists will be split into frames. This will allow slave devices with less memory to still go through large lists, without having to save all the data to memory when its assigned.

This also brings a problem, when value’s are changed from any other place then the slave device itself, we cant assume it has the right frame in memory. So a reassignment is needed in some cases to force this.

right now however, we can consider it a bug on our side, as the reassignment is not always needed, and should not happen in this version.

Sorry for the confusion! We will iron things out in the next CC update!

6 Likes

Thanks for the reply, @Jan! It’s clear now.

Hi @Jan, a quick one (I hope): now that I run the cc library on Arduino Mega, and dynamic memory is not an issue (with the CC_MAX_OPTIONS_ITEMS set to 32 there’s still 5K of dynamic memory free), I keep experimenting with snapshots switching.
After I set a pair of actuators to scroll up and down through the snapshots, it works for several changes of snapshots, and then it stops, and here’s what I see in the debug screen:

---
[cc-lib]   unassignment timeout (id: 1)
[cc-lib] assignment received (id: 0)
[cc-lib]   requesting assignment to device (id: 0)
SEND: device: 1, command: assignment, data size: 80
      data: 00 00 0A 50 45 44 41 4C 42 4F 41 52 44 00 00 80 3F 00 00 00 00 00 00 40 40 00 00 00 40 24 0C 00
            00 02 00 04 4E 4F 4E 45 03 07 44 45 46 41 55 4C 54 00 00 00 00 08 31 3A 53 4F 4E 47 20 41 00 00
            80 3F 08 32 3A 53 4F 4E 47 20 42 00 00 00 40 01
      text: PEDALBOARD?@@@$NONEDEFAULT1:SONG A?2:SONG B@
---
[cc-lib]   assignment timeout (id: 0)
[cc-lib] assignment received (id: 1)
[cc-lib]   requesting assignment to device (id: 1)
SEND: device: 1, command: assignment, data size: 80
      data: 01 01 0A 50 45 44 41 4C 42 4F 41 52 44 00 00 80 3F 00 00 00 00 00 00 40 40 00 00 00 40 24 08 00
            00 02 00 04 4E 4F 4E 45 03 07 44 45 46 41 55 4C 54 00 00 00 00 08 31 3A 53 4F 4E 47 20 41 00 00
            80 3F 08 32 3A 53 4F 4E 47 20 42 00 00 00 40 00
      text: PEDALBOARD?@@@$NONEDEFAULT1:SONG A?2:SONG B@
---

The question is, these reported timeouts, [cc-lib] unassignment timeout (id: 1) and [cc-lib] assignment timeout (id: 0), are these more likely on the MOD Dwarf’s side, or on my Arduino’s side? I.e. are these the symptoms of what we were discussing above, and there’s hope this will be sorted out with one of the next firmware updates, or should I keep debugging my code?

2 Likes

You know what, I’ll just pause Arduino-based developing for now. I’ll wait for the next update on the cc library: this one is just too buggy, I’m spending too much time on it with little outcome.

2 Likes

Hello @TheRedOne ,

thank you for your time investigating.

I haven`t decided what to build with my control chain board and an unused Arduino Mega yet,

but I’m looking forward what you and @Jan come up with.

Thanks both for your time.

Greetings and God bless, Marius

4 Likes

Hey, did you know they have a miniaturised yet fully functional Mega?
I didn’t until yesterday, but I have just bought a couple of those from AliExpress to try out.

6 Likes

This looks super cool! It makes the Mega way more suitable to certain projects

2 Likes

Aha, the ‘embed’-type projects :wink:

3 Likes

Hi @Jan! Does this RC update
fix the issue with scrolling through the snapshots from an external control chain device that we were discussing earlier in this thread?

2 Likes

No, that is an 1.13 thing

7 Likes

Eagerly waiting 1.13 then ))

5 Likes