Rewiring the flowgraph


#1

Hello!

I tried to rewire a flwograph, but with no success:

from gnuradio import gr, audio
fg =gr.flow_graph()
src = gr.sig_source_f(48000, gr.GR_SIN_WAVE, 440, 1)
sink = audio.sink(48000)
fg.connect(src, sink)
fg.start()
fg.stop()
fg.disconnect(src, sink)
fg.connect(src, sink)
fg.start()
Traceback (most recent call last):
File “”, line 1, in ?
File
“/usr/local/lib/python2.3/site-packages/gnuradio/gr/flow_graph.py”, line
88, in start
self._setup_connections ()
File
“/usr/local/lib/python2.3/site-packages/gnuradio/gr/flow_graph.py”, line
117, in _setup_connections
self.validate ()
File
“/usr/local/lib/python2.3/site-packages/gnuradio/gr/basic_flow_graph.py”,
line 165, in validate
raise ValueError, ("%s::check_topology (%d, %d) failed" % (m,
ninputs, noutputs))
ValueError: <gr_block audio_alsa_sink (1)>::check_topology (1, 0) failed

Is it possible to do something like this? I guess fg.disconnect is meant
to enable some new connections to another block, but I’ve has no success
until now.

I’d like to change the flowgraph to enable or disable different
branches, say FM or AM decoding, on the fly. Another use would be to
record some signal and in parallel listen to what you record. Instead of
muting the sound, disconnect it and listen to your favourite music
instead.

Patrick

Engineers motto: cheap, good, fast: choose any two
Patrick S.
Student of Telematik, Techn. University Graz, Austria


#2

On Tue, Jun 13, 2006 at 02:29:49PM +0200, Patrick S. wrote:

fg.stop()
“/usr/local/lib/python2.3/site-packages/gnuradio/gr/flow_graph.py”, line
to enable some new connections to another block, but I’ve has no success
until now.

It should work. I think this may be a problem in the ALSA sink
implementation. There are a couple of FIXME’s in there :wink:

I’d like to change the flowgraph to enable or disable different
branches, say FM or AM decoding, on the fly. Another use would be to
record some signal and in parallel listen to what you record. Instead of
muting the sound, disconnect it and listen to your favourite music instead.

It should be possible. Let me know how it goes.

Patrick

Eric