[Discuss-gnuradio] switching between two flow-graphs / controlling two f
From:
niaz ahmed
Subject:
[Discuss-gnuradio] switching between two flow-graphs / controlling two flow-graphs
Date:
Fri, 29 Jul 2011 12:47:51 +0000
Hi,
I am working on an application ( half duplex communication ) where i have two flow graphs receiver and transmitter. the scenario is that the receiver should always be running but when the application require to send something the receiver flow-graph should be stopped at that time. the reason for the receiver flow-graph to be stopped is obvious that it should not receive the data it is sending. i am using laptop sound card (not usrp).
i am trying to stop the receiver and start it once the transmitter queue becomes empty but i am getting the following error when i restart the graph
audio_alsa_source[plughw:0,0]: snd_pcm_hw_params failed: File descriptor in bad state
while True: message = raw_input("Enter a message to transmit (Ctrl-D to exit): ")
fg1.stop() #here i am stopping the receiver graph # # here i am making pkt from the message # fg.src.msgq().insert_tail(pkt)
if fg.src.msgq().empty_p(): fg1.start()
“We
are always more anxious to be distinguished for a talent which we do
not possess, than to be praised for the fifteen which we do possess” : Mark Twain