discuss-gnuradio
[Top][All Lists]
Advanced

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

RE: Error "gr::vmcircbuf_sysv_shm: shmget (1): No space left on device"


From: zhang.weit3
Subject: RE: Error "gr::vmcircbuf_sysv_shm: shmget (1): No space left on device"
Date: Fri, 2 Apr 2021 12:27:10 -0500

Hi,

Thank you for your suggestion. I think "lock()" may not work in my case.

Below is the script I was using. My goal is to use the B210 USRP that will take 
the transmitting and receiving measurement every one sec. Currently, I could 
not think about any other way to avoid creating the same flowchart multiple 
times. 

I also tried put "tb = top_block_cls()" outside the while-loop, where the 
transmitter will work for the first loop but will never be turned on 
afterwards. Note that the receiver can always receive every one sec.

Thank you!
Weite

##################################################
from gnuradio import blocks
from gnuradio import eng_notation
from gnuradio import gr
from gnuradio import uhd
from gnuradio.eng_option import eng_option
from gnuradio.filter import firdes
from optparse import OptionParser
import pmt
import time

class top_block(gr.top_block):

    def __init__(self):
        gr.top_block.__init__(self, "Top Block")

        ##################################################
        # Variables
        ##################################################
        self.tx_gain = tx_gain = 40
        self.samp_rate = samp_rate = 1e6
        self.rx_gain = rx_gain = 40
        self.freq = freq = 2.45e9

        ##################################################
        # Blocks
        ##################################################
        self.uhd_usrp_source_0 = uhd.usrp_source(
            ",".join(("", "")),
            uhd.stream_args(
                cpu_format="sc16",
                channels=range(1),
            ),
        )
        self.uhd_usrp_source_0.set_samp_rate(samp_rate)
        self.uhd_usrp_source_0.set_center_freq(freq, 0)
        self.uhd_usrp_source_0.set_gain(rx_gain, 0)
        self.uhd_usrp_source_0.set_antenna('RX2', 0)
        self.uhd_usrp_sink_0 = uhd.usrp_sink(
            ",".join(("serial=31ECE7A", "")),
            uhd.stream_args(
                cpu_format="fc32",
                channels=range(1),
            ),
        )
        self.uhd_usrp_sink_0.set_clock_source('internal', 0)
        self.uhd_usrp_sink_0.set_subdev_spec('A:A', 0)
        self.uhd_usrp_sink_0.set_samp_rate(samp_rate)
        self.uhd_usrp_sink_0.set_center_freq(freq, 0)
        self.uhd_usrp_sink_0.set_gain(tx_gain, 0)
        self.uhd_usrp_sink_0.set_antenna('TX/RX', 0)

        self.blocks_head_1 = blocks.head(gr.sizeof_float*1, 5000)
        self.blocks_float_to_complex_0 = blocks.float_to_complex(1)
        self.blocks_file_source_0_0 = blocks.file_source(gr.sizeof_float*1, 
'/home/sica/tx_raw_data_imag.bin', False)
        self.blocks_file_source_0 = blocks.file_source(gr.sizeof_float*1, 
'/home/sica/tx_raw_data_real.bin', False)
        self.blocks_file_sink_1_0 = blocks.file_sink(gr.sizeof_float*1, 
'/home/sica/rx_raw_data.bin', False)
        self.blocks_file_sink_1_0.set_unbuffered(False)


        ##################################################
        # Connections
        ##################################################
        self.connect((self.blocks_file_source_0, 0), 
(self.blocks_float_to_complex_0, 0))
        self.connect((self.blocks_file_source_0_0, 0), 
(self.blocks_float_to_complex_0, 1))

        self.connect((self.blocks_float_to_complex_0, 0), 
(self.uhd_usrp_sink_0, 0))
        self.connect((self.blocks_head_1, 0), (self.blocks_file_sink_1_0, 0))
        self.connect((self.uhd_usrp_source_0, 0), (self.blocks_head_1, 0))

def main(top_block_cls=top_block, options=None):

    while True:
        tb = top_block_cls()
        tb.start()
        tb.wait()
        time.sleep(1.0)
        del tb

if __name__ == '__main__':
    main()

-----Original Message-----
From: Discuss-gnuradio <discuss-gnuradio-bounces+zhang.weit3=gmail.com@gnu.org> 
On Behalf Of Daniel Estévez
Sent: Wed, March , 2021 3:56 PM
To: discuss-gnuradio@gnu.org
Subject: Re: Error "gr::vmcircbuf_sysv_shm: shmget (1): No space left on device"

El 31/3/21 a las 15:19, Marcus Müller escribió:

> What is it that you
> want to achieve?

Hi,

This question from Marcus is key here. Something that is possible is to
.lock() and .unlock() a flowgraph (basically pause and resume) in order to 
change something about it. You can change block connections and even destroy 
some blocks or add new ones. More info:

https://wiki.gnuradio.org/index.php/Handling_Flowgraphs#Reconfiguring_Flowgraphs

Without knowing what you want to do is difficult to guess, but maybe this might 
fit better your use case and is not as drastic as destroying and creating again 
the whole flowgraph?

Best,

Dani.





reply via email to

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