Radarcape:Acarsdec: Difference between revisions
imported>Dl4mea |
imported>Dl4mea |
||
(19 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
acarsdec is a software which uses a DVB-T stick in order to decode up to 4 | |||
=acarsdec on the Radarcape= | |||
acarsdec is a software which uses a DVB-T stick in order to decode up to 4 channel with ACARS signals within a 1MHz band segment. The front panel extension port of the Radarcape may be used to plug such a DVB-T stick.<br>The decoding process requires some mathematical functions and obtains plenty of processing resources. Due to that it is not guaranteed to run on a heavily loaded Radarcape and/or together with Mode-AC or FR24 feeder. You may need to disable some features. | |||
Installation requires some skills in handling a console but at the end is easy. | Installation requires some skills in handling a console but at the end is easy. | ||
The original places where to find the used components are | The original places where to find the used components are | ||
* [http:// | * [http://www.satsignal.eu/raspberry-pi/acars-decoder.html ACARS decoder for Raspberry Pi]<br> | ||
* [http://sourceforge.net/projects/acarsdec/ Acarsdec] | * [http://sourceforge.net/projects/acarsdec/ Acarsdec] | ||
* [http://askubuntu.com/questions/110341/how-to-blacklist-kernel-modules How to blacklist kernel modules] | |||
* [https://community.arm.com/groups/tools/blog/2013/04/15/arm-cortex-a-processors-and-gcc-command-lines ARM Cortex-A Processors and GCC Command Lines] | |||
Installation requires some skills in handling a console and edit files, but at the end is easy. | |||
==Installation on a Debian distribution based Radarcape== | |||
===Prepare Installation ( | ===Prepare Installation (Debian)=== | ||
First, you need to install build tools on the Radarcape. | First, you need to install build tools on the Radarcape. You may need to enter one line after the other separately. | ||
<source lang="bash"> | <source lang="bash"> | ||
apt-get update | |||
apt-get upgrade -y | |||
apt-get install -y build-essential cmake git libusb-1.0-0-dev | |||
sync | sync | ||
</source> | </source> | ||
This will take some time. | This will take some time. | ||
===Install librtlsdr ( | ===Install librtlsdr (Debian)=== | ||
Install rtl-sdr library. You need to blacklist the kernel DVB-T stick driver before using this new driver. | |||
<source lang="bash"> | <source lang="bash"> | ||
echo blacklist dvb_usb_rtl28xxu >> /etc/modprobe.d/fbdev-blacklist.conf | |||
</source> | </source> | ||
Then you are ready to build and install the library. | |||
<source lang="bash"> | <source lang="bash"> | ||
cd | git clone git://git.osmocom.org/rtl-sdr.git | ||
cd rtl-sdr | |||
mkdir build | mkdir build | ||
cd build | cd build | ||
cmake ../ | cmake ../ -DINSTALL_UDEV_RULES=ON | ||
make | make | ||
make install | make install | ||
ldconfig | ldconfig -v | ||
cd .. | |||
cp -v rtl-sdr.rules /etc/udev/rules.d/ | |||
sync | |||
</source> | </source> | ||
After this step, reboot your Radarcape without DVB-T stick connected. Wait a few 10 seconds, plug your stick and check with command dmesg if the stick became recognized correctly: | |||
[[File:acarsdec1.png|none|Relevant dmesg output after DVB-T stick was plugged]] | |||
Next, check with the command rtl_test if it works: | |||
<source lang="bash"> | <source lang="bash"> | ||
root@rc66:~# rtl_test | |||
Found 1 device(s): | |||
0: Realtek, RTL2838UHIDIR, SN: 00000001 | |||
Using device 0: Generic RTL2832U OEM | Using device 0: Generic RTL2832U OEM | ||
Found Rafael Micro R820T tuner | Found Rafael Micro R820T tuner | ||
Supported gain values (29): 0.0 0.9 1.4 2.7 3.7 7.7 8.7 12.5 14.4 15.7 16.6 19.7 20.7 22.9 25.4 28.0 29.7 32.8 33.8 36.4 37.2 38.6 40.2 42.1 43.4 43.9 44.5 48.0 49.6 | |||
[R82XX] PLL not locked! | |||
Sampling at 2048000 S/s. | |||
Info: This tool will continuously read from the device, and report if | |||
samples get lost. If you observe no further output, everything is fine. | |||
Reading samples in async mode... | |||
lost at least 232 bytes | |||
</source> | </source> | ||
One 'lost' message is ok during startup, but there should none appear later. | |||
===Install | ===Install acarsdec (Debian)=== | ||
With a simple '''cd''' command, go back into your root folder. | |||
acarsdec source package can be found on [https://sourceforge.net/projects/acarsdec/files/acarsdec/ sourceforge]. There is a green button with the latest version, click on it and then look for the ' ''direct link'' ', which you should cut & paste, edit and execute with wget like shown below.After uncompressing the archive, change to the folder that became created by tar. | |||
Note that at the time of writing version 3.2 was latest, it might be different sometimes later. | |||
<source lang="bash"> | <source lang="bash"> | ||
cd | cd | ||
wget http://downloads.sourceforge.net/project/acarsdec/acarsdec/3.2/acarsdec-3.2.tar.gz | |||
cd | tar xvf acarsdec-3.2.tar.gz | ||
cd acarsdec-3.2 | |||
</source> | </source> | ||
Now it comes... the complicated part is that ALSA lib is not necessary for the build here, and it seems that the Angstrom distribution that is used on the Radarcape has a different library structure.<br>That means you need to edit the Makefile: | |||
* comment out all lines with CFLAGS with a # sign in the first column. | |||
* insert a new CFLAGS line | |||
<source lang="bash"> | <source lang="bash"> | ||
CFLAGS= -g -O3 -flto -mcpu=cortex-a8 -mfpu=vfpv3 -ffast-math -funroll-loops -pthread -D WITH_RTL | |||
</source> | </source> | ||
* | * in the line showing LDLIBS, remove -lasound, so it looks like | ||
<source lang="bash"> | <source lang="bash"> | ||
modified: LDLIBS= -lm -pthread -lrtlsdr | |||
modified: LDLIBS= -lm -pthread -lrtlsdr | |||
</source> | </source> | ||
Start compilation with the command ''make'' | |||
You then should see some output like this: | You then should see some output like this: | ||
<source lang="bash"> | <source lang="bash"> | ||
root@radarcape:~/acarsdec-3.2# make | |||
cc -g -O3 -flto -mcpu=cortex-a8 -mfpu=vfpv3 -ffast-math -funroll-loops -pthread -D WITH_RTL -D WITH_SNDFILE -c -o acarsdec.o acarsdec.c | |||
cc -g -O3 -flto -mcpu=cortex-a8 -mfpu=vfpv3 -ffast-math -funroll-loops -pthread -D WITH_RTL -D WITH_SNDFILE -c -o acars.o acars.c | |||
cc -g -O3 -flto -mcpu=cortex-a8 -mfpu=vfpv3 -ffast-math -funroll-loops -pthread -D WITH_RTL -D WITH_SNDFILE -c -o msk.o msk.c | |||
cc -g -O3 -flto -mcpu=cortex-a8 -mfpu=vfpv3 -ffast-math -funroll-loops -pthread -D WITH_RTL -D WITH_SNDFILE -c -o rtl.o rtl.c | |||
cc -g -O3 -flto -mcpu=cortex-a8 -mfpu=vfpv3 -ffast-math -funroll-loops -pthread -D WITH_RTL -D WITH_SNDFILE -c -o air.o air.c | |||
cc -g -O3 -flto -mcpu=cortex-a8 -mfpu=vfpv3 -ffast-math -funroll-loops -pthread -D WITH_RTL -D WITH_SNDFILE -c -o output.o output.c | |||
cc -g -O3 -flto -mcpu=cortex-a8 -mfpu=vfpv3 -ffast-math -funroll-loops -pthread -D WITH_RTL -D WITH_SNDFILE -c -o alsa.o alsa.c | |||
cc acarsdec.o acars.o msk.o rtl.o air.o output.o alsa.o -o acarsdec -lm -pthread -lrtlsdr | |||
</source> | </source> | ||
Execute acarsdec. | Execute acarsdec. It might be good if you don't see messages from specific frequency to leave them out from decoding. The command also needs to be modified for networking according to its original description if you like to send decoded messages to other computers. | ||
The command needs to be modified for networking according to its original description if you like to send decoded messages to other computers. | |||
<source lang="bash"> | <source lang="bash"> | ||
./acarsdec -o1 -v -p 79 -g 400 -r 0 | ./acarsdec -o1 -v -p 79 -g 400 -r 0 131.725 | ||
</source> | </source> | ||
Line 230: | Line 135: | ||
<source lang="text"> | <source lang="text"> | ||
root@radarcape:~/acarsdec-3.2# ./acarsdec -o1 -v -p 79 -g 400 -r 0 131.525 131.725 131.825 | |||
Found 1 device(s): | |||
0: Realtek, RTL2838UHIDIR, SN: 00000001 | |||
Using device 0: Generic RTL2832U OEM | Using device 0: Generic RTL2832U OEM | ||
Found Rafael Micro R820T tuner | Found Rafael Micro R820T tuner | ||
Tuner gain : 40.200000 | Tuner gain : 40.200000 | ||
Set center freq. to | Set center freq. to 131750000Hz | ||
Exact sample rate is: | Exact sample rate is: 2500000.107620 Hz | ||
Decoding | Decoding 1 channels | ||
# | #1 (L:-32 E:0) 08/09/2016 10:34:58 .A6-EDU EK0015 2 Q0 S76A | ||
#1 (L:-38 E:0) 08/09/2016 10:34:59 .PH-BXK KL1652 G 10 M67A ETA93A08103456KLM1652 LIPZEHA | |||
#1 (L:- | #1 too many parity errors | ||
# | #1 (L:-33 E:0) 08/09/2016 10:35:06 .A6-EDU EK0015 2 Q0 S76A | ||
#1 (L:- | |||
</source> | </source> | ||
===Tweaking (Debian)=== | |||
Probably it makes sense to disable automatic power savings on the CPU. | |||
<source lang="bash"> | |||
apt-get update | |||
apt-get install -y cpufrequtils | |||
cpufreq-set -g performance | |||
</source> | |||
This is not automatically permanent. | |||
==Installation on an Angstrom distribution based Radarcape (may work)== | |||
Angstrom is outdated and this description is only hold for completeness. Especially because Debian is able to use the floating point unit of the ARM, for Acarsdec Debian is strongly recommended. | |||
===Prepare Installation=== | ===Prepare Installation (Angstrom)=== | ||
First, you need to install build tools on the Radarcape | First, you need to install build tools on the Radarcape. | ||
<source lang="bash"> | <source lang="bash"> | ||
opkg update | |||
opkg install packagegroup-core-buildessential | |||
opkg install cmake | |||
opkg install libusb-1.0-dev | |||
opkg install libsndfile-dev | |||
sync | sync | ||
</source> | </source> | ||
This will take some time. | This will take some time. | ||
If problems appear somehow around something that is led_aging or so, mind this link | |||
[https://www.mail-archive.com/[email protected]/msg15617.html https://www.mail-archive.com/[email protected]/msg15617.html] | |||
Install | ===Install librtlsdr (Angstrom)=== | ||
Download one of the [https://github.com/steve-m/librtlsdr/releases packaged releases]: Look for the eventually greyed .tar.gz text, cut & paste the link of it and fetch it with wget on your Radarcape (in this case it is version 0.5.3, which was current while writing this descrition): | |||
<source lang="bash"> | |||
wget --no-check-certificate https://github.com/steve-m/librtlsdr/archive/v0.5.3.tar.gz | |||
</source> | |||
Untar/unpack it. Note that the filename eventually may differ for your download | |||
<source lang="bash"> | <source lang="bash"> | ||
tar xvf v0.5.3.tar.gz | |||
</source> | </source> | ||
As described [http://sdr.osmocom.org/trac/wiki/rtl-sdr here], navigate to ' ''Building with cmake:'' ' and follow these steps. You don't need sudo, as you are already root user on your Radarcape. The first command 'cd' must be adopted to what you have got as folder when unpacking your archive in the latest step. | |||
<source lang="bash"> | <source lang="bash"> | ||
cd librtlsdr-0.5.3 | |||
mkdir build | mkdir build | ||
cd build | cd build | ||
cmake ../ | cmake ../ | ||
make | make | ||
make install | make install | ||
ldconfig | ldconfig | ||
</source> | </source> | ||
===Install acarsdec (Angstrom)=== | |||
acarsdec source package can be found [http://sourceforge.net/projects/acarsdec on sourceforge]. There is a nice green button with the latest version, click on it and then look for the ' ''direct link'' ', which you should cut & paste, edit and execute with wget like shown below.<br>But '''before''', with a simple '''cd''', go back into your root folder. After uncompressing the archive, change to the folder that became created by tar | acarsdec source package can be found [http://sourceforge.net/projects/acarsdec on sourceforge]. There is a nice green button with the latest version, click on it and then look for the ' ''direct link'' ', which you should cut & paste, edit and execute with wget like shown below.<br>But '''before''', with a simple '''cd''', go back into your root folder. After uncompressing the archive, change to the folder that became created by tar | ||
Line 338: | Line 217: | ||
<source lang="bash"> | <source lang="bash"> | ||
cd | cd | ||
wget http://downloads.sourceforge.net/project/acarsdec/acarsdec/ | wget http://downloads.sourceforge.net/project/acarsdec/acarsdec/3.0/acarsdec-3.0.tar.gz | ||
tar xvf acarsdec- | tar xvf acarsdec-3.0.tar.gz | ||
cd acarsdec- | cd acarsdec-3.0 | ||
</source> | </source> | ||
Now it comes... the complicated part is that ALSA lib is not necessary for the build here | Now it comes... the complicated part is that ALSA lib is not necessary for the build here. Remove -D WITH_ALSA from the CFLAGS line. Next, I found that with different compiler options the CPU load is about one third of the original ones. | ||
<source lang="bash"> | <source lang="bash"> | ||
original: CFLAGS= -g -Ofast -ftree-vectorize -funroll-loops -pthread -D WITH_RTL -D WITH_SNDFILE -D WITH_ALSA | original: CFLAGS= -g -Ofast -ftree-vectorize -funroll-loops -pthread -D WITH_RTL -D WITH_SNDFILE -D WITH_ALSA | ||
modified: CFLAGS= - | modified: CFLAGS= -g -O3 -flto -funroll-loops -ffast-math -pthread -D WITH_RTL -D WITH_SNDFILE | ||
</source> | </source> | ||
You then should see some output like this: | You then should see some output like this: | ||
<source lang="text"> | <source lang="text"> | ||
root@ | root@beaglebone:~/acarsdec-3.0# make | ||
cc -flto | cc -O3 -flto -ffast-math -funroll-loops -pthread -D WITH_RTL -D WITH_SNDFILE -c -o acarsdec.o acarsdec.c | ||
cc -flto | cc -O3 -flto -ffast-math -funroll-loops -pthread -D WITH_RTL -D WITH_SNDFILE -c -o acars.o acars.c | ||
cc -flto | cc -O3 -flto -ffast-math -funroll-loops -pthread -D WITH_RTL -D WITH_SNDFILE -c -o msk.o msk.c | ||
cc -flto | cc -O3 -flto -ffast-math -funroll-loops -pthread -D WITH_RTL -D WITH_SNDFILE -c -o rtl.o rtl.c | ||
cc -flto | cc -O3 -flto -ffast-math -funroll-loops -pthread -D WITH_RTL -D WITH_SNDFILE -c -o output.o output.c | ||
cc -flto | cc -O3 -flto -ffast-math -funroll-loops -pthread -D WITH_RTL -D WITH_SNDFILE -c -o soundfile.o soundfile.c | ||
cc -flto | cc -O3 -flto -ffast-math -funroll-loops -pthread -D WITH_RTL -D WITH_SNDFILE -c -o alsa.o alsa.c | ||
cc | cc acarsdec.o acars.o msk.o rtl.o output.o soundfile.o alsa.o -o acarsdec -lm -pthread -lrtlsdr -lsndfile -lasound | ||
</source> | </source> | ||
In order to execute it for the first, time you | In order to execute it for the first, time you need to set LD_LIBRARY_PATH. For later restarts, this one time write /usr/local/lib into /etc/ld.so.conf, which will be active after the next reboot. (see: [http://www.linux-praxis.de/lpic1/lpi101/1.102.4.html]) | ||
<source lang="bash"> | <source lang="bash"> | ||
echo "/usr/local/lib" > /etc/ld.so.conf | echo "/usr/local/lib" > /etc/ld.so.conf |
Latest revision as of 18:15, 15 September 2016
acarsdec on the Radarcape
acarsdec is a software which uses a DVB-T stick in order to decode up to 4 channel with ACARS signals within a 1MHz band segment. The front panel extension port of the Radarcape may be used to plug such a DVB-T stick.
The decoding process requires some mathematical functions and obtains plenty of processing resources. Due to that it is not guaranteed to run on a heavily loaded Radarcape and/or together with Mode-AC or FR24 feeder. You may need to disable some features.
Installation requires some skills in handling a console but at the end is easy.
The original places where to find the used components are
- ACARS decoder for Raspberry Pi
- Acarsdec
- How to blacklist kernel modules
- ARM Cortex-A Processors and GCC Command Lines
Installation requires some skills in handling a console and edit files, but at the end is easy.
Installation on a Debian distribution based Radarcape
Prepare Installation (Debian)
First, you need to install build tools on the Radarcape. You may need to enter one line after the other separately.
apt-get update
apt-get upgrade -y
apt-get install -y build-essential cmake git libusb-1.0-0-dev
sync
This will take some time.
Install librtlsdr (Debian)
Install rtl-sdr library. You need to blacklist the kernel DVB-T stick driver before using this new driver.
echo blacklist dvb_usb_rtl28xxu >> /etc/modprobe.d/fbdev-blacklist.conf
Then you are ready to build and install the library.
git clone git://git.osmocom.org/rtl-sdr.git
cd rtl-sdr
mkdir build
cd build
cmake ../ -DINSTALL_UDEV_RULES=ON
make
make install
ldconfig -v
cd ..
cp -v rtl-sdr.rules /etc/udev/rules.d/
sync
After this step, reboot your Radarcape without DVB-T stick connected. Wait a few 10 seconds, plug your stick and check with command dmesg if the stick became recognized correctly:
Next, check with the command rtl_test if it works:
root@rc66:~# rtl_test
Found 1 device(s):
0: Realtek, RTL2838UHIDIR, SN: 00000001
Using device 0: Generic RTL2832U OEM
Found Rafael Micro R820T tuner
Supported gain values (29): 0.0 0.9 1.4 2.7 3.7 7.7 8.7 12.5 14.4 15.7 16.6 19.7 20.7 22.9 25.4 28.0 29.7 32.8 33.8 36.4 37.2 38.6 40.2 42.1 43.4 43.9 44.5 48.0 49.6
[R82XX] PLL not locked!
Sampling at 2048000 S/s.
Info: This tool will continuously read from the device, and report if
samples get lost. If you observe no further output, everything is fine.
Reading samples in async mode...
lost at least 232 bytes
One 'lost' message is ok during startup, but there should none appear later.
Install acarsdec (Debian)
With a simple cd command, go back into your root folder.
acarsdec source package can be found on sourceforge. There is a green button with the latest version, click on it and then look for the ' direct link ', which you should cut & paste, edit and execute with wget like shown below.After uncompressing the archive, change to the folder that became created by tar.
Note that at the time of writing version 3.2 was latest, it might be different sometimes later.
cd
wget http://downloads.sourceforge.net/project/acarsdec/acarsdec/3.2/acarsdec-3.2.tar.gz
tar xvf acarsdec-3.2.tar.gz
cd acarsdec-3.2
Now it comes... the complicated part is that ALSA lib is not necessary for the build here, and it seems that the Angstrom distribution that is used on the Radarcape has a different library structure.
That means you need to edit the Makefile:
- comment out all lines with CFLAGS with a # sign in the first column.
- insert a new CFLAGS line
CFLAGS= -g -O3 -flto -mcpu=cortex-a8 -mfpu=vfpv3 -ffast-math -funroll-loops -pthread -D WITH_RTL
- in the line showing LDLIBS, remove -lasound, so it looks like
modified: LDLIBS= -lm -pthread -lrtlsdr
Start compilation with the command make
You then should see some output like this:
root@radarcape:~/acarsdec-3.2# make
cc -g -O3 -flto -mcpu=cortex-a8 -mfpu=vfpv3 -ffast-math -funroll-loops -pthread -D WITH_RTL -D WITH_SNDFILE -c -o acarsdec.o acarsdec.c
cc -g -O3 -flto -mcpu=cortex-a8 -mfpu=vfpv3 -ffast-math -funroll-loops -pthread -D WITH_RTL -D WITH_SNDFILE -c -o acars.o acars.c
cc -g -O3 -flto -mcpu=cortex-a8 -mfpu=vfpv3 -ffast-math -funroll-loops -pthread -D WITH_RTL -D WITH_SNDFILE -c -o msk.o msk.c
cc -g -O3 -flto -mcpu=cortex-a8 -mfpu=vfpv3 -ffast-math -funroll-loops -pthread -D WITH_RTL -D WITH_SNDFILE -c -o rtl.o rtl.c
cc -g -O3 -flto -mcpu=cortex-a8 -mfpu=vfpv3 -ffast-math -funroll-loops -pthread -D WITH_RTL -D WITH_SNDFILE -c -o air.o air.c
cc -g -O3 -flto -mcpu=cortex-a8 -mfpu=vfpv3 -ffast-math -funroll-loops -pthread -D WITH_RTL -D WITH_SNDFILE -c -o output.o output.c
cc -g -O3 -flto -mcpu=cortex-a8 -mfpu=vfpv3 -ffast-math -funroll-loops -pthread -D WITH_RTL -D WITH_SNDFILE -c -o alsa.o alsa.c
cc acarsdec.o acars.o msk.o rtl.o air.o output.o alsa.o -o acarsdec -lm -pthread -lrtlsdr
Execute acarsdec. It might be good if you don't see messages from specific frequency to leave them out from decoding. The command also needs to be modified for networking according to its original description if you like to send decoded messages to other computers.
./acarsdec -o1 -v -p 79 -g 400 -r 0 131.725
And now you will see its output.
root@radarcape:~/acarsdec-3.2# ./acarsdec -o1 -v -p 79 -g 400 -r 0 131.525 131.725 131.825
Found 1 device(s):
0: Realtek, RTL2838UHIDIR, SN: 00000001
Using device 0: Generic RTL2832U OEM
Found Rafael Micro R820T tuner
Tuner gain : 40.200000
Set center freq. to 131750000Hz
Exact sample rate is: 2500000.107620 Hz
Decoding 1 channels
#1 (L:-32 E:0) 08/09/2016 10:34:58 .A6-EDU EK0015 2 Q0 S76A
#1 (L:-38 E:0) 08/09/2016 10:34:59 .PH-BXK KL1652 G 10 M67A ETA93A08103456KLM1652 LIPZEHA
#1 too many parity errors
#1 (L:-33 E:0) 08/09/2016 10:35:06 .A6-EDU EK0015 2 Q0 S76A
Tweaking (Debian)
Probably it makes sense to disable automatic power savings on the CPU.
apt-get update
apt-get install -y cpufrequtils
cpufreq-set -g performance
This is not automatically permanent.
Installation on an Angstrom distribution based Radarcape (may work)
Angstrom is outdated and this description is only hold for completeness. Especially because Debian is able to use the floating point unit of the ARM, for Acarsdec Debian is strongly recommended.
Prepare Installation (Angstrom)
First, you need to install build tools on the Radarcape.
opkg update
opkg install packagegroup-core-buildessential
opkg install cmake
opkg install libusb-1.0-dev
opkg install libsndfile-dev
sync
This will take some time.
If problems appear somehow around something that is led_aging or so, mind this link https://www.mail-archive.com/[email protected]/msg15617.html
Install librtlsdr (Angstrom)
Download one of the packaged releases: Look for the eventually greyed .tar.gz text, cut & paste the link of it and fetch it with wget on your Radarcape (in this case it is version 0.5.3, which was current while writing this descrition):
wget --no-check-certificate https://github.com/steve-m/librtlsdr/archive/v0.5.3.tar.gz
Untar/unpack it. Note that the filename eventually may differ for your download
tar xvf v0.5.3.tar.gz
As described here, navigate to ' Building with cmake: ' and follow these steps. You don't need sudo, as you are already root user on your Radarcape. The first command 'cd' must be adopted to what you have got as folder when unpacking your archive in the latest step.
cd librtlsdr-0.5.3
mkdir build
cd build
cmake ../
make
make install
ldconfig
Install acarsdec (Angstrom)
acarsdec source package can be found on sourceforge. There is a nice green button with the latest version, click on it and then look for the ' direct link ', which you should cut & paste, edit and execute with wget like shown below.
But before, with a simple cd, go back into your root folder. After uncompressing the archive, change to the folder that became created by tar
cd
wget http://downloads.sourceforge.net/project/acarsdec/acarsdec/3.0/acarsdec-3.0.tar.gz
tar xvf acarsdec-3.0.tar.gz
cd acarsdec-3.0
Now it comes... the complicated part is that ALSA lib is not necessary for the build here. Remove -D WITH_ALSA from the CFLAGS line. Next, I found that with different compiler options the CPU load is about one third of the original ones.
original: CFLAGS= -g -Ofast -ftree-vectorize -funroll-loops -pthread -D WITH_RTL -D WITH_SNDFILE -D WITH_ALSA
modified: CFLAGS= -g -O3 -flto -funroll-loops -ffast-math -pthread -D WITH_RTL -D WITH_SNDFILE
You then should see some output like this:
root@beaglebone:~/acarsdec-3.0# make
cc -O3 -flto -ffast-math -funroll-loops -pthread -D WITH_RTL -D WITH_SNDFILE -c -o acarsdec.o acarsdec.c
cc -O3 -flto -ffast-math -funroll-loops -pthread -D WITH_RTL -D WITH_SNDFILE -c -o acars.o acars.c
cc -O3 -flto -ffast-math -funroll-loops -pthread -D WITH_RTL -D WITH_SNDFILE -c -o msk.o msk.c
cc -O3 -flto -ffast-math -funroll-loops -pthread -D WITH_RTL -D WITH_SNDFILE -c -o rtl.o rtl.c
cc -O3 -flto -ffast-math -funroll-loops -pthread -D WITH_RTL -D WITH_SNDFILE -c -o output.o output.c
cc -O3 -flto -ffast-math -funroll-loops -pthread -D WITH_RTL -D WITH_SNDFILE -c -o soundfile.o soundfile.c
cc -O3 -flto -ffast-math -funroll-loops -pthread -D WITH_RTL -D WITH_SNDFILE -c -o alsa.o alsa.c
cc acarsdec.o acars.o msk.o rtl.o output.o soundfile.o alsa.o -o acarsdec -lm -pthread -lrtlsdr -lsndfile -lasound
In order to execute it for the first, time you need to set LD_LIBRARY_PATH. For later restarts, this one time write /usr/local/lib into /etc/ld.so.conf, which will be active after the next reboot. (see: [1])
echo "/usr/local/lib" > /etc/ld.so.conf
ldconfig
export LD_LIBRARY_PATH=/usr/local/lib
Execute acarsdec. My stick has +79ppm offset and the gain is fixed to 40dB. With the 3 channels that are active within the decodeable 1MHz segment here, the CPU load is just 35%. That fits to a running Radarcape, if not too busy with Mode-AC. In case of doubts, open another ssh terminal and execute htop command there.
The command needs to be modified for networking according to its original description if you like to send decoded messages to other computers.
./acarsdec -o1 -v -p 79 -g 400 -r 0 131.525 131.725 131.825
And now you will see its output.
Using device 0: Generic RTL2832U OEM
Found Rafael Micro R820T tuner
Tuner gain : 40.200000
Set center freq. to 131850000Hz
Exact sample rate is: 1000000.026491 Hz
Decoding 3 channels
#2 too many parity errors
#3 (L:-21 E:0) 02/01/2000 04:25:07 .OY-KBH SK0610 2 B9 M36A /EKCH.TI2/040EKCHAC5B3
#1 (L:-20 E:0) 02/01/2000 04:25:12 .D-AILA LH03RV R 1L M74A 02467226782VUYY93,EBB*14GK0
#2 parity error(s): 2
#2 crc error
#2 not able to fix errors
#3 (L:-21 E:0) 02/01/2000 04:25:14 .OY-KBH SK0610 2 _d S88A
#1 (L:-25 E:0) 02/01/2000 04:25:17 .G-BNWM BA0155 2 Q0 S09A
#1 (L:-20 E:0) 02/01/2000 04:25:18 .D-AILA LH03RV R _d S35A
#1 (L:-19 E:0) 02/01/2000 04:25:21 .D-AILA LH03RV R _d S36A
#2 (L:-28 E:0) 02/01/2000 04:25:22 .D-AICC DE03FC X _d S58A
#2 (L: -3 E:0) 02/01/2000 04:25:29 .PH-TFC OR0717 E Q0 S11A
#3 (L:-22 E:0) 02/01/2000 04:25:29 .OY-KBH SK0610 2 _d S89A