Skip to content
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

Install fails on Raspberry Pi 4 #82

Open
srs4511351 opened this issue Nov 6, 2020 · 93 comments
Open

Install fails on Raspberry Pi 4 #82

srs4511351 opened this issue Nov 6, 2020 · 93 comments

Comments

@srs4511351
Copy link

I have an SDRplay RSP1A.
After trying to satisfy all of the prerequisites and following the installation in README.md, the installation fails with errors.
Here is the last bit of installation messages:

In file included from ../src/mumbleclient.h:34,
from ../src/mumbleclient.cpp:17:
../src/sslclient.h:48:5: error: 'QSslCipher' does not name a type; did you mean 'QSslKey'?
QSslCipher getCipher();
^~~~~~~~~~
QSslKey
../src/sslclient.h:65:5: error: 'QSslSocket' does not name a type; did you mean 'QUdpSocket'?
QSslSocket *_socket;
^~~~~~~~~~
QUdpSocket
make: *** [Makefile:7622: mumbleclient.o] Error 1
make: *** Waiting for unfinished jobs....
In file included from ../src/mumbleclient.h:34,
from ../mainwindow.h:38,
from ../mainwindow.cpp:17:
../src/sslclient.h:48:5: error: 'QSslCipher' does not name a type; did you mean 'QSlider'?
QSslCipher getCipher();
^~~~~~~~~~
QSlider
../src/sslclient.h:65:5: error: 'QSslSocket' does not name a type; did you mean 'QUdpSocket'?
QSslSocket *_socket;
^~~~~~~~~~
QUdpSocket
In file included from ../src/mumbleclient.h:34,
from ../mainwindow.h:38,
from ../main.cpp:27:
../src/sslclient.h:48:5: error: 'QSslCipher' does not name a type; did you mean 'QSlider'?
QSslCipher getCipher();
^~~~~~~~~~
QSlider
../src/sslclient.h:65:5: error: 'QSslSocket' does not name a type; did you mean 'QUdpSocket'?
QSslSocket *_socket;
^~~~~~~~~~
QUdpSocket
make: *** [Makefile:7079: mainwindow.o] Error 1
make: *** [Makefile:6590: main.o] Error 1

Do I need to include any other information?

----Steve

@kantooon
Copy link
Collaborator

kantooon commented Nov 6, 2020

Can you please check which Qt version you have installed? At least Qt 5.7 is necessary, preferably Qt >= 5.14
Also, I was not aware that SDRplay is supported by gr-osmosdr. Are you using a fork or the official version? If it's indeed supported, I'd like to add this information to the README.

@srs4511351
Copy link
Author

srs4511351 commented Nov 6, 2020 via email

@kantooon
Copy link
Collaborator

kantooon commented Nov 6, 2020

Ok, let me check, I think the TLS v1.3 version define in the code is not correct, I'll adjust that so the build can pass with 5.11 as well. But the fact that it says it's missing QSslSocket is not normal. That's been a part of Qt since at least version 4, specifically the libqt5network5 library and corresponding headers. I can suspect that the Qt5 dev package (the headers required to build it) are missing some components. The dev package should be the same version as the version it is trying to link into.
Can you please check this include file exists and is readable:
/usr/include/x86_64-linux-gnu/qt5/QtNetwork/qsslsocket.h
The location may vary depending on your install, so on the Raspberry it will definitely not be x86_64-linux-gnu

@kantooon
Copy link
Collaborator

kantooon commented Nov 6, 2020

Regarding the SDRplay. If you are normally using it through SoapySDR, that's going to work, you just need the relevant Soapy plugin. If you don't, then you'll probably need a fork like the one you mentioned. As a general rule, if the device is usable in Gqrx, it will also be usable here since it uses the exact same gr-osmosdr API.

@srs4511351
Copy link
Author

srs4511351 commented Nov 6, 2020 via email

@kantooon
Copy link
Collaborator

kantooon commented Nov 6, 2020

I'm afraid the only easy way is to have a distribution provided package, because the Raspberry Pi OS is not exactly similar to Debian although it's derived from it. I can't provide even Debian packages currently, because Travis CI which was used for this purposes does not support open source projects anymore.
I know what sort of issues you are going through, I had the same problems with raspbian in the past and eventually just ended up using Debian on it.

Re. SoapySDR support, in the official gr-osmosdr version this is built in so you don't have to do anything about it. But there are numerous unofficial forks floating around and I don't know about any of those.

@srs4511351
Copy link
Author

srs4511351 commented Nov 6, 2020 via email

@srs4511351
Copy link
Author

srs4511351 commented Nov 7, 2020 via email

@kantooon
Copy link
Collaborator

kantooon commented Nov 7, 2020

Ok, glad you could make it work. The only way to check version right now is to know either the version of the deb package installed or the git tag / commit hash from which it was built. When I have some time, I will try to add a command line parameter to retrieve the version at runtime.

Most documentation, as far as I have been able to document it, is located in the docs/README.md file inside the repository.
Your audio "freezes" are most likely the squelch coming in and out, you can adjust it manually and there is also an Autosquelch button which will adjust it to squelch above the current level, so don't press it while you want to listen to something.
SSB, AM, and FM filters are adjustable by dragging on the margins of the filter box on the screen. You can also zoom in on the signal by hovering on the bar where frequency numbers are displayed and using the mouse scroll wheel or dragging left and right. Same for the vertical bar with signal levels on the left.
Be aware that qradiolink is a voice communications transceiver, so it is not really optimized as a receiver for best sound. If you need best sound quality, Gqrx will be a lot better. The audio sample rate is only 8000 Hz so it will cut out frequencies outside the human voice spectrum.

The constellation display is onyl needed for digital signals, BPSK, DQPSK, 2FSK and 4FSK (except FreeDV which has different internals). It will also be useful for the video signal or the IP modem signal. The video transmission in your older version has no sound. That is implemented on the next branch (development branch) but not part of any release yet. To transmit a text message, just press "Send text" or "Text file beacon" which will broadcast a text file on repeat. To stop text transmission, press "PTT" twice.
The tooltips will hopefully guide you from here. This being a hobby to me, I don't always have time to properly document things.

@srs4511351
Copy link
Author

srs4511351 commented Nov 8, 2020 via email

@kantooon
Copy link
Collaborator

kantooon commented Nov 8, 2020

This is great feedback, much appreciate your taking the time to describe the issues. One issue at a time:

  1. For soapy devices, what seems to help sometime when a device is not found correctly, is to put in more parameters that SoapySDRUtil --find gives in the string, without spaces. For example:
    Found device 1
    addr = 24607:1027
    driver = lime
    label = LimeNET-Micro [USB 2.0] 583A25BFD101
    media = USB 2.0
    module = FT601
    name = LimeNET-Micro
    serial = 00583A25BFD101
    The device string could be soapy=1,driver=lime,addr=24607:1027,serial=00583A25BFD101
    To make matters a little worse, this also depends on which gr-osmosdr is used. I have version 0.2.0 here and it behaves in a different way to version 0.1.9.

  2. The freezes, I now remember a similar issue seen some time ago with an early pre-production Lime board. The freeze is definitely caused by one of my mutexes, but the root cause in that case was an issue in the Soapy Lime plugin, which got fixed later so I didn't bother looking at that code again. But now based on your description I think I may have to actually change something in the code as a workaround.

  3. The AGC in GNU radio is a source of headaches, there are actually three different blocks which behave in their own way, I will try to reproduce the issues and change the parameters to the blocks.

  4. I don't really ever use AM, not having a shortwave antenna, but the filter rolloff for low frequencies may indeed be too high. That can easily be corrected. Probably the same for the SSB low frequency cutoff, although SSB is different because it uses a complex taps filter for transmitting which is tightly coupled to the receiver filter adjustment. There is potential for improvement there, but needs changes to the UI code as well.

  5. FreeDV has a fixed width filter for the digital signal implemented on FreeDV side, so changing the filter width on GNU radio's side will have no effect, unless you mean for close adjacent SSB signals (they will only pass through if FreeDV is not synced in digital mode RX, if FreeDV is synchronized there will be no analog pass-through.

@kantooon
Copy link
Collaborator

kantooon commented Nov 8, 2020

One other comment. Looking at your logs above I noticed this:
[7/Nov/2020 00:41:50] [Info] Using audio input device default
[7/Nov/2020 00:41:50] [Info] Using audio output device default

If the system has Pulseaudio (default in most distros), don't use the default sink and source. Instead, for better sound quality use the Pulseaudio sinks and sources, which should be located right at the end of the audio devices listing. You can recognise them easily because the names are long and specific:
pa_sinks
Of course, this advice does not apply for an Alsa only system.

@srs4511351
Copy link
Author

srs4511351 commented Nov 8, 2020 via email

@kantooon
Copy link
Collaborator

kantooon commented Nov 8, 2020

Just to clarify, the AM mode is meant for amateur radio not for receiving broadcast radio. So it is optimized for human voice spectrum. And the WideFM receiver is mono only, not stereo.
Have you used FreeDV before with an SSB transceiver? I think what you are describing as noise is just random spurious decodes, they are quite normal.

@srs4511351
Copy link
Author

srs4511351 commented Nov 8, 2020 via email

@kantooon
Copy link
Collaborator

kantooon commented Nov 8, 2020

A recording would be good. I'm intrigued about what you're describing. FreeDV is a digital mode, and you need to be listening to a ham transmitting it to be able to decode. Is that what you are trying to do? Listening to any analog signals with it would be useless, it's not what it's meant for. It's fairly sensitive to accurate tuning due to the OFDM waveform, but otherwise very usable.

@srs4511351
Copy link
Author

srs4511351 commented Nov 8, 2020 via email

@srs4511351
Copy link
Author

srs4511351 commented Nov 9, 2020 via email

@kantooon
Copy link
Collaborator

kantooon commented Nov 9, 2020

  1. Yes it helps if you have amateur radio knowledge.
  2. Yes you can do remote operation via Internet
  3. The same as the other modes, just select the appropriate modulation and transmit or receive. FreeDV here is standalone, does not require anything other than a SDR device.
  4. They are not called digital filters. They are called digital operating modes, the filters are just a DSP component in a larger chain. And yes, obviously over the air. To use high power you need to have an amateur radio license, these are generally issued by the state regulatory agency following an exam. Contact some local hams in your country and they will help walk you through the procedure to get licensed, it is not very complicated, you just need to fulfill some legal requirements.
  5. To learn more about digital signal processing, head over to the https://www.gnuradio.org website or start looking at some amateur radio resources online, there is a lot to learn but there are a lot more interesting things to do as an amateur radio opeator than just shortwave: microwave communications, sattelite operations, repeater operations etc.

@srs4511351
Copy link
Author

srs4511351 commented Nov 10, 2020 via email

@srs4511351
Copy link
Author

srs4511351 commented Nov 10, 2020 via email

@kantooon
Copy link
Collaborator

If you're an amateur radio operator, great, it means you can use it to the full extent.
Note about FreeDV 700D: the current implementation of this mode has an issue with having more than one instance of mod/demod loaded - when trying to stop the receiver or transceiver by using the relevant button, the program will segfault in libcodec2. Other FreeDV modes are not affected. I've been meaning to contact David Rowe, the author of FreeDV, about this issue, but I've been a little busy with other things lately. I actually added 700D at some point, but removed it later due to the instability it caused. I want to add it back too, but I'm not sure how hard will this issue be to resolve on their side.
The other digital modes are for voice and text mainly for experimentation with different DSP techniques. The prefix denotes the modulation type, and the number suffix (1K, 2K, 10K etc.) denotes the effective bit rate. There are 3 codecs used for digital voice (outside of FreeDV of course): Codec2 700C, Codec2 1400, and Opus 9400 bits per second.

Now, about your first error, the define in the code should check the version and not enable TLS v1.3 unless using Qt 5.14. I can only assume that the version check fails for some reasons on your system (multiple mixed Qt versions and the wrong one is found? I don't really know).
The second error seems easier. Yes, I think it is trying to link into GNU radio version 3.7 instead of 3.8. These things tend to happen when you mix library versions, the good news is that it is usually fixed quite easy, by having the appropriate PATH and LD_LIBRARY_PATH variables set.
You also need to ensure that the Qt / GNU radio headers (they are usually in a package suffixed with -dev) are consistent. It can happen that qmake uses one version of Qt for headers and another for ld to link into.
Of course, it also depends on you install locations, but usually (this is what I do) the source build is configured to be installed in /usr/local/lib and LD_LIBRARY_PATH has /usr/local before /usr/lib. I also assume that you tried to run manually ldconfig already. My advice would generally be aimed at Debian, since this is what I use everywhere, but I hope the Raspberry Pi OS does not stray to far from normal defaults.

And here is another curious thing: if you built 0.8.5-rc3 successfully, there is no dependency or version difference to the latest code from next apart from some gstreamer plugins used for video mode transmission. So you just need to ensure some consistency when switching builds and it should work just as well. 0.8.5-rc3 requires GR 3.8 as well. I have to prepare for work now, but if you do some research into having multiple library versions installed in different locations, I'm sure you can pull this off. I do this all the time, despite the general advice not to do it.

@srs4511351
Copy link
Author

srs4511351 commented Nov 11, 2020 via email

@kantooon
Copy link
Collaborator

I've been pretty busy at work these days, but it looks like you made good progress with the install, except for the Soapy Remote thing.

I've made some changes to the code based on your feedback: enabled AGC for AM mode in addition to SSB, widened AM audio filter and changed it from bandpass to low_pass for better low frequency respose. These changes will be present in the next release along with other new features.

If you manage to get a fully working installation on Raspberry Pi OS, it would be great if you wrote a short installation guide, this has been a pain point for many users who choose to use this OS.

@srs4511351
Copy link
Author

srs4511351 commented Nov 14, 2020 via email

@kantooon
Copy link
Collaborator

For the Qt Network errors, the hint is in this message:
qt.network.ssl: Incompatible version of OpenSSL

This warning:
[WARNING] Set thread priority 0.5 failed: Operation not permitted
Might come from SoapyRemote. Since I've never used the Soapy remote feature, I don't know if it means anything.
So, the question is: does reception work now or do you still have issues with it?

@srs4511351
Copy link
Author

srs4511351 commented Nov 14, 2020 via email

@srs4511351
Copy link
Author

srs4511351 commented Nov 14, 2020 via email

@kantooon
Copy link
Collaborator

I would suggest to solve first the reported OpenSSL compatibility issue. However, your main issue seems to come from SoapyRemote not receiving samples from the device. I have never used SoapyRemote, so I can't give any useful advice here. Perhaps you could ask on the SoapySDR discussion forum or bug tracker? I am not sure if the version of gr-osmosdr is the same as the one you were using before, but you might want to check that as well.

@kantooon
Copy link
Collaborator

Sorry about that. Apparently Qt is too quick to mark deprecations even if the new alternative is not yet available. I've reverted that commit now, so your build should pass.

And I think I have an explanation for the weird AGC behaviour. Right now, the AGC attack and decay times are not linear as you would expect, they are exponential with powers of 10. So if the AGC updates every X seconds, for a value of 2, it would take it 100 seconds to decay, and for a value of 3 it would take 1000 seconds to decay. I think I need to add a more useful range for the values that is not exponential. Might take me a few tries though, because I don't have a shortwave setup and other signals on the 2 meter band and above are too weak to even need an AGC.

@kantooon
Copy link
Collaborator

Here are a couple of changes I made now: I've added AGC control dials to the main menu to be easier to tweak, and I've linearized the AGC range to the interval (-500, 500). This range may be too large, only values around the center are probably useful. Explanation of range values: -500 means it will take the AGC update loop 500 seconds to adjust attack and decay, while a value of 500 means the attack and decay will be adjusted 500 times per second.
Please test the new AGC settings and let me know if you think the range is too wide or too narrow. Make sure to start with centered dials around a value of 0 or 1, this gives the AGC one second to adjust attack and decay.

@kantooon
Copy link
Collaborator

Found interval (-500, 500) to be too larged, reduced to (-25, 25) and lowered AGC reference voltage to avoid some clipping noise. You may find that the best attack and decay values are around the center of the dial.

@srs4511351
Copy link
Author

srs4511351 commented Dec 13, 2020 via email

@kantooon
Copy link
Collaborator

The colors being off (yellow on white or similar) is caused by Gnome overriding my Qt CSS theme and replacing it with some other values from a local theme. In other words it's a Gnome/GTK theme bug, nothing I can do here. If you try to run it on a machine with KDE you will see it looks fine. There might exist a way to fix that by looking into what other desktop themes for Qt applications are available in Gnome.

@kantooon
Copy link
Collaborator

I'm pretty dissatisfied that Gnome users continue to have an inferior experience even after all the recent CSS styling effort I put through, so in the next days I'll try to spin up a Gnome VM to search for a workaround regarding visual theme.

@srs4511351
Copy link
Author

srs4511351 commented Dec 14, 2020 via email

@kantooon
Copy link
Collaborator

I tried to reproduce the graphical issue on a Gnome system but aside from a few minor glitches which are now fixed I can't reproduce the yellow on white menus problem. So the question is, what desktop environment are you using, and can you attach a screenshot here on Github.

@kantooon
Copy link
Collaborator

I've reduced the minimum AGC attack time to 2 msec (from 40 previously). I'm not seeing any marked improvement, hower my testing involves only locally generated signals.

@srs4511351
Copy link
Author

I tried it and I don't hear much difference. Attack seems to be good at any setting.
Decay is different. I have a slow decay set, which takes 2-3 seconds to recover, but I hear noise pumping in and out between syllables as if decay is faster at first, slower later. It should be the other way around, more steady while the same person is talking, decaying a little faster between transmissions. Sometimes I see a "hang" feature.

@kantooon
Copy link
Collaborator

There is no way in GNU radio's AGC to detect speech and treat it differently, so the "hang" feature is probably just slightly different voice timing you are seeing. I think the best setting is with a decay between 10 seconds and 1 second, so between 9 o'clock and 11 o'clock on the dial since decay is constant at a certain setting. I tried to test the settings by using a magloop and a HF receiver but no signals were strong enough here.

@srs4511351
Copy link
Author

srs4511351 commented Dec 22, 2020 via email

@kantooon
Copy link
Collaborator

You're right, ideally it should work like that. However, the AGC in gnuradio is not that advanced, it only has two configuration values: attack speed and decay speed (and a maximum gain). I think its main purpose always was digital signals (especially PSK). Some other applications like Gqrx for instance have their own much more advanced AGC code written from scratch and don't use the GNU radio one for analog modes. I decided to use the GNU radio AGC because implementing it from scratch would have been quite a difficult task which would take much more time than just use the existing AGC in GNU radio. But maybe going forward a custom AGC could be an option.

@srs4511351
Copy link
Author

srs4511351 commented Dec 23, 2020 via email

@srs4511351
Copy link
Author

srs4511351 commented Jan 22, 2021 via email

@kantooon
Copy link
Collaborator

See this old email thread about GR on ARM platforms, it references your error: https://lists.gnu.org/archive/html/discuss-gnuradio/2013-08/msg00479.html
This is not related to qradiolink code.

@srs4511351
Copy link
Author

srs4511351 commented Jan 23, 2021 via email

@kantooon
Copy link
Collaborator

Right, that email thread was just informational, regarding some issues gnuradio seems to have on some ARM platforms.
The clue being these errors:
/home/pi/.gnuradio/prefs/vmcircbuf_default_factory: No such file or
directory
vmcircbuf_createfilemapping: createfilemapping is not available
gr::vmcircbuf_sysv_shm: shmat (2): Invalid argument
gr::vmcircbuf_sysv_shm: shmat (2): Invalid argument
gr::vmcircbuf_sysv_shm: shmat (2): Invalid argument

It might also be related to the support for your particular device.

@srs4511351
Copy link
Author

srs4511351 commented Jan 24, 2021 via email

@kantooon
Copy link
Collaborator

Ok, thanks for letting me know. I have only run qradiolink on armhf, but there are other ARM architectures and this problem in gnuradio could be occuring in a more recent version. Which arch are your running on your pi? Is it arm64?

@srs4511351
Copy link
Author

srs4511351 commented Jan 24, 2021 via email

@kantooon
Copy link
Collaborator

Thanks for the update, I'll update the docs as well as soon as I get a chance.

@alphafox02
Copy link

I’ll be trying to include QRadioLink to the aarch64 build of DragonOS, if I run into issues I’ll refer to this.

What I wanted to point out though is that rsp_tcp can remotely or even locally run the sdrplay equipment. This in turn can then be accessed via gr-osmosdr just like rtl_tcp can. I’ve found it works rather well in other situations where I want to use sdrplay equipment w/ the newer API.

@srs4511351
Copy link
Author

I have come a long way since this posting. I have also been building aarch64 systems. I have tried 32-bit Ubuntu, 64-bit Debian and the pre-release Raspberry Pi OS 64-bit system.
It is all documented here in case that helps you.
https://www.radiosrs.net/tech.html
The aarch64 Raspberry Pi OS is the fastest one so far. If yours is faster, let me know. There seems to be some compatibility issues with the 64 bit API and pulseaudio, but I am able to use the SDRplay SDR with SoapySDR. Some applications support it directly.
Qradiolink and many other SDR packages are covered.

----Steve

@alphafox02
Copy link

I was able to build it and run it on aarch64 (Ubuntu 20.04). For the most part it seems okay when starting and using it with the hackrf. I used a debugger to see why sometimes and it would start showing the waterfall and sometimes it’d take awhile or not start. Actually not sure what was up, but I’ll go back and try my rsp1a.

Do you have a good example of how to test the Tx side? I’d try Fm, am, etc and each time it would say I was selecting a frequency outside the allowed band. Getting slightly off topic here, sorry.

@alphafox02
Copy link

By the way, this is the 64 bit image I’m working on. I just had to install a few of the decencies and then it built fine. https://sourceforge.net/projects/dragonos-pi64/files/

@srs4511351
Copy link
Author

srs4511351 commented Jun 6, 2021 via email

@kantooon
Copy link
Collaborator

kantooon commented Jun 6, 2021

Indeed only IARU region 1 band limits are implemented, so if you're in the US depending on frequencies you might need to disable TX limits in the settings otherwise the application will prevent you from even tuning the TX outside the hardcoded bands.

@alphafox02
Copy link

alphafox02 commented Jun 6, 2021

Sorry I didn’t jump right back on here. I quickly figured out I had to uncheck the tx limit, but what I really need to be doing is learning all the bands! I was able to use it and will keep testing with the hackrf, b205, lime, and bladerf! Love the program - I just need to learn how to better use it.

Some notes though, after reading above. I to have had some issues with starting qradiolink on the Pi4 with asrch64. Actually the program itself starts, but say I click RX with proper hackrf settings I can see in terminal the mention of gr-osmosdr as if it’s going to start up, but the waterfall stays empty and it just stays there. I’ll kill it a couple times and then suddenly is works after starting it all back up. I’ll get more detailed info after I build it all over again and include it in my img file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants