[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Discuss-gnuradio] Rewiring the flowgraph

From: Patrick Strasser
Subject: [Discuss-gnuradio] Rewiring the flowgraph
Date: Tue, 13 Jun 2006 14:29:49 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.6) Gecko/20050602 Thunderbird/1.0.2 Mnenhy/


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.disconnect(src, sink)
fg.connect(src, sink)
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.

Engineers motto: cheap, good, fast: choose any two
Patrick Strasser <patrick dot strasser at  tugraz dot at>
Student of Telematik, Techn. University Graz, Austria

reply via email to

[Prev in Thread] Current Thread [Next in Thread]