Hello,
I’m starting to play around with gnuradio and the USRP1. I have the
RFX400 daughterboard but only one antenna. I used the examples
usrp_wfm_rcv.py and usrp_nbfm_rcv.py for testing and it worked (I only
had to change the center frequencies for the use with the FRX400). For
emitting I used gnuradio-companion and the WBFM transmit block that also
worked fine. Now, I’m trying to set up a transceiver that uses for both
the receive and emit path the TX/RX antenna of the RFX400. I made a
first (simple) flowgraph using different classes for the Rx and Tx paths
(classes copied from working grc flowgraphs). I used the same parameters
than for the receiver and emitter alone but I set the transmit parameter
of the USRP sink to Auto T/R. Now, my plan is to remain in the reception
mode all the time and to switch to transmission mode only if I want to
speak. In order to do this, I added this code to my python script:
if name == ‘main’:
parser = OptionParser(option_class=eng_option, usage="%prog:
[options]")
(options, args) = parser.parse_args()
tr = usrp_wbfm_receive_nogui()
tt = usrp_wbfm_emit_rfx400()
while 1:
tr.start()
raw_input('Press Enter to emit: ')
tr.stop()
tt.start()
raw_input('Press Enter to stop emitting ')
tt.stop()
And both the reception and transmission seem to work in first place. But
if I press Enter the second time, I get this error message:
RuntimeError: top_block::start: top block already running or wait() not
called after previous stop()
Assuming that it’s impossible to restart a block after stopping it
without executing the wait() call, I added tr.wait() and tt.wait() after
the respective stop calls. But then I get another error message:
audio_alsa_sink[plughw:0,0]: snd_pcm_hw_params failed: File descriptor
in bad state
RuntimeError: check topology failed on audio_alsa_sink(1) using
ninputs=1, noutputs=0
It seems to be linked to the fact that the alsa driver won’t switch back
to it’s receive config after the transmission. Is there a possibility to
make my script work or am I doing it all the wrong way?
Thanks for your help
Mirko
PS: I’ve joined the complete code to show the context of my script