Project

General

Profile

Bug #3340

osmo-trx-lms doesn't exit nor recover if device is unplugged

Added by laforge almost 3 years ago. Updated over 2 years ago.

Status:
Resolved
Priority:
High
Assignee:
Category:
LimeSDR
Target version:
-
Start date:
06/13/2018
Due date:
% Done:

100%

Spec Reference:

Description

Especially with USB based devices, it's not completely unlikely that once upon a time there is a bus reset or some other event that makes the device disappear.

The current behavior of osmo-trx-lms is to start spewing error messages, but it will not terminate, nor will it recover after the USB device is re-attached.

Wed Jun 13 15:34:30 2018 DMAIN <0000> LMSDevice.cpp:509 [tid=140361119426304] LMS: Device receive timed out
Wed Jun 13 15:34:30 2018 DMAIN <0000> radioInterface.cpp:319 [tid=140361119426304] Receive error 340
Wed Jun 13 15:34:30 2018 DMAIN <0000> LMSDevice.cpp:507 [tid=140361119426304] chan 0 recv buffer of len 0 expect dc7d50 got 0 (0) diff=ffffffffff2382b0
Wed Jun 13 15:34:30 2018 DMAIN <0000> LMSDevice.cpp:509 [tid=140361119426304] LMS: Device receive timed out
Wed Jun 13 15:34:30 2018 DMAIN <0000> radioInterface.cpp:319 [tid=140361119426304] Receive error 0
Wed Jun 13 15:34:30 2018 DMAIN <0000> LMSDevice.cpp:507 [tid=140361119426304] chan 0 recv buffer of len 0 expect dc7d50 got 0 (0) diff=ffffffffff2382b0
Wed Jun 13 15:34:30 2018 DMAIN <0000> LMSDevice.cpp:509 [tid=140361119426304] LMS: Device receive timed out
Wed Jun 13 15:34:30 2018 DMAIN <0000> radioInterface.cpp:319 [tid=140361119426304] Receive error 0
Wed Jun 13 15:34:30 2018 DMAIN <0000> LMSDevice.cpp:507 [tid=140361119426304] chan 0 recv buffer of len 0 expect dc7d50 got 0 (0) diff=ffffffffff2382b0

I think the easiest would be to exit the program and have systemd respawn it, like we do with other osmocom programs


Related issues

Related to OsmoTRX - Feature #2919: Native LimeSDR supportResolved02/09/2018

Associated revisions

Revision 49ad7590 (diff)
Added by pespin over 2 years ago

lms: Return error on device read timeout

If LImeSDR device is unplugged or its fw crashes during operation,
reading from the device will fail and will first receive short reads and
finally 0 byte reads. Let's quickly notify these events to upper layers
instead of trying to process the buffer and checking timestamps for
something we know it's already not useful.

Related: OS#3340
Change-Id: Ib1af8cdd6cdadf581b039882add4049eea45a0f7

History

#1 Updated by laforge almost 3 years ago

#2 Updated by laforge over 2 years ago

  • Priority changed from Normal to High

#3 Updated by pespin over 2 years ago

  • Description updated (diff)

#4 Updated by pespin over 2 years ago

Improved the situation with following patches:

remote: https://gerrit.osmocom.org/#/c/osmo-trx/+/10739 Logger: Disable pthread cancel point inside Logger destructor
remote: https://gerrit.osmocom.org/#/c/osmo-trx/+/10740 cosmetic: Fix trailing whitespace
remote: https://gerrit.osmocom.org/#/c/osmo-trx/+/10741 radioInterface: forward errors from RadioDevice to Transceiver in recv path
remote: https://gerrit.osmocom.org/#/c/osmo-trx/+/10742 lms: Return error on device read timeout
remote: https://gerrit.osmocom.org/#/c/osmo-trx/+/10743 osmo-trx: Add osmo_signal to stop whole transceiver chain correctly on error
remote: https://gerrit.osmocom.org/#/c/osmo-trx/+/10744 radioInterface: Fix variable storing integer return value

So after those patches are applied, when I disconnect the usb plug of the device it will signal that the device is failing and osmo-trx will destroy the transceiver object (and all the other objects behind it) and once it's done, it will end the process.

#5 Updated by pespin over 2 years ago

  • Status changed from New to Feedback
  • % Done changed from 0 to 90

#6 Updated by pespin over 2 years ago

  • Status changed from Feedback to Resolved
  • % Done changed from 90 to 100

Merged, closing.

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)