-
-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
wsjtx: unvendor hamlib #266355
wsjtx: unvendor hamlib #266355
Conversation
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.
Looks good, straightforward and tested alright.
@mattmelling Tested today, failed on split mode with FLRig
|
Sorry about merging so eagerly, figured it was good. Do you want a revert or what are next steps? |
I don't think this is a regression for WSJTX generally; currently using it in the same configuration as @dotemup with flrig split mode and it works with my rig. This PR came about while working on other issues around hamlib which I am working through. Just my 2c, if others agree that this should be reverted then I'm happy to shelve and come back to it later. |
Hmm, I wonder what would cause the issue I'm getting then? You're using the nixpkgs flrig correct @mattmelling? It's very peculiar. I could probably go up to R&L tomorrow and see if I can try on a 7300 (if that's what you're using, you had mentioned it before) to see if I get the same issue with a different rig in FLRig. FWIW this is my basic configuration.nix. Is there something different you're using?
|
I tried a number of things to try and resolve but still not quite working, even tested the rc1 and rc2 of 2.7.0 same issues when building from git source. Tried adding cmake flags like the fedora spec does for their packaging but no change. Could it be an issue with the hardening of gcc in the stdenv, I know I get a ton of warnings for a lot of the c and fortran code during the build. Reverted back to my old generation where the build came from the superbuild tarball and back to working. Strange stuff. |
I'm using wsjtx built from this PR's branch, with flrig 2.0.04 from nixpkgs trunk. I don't think it is an issue with your system configuration. It looks as if flrig isn't returning anything when asked by hamlib what mode a particular VFO is in. Either it is a bug in hamlib or the version update exposes a bug in flrig. flrig has some options to enable traces which might show what is going on when hamlib makes this particular request. I've spent most of the evening here playing with the js8call/hamlib code to figure out where the delays are coming from, which is also related to querying the rig state when operating flrig in split mode on my IC7300. This doesn't occur with hamlib rigctld, so my suspicion is that it is related to how hamlib is interacting with flrig, and likely that you are running in to something similar, the major difference being the rig. |
Alright so I did a very deep dive last night looking into the xml responses in trace and comparing to the source for hamlib 4.5.5 to see how the flrig transactions were being carried out. Something weird happening when it tries to start checking for features. Also started hacking on the hamlib_4 package to build it from source instead the tarball to see if there was anything weird going on there before trying to build wsjtx. I thought there could be an issue with rigmem xml support when building hamlib. Here's the wsjtx error returned again. Here's a dump of the flrig trace. When the transaction starts Hamlib queries rig to see if it has these rig features. I'm not sure where those are defined as the 817/818 code it doesn't have those bwA bwB calls to check bandwidth on the vfo but only a few rigs do, the 7300 doesn't seem to have them directly either. So I'm not sure how those get worked out... I think the issue in the xml trace is here: rig.get_bwA call returns a valid response with NONE, so flrig thinks we have that feature, which isn't really true.
Then tries to do the rig.set_bwA which faults so it should know we don't have that feature.
But the flrig.c for bandwidth says, oh you have get_bwA you should have get_bwB. Which we don't have it. Because of that when it calls get_bwB there's no data in the xml. It doesn't return NONE like the get_bwA does. So it tries it 4 times and then throws an error in wsjtx.
I switch from true split to fake it and things started working... But kind of frustrating and dumb because I do have split, just not any bandwidth control. |
That is very interesting, hadn't got that far in to it myself. Span up a Fedora 39 VM earlier and the issue isn't there, however one thing I noted was that distro has flrig 2.0.03 rather than 2.0.04. Might be worth posting about this to the hamlib-devel and fldigi-devel lists as it is clearly an issue in how those packages are talking to each other. |
Also I just set js8call with your hacked package for hamlib_4 support and it works the same as wsjtx so using fake it for now solves my problem. So the issue isn't with wsjtx or js8call rather within hamlib flrig.c. Super dumb, I've always used true split. |
Posted to hamlib-developers awaiting moderation approval on fldigi-devel @ lists.sourceforge.net for both. Let's see what anyone else thinks. |
Try the latest Hamlib -- I put in a patch that should fix this. |
I do have a branch to build from source updated in my repo somewhere. Can fetchgit pull latest git source I've only used tags for ref. Is there another way to just pull down the latest in the main/master branch? @mdblack98 thanks for following up on this for me :) |
I don't know what fetchgit is....
I just use plain ol' git....
git clone https://github.com/Hamlib/Hamlib.git
Mike W9MDB
On Monday, November 13, 2023 at 05:17:49 PM CST, dotemup ***@***.***> wrote:
I do have the a branch to build from source updated, can fetchgit pull latest git source I've only used tags for ref. Is there another way to just pull down the latest in the main/master branch?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: ***@***.***>
|
fetchgit can also take a git hash, see e.g. hydra_unstable. https://noogle.dev/?selected=%22builtins.fetchGit%22&term=%22fetchgit+%22 |
It's a nix specific thing, no worries :)
Thanks @Mindavi I'll try that in my hacked branch. |
Unfortunately it looks like it has similar behavior. In wsjtx it goes orange/red faster and with more delay while it's making decisions though. Same error message as before. Built from hamlib from latest source including the most recent commit via this nix hack, I've been trying variations of building from source with different flags/libs before trying this latest git fetch so its a bit wild in there with extra things: @relrod Once we get this sorted can we do something similar instead of using a tarball?
Once I had the hacked hamlib4 package from the latest I rebuilt wsjtx and launched from /result/bin Here's the trace from flrig: Error from wsjtx, the stack trace line callouts are different so it's for sure using the latest code. But essentially the same result.
|
Try again.
But if you still have problems I need to see the debug log from WSJT-X instead.
Please place this file as described belowhttps://www.dropbox.com/s/t52ngcalsgnpm8m/wsjtx_log_config.ini?dl=0
C:\Users\[username]\AppData\Local\WSJT-X The WSJT-X_Rigcontrol.log file will be in the same location Here's a youtube video showing Windows users howto -- https://www.youtube.com/watch?v=q9tAvhNmSvc
For Linux put it in ~/.config The WSJT-X_Rigcontrol.log file will be here: ~/.local/share/WSJT-X
For MacOS put it in /Users/[username]/Library/Preferences Restart WSJT-X and duplicate the problem.Shut down WSJT-X
Then send me the WSJT-X_RigControl.log fileMike W9MDB
On Monday, November 13, 2023 at 07:15:31 PM CST, dotemup ***@***.***> wrote:
Unfortunately it looks like it has similar behavior. In wsjtx it goes orange/red faster and with more delay while it's making decisions though. Same error message as before.
Built from hamlib from latest source including the most recent commit via this nix hack, I've been trying variations of building from source before trying this latest git fetch so its a bit wild in there with extra things:
{ lib
, stdenv
, fetchgit
, autoconf
, automake
, libtool
, pkg-config
, swig
, perl
, python3
, ncurses
, tcl
, libxml2
, gd
, libusb1
, readline
, boost
, perlPackages
, xmlSupport ? true
, pythonBindings ? true
, tclBindings ? true
, perlBindings ? true
}:
stdenv.mkDerivation rec {
pname = "hamlib";
version = "4.5.5";
src = fetchgit {
url = "https://github.com/${pname}/${pname}.git";
rev = "394cb4cbcf53971ac5f5e2ede0b0c488be989528";
sha256 = "sha256-ZqbhkjNfeOTW7JgaTqv+C4gJ0icmnMDHfVyl4fqXeGg=";
};
preConfigure = ''
./bootstrap
'';
nativeBuildInputs = [
autoconf
automake
libtool
pkg-config
swig
] ++ lib.optionals perlBindings [ perl ]
++ lib.optionals tclBindings [ tcl ]
++ lib.optionals perlBindings [ python3 ];
buildInputs = [
readline
ncurses
gd
libusb1
boost
] ++ lib.optionals perlBindings [ perl perlPackages.ExtUtilsMakeMaker ]
++ lib.optionals tclBindings [ tcl ]
++ lib.optionals pythonBindings [ python3 ]
++ lib.optionals xmlSupport [ libxml2 ];
configureFlags = lib.optionals perlBindings [ "--with-perl-binding" ]
++ lib.optionals tclBindings [ "--with-tcl-binding" "--with-tcl=${tcl}/lib/" ]
++ lib.optionals pythonBindings [ "--with-python-binding" ]
++ lib.optionals xmlSupport [ "--with-xml-support"];
meta = with lib; {
description = "Runtime library to control radio transceivers and receivers";
longDescription = ''
Hamlib provides a standardized programming interface that applications
can use to send the appropriate commands to a radio.
Also included in the package is a simple radio control program 'rigctl',
which lets one control a radio transceiver or receiver, either from
command line interface or in a text-oriented interactive interface.
'';
license = with licenses; [ gpl2Plus lgpl2Plus ];
homepage = "https://hamlib.sourceforge.net";
maintainers = with maintainers; [ relrod ];
platforms = with platforms; unix;
};
}
Once I had the hacked hamlib4 package from the latest I rebuilt wsjtx and launched from /result/bin
Here's the trace from flrig:
trace-xml-latest.txt
Error from wsjtx, the stack trace line callouts are different so it's for sure using the latest code. But essentially the same result.
Hamlib error: Content-length: 168
<?xml version="1.0"?>
<methodResponse><params><param>
<value><array><data><value></value><value></value></data></array></value>
</param></params></methodResponse>
xml_parse2: value returned=''
xml_parse2: xml='<methodResponse><params><param>
<value><array><data><value></value><value></value></data></array></value>
</param></params></methodResponse>
'
flrig_transaction: no value returned
6:flrig.c(604):flrig_transaction returning(8)
5:flrig.c(1760):flrig_get_mode returning(8)
4:flrig.c(2080):flrig_set_split_freq_mode returning(8)
3:rig_set_split_freq_mode: elapsed=715ms
3:rig.c(5131):rig_set_split_freq_mode returning(8)
Protocol error
Protocol error
while setting split TX frequency and mode
Timestamp: 2023-11-14T01:06:30.842Z
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
@mdblack98 Latest worked somewhat, just feels a little slow on TX. Starts maybe 2-2.5s into the 15s cycle. I'll capture a wsjtx debug shortly and follow up. Something interesting is the split frequency tries to set with an offset 1000hz like normal, but then on switch changes back to center. Then sticks to the 1000hz offset. Not sure if that's 100% working as expected. For example on 2m where I'm testing it usually shows, 144.174 / 144.175 when working in the top half of the sideband. 144.174 / 144.173 when working in the lower half of the sideband. Perhaps part of this is the 2s delay. It feels like it's trying to fake it while using split. Change the current VFO frequency as well as changing VFO. Pulled at this commit Hamlib/Hamlib@d868f1a
|
Here's the wsjtx_rigctl debug from my test Actions taken:
Here's some screenshots with the timing in above steps. Reselecting 2m before starting any TX. I also just tried a few more attempts to try and track down the issue with the split switching/setting frequency and it's inconsistent behavior. So I'm not sure exactly what's happening, sometimes it's on the right VFO but wrong frequency, sometimes it's on the wrong VFO and right frequency, sometimes both wrong... Very strange. |
The FT818 is known to be slow...how does it behave if you connect WSJT-X directly to the rig instead of FLRig? It might be a bit faster. I see a 150ms delay on several commands in FLRig for the FT818.I can see one bug in Hamlib that is causing a 540ms delay that I've fixed now.But it looks like what we need to do is have the FT818 use cached information all the time.Le
Here's the timing
PTT is requested[2023-11-14 23:41:16.777208][00:01:00.071254][RIGCTRL:trace] #: Transceiver::TransceiverState(online: yes Frequency {144174000Hz, 144175000Hz} Mode: DIG_U; SPLIT: on; PTT: on)
Get active VFO started[2023-11-14 23:41:16.777233][00:01:00.071279][RIGCTRL:debug] 2:rig.c(3193):rig_get_vfo entered
Get active VFO ended[2023-11-14 23:41:16.779085][00:01:00.073132][RIGCTRL:debug] 2:rig_get_vfo: elapsed=2ms
Set VFOB freq[2023-11-14 23:41:16.779133][00:01:00.073180][RIGCTRL:trace] rig_set_split_freq_mode freq=144175000 mode = PKTUSB
[2023-11-14 23:41:17.469664][00:01:00.763711][RIGCTRL:debug] 4:flrig_transaction: elapsed=690ms
Get VFOB mode [2023-11-14 23:41:17.469742][00:01:00.763788][RIGCTRL:debug] 4:flrig.c(1653):flrig_get_mode entered
[2023-11-14 23:41:18.124848][00:01:01.418894][RIGCTRL:debug] 5:flrig_transaction: elapsed=655ms
Set VFOB mode (should not need to do this -- it's a bug) [2023-11-14 23:41:18.125083][00:01:01.419130][RIGCTRL:trace] flrig_get_mode: mode= width='DIG'
[2023-11-14 23:41:18.667228][00:01:01.961274][RIGCTRL:debug] 5:flrig_transaction: elapsed=541ms
Set VFOA active [2023-11-14 23:41:18.667332][00:01:01.961404][RIGCTRL:trace] flrig_set_vfo: vfo=VFOA
[2023-11-14 23:41:18.946755][00:01:02.240801][RIGCTRL:debug] 6:flrig_transaction: elapsed=279ms
[2023-11-14 23:41:18.951298][00:01:02.245344][RIGCTRL:debug] 2:rig_set_split_freq_mode: elapsed=2172ms
Now we get to PTT which is done quickly....[2023-11-14 23:41:18.951491][00:01:02.245537][RIGCTRL:debug] flrig_set_ptt: fast_set_ptt=0[2023-11-14 23:41:18.958349][00:01:02.252395][RIGCTRL:debug] 2:rig_set_ptt: elapsed=7ms
Message ID: ***@***.***>
|
@mdblack98 Thanks, I'll try the latest here in a few hours at lunch and i'll try directly in wsjtx too. Will that bug fix correct the offset frequency issue described? Will post results here as soon as I can. |
I set the rig in wsjtx from yesterday's build to ft818 instead of flrig works okay but still has some odd behavior when setting the offset frequency, looks like it cycles twice before setting the correct frequency offset. Doesn't seem to be changing vfo, just swapping the frequency but much harder to tell without FLRIG. I rebuilt hamlib to the latest commit, then rebuilt wsjtx using the latest lib, failed to open wsjtx at first but then got in and switched to FLRIG. That also seems to work okay now less delay than before which is acceptable and similar to that when I set the rig directly in wsjtx. TX frequency also seems to be getting set correctly as well. However now it's not split, VFO doesn't change, just the frequency changing on VFO_A. Here's the wsjtx debug from FLRIG Then tried to revert to setting the rig in WSJTX to FT818 when built from the latest hamlib commits and I now get seg faults. FLRIG works, Direct Rig doesn't. Not sure what's happening there. |
@mdblack98 any chance of a minor version to hamlib so we can target in our package? Fetching master isn't really ideal for packaging. I know you're busy and lots of activity in hamlib just not sure how far our 4.6 is or if there's a chance we could get a 4.5.6 out first? Thanks! |
Is the current version of Hamlib working OK on both FLRig and direct connect? |
Yes current release working as expected. Had to re-evaluate proper split as it was working improperly for so long by switching A/B previously instead of just using B frequency when split is enabled properly. Haven't had any issues since the weird segfault issues on one of the builds when switching between direct and with flrig. All tested and working in latest for FT818 for direct and with flrig. |
4.6 will be published this month.
On Monday, December 4, 2023 at 09:41:47 PM CST, dotemup ***@***.***> wrote:
@mdblack98 any chance of a minor version to hamlib so we can target in our package? Fetching master isn't really ideal for packaging. I know you're busy and lots of activity in hamlib just not sure how far our 4.6 is or if there's a chance we could get a 4.5.6 out first?
Thanks!
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Description of changes
Switch to building from upstream repo rather than "super" tarball containing a hamlib distribution.
During investigation of #265747, #265897, learned from wstjx-devel mailing list that there is no longer a need to build wsjtx using the vendored hamlib, and a number of other distributions are building against their native hamlib packages. This change simplifies the build for wsjtx.
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)