¿ªÔÆÌåÓý

Re: zbitx, compiler optimizations #zbitx


 

¿ªÔÆÌåÓý


On May 16, 2025, at 02:46, Jody - K3JZD via groups.io <k3jzd.jody@...> wrote:

Check my thread about a zBITX Memory Leak.? ?I concluded that the i2cbb.c program in sBitx version 3.052 being used in the xBITX was being swamped with send requests, resulting in a huge number of bus contentions, disconnects, and reconnects.? Odds that has contributed to the large time spent in what has been identified here as 'ic2_delay'.? ? I also identified the root cause of the huge number of send requests that are swamping the ic2 bus handling functions.? ?
?
I also think that the RasPi Zero used in the zBITX has enough horsepower to do the job.? Back when I was doing sales support for custom computerized control systems, and potential customer had spec'ed that they wanted the CPU usage to be 75% maximum, I always asked what they will do with the other 25%.? Sure, we could limit it to that, but why slow down the system for an artificial constraint.

OK, I guess I should read that thread.

I think the i2c communication must be excessive in general. ?It makes audible noise (everybody¡¯s complaining about ¡°chugging"), but I¡¯ve also found that when I have a USB ethernet adapter attached, communication there makes noise too. ?(Of course, the electrical design could be better, but I don¡¯t yet know how to pinpoint why that is happening.). (To me it sometimes sounds like hard drive seeking noises. ?;-) ?One obvious solution to do less communication is using notifications/signals: each field should notify when it has changed (only when the stored value really changed), and that should trigger the updates: those that go to the GTK UI, i2c UI update commands, and/or some network protocols. ?In Qt one uses signals: ?


But I think gtk/glib has something like that too. ?? leads to?? : yep that looks like what we need.

For 9p I just tried an explicit callback first (and I¡¯m not calling it from enough places yet):

void notify_field_changed(const char *field_id, const char *old, const char *newval);

The implementation of this function could take care of notifying the various UIs and network protocols. ?But probably it should rather emit a signal: each ¡°client¡± should subscribe for notifications. ??is something that just about everybody has to do at some point...


Sbitx/zbitx is doing too much polling and timer-based refresh instead, and that is creating a lot of inefficiency. ?Especially with the excessive string comparison and conversion going on.

The network protocol is important to me because I want to decouple the GUI from the radio daemon anyway. ?This daemon will eventually need to avoid using gtk/gdk at all: pure C for the core functionality. ?(Why does zbitx have to run X11 and a GTK UI under the condition that nobody is looking at it? ?Sometimes HDMI is connected, sometimes not. ?We only have 512MB, and startup time is noticeable too.) ?9p is gonna be great for that, eventually, probably. ?I have a working client on Plan 9 now, just rather buggy and incomplete compared to the GTK one. ?I just got a waterfall added to it, without taking much bandwidth (because I only send the latest line of samples at a time; too bad it¡¯s only about 440 actual pixels, despite the memory allocated to hold 1024 * history size). And later I will do a Qt client with the same protocol, for all the other platforms. ?That one can have fancier features.

sbitx-plan9.png

Join [email protected] to automatically receive all group messages.