Monday, October 6, 2014

[Discuss-gnuradio] Windows audio-in and compilation issues

Dear list,

I'm having lots of problems getting Gnuradio to work in Windows to process signals from a soundcard audio source. Please help! This is what I've tried so far:

1. Pre-built binaries ==> Audio source not working.

I followed the instructions in the WindowsInstall [1] wiki and Bhaskar11's guide. The installation process was smooth, except that some of the recommended versions were no longer available, so I opted to pick the following replacements from the UCI repository so that I could get consistent compiler and matching library versions:
numpy‑MKL‑1.8.2.win32‑py2.7.exe
PyQt4‑4.10.4‑gpl‑Py2.7‑Qt4.8.6‑x32.exe
PyQwt‑5.2.1‑py2.7‑x32‑pyqt4.10.4‑numpy1.8.1.exe
PyOpenGL‑3.1.0.win32‑py2.7.exe

I tried both the recommended stable 3.6.4.1 and the latest-stable 3.7.2.2 gnuradio binaries built by Ettus. GRC itself seems to work (without WX widgets in 3.7). However, I was unable to get the audio source working in both. Then I found bug #521 [3], which seems to indicate that the gr-audio windows source block does not work at this time.

Is there any workaround to get streaming audio sources to work? Eg, an external virtual audio cable that writes to a wav file or memory buffer that gnuradio can do streaming reads from?

2. Compile in Cygwin ==> compilation problems

According to the WindowsTips wiki [4], the only working audio sources for Windows are OSS audio and !PortAudio. OSS audio is only available in cygwin, while PortAudio is 'easy' in cygwin, so I tried this approach by following the CygwinInstallMain wiki [5]. This was a clean cygwin installation with the latest packages as of last week:

cmake 2.8.9-2
cppunit 1.12.1-2 (1.12.0-1 is not available, and hopefully the incompatabilities with 1.12.1 are fixed)
gcc-g++ 4.8.3-3 (3.4.4 is not available, and hopefully the incompatabilities with 4.3.4 are fixed)
python 2.7.8-1 (2.6 is not available)
libusb1.0 1.0.19-1 (libusb-win32 is not available)

The wiki advised to compile three libraries manually.

a. Boost => updates to instructions

The WindowsTips wiki [6] says that boost 1.35 or later is required, and must be compiled as the cygwin binaries are too old or used mismatching compilers. This may not longer be necessary: cygwin packages currently list boost 1.50 and 1.53, and libboost-devel is at 1.55. I didn't seem to experience any subsequent boost-related compilation issues using the pre-built binaries, but decided to try a custom build anyway just in case.

[6] recommended to build with 1.45, but boost threads in this version doesn't work after gcc 4.7 [7]. So I went with the latest boost 1.56. This built fine, but I included additional libraries based on other gnuradio+boost instructions, ie.
./bootstrap.sh --with-libraries=thread,date_time,program_options,filesystem,system,test

b. wxPython => compilation issues

I followed the instructions from the WxPythonCygwin wiki [8] and downloaded the 3.0.1.1 src. Not sure if the recommended patches are still required, as I got lots of warnings about redefining wxUSE_DATEPICKCTRL_GENERIC. I ran into the conflict between winsock.h and select.h's select. The suggestion to rename select.h didn't help, and I got other errors instead. I found a tip on another website about editing the winsock.h definition to match select.h's definition, and found that the winsock.h definition is actually wrapped within an ifndef like so:

#ifndef __INSIDE_CYGWIN__
WINSOCK_API_LINKAGE int WSAAPI select(int nfds,fd_set *readfds,fd_set *writefds,fd_set *exceptfds,struct PTIMEVAL *timeout);

No comments:

Post a Comment