There is a great advantage to running SDR decoder apps on a single board PC like a Raspberry Pi 3. For example instead of committing a whole PC to become a dedicated decoder, a cheap Pi 3 can be used instead. However, unfortunately many decoder apps are written for the x86 CPU architecture and/or Windows, making them impossible to run on ARM and/or primarily Linux devices like the Raspberry Pi 3.
That is unless you use an emulator combination like Eltechs Exagear and Wine. Exagear is an emulator that emulates an x86 environment on a device like a Raspberry Pi 3 which uses an ARM CPU. Wine is a Windows compatibility layer that allows you to run x86 Windows apps on an x86 Linux installation. So by combining Exagear together with Wine it is possible to run Windows apps on ARM Linux devices.
Exagear is not free (although there is a free trial). It currently costs $22.95 USD for a Pi 3 licence, and $16.95 USD for a Pi 2 licence and $11.45 for a Pi 1/Zero licence. They also have versions for Odroid, Cubieboard, BananaPi, Jetson and many other ARMv7 and ARMv8 devices like the super cheap and powerful Orange Pi’s. There are free alternatives out there like QEMU, however when we tested QEMU it was far too slow on the Pi 3 to even run notepad responsively, let alone a decoder. Exagear on the other hand seems to run apps at near native speeds, without much lag at all. So in this respect the price seems to be worth it.
We decided to test the Exagear + Wine combination on a Pi 3 and were successful in running a number of apps including Unitrunker, WinSTD-C, WXtoImg, DSDPlus, PC-HFDL, MultiPSK, Orbitron and Sondemonitor.
Trunking setup with Unitrunker on a Raspberry Pi 3
With Unitrunker we were able to set up a full trunk tracking system using two RTL-SDR dongles, rtl_fm, rtl_udp and a custom script to control rtl_udp.
In the future we may put up a full double checked tutorial with images, but for now a roughly written tutorial is presented below. The tutorial is fairly involved and assumes decent Linux experience. The tutorial starts from a fresh install of Raspbian.
The basic idea of operation is based around the fact that the RTL-SDR cannot be used directly within Wine (or so it seems). So the control signal audio is routed from rtl_fm running on one dongle into Unitrunker on Wine using alsa loopback. Then we use the old Unitrunker remote.dll method to generate a sdrsharptrunking.log file which is a text file that contains the current frequency that the voice receiver should tune to. A simple shell script continuously reads this file and extracts the frequency, and then commands an instance of rtl_udp running with the second dongle to tune to that frequency.
- Install the RTL-SDR drivers using “sudo apt-get rtl-sdr” or install from source.
- Do a git clone on the rtl_udp repo, and then compile the code. You may also need to use apt-get install to install cmake and libusb-dev and libusb-1.0-dev first. Note that we recommend not using make install as the final step, as the standard osmocom rtl_fm seems to run with less audio underruns.
- Purchase and install Exagear onto your system following their instructions. Note that we recommend not enabling FullGL as they suggest, as it seems to break too many things.
- Open an Exagear shell by typing in “exagear” within a regular shell.
- Install wine with “sudo apt-get install wine”. Make sure to install wine within the Exagear shell, as Exagear repos provide a special version for the Pi.
- Now use a web browser to download the latest Unitrunker preview build. At the time of testing we used Unitrunker 33.6.
- Now in your Exagear shell browse to the .msi file, and use “wine msiexec /i UniTrunker-18.104.22.168.msi” to install it. You should be able to install it normally now.
- Next if you were to run Unitrunker right now it would probably complain about missing WinUSB.dll. In a web browser go to https://www.dll-files.com/winusb.dll.html, and download a 32-bit version of winusb.dll. Note be careful on this website as there are a bunch of misleading ads. Just scroll down and click on the text download, not any of the images.
- Place this DLL into the ~/.wine/drive_c/windows/system32 folder.
- Now in your Exagear shell browse to “~/.wine/drive_c/Program\ Files/Unitrunker”, and try to run Uniform.exe with “wine Uniform.exe”. It may run, or you may get some errors stating that there are some further missing dlls. If there are missing dlls, search for them on the dll-files.com website, download the 32-bit versions and copy them into the system32 folder. Once you’ve copied all those dlls you should be able to open Unitrunker.
- But if you open Unitrunker now you’ll probably see that the buttons are all messed up. This is because Unitrunker uses the Windows Wingdings and Webdings fonts for its icons. To fix this use a real Windows PC to copy all the Wingdings and Webdings fonts over to your Pi (you might find downloads of these fonts online too). Place them in the ~/.wine/drive_c/windows/Fonts folder. Now you’ll probably need to restart your Exagear shell, or maybe the whole Pi to get these fonts registered.
- Now Unitrunker should run and the icons should look normal.
- Next plug in your two RTL-SDRs, and run in a regular non-exagear shell “sudo modprobe aloop”, this will set up a loopback audio device, like Stereo Mix in Windows.
- Next install sox with “sudo apt-get install sox”
- In another non-exagear shell run:
rtl_fm -M fm -f FREQ -s 12.5k -g 20 -F 0 | sox -r 12.5k -t raw -e s -b 16 - -traw -r 48k -e s -b 16 -c 1 - | aplay -r 48k -f S16_LE -t raw -c 1 -D hw:Loopback,0,0",
replacing FREQ with your control channel. Remember to change the gain to what’s best for your RF environment, and set a PPM adjustment if necessary. This command line code takes the output of rtl_fm, converts it into a 48k sample rate, and then sends it to the loopback device silently. Using the standard rtl_fm -r resampler does not appear work.
- Open up Unitrunker and create a new Signal receiver, with the audio input as the Loopback device. If you’re tuned to a valid control channel the site box should pop up.
- Create a new Debug receiver, and set its mode to Voice.
- This should create some folders in your “~/.wine/drive_c/users/pi/Application Data/Unitrunker” folder that start with R and have a few numbers after. e.g. “R000001”
- Place the remote.dll from the Unilogger 1.5 zip file on this site (scroll down to the bottom) into those directories starting with R. Doing this will tell Unitrunker to generate the required sdrsharptrunking.log file.
- After doing this you may need to restart Unitrunker to get it to see the dlls. After restarting confirm that the sdrsharptrunking.log file is created in the “~/.wine/drive_c/users/pi/Application\ Data/Unitrunker/” folder.
- Next in your rtl_udp folder, create a shell script with the following (thanks to Jack McHugh’s video for the general idea). Edit the number after grep -i to be the first number in the voice frequencies that you are monitoring. Save it as unitr_rtludp_tune.sh:
#!/bin/bash lastFreq=0 while true do freq=$(cat ~/.wine/drive_c/users/pi/Application\ Data/Unitrunker/sdrsharptrunking.log | grep -i 8 | sed 's/[^0-9]*//g' | cut -c1-9) freq=$((freq+0)) if [ "$lastFreq" -ne "$freq" ]; then ./udpclient.py freq $freq fi lastFreq=$freq done
- In another non-exagear shell browse to your “rtl_udp/build/src” directory and run:
./rtl_udp -N -f 416.5875M -g 20 -d 1 -s 15k -l 50 | sox -r 15k -t raw -e s -b 16 -c 1 - -t raw -r 48k -e s -b 16 -c 1 - lowpass 750 vol 5 | aplay -r 48k -f S16_LE -t raw -c 1.
Setting the frequency correctly here is not critical because this will be changed by Unitrunker to the voice frequency. This outputs the audio to your speakers on the Pi 3 (HDMI or Analogue according to what you’ve set – HDMI is default if you have a HDMI monitor plugged in).
- In another non-exagear shell browse to your rtl_udp folder and run “sh unitr_rtludp_tune.sh”.
The shell script should now be using data from the sdrsharptrunking.log file to tune rtl_udp.
There are still some problems with this approach. First it seems that the rtl_fm and rtl_udp instances produce some audio underruns which cause choppy audio. They are not so prevalent as to stop decoding, but may sound slightly annoying. Secondly, the CPU usage with everything running seems to hover at around 75%. After running for a while the Pi 3 generates the thermometer icon on the top right, which indicates that it is close to overheating. A fan or heatsink may be beneficial.
It should also be possible to get this setup to interface with DSD+ for digital P25/DMR etc signals as well (DSD+ works in exagear+wine). But as of yet we haven’t figured out the audio routing for a third program. If anyone gets it working please let us know in the comments. We’ve tried Pulseaudio, but using Pulseaudio seems to crash Unitrunker and prevent it from running.
Another possibility could be using this to stream the voice online to RadioReference, Broadcastify etc.
Of course in the end it might be easier to use SDRTrunk instead, although it seems that many people still prefer Unitrunker.
Other Tested Software
WinSTD-C: We’ve also managed to get the Inmarsat STD-C decoder WinSTD-C running and decoding SafetyNET messages. To do this simply enable the loopback with “sudo modprobe snd-aloop”, then use the standard Osmocom rtl_fm and set the mode to “-m usb”. The latest version of the Osmocom RTL-SDR package even supports the bias tee on our RTL-SDR V3 with the “-T” flag, so it is easy to use an L-band LNA with it.
./rtl_fm -M fm -f 1541.449M -s 6k -g 40 -T | sox -r 6k -t raw -e s -b 16 - -traw -r 48k -e s -b 16 -c 1 - | aplay -r 48k -f S16_LE -t raw -c 1 -D hw:Loopback,0,0
We tried the Windows based Tekmanoid and inmarsat.com STD-C decoders, but were unable to get those running on wine. The Tekmanoid program is Java based, so it should be possible to run that without emulation, but the author has not yet released a Linux version. For now it may also run on Wine, but we have not attempted to install Java on Wine yet.
Below is an image of the WinSTD-C software running on the Pi 3. We used the Outernet active ceramic patch antenna and a V3 dongle with bias tee on. As far as we know, this is the only way to get STD-C decoding operational on a Linux device, let alone Pi 3, since all the apps are written for Windows.
DSDPlus: DSD+ runs well on Exagear + Wine. Again to get going just like in the above examples first enable the loopback with “sudo modprobe snd-aloop”. Then open DSDPlus.exe with “wine DSDPlus.exe” from within an Exagear shell.
Using the Osmocom rtl_fm run the following line in a terminal. Note that here we used the -F flag to get a higher quality audio output. In our case on a DMR signal, running -F 9 seems to be necessary to get audio quality good enough for DSD to decode.
rtl_fm -M fm -f 416.5875M -s 12.5k -g 20 -F 9 | sox -r 12.5k -t raw -e s -b 16 - -traw -r 48k -e s -b 16 -c 1 - | aplay -r 48k -f S16_LE -t raw -c 1 -D hw:Loopback,0,0
WxToIMG: There is actually a Linux version of WxToImg, but it is compiled for the x86 architecture, so normally it cannot be run on ARM devices. But with Exagear it runs, and runs smoothly. We haven’t been able to set the audio pipes up correctly yet, but the GUI and terminal versions run fine with a .wav file input.
MultiPSK: Runs, but is quite slow, and seems to be a bit buggy.
PC-HFDL: Runs well.
Orbitron: Runs well.
SondeMonitor: Runs well.
SDRSharp: Unable to get working. Maybe require some work with installing Mono.
Exagear is available for Android as well, so it’s possible that some of these apps may also run on Android phones and tablets.
It should be possible to use Pulseaudio to create a full digital decoding system with Unitrunker. But currently using Pulseaudio seems to cause Unitrunker to not open.
rtl_fm generates some audio underruns. They only happen every 10-20 seconds though and don’t affect digital decoding much.
If there are any other Windows only or x86 only apps you’d like us to test, please let us know in the comments.