Audio on Mac OS X - status and workarounds


While working on the Mac OS X app bundle for Gqrx 2.2, (available here, I encountered several issues with the OS X
audio support in gnuradio. These are my notes and how I worked around

My setup consists of Mac OS X 10.7, UHD and gnuradio-devel installed
via macports with minimal python et al. (only interested in C++ for
gqrx). rtl-sdr, hackrf, gr-fcdproplus, osmosdr and gr-osmosdr
installed separately from source.

Using the Qt4 package installed via macports I could readily build
gqrx, which was a huge step forward compared to my previous attempts.
This allowed me to check functionality using USRP, rtlssdr and hackrf.

Then I moved on to trying the Funcube Dongle Pro and Pro+ devices
which, as you may know, look like audio input devices. The Pro comes
with 96 ksps the Pro+ with 192 ksps. Anyway, this is where things
started to behave strange.

First the audio sink seems to work in the sense that I could get
stable 48 kHz audio out through the default device selected in the
system preferences. I did not try to change sample rate or output
device from within the application, but I suspect the audio sink has
the same shortcomings as the source (see below).

Next step was to try to get input from the Funcube Dongle, i.e. using
the osx-audio source. This is where things got weird in that (1) I
could not select audio input device from within the application; the
source was always reading from the default input source and (2) even
when I selected the FCD as input source the sample rate was limited to
96 kHz even for the Pro+. Finally, the input source was not working at
all. Every time I started the application it would read samples for a
few seconds then the data would “go through the roof” as illustrated
on this screen capture:

This behavior happened with all available input devices.

Before giving up I noticed that Michael also included the portaudio
backend in the gnuradio-devel package. I gave that a try and suddenly
everything was working perfectly! As a bonus, portaudio has a very
simple API that I could use to enumerate available audio devices and
implement device discovery for the Funcube Dongle on OS X.

So, if you have problems with gnuradio-audio on Mac OS X, try
switching to the portaudio backend.