I've been working with the gr-gsm code which obtains the Cell-ID using and RTL-SDR. I was trying to understand the source code and I've been planning to make an application which is continuous scanning, based on the wideband-scanner and do-scan functions.
Nevertheless, I was not successful when I tried to execute the do_scan function within a loop, because at the second loop scanning the full band the program stops with this error:
Scanning @ 955.8 / 959.0 MHzgr-osmosdr 0.2.0.0 (0.2.0) gnuradio 3.8.1.0
built-in source types: file osmosdr fcd rtl rtl_tcp uhd miri hackrf bladerf rfspace airspy airspyhf soapy redpitaya freesrp
Using device #0 Realtek RTL2838UHIDIR SN: 00000001
Found Rafael Micro R820T tuner
[R82XX] PLL not locked!
Exact sample rate is: 2000000,052982 Hz
[R82XX] PLL not locked!
gr::vmcircbuf_sysv_shm: shmget (2): No queda espacio en el dispositivo
gr::vmcircbuf_sysv_shm: shmget (2): No queda espacio en el dispositivo
gr::vmcircbuf_sysv_shm: shmget (2): No queda espacio en el dispositivo
gr::buffer::allocate_buffer: failed to allocate buffer of size 64 KB
gr::vmcircbuf_sysv_shm: shmget (2): No queda espacio en el dispositivo
gr::vmcircbuf_sysv_shm: shmget (2): No queda espacio en el dispositivo
gr::vmcircbuf_sysv_shm: shmget (2): No queda espacio en el dispositivo
gr::buffer::allocate_buffer: failed to allocate buffer of size 64 KB
Traceback (most recent call last):
[...] File "/usr/lib/python3/dist-packages/gnuradio/gr/top_block.py", line 111, in start
top_block_start_unlocked(self._impl, max_noutput_items)
File "/usr/lib/python3/dist-packages/gnuradio/gr/runtime_swig.py", line 4832, in top_block_start_unlocked
return _runtime_swig.top_block_start_unlocked(r, max_noutput_items)
RuntimeError: std::bad_alloc
The application can do a complete band scan only once and a half before stopping.
I understand that the problem is the memory reservation done by GNURadio, but I don't know how to solve or alleviate it. I'm executing this code in my computer (MSI i7 Ubuntu Focal Fossa) and I prefer to optimize the code before changing hardware parameters, because I plan to repeat the band scanning at least 30 times.
Thank you very much in advance.