Forum: GNU Radio Rewiring the flowgraph

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Patrick Strasser (Guest)
on 2006-06-13 14:34
(Received via mailing list)
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 "<input>", 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 Strasser <patrick dot strasser at  tugraz dot at>
Student of Telematik, Techn. University Graz, Austria
Eric Blossom (Guest)
on 2006-06-13 15:47
(Received via mailing list)
On Tue, Jun 13, 2006 at 02:29:49PM +0200, Patrick Strasser 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 ;)

> 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
This topic is locked and can not be replied to.