Audio card sampling rate problem

Hi all,

I have been experienting with gnuradio for some time and I have noticed
an annoying problem
with the audio sampling rate: in the scripts from the example directory
it is set to a hard
value of 32ksamples/s. However, my laptop audio card (or its linux
driver) do not support
this speed, only 44100 or 48000. So when updating to scripts from new
gnuradio source it is
always necessary to adapt the values in the scripts. Is there some way
how to ask the alsa
system about supported audio sampling rates from within a python script?
I guess there can
be more users with such limitations and it would be nice if the final
gnuradio applications
would determine the audio rates automatically.

Best regards,


Jiri Pittner wrote:

Use the following option “-O plughw:0.0”

That tells alsa to use its own resampler.


Is there a way or method to calculate (find) the
minimum signal level to input into the ADC?

I mean, if I decide to build or interface a custom RF
board, how much gain should I provide in the analog
path, assuming a 500nV at the antenna terminal?

Thank you,



Luggage? GPS? Comic books?
Check out fitting gifts for grads at Yahoo! Search

I get an error with that:

|jp:/home/jiri/pokusy/gnuradio/examples/python/usrp> ./ -R B -f 98.7e6 -O plughw:0.0

gr_fir_ccf: using SSE
gr_fir_fff: using SSE
gr_fir_fcc: using SSE
ALSA lib pcm_hw.c:1351:(_snd_pcm_hw_open) Invalid value for card
audio_alsa_sink[plughw:0.0]: No such device
Traceback (most recent call last):
File “./”, line 325, in ?
app = stdgui.stdapp (wfm_rx_graph, “USRP WFM RX”)
line 36, in init
wx.App.init (self, redirect=False)
line 7700, in init
line 7352, in _BootstrapApp
return core.PyApp__BootstrapApp(*args, **kwargs)
line 39, in OnInit
frame = stdframe (self.flow_graph_maker, self.title, self._nstatus)
line 60, in init
self.panel = stdpanel (self, self, flow_graph_maker)
line 81, in init
self.fg = flow_graph_maker (frame, self, vbox, sys.argv)
File “./”, line 99, in init
False) # ok_to_block
File “/usr/local/lib/python2.4/site-packages/gnuradio/”,
line 236, in sink
return _audio_alsa.sink(*args)
RuntimeError: audio_alsa_sink

I am using alsa 1.0.14a-r1 and kernel 2.6.21-gentoo.

Jiri Pittner wrote:

I get an error with that:

./ -R B -f 98.7e6 -O plughw:0.0

That was a typo. It should be “-O plughw:0,0”. Note the comma instead of
the period.