In this series:

In Part 1 of this blog series, we looked at how Nutaq’s rapid prototyping platforms include software tools like the Board Support Development Kit (BSDK) to simplify the integration of FGPA mezzanine cards (FMCs) and implement specific FPGA functionalities.

The BSDK includes sample applications that demonstrate the BSDK’s application programming interfaces (APIs). In Part 1, we examined a Windows-based C/C++ application included in Nutaq’s OFDM reference design that streams raw HD video data. The application mimics the functions of the upper layers on a PC in order to demonstrate real-time data exchange over the PHY Rx and Tx paths. We then created a make file and build script for compiling the application under Linux.

In this blog post, I demonstrate the portability of C/C++ applications developed with Nutaq’s API by porting the C code for the HD video application to Linux (Fedora).

Porting the C code to Linux

To start, I copied over the C files from the Windows OFDM project: I copied the Windows OFDM project to the Linux folder tree and renamed “host” to “host_win” to avoid possible confusion.
 

Figure 1:  Source code copied over from the Windows OFDM project

Looking at the source code, I could see that the main entry point was defined in “adp_radio420x_ofdm.c“. InitRadio420x(), iGetConnectionPeerMacAddr(), RTDExOpenEth(), RTDExStart(), RTDExSend()– most of the functions invoked in this program were from Nutaq API libraries already in the new make file; they would compile and link without any problems. Then, adp_radio420x_ofdm.c and radio420x_settings.c required minor modifications to compile under Linux. Precompiler instructions such as #ifdef __linux__ and #typedef were used where function names or types differed in Linux from Windows. ‘

In some cases, I could refer back to code from the Radio420X, which is cross-platform in the first place. Using this approach, I could reuse the implementation of generic functions such as _getch() and _kbhit() which are absent from the Windows OFDM version as they are part of the Windows C run-time library.

Figure 2:  Generic function copied over from the Radio420 project

Building and running the application in Linux

After about an hour of work, the code was ready to compile and the executable was built by invoking the build script with the “./build_demo.sh” command.

Figure 3:  Building the executable

With the PicoSDR power switch in the ON position and the FPGA bit file pre-loaded, all that was left to do was to launch the application. I invoked the launch script with “sudo ./Launch_radio420m_ofdm.sh”. Root privileges are required by the RTDEx libraries to obtain the MAC address of the Perseus601X, which is necessary for streaming.

When the application is launched, the Radio420X is configured and calibrated for MIMO wireless transmission at a specified frequency (in this case 453 MHz). Bytes of raw HD video are read from a local file and the data flows between the PC and the FPGA using the RTDEx libraries from the C/C++ API (see Part 1 of this series for the Tx and Rx paths). The VLC media player is used to capture the received video feed so that the quality of the data transmitted and received can be observed.
 

Figure 4: Observing the quality of the data transfer in VLC

Figure 4: Observing the quality of the data transfer in VLC

Conclusion

Wireless HD video streaming using the FPGA PHY from Nutaq’s 2×2 MIMO OFDM reference design with QAM-64 modulation can now be enjoyed in Linux. By doing so, this blog series demonstrated the ease-of-use and portability of a C/C++ application developed with the Nutaq API, part of Nutaq's BSDK for PicoSDR platform.