Skip to content

Instantly share code, notes, and snippets.

@ozanyurt
Forked from sam210723/gnuradio-wsl2.md
Created February 17, 2023 13:26
Show Gist options
  • Save ozanyurt/7f527ca5803501df5c4a5c82dedccc75 to your computer and use it in GitHub Desktop.
Save ozanyurt/7f527ca5803501df5c4a5c82dedccc75 to your computer and use it in GitHub Desktop.
Install GNU Radio 3.8 in WSL2 (Ubuntu 20.04)

Setup Xming X Server in Windows

Download and install Xming with all default settings. Uncheck "Launch Xming" on the last setup screen.

Start "XLaunch" from the Start Menu and click next until the "Specify parameter settings" screen. Check "No Access Control" then click next, then finish.

Setup GNU Radio

Launch a WSL2 instance and run the following commands:

sudo add-apt-repository ppa:gnuradio/gnuradio-releases
sudo apt-get update
sudo apt-get install gnuradio xterm python3-gi gobject-introspection gir1.2-gtk-3.0

Run GNU Radio Companion

Inside the WSL instance run the following commands to launch GNU Radio Companion. Replace 192.168.1.1 with the IP address of your host Windows PC.

export DISPLAY=192.168.1.1:0.0
gnuradio-companion

Place the export command at the end of ~/.profile to have the DISPLAY environment variable set each time a WSL bash terminal is launched.

printf '\n# Remote X Server\nexport DISPLAY=192.168.1.1:0.0\n' >> ~/.profile

One-liner Launch Command

Run the following command from Command Prompt in Windows to launch GNU Radio Companion without entering the WSL bash terminal. Replace 192.168.1.1 with the IP address of your host Windows PC.

wsl export DISPLAY=192.168.1.1:0.0 ^&^& gnuradio-companion

Install SoapySDR and gr-soapy

sudo apt-get install -y pkg-config swig liborc-0.4-dev soapysdr0.7 soapysdr-tools soapysdr-module-remote python3-soapysdr python3-numpy
git clone https://gitlab.com/librespacefoundation/gr-soapy
cd gr-soapy
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=/usr
make -j
sudo make install
sudo ldconfig

Soapy Source Block

Device Type custom
Device String driver=remote
Arguments remote=192.168.1.1,remote:driver=airspy
Stream Args remote:prot=tcp

VLC Raw UDP Audio

Audio @ 48 kHz -> Float To Short (x128) -> Endian Swap -> UDP Sink (Short)
vlc --demux=rawaud --rawaud-channels=1 --rawaud-samplerate=48000 udp://@:7355

References

https://www.scivision.dev/gnu-radio-companion-windows-subsystem-for-linux/ https://virtualizationreview.com/articles/2017/02/08/graphical-programs-on-windows-subsystem-on-linux.aspx https://wiki.gnuradio.org/index.php/InstallingGR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment