Oh Christ...

I'm going about this all the way wrong. I was focussing on matching the
numbers inside the LUA scripts, patching the code to be indifferent to
the sign change, but the whole point of this jive_jiffies() thing is for
all independent components to have their time values synchronized. And
so even if I can get the LUA part to continue running with negative
values for time this is bound to result in the unwanted behaviour that
led to the introduction of jive_jiffies() in the first place.

So let's break this down. As I see it there are two separate issues that
require addressing:

  
- *sign change*
  There is a difficult way and a simple way to address this. The problem
  with the simple way is that this requires the jive executable to be
  recompiled and therefore this is not a simple patch. The difficult and
  user patchable way is to handle the sign change inside the LUA scripts
  and the most straight forward method in this case will likely be to
  change all references to `getTicks()` to a new function
  `getCorrectedTicks()` that adds 4,294,967,296 when `getTicks()`
  returns a negative number.
- *max integer value overrun*
  Be noted that it will be rather pointless to even start addressing
  this issue without having considered #1 first. As has been stipulated
  earlier the LUA number format is different from what `jive_jiffies()`
  returns. More specifically, `lua_number` has a much higher maximum
  value than the  `uint32_t`that is used internally inside the jive
  executable *AND* the ALSA backend. At this point I'm unsure what would
  be the best or even simplest way to address this as both methods imply
  a fairly big change to the code base. Implementing some MAX_VAL
  routine inside the LUA scripts to handle loop issues is one method,
  the other one would involve changing the value type to be compatible
  all over the board (i.e. a double) which appears to have the highest
  chance of not running into other issues, be it somewhat dubious to
  store an integer value in a floating point type.


------------------------------------------------------------------------
gordonb3's Profile: http://forums.slimdevices.com/member.php?userid=71050
View this thread: http://forums.slimdevices.com/showthread.php?t=111650

_______________________________________________
Radio mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/radio

Reply via email to