Hi all,

Does anyone know how to successfully change audio in the middle of execution? I've swapped out other blocks before, so I'm familiar with that.

Actually, I'm changing the guts connected to the audio, using the usual flow graph stop, disconnect, connect blocks. I tried changing the guts without deleting the audio sink and I also tried changing the guts deleting the audio sink like this:


   def swap_sound(self):
       print "test sound change"
       fg.stop()
       fg.disconnect(self.demod_guts_block, self.audio_sink)

# either don't do this, or delete/re-create.. both don't seem to work
       del(self.audio_sink)
       print "Re-Create Audio Sink"
       self.audio_sink = audio.sink(int(self.demod_guts_block.audio_rate))
       print "Audio sink created"
       fg.connect(self.demod_guts_block, self.audio_sink)
fg.start()

What happens, I believe, is that the deconstructor for the alsa audio sink isn't actually releasing the device. When I go to create a "new" audio sink, the creation function hangs there, I assume because it's waiting for the device to finish.

In the case where I do not delete the audio sink and re-create it, it does not allow me to make the connection:

ValueError: <gr_block audio_alsa_sink (6)>::check_topology (1, 0) failed


-jamie




_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio

Reply via email to