drowe67 / freedv-gui

GUI Application for FreeDV – open source digital voice for HF radio
https://freedv.org/
GNU Lesser General Public License v2.1
206 stars 52 forks source link

horus_open and horus_rx require additional arguments #57

Closed digver closed 4 years ago

digver commented 4 years ago

horus_open and horus_rx in codec2 were recently modified to require additional arguments. This causes compile to fail for both git and the released tar.gz source file.

/home/digger/src/freedv-gui-1.4/src/fdmdv2_main.cpp: In member function ‘virtual void MainFrame::OnTogBtnOnOff(wxCommandEvent&)’: /home/digger/src/freedv-gui-1.4/src/fdmdv2_main.cpp:2684:51: error: too few arguments to function ‘horus* horus_open(int, int)’ 2684 | g_horus = horus_open(HORUS_MODE_BINARY); | ^ In file included from /home/digger/src/freedv-gui-1.4/src/fdmdv2_main.h:72, from /home/digger/src/freedv-gui-1.4/src/fdmdv2_main.cpp:23: /home/digger/src/freedv-gui-1.4/codec2/src/horus_api.h:44:15: note: declared here 44 | struct horus *horus_open (int mode, int Rs); | ^~~~~~~~~~ /home/digger/src/freedv-gui-1.4/src/fdmdv2_main.cpp: In function ‘void per_frame_rx_processing(FIFO*, FIFO*)’: /home/digger/src/freedv-gui-1.4/src/fdmdv2_main.cpp:4139:55: error: too few arguments to function ‘int horus_rx(horus*, char*, short int*, int)’ 4139 | if (horus_rx(g_horus, ascii_out, input_buf)) { | ^ In file included from /home/digger/src/freedv-gui-1.4/src/fdmdv2_main.h:72, from /home/digger/src/freedv-gui-1.4/src/fdmdv2_main.cpp:23: /home/digger/src/freedv-gui-1.4/codec2/src/horus_api.h:53:15: note: declared here 53 | int horus_rx (struct horus *hstates, char ascii_out[], short demod_in[], int quadrature); | ^~~~~~~~

drowe67 commented 4 years ago

@digver thanks. Looking at the latest freedv-gui source, I think the call to horus_rx is up to date, by we need an extra argument in horus_open() .

@darksidelemm could you pls raise a PR for that change and perhaps check the Horus functionality in freedv-gui still works? We have made a lot of changes in that area recently.

darksidelemm commented 4 years ago

Hmm, while the modem has changed, I thought the horus calls were all in alignment already (I remember submitting PRs for this a few months ago).

If he's using the v1.4 release tar.gz, then the above errors are expected, as the release tarball pre-dates those changes.

@digver can you try and compile from the latest git versions of both freedv-gui and codec2?

digver commented 4 years ago

I get the same error with both the tarballs and git. To be sure I just tried with a fresh clone of freedv-gui and still get the same error. I did not try to compile codec2 on its own.

As @darksidelemm said this type of problem always be an issue with the tarballs since the freedv-gui is static and build_linux.sh draws on the moving targets of codec2 and LPCet. Perhaps the tarball should rely on static versions rather than git.

As far as git goes, you can see that in fdmdv2_main.cpp the additional arguments are missing:

line 2691: g_horus = horus_open(HORUS_MODE_BINARY); line 4151 if (horus_rx(g_horus, ascii_out, input_buf, 0)) {

digver commented 4 years ago

My mistake, horus_rx does not seem to be an issue in git -- but is in the tarball

drowe67 commented 4 years ago

@darksidelemm I think in codec2 4d63d040b (27 March) you added:

-struct horus *horus_open  (int mode, int Rs);
+struct horus *horus_open  (int mode);

But the complex option to horus_rx() was added earlier, and yes I think you have patched freedv-gui for that.

drowe67 commented 4 years ago

@digver @darksidelemm I've made Horus support conditional on a #define so we can get freedv-gui building again https://github.com/drowe67/freedv-gui/pull/58

digver commented 4 years ago

Great! That works for me, the compile completed!