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

CPU consumption on Raspberry Pi 3 over 100% in 9600 bauds. #314

Open
kovalroma opened this issue Feb 16, 2021 · 2 comments
Open

CPU consumption on Raspberry Pi 3 over 100% in 9600 bauds. #314

kovalroma opened this issue Feb 16, 2021 · 2 comments

Comments

@kovalroma
Copy link

Raspberry Pi 3
Direwolf 1.6

Command to start
rtl_fm -f 432.500M -g 22 -o 4 -s 44100 - | direwolf -c sdr.conf -r 44100 -B 9600 -

After first packet received, CPU increases over 100%. Then program stucks and not working.
On 1200 bauds working good.
Screenshot_398

@wb2osz
Copy link
Owner

wb2osz commented Feb 16, 2021

I can't explain that. This is what I get, with the same command, on an RPi 3:

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
12674 pi 20 0 134912 12628 9424 S 43.7 1.3 61:03.90 direwolf
12673 pi 20 0 53232 6820 1824 S 11.6 0.7 15:24.04 rtl_fm

What are we doing differently?
What compiler are you using? gcc or clang?
When cmake is run, does it say somethng about NEON?

@kovalroma
Copy link
Author

This command I use to install Direwolf

git clone https://www.github.com/wb2osz/direwolf
cd direwolf
mkdir build && cd build
cmake ..
make -j4
sudo make install

cmake log:

pi@raspberrypi:~/direwolf/build $ cmake ..
-- The C compiler identification is GNU 10.2.0
-- The CXX compiler identification is GNU 10.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Git: /usr/bin/git (found version "2.28.0") 
-- Dire Wolf Version: 1.6.0
-- Build type set to: Release
CMake system: Linux
-- Target architecture: ARM
-- Use NEON SIMD instructions
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- Found Threads: TRUE  
-- Checking for module 'libgps'
--   No package 'libgps' found
-- Checking for module 'hamlib'
--   No package 'hamlib' found
CMake Warning (dev) at /usr/local/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:273 (message):
  The package name passed to `find_package_handle_standard_args` (HAMLIB)
  does not match the name of the calling package (hamlib).  This can lead to
  problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  cmake/modules/Findhamlib.cmake:55 (find_package_handle_standard_args)
  CMakeLists.txt:260 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Could NOT find HAMLIB (missing: HAMLIB_LIBRARY HAMLIB_INCLUDE_DIR) 
-- Found ALSA: /usr/lib/arm-linux-gnueabihf/libasound.so (found version "1.2.3.2") 
-- Checking for module 'libudev'
--   No package 'libudev' found
CMake Warning (dev) at /usr/local/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:273 (message):
  The package name passed to `find_package_handle_standard_args` (UDEV) does
  not match the name of the calling package (udev).  This can lead to
  problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  cmake/modules/Findudev.cmake:68 (find_package_handle_standard_args)
  CMakeLists.txt:274 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Could NOT find UDEV (missing: UDEV_LIBRARY UDEV_INCLUDE_DIR) 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/pi/direwolf/build

make -j4 log:

pi@raspberrypi:~/direwolf/build $ make -j4
Scanning dependencies of target geotranz
Scanning dependencies of target misc
[  1%] Building C object external/misc/CMakeFiles/misc.dir/strlcpy.c.o
[  1%] Building C object external/misc/CMakeFiles/misc.dir/strlcat.c.o
[  1%] Building C object external/geotranz/CMakeFiles/geotranz.dir/mgrs.c.o
[  2%] Building C object external/geotranz/CMakeFiles/geotranz.dir/error_string.c.o
[  3%] Building C object external/geotranz/CMakeFiles/geotranz.dir/polarst.c.o
[  3%] Linking C static library libmisc.a
[  3%] Building C object external/geotranz/CMakeFiles/geotranz.dir/tranmerc.c.o
[  3%] Built target misc
[  4%] Building C object external/geotranz/CMakeFiles/geotranz.dir/ups.c.o
[  4%] Building C object external/geotranz/CMakeFiles/geotranz.dir/usng.c.o
[  5%] Building C object external/geotranz/CMakeFiles/geotranz.dir/utm.c.o
Scanning dependencies of target decode_aprs
Scanning dependencies of target text2tt
[  6%] Building C object src/CMakeFiles/text2tt.dir/tt_text.c.o
Scanning dependencies of target tt2text
[  8%] Building C object src/CMakeFiles/tt2text.dir/tt_text.c.o
[  8%] Linking C static library libgeotranz.a
[  8%] Linking C executable tt2text
[  8%] Linking C executable text2tt
[  8%] Built target tt2text
[  8%] Built target text2tt
Scanning dependencies of target gen_packets
Scanning dependencies of target atest
[  8%] Built target geotranz
Scanning dependencies of target aclients
[  9%] Building C object src/CMakeFiles/decode_aprs.dir/decode_aprs.c.o
[  9%] Building C object src/CMakeFiles/aclients.dir/aclients.c.o
[  9%] Building C object src/CMakeFiles/gen_packets.dir/gen_packets.c.o
[ 10%] Building C object src/CMakeFiles/atest.dir/atest.c.o
[ 11%] Building C object src/CMakeFiles/aclients.dir/ax25_pad.c.o
[ 11%] Building C object src/CMakeFiles/atest.dir/ais.c.o
[ 12%] Building C object src/CMakeFiles/gen_packets.dir/ax25_pad.c.o
[ 12%] Building C object src/CMakeFiles/aclients.dir/fcs_calc.c.o
[ 13%] Building C object src/CMakeFiles/atest.dir/demod.c.o
[ 15%] Building C object src/CMakeFiles/aclients.dir/textcolor.c.o
[ 15%] Building C object src/CMakeFiles/decode_aprs.dir/ais.c.o
[ 15%] Linking C executable aclients
[ 15%] Built target aclients
Scanning dependencies of target kissutil
[ 15%] Building C object src/CMakeFiles/atest.dir/demod_afsk.c.o
[ 16%] Building C object src/CMakeFiles/kissutil.dir/kissutil.c.o
[ 16%] Building C object src/CMakeFiles/gen_packets.dir/fx25_encode.c.o
[ 17%] Building C object src/CMakeFiles/decode_aprs.dir/kiss_frame.c.o
[ 18%] Building C object src/CMakeFiles/gen_packets.dir/fx25_init.c.o
[ 18%] Building C object src/CMakeFiles/decode_aprs.dir/ax25_pad.c.o
[ 18%] Building C object src/CMakeFiles/kissutil.dir/kiss_frame.c.o
[ 19%] Building C object src/CMakeFiles/atest.dir/demod_psk.c.o
[ 19%] Building C object src/CMakeFiles/gen_packets.dir/fx25_send.c.o
[ 20%] Building C object src/CMakeFiles/kissutil.dir/ax25_pad.c.o
[ 22%] Building C object src/CMakeFiles/gen_packets.dir/hdlc_send.c.o
[ 22%] Building C object src/CMakeFiles/gen_packets.dir/fcs_calc.c.o
[ 22%] Building C object src/CMakeFiles/atest.dir/demod_9600.c.o
[ 23%] Building C object src/CMakeFiles/gen_packets.dir/gen_tone.c.o
[ 24%] Building C object src/CMakeFiles/atest.dir/dsp.c.o
[ 24%] Building C object src/CMakeFiles/gen_packets.dir/morse.c.o
[ 25%] Building C object src/CMakeFiles/decode_aprs.dir/dwgpsnmea.c.o
[ 25%] Building C object src/CMakeFiles/atest.dir/fx25_extract.c.o
[ 26%] Building C object src/CMakeFiles/gen_packets.dir/dtmf.c.o
[ 26%] Building C object src/CMakeFiles/decode_aprs.dir/dwgps.c.o
[ 26%] Building C object src/CMakeFiles/kissutil.dir/fcs_calc.c.o
[ 27%] Building C object src/CMakeFiles/atest.dir/fx25_init.c.o
[ 27%] Building C object src/CMakeFiles/gen_packets.dir/textcolor.c.o
[ 29%] Building C object src/CMakeFiles/kissutil.dir/textcolor.c.o
[ 30%] Building C object src/CMakeFiles/decode_aprs.dir/dwgpsd.c.o
[ 31%] Building C object src/CMakeFiles/gen_packets.dir/dsp.c.o
[ 31%] Building C object src/CMakeFiles/kissutil.dir/serial_port.c.o
[ 31%] Building C object src/CMakeFiles/decode_aprs.dir/serial_port.c.o
[ 31%] Building C object src/CMakeFiles/atest.dir/fx25_rec.c.o
[ 32%] Building C object src/CMakeFiles/kissutil.dir/dtime_now.c.o
[ 33%] Building C object src/CMakeFiles/decode_aprs.dir/symbols.c.o
[ 33%] Linking C executable gen_packets
[ 33%] Built target gen_packets
[ 33%] Building C object src/CMakeFiles/kissutil.dir/dwsock.c.o
Scanning dependencies of target ttcalc
/home/pi/direwolf/src/symbols.c: In function ‘symbols_init’:
/home/pi/direwolf/src/symbols.c:409:6: warning: ‘strncpy’ output may be truncated copying 29 bytes from a string of length 194 [-Wstringop-truncation]
  409 |      strncpy(new_sym_ptr[new_sym_len].description, stuff+COL6_DESC, NEW_SYM_DESC_LEN);
      |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ 34%] Building C object src/CMakeFiles/ttcalc.dir/ttcalc.c.o
[ 36%] Linking C executable kissutil
[ 36%] Built target kissutil
[ 36%] Building C object src/CMakeFiles/decode_aprs.dir/textcolor.c.o
[ 36%] Building C object src/CMakeFiles/ttcalc.dir/ax25_pad.c.o
[ 37%] Building C object src/CMakeFiles/atest.dir/hdlc_rec.c.o
[ 38%] Building C object src/CMakeFiles/decode_aprs.dir/fcs_calc.c.o
[ 39%] Building C object src/CMakeFiles/ttcalc.dir/fcs_calc.c.o
[ 39%] Building C object src/CMakeFiles/atest.dir/hdlc_rec2.c.o
[ 40%] Building C object src/CMakeFiles/atest.dir/multi_modem.c.o
[ 40%] Building C object src/CMakeFiles/decode_aprs.dir/latlong.c.o
[ 41%] Building C object src/CMakeFiles/decode_aprs.dir/log.c.o
Scanning dependencies of target log2gpx
[ 41%] Building C object src/CMakeFiles/atest.dir/rrbb.c.o
[ 43%] Building C object src/CMakeFiles/log2gpx.dir/log2gpx.c.o
[ 43%] Building C object src/CMakeFiles/ttcalc.dir/textcolor.c.o
[ 43%] Building C object src/CMakeFiles/decode_aprs.dir/telemetry.c.o
[ 45%] Building C object src/CMakeFiles/atest.dir/fcs_calc.c.o
[ 45%] Linking C executable ttcalc
[ 44%] Building C object src/CMakeFiles/log2gpx.dir/textcolor.c.o
[ 46%] Building C object src/CMakeFiles/decode_aprs.dir/tt_text.c.o
[ 46%] Built target ttcalc
[ 46%] Building C object src/CMakeFiles/atest.dir/ax25_pad.c.o
[ 47%] Building C object src/CMakeFiles/atest.dir/decode_aprs.c.o
[ 48%] Linking C executable log2gpx
[ 48%] Built target log2gpx
[ 48%] Building C object src/CMakeFiles/atest.dir/dwgpsnmea.c.o
[ 50%] Building C object src/CMakeFiles/atest.dir/dwgps.c.o
[ 50%] Linking C executable decode_aprs
Scanning dependencies of target appserver
[ 51%] Building C object src/CMakeFiles/appserver.dir/appserver.c.o
[ 51%] Built target decode_aprs
[ 51%] Building C object src/CMakeFiles/appserver.dir/agwlib.c.o
/home/pi/direwolf/src/appserver.c: In function ‘agw_cb_D_connected_data’:
/home/pi/direwolf/src/appserver.c:501:65: warning: ‘%-9s’ directive output may be truncated writing between 9 and 479 bytes into a region of size between 54 and 64 [-Wformat-truncation=]
  501 |        snprintf (greeting, sizeof(greeting), "  %2d       %d    %-9s [time later]\r",
      |                                                                 ^~~~
/home/pi/direwolf/src/appserver.c:501:8: note: ‘snprintf’ output between 40 and 520 bytes into a destination of size 80
  501 |        snprintf (greeting, sizeof(greeting), "  %2d       %d    %-9s [time later]\r",
      |        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  502 |    n, session[n].channel, session[n].client_addr);
      |    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ 52%] Building C object src/CMakeFiles/appserver.dir/dwsock.c.o
Scanning dependencies of target direwolf
[ 52%] Building C object src/CMakeFiles/appserver.dir/dtime_now.c.o
[ 52%] Building C object src/CMakeFiles/atest.dir/dwgpsd.c.o
[ 53%] Building C object src/CMakeFiles/appserver.dir/ax25_pad.c.o
[ 54%] Building C object src/CMakeFiles/atest.dir/serial_port.c.o
[ 54%] Building C object src/CMakeFiles/atest.dir/telemetry.c.o
[ 55%] Building C object src/CMakeFiles/atest.dir/dtime_now.c.o
[ 56%] Building C object src/CMakeFiles/direwolf.dir/direwolf.c.o
[ 56%] Building C object src/CMakeFiles/atest.dir/latlong.c.o
[ 58%] Building C object src/CMakeFiles/atest.dir/symbols.c.o
[ 58%] Building C object src/CMakeFiles/atest.dir/tt_text.c.o
/home/pi/direwolf/src/symbols.c: In function ‘symbols_init’:
/home/pi/direwolf/src/symbols.c:409:6: warning: ‘strncpy’ output may be truncated copying 29 bytes from a string of length 194 [-Wstringop-truncation]
  409 |      strncpy(new_sym_ptr[new_sym_len].description, stuff+COL6_DESC, NEW_SYM_DESC_LEN);
      |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ 58%] Building C object src/CMakeFiles/direwolf.dir/ais.c.o
[ 59%] Building C object src/CMakeFiles/direwolf.dir/aprs_tt.c.o
[ 59%] Building C object src/CMakeFiles/appserver.dir/fcs_calc.c.o
[ 60%] Building C object src/CMakeFiles/atest.dir/textcolor.c.o
[ 61%] Building C object src/CMakeFiles/appserver.dir/textcolor.c.o
Scanning dependencies of target ll2utm
[ 61%] Linking C executable atest
[ 61%] Building C object src/CMakeFiles/ll2utm.dir/ll2utm.c.o
[ 61%] Linking C executable appserver
[ 61%] Built target appserver
[ 61%] Building C object src/CMakeFiles/direwolf.dir/audio_stats.c.o
[ 61%] Built target atest
[ 62%] Building C object src/CMakeFiles/direwolf.dir/ax25_link.c.o
[ 62%] Building C object src/CMakeFiles/direwolf.dir/ax25_pad.c.o
[ 63%] Building C object src/CMakeFiles/ll2utm.dir/textcolor.c.o
[ 65%] Building C object src/CMakeFiles/direwolf.dir/ax25_pad2.c.o
[ 65%] Linking C executable ll2utm
[ 65%] Built target ll2utm
[ 65%] Building C object src/CMakeFiles/direwolf.dir/beacon.c.o
Scanning dependencies of target utm2ll
[ 65%] Building C object src/CMakeFiles/utm2ll.dir/utm2ll.c.o
[ 66%] Building C object src/CMakeFiles/utm2ll.dir/textcolor.c.o
[ 67%] Linking C executable utm2ll
[ 68%] Building C object src/CMakeFiles/direwolf.dir/config.c.o
[ 68%] Built target utm2ll
[ 68%] Building C object src/CMakeFiles/direwolf.dir/decode_aprs.c.o
[ 69%] Building C object src/CMakeFiles/direwolf.dir/dedupe.c.o
[ 69%] Building C object src/CMakeFiles/direwolf.dir/demod_9600.c.o
[ 70%] Building C object src/CMakeFiles/direwolf.dir/demod_afsk.c.o
[ 70%] Building C object src/CMakeFiles/direwolf.dir/demod_psk.c.o
[ 72%] Building C object src/CMakeFiles/direwolf.dir/demod.c.o
[ 72%] Building C object src/CMakeFiles/direwolf.dir/digipeater.c.o
[ 73%] Building C object src/CMakeFiles/direwolf.dir/cdigipeater.c.o
[ 73%] Building C object src/CMakeFiles/direwolf.dir/dlq.c.o
[ 74%] Building C object src/CMakeFiles/direwolf.dir/dsp.c.o
[ 74%] Building C object src/CMakeFiles/direwolf.dir/dtime_now.c.o
[ 75%] Building C object src/CMakeFiles/direwolf.dir/dtmf.c.o
[ 75%] Building C object src/CMakeFiles/direwolf.dir/dwgps.c.o
[ 76%] Building C object src/CMakeFiles/direwolf.dir/dwsock.c.o
[ 76%] Building C object src/CMakeFiles/direwolf.dir/encode_aprs.c.o
[ 77%] Building C object src/CMakeFiles/direwolf.dir/fcs_calc.c.o
[ 77%] Building C object src/CMakeFiles/direwolf.dir/fx25_encode.c.o
[ 79%] Building C object src/CMakeFiles/direwolf.dir/fx25_extract.c.o
[ 79%] Building C object src/CMakeFiles/direwolf.dir/fx25_init.c.o
[ 80%] Building C object src/CMakeFiles/direwolf.dir/fx25_rec.c.o
[ 80%] Building C object src/CMakeFiles/direwolf.dir/fx25_send.c.o
[ 81%] Building C object src/CMakeFiles/direwolf.dir/fx25_auto.c.o
[ 81%] Building C object src/CMakeFiles/direwolf.dir/gen_tone.c.o
[ 82%] Building C object src/CMakeFiles/direwolf.dir/hdlc_rec.c.o
[ 82%] Building C object src/CMakeFiles/direwolf.dir/hdlc_rec2.c.o
[ 83%] Building C object src/CMakeFiles/direwolf.dir/hdlc_send.c.o
[ 83%] Building C object src/CMakeFiles/direwolf.dir/igate.c.o
[ 84%] Building C object src/CMakeFiles/direwolf.dir/kiss_frame.c.o
[ 84%] Building C object src/CMakeFiles/direwolf.dir/kiss.c.o
[ 86%] Building C object src/CMakeFiles/direwolf.dir/kissserial.c.o
[ 86%] Building C object src/CMakeFiles/direwolf.dir/kissnet.c.o
[ 87%] Building C object src/CMakeFiles/direwolf.dir/latlong.c.o
[ 87%] Building C object src/CMakeFiles/direwolf.dir/log.c.o
[ 88%] Building C object src/CMakeFiles/direwolf.dir/morse.c.o
[ 88%] Building C object src/CMakeFiles/direwolf.dir/multi_modem.c.o
[ 89%] Building C object src/CMakeFiles/direwolf.dir/waypoint.c.o
[ 89%] Building C object src/CMakeFiles/direwolf.dir/serial_port.c.o
[ 90%] Building C object src/CMakeFiles/direwolf.dir/pfilter.c.o
[ 90%] Building C object src/CMakeFiles/direwolf.dir/ptt.c.o
[ 91%] Building C object src/CMakeFiles/direwolf.dir/recv.c.o
[ 91%] Building C object src/CMakeFiles/direwolf.dir/rrbb.c.o
[ 93%] Building C object src/CMakeFiles/direwolf.dir/server.c.o
[ 93%] Building C object src/CMakeFiles/direwolf.dir/symbols.c.o
/home/pi/direwolf/src/symbols.c: In function ‘symbols_init’:
/home/pi/direwolf/src/symbols.c:409:6: warning: ‘strncpy’ output may be truncated copying 29 bytes from a string of length 194 [-Wstringop-truncation]
  409 |      strncpy(new_sym_ptr[new_sym_len].description, stuff+COL6_DESC, NEW_SYM_DESC_LEN);
      |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ 94%] Building C object src/CMakeFiles/direwolf.dir/telemetry.c.o
[ 94%] Building C object src/CMakeFiles/direwolf.dir/textcolor.c.o
[ 95%] Building C object src/CMakeFiles/direwolf.dir/tt_text.c.o
[ 95%] Building C object src/CMakeFiles/direwolf.dir/tq.c.o
[ 96%] Building C object src/CMakeFiles/direwolf.dir/tt_user.c.o
[ 96%] Building C object src/CMakeFiles/direwolf.dir/xid.c.o
[ 97%] Building C object src/CMakeFiles/direwolf.dir/xmit.c.o
[ 97%] Building C object src/CMakeFiles/direwolf.dir/dwgpsnmea.c.o
[ 98%] Building C object src/CMakeFiles/direwolf.dir/dwgpsd.c.o
[ 98%] Building C object src/CMakeFiles/direwolf.dir/mheard.c.o
[100%] Building C object src/CMakeFiles/direwolf.dir/audio.c.o
[100%] Linking C executable direwolf
[100%] Built target direwolf

My system
Linux raspberrypi 4.9.35-v7+ #1014 SMP Fri Jun 30 14:47:43 BST 2017 armv7l GNU/Linux

cat /etc/issue
Raspbian GNU/Linux 8 \n \l

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

2 participants