If you notice spammers in the forum, please notify Bas ON5HB, so they can be removed and banned. Give a link in the chatbox or send a PM to me. Thanks.

Tried to Compile on a RPI4 with 2GB memory...

Started by Bas ON5HB, Sep 04, 2024, 11:09 PM

Previous topic - Next topic

Bas ON5HB

So far fail....it starts swapping and doesn't complete. ;D

Best regards,

Bas ON5HB

Ps. the Community Edition can be found here: https://github.com/ny4qphil/PhantomSDR-Plus

magicint1337

Maintainer and Developer of PhantomSDR-Plus

Bas ON5HB

It just started swapping and nothing else was possible to do.
Best regards,

Bas ON5HB

Ps. the Community Edition can be found here: https://github.com/ny4qphil/PhantomSDR-Plus

linkz

#3
You gave me the idea to try - history below

Raspberry Pi 4 Model B Rev 1.2
PRETTY_NAME="Raspbian GNU/Linux 11 (bullseye)"
NAME="Raspbian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
Linux 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr  3 17:24:16 BST 2023 aarch64 GNU/Linux

---requirements---
$ sudo apt install build-essential cmake pkg-config meson libfftw3-dev libwebsocketpp-dev libflac++-dev zlib1g-dev libzstd-dev libboost-all-dev libopus-dev libliquid-dev git psmisc
pass

------------------
1st attempt: (cmake version nok)


$ meson setup build --optimization 3
CMake Error at CMakeLists.txt:1 (cmake_minimum_required):
  CMake 3.21 or higher is required.  You are running version 3.18.4
-- Configuring incomplete, errors occurred!

$ sudo apt install cmake
cmake is already the newest version (3.18.4-2+rpt1+rpi1+deb11u1).

$ cat /etc/apt/sources.list
deb http://raspbian.raspberrypi.org/raspbian/ bullseye main contrib non-free rpi
deb-src http://raspbian.raspberrypi.org/raspbian/ bullseye main contrib non-free rpi

→ upgrading cmake

$ cat /etc/apt/sources.list
deb http://raspbian.raspberrypi.org/raspbian/ bullseye main contrib non-free rpi
deb-src http://raspbian.raspberrypi.org/raspbian/ bullseye main contrib non-free rpi
deb http://deb.debian.org/debian bullseye-backports main contrib non-free
deb-src http://deb.debian.org/debian bullseye-backports main contrib non-free

$ sudo apt update && apt install cmake -t bullseye-backports

$ cmake --version
cmake version 3.25.1

------------------
2nd attempt: (gcc version nok)


$ meson setup build --optimization 3
pass

$ meson compile -C build
c++: error: unrecognized command-line option '-std=c++23'; did you mean '-std=c++03'?
ninja: build stopped: subcommand failed.

$ gcc --version
gcc (Raspbian 10.2.1-6+rpi1) 10.2.1 20210110

$ sudo apt install gcc -t bullseye-backports
gcc is already the newest version (4:10.2.1-1+rpi1).

$ nano meson.build
-add_project_arguments(['-std=c++23','-Wall','-Wextra','-Wpedantic'], language: 'cpp')
+add_project_arguments(['-std=c++11','-Wall','-Wextra','-Wpedantic'], language: 'cpp')

------------------
3rd attempt: (fix attempt failure)


$ rm -rf build/

$ meson setup build --optimization 3
pass

$ meson compile -C build
../subprojects/tomlplusplus-3.4.0/include/toml++/impl/preprocessor.hpp:54:2: error: #error toml++ requires C++17 or higher. For a C++11 TOML library see https:
   54 | #error toml++ requires C++17 or higher. For a C++11 TOML library see https://github.com/ToruNiina/toml11
      |  ^~~~~
ninja: build stopped: subcommand failed.

------------------
4th attempt: (missing nlohmann-json)


$ nano meson.build
-add_project_arguments(['-std=c++11','-Wall','-Wextra','-Wpedantic'], language: 'cpp')
+add_project_arguments(['-std=c++17','-Wall','-Wextra','-Wpedantic'], language: 'cpp')

$ rm -rf build/

$ meson setup build --optimization 3
pass

$ meson compile -C build
../src/audio.h:7:10: fatal error: nlohmann/json.hpp: No such file or directory
ninja: build stopped: subcommand failed.

$ apt-cache search nlohmann
nlohmann-json-dev - JSON for Modern C++
nlohmann-json3-dev - JSON for Modern C++

$ sudo apt install nlohmann-json-dev

------------------
5th attempt: (wrong nlohmann-json installed + c++20 fix)


$ meson compile -C build
[0/18] Compiling C++ object spectrumserver.p/src_signal.cpp.o
../src/utils.h:97:5: error: need 'typename' before 'std::conditional<std::is_floating_point<_Tp>::value, Neumaier<T>, T>::type' because 'std::conditional<std::is_floating_point<_Tp>::value, Neumaier<T>, T>' is a dependent scope
   97 |     std::conditional<std::is_floating_point<T>::value, Neumaier<T>, T>::type
      |     ^~~
      |     typename
ninja: build stopped: subcommand failed.

$ nano meson.build
-add_project_arguments(['-std=c++17','-Wall','-Wextra','-Wpedantic'], language: 'cpp')
+add_project_arguments(['-std=c++20','-Wall','-Wextra','-Wpedantic'], language: 'cpp')

$ rm -rf build/

$ meson setup build --optimization 3
pass

$ meson compile -C build
/usr/include/nlohmann/json.hpp:1634:15: error: 'class std::allocator<std::vector<nlohmann::basic_json<>, std::allocator<nlohmann::basic_json<> > > >' has no member named 'construct'

$ sudo apt install nlohmann-json3-dev

------------------
6th attempt: (last chance, upgrade gcc - moved to armbian testing)


$ meson compile -C build
FAILED: spectrumserver.p/src_client.cpp.o
../subprojects/glaze/include/glaze/reflection/get_name.hpp:48:108: error: no matching function for call to 'mangled_name<glz::detail::get_ptr<0, const glz::detail::GLAZE_REFLECTOR&>(glz::detail::external<glz::detail::GLAZE_REFLECTOR>)>()'
   48 |    constexpr std::string_view get_name_impl = mangled_name<get_ptr<N>(external<std::remove_volatile_t<T>>)>();
      |                                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
ninja: build stopped: subcommand failed.

$ cat /etc/apt/sources.list
deb http://raspbian.raspberrypi.org/raspbian/ bullseye main contrib non-free rpi
deb-src http://raspbian.raspberrypi.org/raspbian/ bullseye main contrib non-free rpi
deb http://deb.debian.org/debian bullseye-backports main contrib non-free
deb-src http://deb.debian.org/debian bullseye-backports main contrib non-free
deb http://mirror.ox.ac.uk/sites/archive.raspbian.org/archive/raspbian/ testing main non-free contrib
deb http://mirror.ox.ac.uk/sites/archive.raspbian.org/archive/raspbian/ testing main contrib non-free
deb http://mirror.ox.ac.uk/sites/archive.raspbian.org/archive/raspbian/ testing main non-free contrib

$ sudo apt update && apt install gcc

$ gcc --version
gcc (Raspbian 13.3.0-1+rpi2) 13.3.0

$ rm -rf build/

$ meson setup build --optimization 3
pass

------------------
7th attempt: (yyeahhh)


$ meson compile -C build

[21/21] Linking target spectrumserver
SUCCESS ! 
I highly recommend to go armbian "testing" directly  :-)


# INSTALLATION TEST

$ sudo dmesg
[ 5396.633032] usb 1-1.4: New USB device found, idVendor=0bda, idProduct=2838, bcdDevice= 1.00
[ 5396.633066] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 5396.633083] usb 1-1.4: Product: Blog V4
[ 5396.633097] usb 1-1.4: Manufacturer: RTLSDRBlog
[ 5396.633111] usb 1-1.4: SerialNumber: 00000001

$ mv config.example.rtlsdr.toml config-rtl.toml

$ rtl_sdr -g 48 -f 145000000 -s 2048000 - | ./build/spectrumserver --config config-rtl.toml

Found 1 device(s):

Thank you for using PhantomSDR+, you are supporting the Development of an Open-Source WebSDR Project ♥
  0:  RTLSDRBlog, Blog V4, SN: 00000001

Unable to open marker.json file.
Using device 0: Generic RTL2832U OEM
No FFTW wisdom file found. Planning from scratch. This may take long on the first time but will then be fast.
Found Rafael Micro R828D tuner
RTL-SDR Blog V4 Detected
Sampling at 2048000 S/s.
Tuned to 145000000 Hz.
Tuner gain set to 48.00 dB.
Reading samples in async mode...
Waterfall is sent every 4 FFTs
Unable to open marker.json file.
2024-09-05 21:57:30] [error] handle_read_frame error: websocketpp.transport:7 (End of File)
[2024-09-05 21:57:30] [error] handle_read_frame error: websocketpp.transport:7 (End of File)
[2024-09-05 21:57:30] [error] handle_read_frame error: websocketpp.transport:7 (End of File)
[2024-09-05 21:57:30] [info] Error getting remote endpoint: system:107 (Transport endpoint is not connected)
[2024-09-05 21:57:30] [info] asio async_write error: system:32 (Broken pipe)
[2024-09-05 21:57:30] [fatal] handle_write_frame error: websocketpp.transport:2 (Underlying Transport Error)
Unable to open marker.json file.


# RESULT

 :-\ AUDIO CUTS EVERY HALF OF A SECOND → UNUSABLE  :-\

$ uptime
 21:59:57 up  1:49,  2 users,  load average: 0.71, 0.79, 0.87

$ free -m
               total        used        free      shared  buff/cache   available
Mem:            3794         108        2400           1        1285        3608


BTW: "No FFTW wisdom file found. Planning from scratch. This may take long on the first time but will then be fast." << yes about 1 to 2 minutes


# NEXT TEST
Is opencl possible ? probably, more to follow, too late for now

Regards
linkz

linkz

#4
I've found a better setting, my bad, no more audio cuts

[input]
sps=2048000 # Input Sample Rate
fft_size=131072 # FFT bins
brightness_offset=0 # Waterfall brightness offset. Reduce to negative if you see black regions in the waterfall
frequency=7100000 # Baseband frequency
signal="iq" # real or iq
accelerator="none" # Accelerator: none, cuda, opencl
audio_sps=12000 # Audio Sample Rate
smeter_offset=0

$ uptime
 22:47:57 up 24 min,  2 users,  load average: 0.90, 0.87, 0.64

$ free -m
               total        used        free      shared  buff/cache   available
Mem:            3794          98        3562           1         132        3628

$ vcgencmd measure_temp
temp=63.7'C  (GPU)

$ awk '{printf("\ntemp=%.1f°C\n\n",$1/1e3)}' /sys/class/thermal/thermal_zone0/temp
temp=63.8°C  (CPU)




Bas ON5HB

Going to try myself layter today....cool ;D

Not got it to work....maybe a good idea to release an RPix 64bit version for download that works?
Best regards,

Bas ON5HB

Ps. the Community Edition can be found here: https://github.com/ny4qphil/PhantomSDR-Plus

linkz

Well, RTL-SDR.com dongle V4 is working ok but no success in running the RX888 MK2 btw

→ streamserver just fails to open the SDDC_FX3.img bootloader

I've even tried to make the bootloader using aarch64 compiler and result is the same

Regards
linkz

Bas ON5HB

I don't even get that far, it crashes on the firat copiling section and starts swapping until the box reacts no more till I close the ssh-session. After it takes minutes to recover from it ;D
Best regards,

Bas ON5HB

Ps. the Community Edition can be found here: https://github.com/ny4qphil/PhantomSDR-Plus

linkz

Some news

PhantomSDR+ 1.5.4 on the Raspi 4B (4GB RAM) + RTLSDRBlog V4 dongle is working like a charm, no crash so far.
Not much people connected at same time to see how it can handle the load, tho.

threads=2
sps=2000000 # Input Sample Rate
fft_size=131072 # FFT bins
fft_threads=2
accelerator="none"
waterfall_size=1024
waterfall_compression="zstd"
---
rtl_sdr -g 15 -f 1000000 -s 2000000



Regards
linkz

Bas ON5HB

Can you make a copy of the Sd-card and upload it to github?

Then others can use your card and run 'out-of-the-box'.
Best regards,

Bas ON5HB

Ps. the Community Edition can be found here: https://github.com/ny4qphil/PhantomSDR-Plus

linkz

Um, no sorry, because there are other private things on this rpi.

But actually it hosted OpenWebRX+ and it is based on an existing image (2023-10-29-OpenWebRX+-1.2.35) which could be downloaded here:
The version I took is no longer available but another one should be suitable.

OpenWebRX+ releases

I was too lazy to start from scratch and wasn't sure if PhantomSDR+ could compile, so I left the OS as is.
It's not ideal to start with a bloated OS version, so why not try to fix your build issues on your current OS instead?

Regards
linkz

magicint1337

Maintainer and Developer of PhantomSDR-Plus

magicint1337

I also tried putting 20 users on this sdr and it ran fine so the PI4 runs awesome!
Maintainer and Developer of PhantomSDR-Plus

linkz

#13
BAS

Can you try this image ?
http://linkz.ddns.net/rpi4b-phantomsdrplus-rtlv4-20240921.img.xz

user / pw
websdr / websdr
root / phantom

Bas ON5HB

Root password wasn't set ;D

But I'm testing it right now.
Best regards,

Bas ON5HB

Ps. the Community Edition can be found here: https://github.com/ny4qphil/PhantomSDR-Plus

Powered by EzPortal