bladeRF icon indicating copy to clipboard operation
bladeRF copied to clipboard

Hit stall for buffer error occurs while reading RX1 continuously

Open SerjSSL opened this issue 2 years ago • 0 comments

Hi. I am using BladeRF via Python but each time I try reading RX1 continuously I get this error after some time spent:

[ERROR @ host/libraries/libbladeRF/src/backend/usb/libusb.c:1071] Hit stall for buffer 000001AB9DF003E0

Here is a code I am using to get the RX data (self.rx_samples_num = 2048):

    self.device.sync_config(layout         = _bladerf.ChannelLayout.RX_X1,
                       fmt            = _bladerf.Format.SC16_Q11,
                       num_buffers    = 2,
                       buffer_size    = 2048,
                       num_transfers  = 1,
                       stream_timeout = 3500)

    # Enable module
    self.postMessage( "RX: Start" )
    self.rx_ch.enable = True

    # Get the samples
    num = self.rx_samples_num
    while _thread.isRunning():
        # Read into buffer
        time.sleep(0.04)
        self.lock.acquire()
        try:
            self.device.sync_rx(self.rx_buf, num)
        except _bladerf.BladeRFError:
            self.postMessage( "RX error.")
        self.lock.release()
        
        # Draw the data
        if self._drawn:
            _thread._draw_signal.update.emit()
            self._drawn = False

    # Disable module
    self.postMessage( "RX: Stop" )
    self.rx_ch.enable = False
    self.rx_ch = None

This code is being executed by a separate thread.

IMPORTANT: The error occurs not instantly but some time after start. It disables the device and "try: except" section does not help in catching of it.

SerjSSL avatar Apr 15 '22 11:04 SerjSSL