-
Couldn't load subscription status.
- Fork 32
Review of fldigixmlrpc code #467
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
after a toggle we shall start from a fresh state no extra method is needed as this is done implicitly in changepars refreshbp can be dropped, it's done later in the code
in order to see the current setting
it is used there locally for error reporting
in order to reduce complexity also check DECREFs
to reduce indentation
used for internal error reporting anyway, no need to pass it by the caller
and use xmlrpc_res_free() to free result
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I stepped through the commits one by one. All are comprehensible. Should be ready as base for further work.
The problem is that the xmlrpc_client_call_server_params() or other function using the "global" client mode return a non-initialized result pointer (a local variable containing garbage) in case of some error situations. This makes impossible to decide whether the result should be free'd or not. The xmlrpc documentation contains no hint on this. The "private" functions on the other can use a pointer passed by the caller, so in this case if the initial NULL is untouched then it hasn't been allocated yet, hence no free'ing is needed.
|
Documentation references: |
|
Now curing my main issue: Fldigi gets blocked when used with TLF. The reason is that in Here is short script to trigger the situation: it sends 300 set_mode requests in about 9 seconds. My setup (Fldigi 4.2.06 + rigctld + rig at 9600 Bd) takes roughly 30 seconds to recover from this flooding. And TLF sends such requests continuously... As I'm not sure if this mode/freq setting is actually required (@airween, any idea?), so the workaround is to request the current values and call the setter function only if really needed. Thus at the expense of 2 getter calls we can avoid the unnecessary and trouble making setters. Will limit the rate of calling Fldigi from the current 50 times per sec (20 ms) to 10 times per sec, as this should be also roughly enough. RTTY at 45 Bd can send less than 10 char/s and for faster modes the practical limit is anyway on the human side. |
|
Uhm, I'm really sorry, I completely missed this issue (and from mentioned one). Let me review both soon and reflect all. |
That's very weird. I don't think I had any reason to make this. My RIG uses 4800 baud and the response time for a RIG command is about 200-300 ms. When Tlf uses that it asks the current VFO and the current FREQ, that's two requests. As I remember in background process we use a 500ms sleep, and as I remember I tried to use the same mechanism. But it was years ago...
Honestly, I don't remember why did I think that mode and freq set was necessary - but may be I found some extra scenario which justified it. Probably we should try your suggestion. |
|
Background process sleeps for 10 ms between iterations and now only each 10th runs checks fldigi status. Let's see if this is enough. |
|
CQ-WW-RTTY is happening right now, there are many RTTY stations in the air. I tried to set up my RIG with Fldigi, and I have to tell you that's completely unusable. As @df7cb explained here, Fldigi's (or the XML-RPC lib) response format depends on used locale. I had to set up the locales for Fldigi, then Tlf could work with that - for a while. After a very few minutes Fldigi completely frozen: I was not able to communicate with it, even the waterfall stopped. I assume the problem was the flood of requests from Tlf (I used Zoli's repository: So we definitely need to review - I try to help you guys with this. |
|
I'll try RTTY (AFSK) tomorrow with my repo and report back. |
|
I would think that polling at a rate faster than once per second is excessive. Maybe I'm missing something. |
|
I was not able to transmit signal, just tried to receive. |
|
Fldigi was running for an hour when I took the screenshot. |
- optimize fldigi polling - reuse valid_call_char() from callinput.c
- it now allows slash (/) also; this can be fixed later if it makes problems
|
Optimized getting call/exchange data from Fldigi. Also tried to move UI code out of these functions as they are called from the background process. |
It has to be much more often so there is no delay after clicking on a call in fldigi before it appears in tlf. |
|
Just tested it and the delay between clicking on Fldigi and the callsign appearing in TLF is minimal. |
|
That's it for the moment. Will address the freq control strory in a follow-up PR: the whole fldigi_xmlrpc_get_carrier() function can be probably dropped. |


A review/rework of Fldigi interworking. It started as I couldn't get the idea behind
connerrandconnerrcntleading to reconnection, at least this is stated in the comment (maybe @airween knows it). Then a number of issues popped up, I'm working through them slowly. Hopefully will get some of the issues from #463 fixed.