gordonb3 wrote: > > 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 > All this has been discussed before and there -is- an easy solution. As @mrw pointed out, it's called -modular arithmetic-, which is default in C.
Please don't be angry with me, but for me, it seems that you still don't really understand why `if (a < b)` is not the same as `if ( (a-b) < 0 )` in C language, although being "mathematically" identical and why it is thus crucial to only work with value _differences_ instead of directly comparing timer values. See e.g. here https://image.slideserve.com/347022/graphische-darstellung-2er-komplement-l.jpg for an explanation. The value range of signed integer numbers in C is *circular*. That's the whole trick and that makes it all easy. And as @ralphy pointed out, he -is- able to rebuild the Jive executable, or did I get this wrong? There is a community build of Radio firmware and @ralphy is even building PiCorePlayer from scratch, as far I know. So we -can- change that bit of code and fixing the C-part of the code is pretty simple. gordonb3 wrote: > max integer value overrun Yes, the Lua part is much harder to fix, because Lua's number type has a completely different value range than the jiffy_timer, but also this has been discussed before and it seems that the best and cleanest solution so far would be to encapsulate the original datatype of the jiffy timer (int32_t) in a Lua -userdata- type and simply use the same modular arithmetic inside it's C implementation. Of course, it is a little bit of work to build that userdata type, but fixing the Lua code should then be easily done in less than an hours, since it seems to only be 2 Lua source files (Framework.lua and Timer.lua) in total that need to be looked through. 1x Squeezebox Classic, 3x Radio, 1x Touch, LMS 7.9.1 running on ODROID-U3, Ubuntu 16.04 and I'm happy with it! :) ------------------------------------------------------------------------ Steevee28's Profile: http://forums.slimdevices.com/member.php?userid=36395 View this thread: http://forums.slimdevices.com/showthread.php?t=111650 _______________________________________________ Radio mailing list [email protected] http://lists.slimdevices.com/mailman/listinfo/radio
