device id lost if the set crashes?

    Feb 28 2013 | 1:25 pm
    Im working on a device that requires it to record its own device id and save this into pattr. This works fine when the set is saved, but if the set crashes, upon reloading the crashed set, the device ids change.
    I also notice as the device ids are created they normally go up in increments e.g. 98,99,100,101 etc. However, mine seem to be going up by up to 200 or more each e.g. 192, 392, 592 etc.
    When the set crashes and is reloaded the 192,392,592, will end up being 98,99,100 etc
    I would be really grateful to know why this might happen if anyone has seen this behaviour before?
    The following code displays my problem:

    • Feb 28 2013 | 1:58 pm
      no worries, i think i found the culprit, im using mu for lemur in my set and it seems to be creating a bucketload of device ids :(
    • Feb 28 2013 | 3:03 pm
      I'm glad you worked this out, but in general, you should either be using the persistent ID feature, or referencing LOM objects by path. The order of ID assignment when a Live set loads is indeterminate and IDs are considered volatile unless you are using the persistent ID feature.
    • Feb 28 2013 | 3:28 pm
      thanks jeremy its seems correct, if i load the above device in a crashed set, the ids change.
      Is there any chance you could explain how to use the persistent ID feature? There seems little information on the forums about this.
      Do i have to find the path first and then query live.object to find the persistent id?
    • Feb 28 2013 | 3:37 pm
      Nope, you just need to flip the "Use Persistent Mapping" switch. In fact, we flip it by default for you.
      Here's the info from the refpage:
      Persistence The live.object object has a special entry in its inspector labelled "Use Persistent Mapping". This setting, when enabled, causes the id associated with the object to persist when the Live document is saved and restored, and when the Max Device is moved between the Live application and the Max editor, or within the Live Set. Beginning in Live 8.2.2, Live API ids remain persistent between launches of Live, which in conjunction with the Persistence feature of live.object , and live.remote~ , makes it possible to create simpler devices which retain their association with elements in the Live user interface.
    • Feb 28 2013 | 4:59 pm
      I think there might be a small bug in the persistent id feature, when live crashes, it gives the first device in the set a new id, all the other ids seem to be correct.
      Here is the code I used to determine this.
    • Feb 28 2013 | 9:30 pm
      Thanks, we've ticketed this for further investigation.