Paeryn wrote: ↑Mon Feb 04, 2019 12:55 pm
That's probably more down to the timer resolution than anything.
If you start at dead on a second (e.g. 0.0s) then your loop will run for ~10 seconds. If however you start part way through a second (e.g. 0.9s) then your loop will only run for ~9.1s and at ~100 lines per second that accounts for ~90 lines difference.
Thank you, I realized that once I'd thought about it. The timer was really just for a ballpark number and to have an exit in case the scrolling window obscured the terminal emulator window or it lost focus so ctrl-c wouldn't work. If I did something like
while (time(NULL) < stop_t)
for my inner loop the timing would be better but I'm not sure how much overhead there is. Doing it thousands of times could be expensive. I do tht (972 here) memcpys before I even check the time.
Is there any non-X widget set I can use? I didn't intend it to be that way but I sort of like the fact that it runs without X, just from a command line. I'd like some labels to display frequencies, gains,etc. And buttons, spinners, edit boxes for inputting numbers. I could probably cobble something up, but I'd probably rather not re-invent the wheel. I was doing scrolling to test feasibility of doing the waterfall in an SDR app this way, looks OK.
Hmm, maybe
https://github.com/littlevgl/
With the official 7 inch touch screen even:
http://www.vk3erw.com/index.php/16-soft ... -littlevgl
Way too complicated, it's like GTK without X. Big learning curve, much baggage.
Actually there seems to have been a GTK 2 for framebuffers
https://ha.redhat.com/f/pdf/gtkfb.pdf Runs without X I guess.
It seems to have been a reality, at least for GTK 2. It probably had to be enabled when you built the GTK. Yes, configured with --with-gdktarget=linux-fb by
http://maemo.org/api_refs/4.0/gtk/gtk-framebuffer.html That's probably not the standard way to build it.
I also have (installed from the debs):
X11 Direct Graphics Access extension wire protocol
This package provides development headers describing the wire protocol
for the XFree86-DGA extension, which provides direct, framebuffer-like,
graphics access.
Not sure if that's the same as DRI or not, could have been renamed, probably deprecated by now. Package name is x11proto-xf86dga-dev.
Apropos dga gets me:
Code: Select all
XDGA (3) - Client library for the XFree86-DGA extension.
XDGAChangePixmapMode (3) - Client library for the XFree86-DGA extension.
XDGACloseFramebuffer (3) - Client library for the XFree86-DGA extension.
XDGACopyArea (3) - Client library for the XFree86-DGA extension.
XDGACopyTransparentArea (3) - Client library for the XFree86-DGA extension.
XDGACreateColormap (3) - Client library for the XFree86-DGA extension.
XDGAFillRectangle (3) - Client library for the XFree86-DGA extension.
XDGAGetViewportStatus (3) - Client library for the XFree86-DGA extension.
XDGAInstallColormap (3) - Client library for the XFree86-DGA extension.
XDGAKeyEventToXKeyEvent (3) - Client library for the XFree86-DGA extension.
XDGAOpenFramebuffer (3) - Client library for the XFree86-DGA extension.
XDGAQueryExtension (3) - Client library for the XFree86-DGA extension.
XDGAQueryModes (3) - Client library for the XFree86-DGA extension.
XDGAQueryVersion (3) - Client library for the XFree86-DGA extension.
XDGASelectInput (3) - Client library for the XFree86-DGA extension.
XDGASetClientVersion (3) - Client library for the XFree86-DGA extension.
XDGASetMode (3) - Client library for the XFree86-DGA extension.
XDGASetViewport (3) - Client library for the XFree86-DGA extension.
XDGASync (3) - Client library for the XFree86-DGA extension.
XF86DGA (3) - Client library for the XFree86-DGA extension.
XFree86-DGA (3) - Client library for the XFree86-DGA extension.
And, sure enough "THIS IS THE OLD DGA API AND IS OBSOLETE. PLEASE DO NOT USE IT ANYMORE" in /usr/include/X11/extensions/xf86dga1.h
Online DGA man page
https://linux.die.net/man/3/xfree86-dga which says
Most of the reasons for the XFree86-DGA extension's existence are now better served in other ways. Further development of this extension is not expected, and it may be deprecated in a future release. The features that continue to be useful will either be provided through other existing mechanisms, or through an extension that address those needs more specifically.
But no idea what the replacement was. Maybe it was DRI.
I have a working framebuffer, I just want a few widgets in it. Do I have to reinvent the wheel?