Dear all,
I'm working on a project where I have to connect and disconnect different
streamers from an RFNoC replay block. (I need to switch back and forth between
TX and RX Streamers and 4 Radios in TX/RX mode connected to the Replay block
for using 4x4 MIMO configuration). I'm running on a USRP X410 with UHD 4.2
Here's the setup:
self._graph = uhd.rfnoc.RfnocGraph('addr=localhost')
self._replay =
uhd.rfnoc.ReplayBlockControl(self._graph.get_block("0/Replay#0"))
for channel in range(NUM_CHANS):
self._replay.set_play_type("sc16", channel)
self._replay.set_record_type("sc16", channel)
self._rxStreamer = self._graph.create_rx_streamer(NUM_CHANS,
uhd.usrp.StreamArgs("sc16", "sc16"))
self._txStreamer = self._graph.create_tx_streamer(NUM_CHANS,
uhd.usrp.StreamArgs("sc16", "sc16"))
Here's the connection:
for channel in range(NUM_CHANS):
self._graph.connect(self._replay.get_unique_id(), channel,
self._rxStreamer, channel)
self._graph.commit()
Then, when I want to disconnect:
self._graph.release()
print("DISCONNECTING!")
try:
for port in range(NUM_CHANS):
self._graph.disconnect("0/RxStreamer#0", port)
self._graph.disconnect("0/RxStreamer#0")
except Exception as E:
print(E, type(E))
for conn in self._graph.enumerate_active_connections():
print("Disconnecting ", conn, "...")
try:
self._graph.disconnect(conn.src_blockid, conn.src_port,
conn.dst_blockid, conn.dst_port)
except Exception as E:
print("Cannot disconnect ", E)
self._graph.commit()
The connection works well, but upon disconnection I get
DISCONNECTING!
Disconnecting 0/Radio#0:0-->0/Replay#0:0 ...
Disconnecting 0/Radio#0:1-->0/Replay#0:1 ...
Disconnecting 0/Radio#1:0-->0/Replay#0:2 ...
Disconnecting 0/Radio#1:1-->0/Replay#0:3 ...
Disconnecting 0/Replay#0:0-->RxStreamer#0:0 ...
Cannot disconnect LookupError: Cannot disconnect blocks, destination block not
found: 0/RxStreamer#0
Disconnecting 0/Replay#0:1-->RxStreamer#0:1 ...
Cannot disconnect LookupError: Cannot disconnect blocks, destination block not
found: 0/RxStreamer#0
Disconnecting 0/Replay#0:2-->RxStreamer#0:2 ...
Cannot disconnect LookupError: Cannot disconnect blocks, destination block not
found: 0/RxStreamer#0
Disconnecting 0/Replay#0:3-->RxStreamer#0:3 ...
Cannot disconnect LookupError: Cannot disconnect blocks, destination block not
found: 0/RxStreamer#0
To me, this indicates that the calls to disconnect("0/RxStreamer#0") have no
effect (they have no return value as well).
Then, if I just ignore these errors and try to reconnect the streamer, I get
RuntimeError: RuntimeError: Streamer port number is already connected to a port
indicating that the streamer has not been disconnected. Can you let me know,
what the correct way is to disconnect the streamer from the graph and open up
the port for subsequent connections?
Thank you,
Max
Please find attached a MWE which shows the problems, with the following outputs
$ python3 disconnect.py
[INFO] [UHD] linux; GNU C++ version 9.2.0; Boost_107100; UHD_4.2.0.0-0-g46a70d85
[INFO] [MPMD] Initializing 1 device(s) in parallel with args:
mgmt_addr=127.0.0.1,type=x4xx,product=x410,serial=323F754,name=NE-LAB-X410-01,fpga=X4_400,claimed=False,addr=localhost
[INFO] [MPM.PeriphManager] init() called with device args
`fpga=X4_400,mgmt_addr=127.0.0.1,name=NE-LAB-X410-01,product=x410,clock_source=internal,time_source=internal'.
DISCONNECTING!
['__class__', '__delattr__', '__dir__', '__doc__', '__eq__', '__format__',
'__ge__', '__getattribute__', '__gt__', '__hash__', '__init__',
'__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__',
'__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__',
'__str__', '__subclasshook__', 'get_max_num_samps', 'get_num_channels',
'issue_stream_cmd', 'recv']
[WARNING] [0/Replay#0] Requested packet size exceeds MTU! Coercing to 8016
[WARNING] [0/Replay#0] Requested packet size exceeds MTU! Coercing to 8016
[WARNING] [0/Replay#0] Requested packet size exceeds MTU! Coercing to 8016
[WARNING] [0/Replay#0] Requested packet size exceeds MTU! Coercing to 8016
DISCONNECTING!
['__class__', '__delattr__', '__dir__', '__doc__', '__eq__', '__format__',
'__ge__', '__getattribute__', '__gt__', '__hash__', '__init__',
'__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__',
'__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__',
'__str__', '__subclasshook__', 'get_max_num_samps', 'get_num_channels',
'issue_stream_cmd', 'recv']
Disconnecting 0/Replay#0:0-->RxStreamer#0:0 ...
Cannot disconnect LookupError: Cannot disconnect blocks, destination block not
found: 0/RxStreamer#0
Disconnecting 0/Replay#0:1-->RxStreamer#0:1 ...
Cannot disconnect LookupError: Cannot disconnect blocks, destination block not
found: 0/RxStreamer#0
Disconnecting 0/Replay#0:2-->RxStreamer#0:2 ...
Cannot disconnect LookupError: Cannot disconnect blocks, destination block not
found: 0/RxStreamer#0
Disconnecting 0/Replay#0:3-->RxStreamer#0:3 ...
Cannot disconnect LookupError: Cannot disconnect blocks, destination block not
found: 0/RxStreamer#0
Releasing graph...
Traceback (most recent call last):
File "disconnect.py", line 81, in <module>
main()
File "disconnect.py", line 67, in main
app.connectForDownload()
File "disconnect.py", line 54, in connectForDownload
self._graph.connect(self._replay.get_unique_id(), channel,
self._rxStreamer, channel)
RuntimeError: RuntimeError: Streamer port number is already connected to a port
Maximilian Matthe
Head of Engineering Lab
[email protected]
Tel.: +49 173 4509667
Barkhausen Institut
www.barkhauseninstitut.org
Barkhausen Institut gGmbH | Sitz: Würzburger Straße 46, 01187 Dresden, Germany
| Registergericht: Amtsgericht Dresden, HRB 37267 | Geschäftsführer: Prof. Dr.
Gerhard Fettweis, Dr. Tim Hentschel | Vorsitzender der
Gesellschafterdelegation: Dr. Andreas Handschuh
Hinweise zum Datenschutz und zur Verarbeitung Ihrer Daten finden Sie unter:
https://barkhauseninstitut.org/data-privacy
This email and any attachments are intended only for the person to whom this
email is addressed and may contain confidential and/or privileged information.
If you received this email in error, please do not disclose the contents to
anyone, but notify the sender by return email and delete this email (and any
attachments) from your system. Information on data protection and processing of
your personal information: https://barkhauseninstitut.org/data-privacy
import uhd
import time
import numpy as np
NUM_CHANS = 4
NUM_SAMPLES = 2**16
class GraphApp:
def __init__(self):
self._graph = uhd.rfnoc.RfnocGraph('addr=localhost')
self._replay =
uhd.rfnoc.ReplayBlockControl(self._graph.get_block("0/Replay#0"))
for channel in range(NUM_CHANS):
self._replay.set_play_type("sc16", channel)
self._replay.set_record_type("sc16", channel)
self._rxStreamer = self._graph.create_rx_streamer(NUM_CHANS,
uhd.usrp.StreamArgs("sc16", "sc16"))
self._txStreamer = self._graph.create_tx_streamer(NUM_CHANS,
uhd.usrp.StreamArgs("sc16", "sc16"))
self._graph.commit()
def __del__(self):
self._graph.release()
def _disconnectAll(self):
print("DISCONNECTING!")
try:
print(dir(self._rxStreamer))
for port in range(NUM_CHANS):
self._graph.disconnect("0/RxStreamer#0", port)
self._graph.disconnect("0/RxStreamer#0")
except Exception as E:
print(E, type(E))
try:
for port in range(NUM_CHANS):
self._graph.disconnect("0/TxStreamer#0", port)
self._graph.disconnect("0/TxStreamer#0")
except RuntimeError as E:
print(E, type(E))
for conn in self._graph.enumerate_active_connections():
print("Disconnecting ", conn, "...")
try:
self._graph.disconnect(conn.src_blockid, conn.src_port,
conn.dst_blockid, conn.dst_port)
except Exception as E:
print("Cannot disconnect ", E)
def connectForDownload(self):
self._graph.release()
self._disconnectAll()
for channel in range(NUM_CHANS):
self._graph.connect(self._replay.get_unique_id(), channel,
self._rxStreamer, channel)
self._graph.commit()
def doStream(self):
pass
def main():
app = GraphApp()
try:
for _ in range(10):
app.connectForDownload()
app.doStream()
finally:
print("Releasing graph...")
del app
if __name__ == '__main__':
main()
_______________________________________________
USRP-users mailing list -- [email protected]
To unsubscribe send an email to [email protected]