Bug 1356 - LIBUSB_ERROR_TIMEOUT and segfault when using Siglent SDS1104X-E over usb
Summary: LIBUSB_ERROR_TIMEOUT and segfault when using Siglent SDS1104X-E over usb
Status: IN_PROGRESS
Alias: None
Product: libsigrok
Classification: Unclassified
Component: Common: SCPI handling code (show other bugs)
Version: unreleased development snapshot
Hardware: All All
: Normal normal
Target Milestone: ---
Assignee: voneiden
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-02-02 15:03 CET by yannik
Modified: 2023-07-05 14:44 CEST (History)
3 users (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description yannik 2019-02-02 15:03:16 CET
Hello,

I'm trying to use a Siglent SDS1104X-E (latest firmware 8.1.6.1.26) attached over usb, however `sigrok-cli --scan` throws an error and segfaults:

$ sigrok-cli --scan
sr: scpi_usbtmc: USBTMC bulk in transfer error: LIBUSB_ERROR_TIMEOUT.
Segmentation fault (core dumped)

This is my lsusb output:
Bus 003 Device 026: ID f4ec:ee38 Atten Electronics / Siglent Technologies Digital Storage Oscilloscope
Comment 1 Andy 2020-10-15 11:35:43 CEST
I have exactly the same issue:
Lots of problems with Pulse view and Siglent SDS1104X-E and latest Firmware 6.1.35R2

I have run Nightly and stable versions on a variety of platforms. Windows 10, Mac Mojave and Catalina, none of which are working properly and mostly just crashing.

PULSE VIEW ON MOJAVE AND CATALINA
- Latest nightly build of simply crashes when you try and select any driver in the device list.
- The Stable build 0.4.2 gets further but doesn't show a trace via USB connection. 
 With network connection it records 20ms of trace and then crashes.  "See Problem report #1" below.


PULSE VIEW ON WINDOWS10
- using WinUSB (v6.1.7600.16385) drive installed via Zadig.exe
- Stable release & Latest nightly build
  - runs and doesn't crash but doesn't show any traces and reports both
    - "sr: scpi_usbtmc: USBTMC invalid bulk in header."
    - "scpi_usbtmc: USBTMC bulk in transfer error: LIBUSB_ERROR_TIMEOUT." error in logging. See Problem report #2 below
  - could not get network interface to work.  Device was not recognised though I could browse on IE to the devices hosted webserver.

If any more info is required please let me know.

Thanks

Andy



PROBLEM REPORT #1
Date/Time:        2020-10-15 10:00:18 +0200
End time:         2020-10-15 10:02:38 +0200
OS Version:       Mac OS X 10.15.6 (Build 19G2021)
Architecture:     x86_64h
Report Version:   29

Data Source:      Stackshots
Shared Cache:     0x61e8000 5329506A-6EFD-362C-83DD-CC8ECAA8A5F9

Command:          pulseview.real
Path:             /Applications/PulseView.app/Contents/MacOS/pulseview.real
Version:          ??? (???)
Parent:           launchd [1]
PID:              1148

Event:            hang
Duration:         140.39s
Duration Sampled: 4.10s (process was unresponsive for 136 seconds before sampling)
Steps:            41 (100ms sampling interval)

Hardware model:   MacBookPro11,3
Active cpus:      8

Time Awake Since Boot: 2300s

Fan speed:        3387 rpm



PROBLEM REPORT #2
pv: "Note for device developers: Ignoring device configuration capability 'Number of horizontal divisions' as it is missing GET and/or SET"
pv: "Note for device developers: Ignoring device configuration capability 'Sample rate' as it is missing GET and/or SET"
pv: "Note for device developers: Ignoring device configuration capability 'Number of vertical divisions' as it is missing GET and/or SET"
pv: "Note for device developers: Ignoring device configuration capability 'Number of vertical divisions' as it is missing GET and/or SET"
pv: "Note for device developers: Ignoring device configuration capability 'Number of vertical divisions' as it is missing GET and/or SET"
pv: "Note for device developers: Ignoring device configuration capability 'Number of vertical divisions' as it is missing GET and/or SET"
pv: "Note for device developers: Ignoring device configuration capability 'Number of horizontal divisions' as it is missing GET and/or SET"
pv: "Note for device developers: Ignoring device configuration capability 'Sample rate' as it is missing GET and/or SET"
pv: "Note for device developers: Ignoring device configuration capability 'Number of vertical divisions' as it is missing GET and/or SET"
pv: "Note for device developers: Ignoring device configuration capability 'Number of vertical divisions' as it is missing GET and/or SET"
pv: "Note for device developers: Ignoring device configuration capability 'Number of vertical divisions' as it is missing GET and/or SET"
pv: "Note for device developers: Ignoring device configuration capability 'Number of vertical divisions' as it is missing GET and/or SET"
sr: scpi_usbtmc: USBTMC invalid bulk in header.
sr: scpi_usbtmc: USBTMC invalid bulk in header.
sr: scpi_usbtmc: USBTMC invalid bulk in header.
sr: scpi_usbtmc: USBTMC invalid bulk in header.
sr: scpi_usbtmc: USBTMC invalid bulk in header.
sr: scpi_usbtmc: USBTMC invalid bulk in header.
sr: scpi_usbtmc: USBTMC invalid bulk in header.
sr: scpi_usbtmc: USBTMC invalid bulk in header.
sr: scpi_usbtmc: USBTMC invalid bulk in header.
sr: scpi_usbtmc: USBTMC invalid bulk in header.
sr: scpi_usbtmc: USBTMC invalid bulk in header.
scpi_usbtmc: USBTMC bulk in transfer error: LIBUSB_ERROR_TIMEOUT.
scpi_usbtmc: USBTMC bulk in transfer error: LIBUSB_ERROR_TIMEOUT.
scpi_usbtmc: USBTMC bulk in transfer error: LIBUSB_ERROR_TIMEOUT.
scpi_usbtmc: USBTMC bulk in transfer error: LIBUSB_ERROR_TIMEOUT.
scpi_usbtmc: USBTMC bulk in transfer error: LIBUSB_ERROR_TIMEOUT.
scpi_usbtmc: USBTMC bulk in transfer error: LIBUSB_ERROR_TIMEOUT.
scpi_usbtmc: USBTMC bulk in transfer error: LIBUSB_ERROR_TIMEOUT.
scpi_usbtmc: USBTMC bulk in transfer error: LIBUSB_ERROR_TIMEOUT.
Comment 2 Andy 2020-11-18 16:30:10 CET
I downloaded the latest nightly build 18/11/2020 and the LIBUSB_ERROR_TIMEOUT error is gone.

However, still no data captured and selection of a device still crashes the program - only tested on Catalina

sr: scpi_usbtmc: Successfully sent SCPI command: 'SANU? C1 '.
sr: scpi: Got response: '3.50E+06', length 8.
sr: scpi_usbtmc: Successfully sent SCPI command: ':TDIV? '.
sr: scpi: Got response: '5.00E-04', length 8.
sr: siglent-sds: Current timebase: 0.0005.
sr: siglent-sds: Current samplerate: 500000000.000000.
sr: siglent-sds: Current memory depth: 3500000.
sr: hwdriver: sr_config_get(): key 30000 (samplerate) sdi 0x7f829e7f4270 cg NULL -> uint64 500000000
sr: session: Using thread-default main context.
sr: session: Starting.
sr: hwdriver: siglent-sds: Starting acquisition.
sr: scpi_usbtmc: Successfully sent SCPI command: 'SANU? C1 '.
sr: scpi: Got response: '3.50E+06', length 8.
sr: scpi_usbtmc: Successfully sent SCPI command: ':TDIV? '.
sr: scpi: Got response: '5.00E-04', length 8.
sr: siglent-sds: Current timebase: 0.0005.
sr: siglent-sds: Current samplerate: 500000000.000000.
sr: siglent-sds: Current memory depth: 3500000.
sr: session: bus: Received SR_DF_HEADER packet.
sr: siglent-sds: Starting data capture for active frameset 1 of 1
sr: scpi_usbtmc: Successfully sent SCPI command: 'ARM '.
sr: scpi_usbtmc: Successfully sent SCPI command: ':INR? '.
sr: scpi: Got response: '8192', length 4.
sr: session: bus: Received SR_DF_FRAME_BEGIN packet.
sr: session: Stopping.
sr: hwdriver: siglent-sds: Stopping acquisition.
sr: session: bus: Received SR_DF_END packet.
sr: usb: usb_source_finalize
sr: session: Stopped.
pv: Acquisition took 1.22 s
Comment 3 voneiden 2021-01-19 18:20:47 CET
I'll try to take a look at this. Currently I'm working on fixing the tcp socket side for SDS1104X (and it seems to be working, so might as well try the USB next)
Comment 4 Andy 2021-01-20 10:16:40 CET
(In reply to voneiden from comment #3)
> I'll try to take a look at this. Currently I'm working on fixing the tcp
> socket side for SDS1104X (and it seems to be working, so might as well try
> the USB next)

Hi voneiden,

That's great news on the TCP issue.  Is this in the nightly build so I could test?  You efforts are much appreciated.  Thank you for also considering fixing the USB bug too.

Andy
Comment 5 voneiden 2021-01-20 15:20:14 CET
Nothing in nightly yet. I have some workaround attempts that allow me to acquire signals but nothing that works reliably. I haven't quite understood so far what the root cause is for these issues, but it feels like the communication protocol simply gets out of sync, possibly due to unexpected response from the device. 

Anyway, I'm a hobbyist C programmer, unfamiliar with Sigrok and both SCPI and USBTMC protocols, so don't get too hopeful. :-)
Comment 6 Andy 2021-01-20 15:55:59 CET
(In reply to voneiden from comment #5)
> Nothing in nightly yet. I have some workaround attempts that allow me to
> acquire signals but nothing that works reliably. I haven't quite understood
> so far what the root cause is for these issues, but it feels like the
> communication protocol simply gets out of sync, possibly due to unexpected
> response from the device. 
> 
> Anyway, I'm a hobbyist C programmer, unfamiliar with Sigrok and both SCPI
> and USBTMC protocols, so don't get too hopeful. :-)

Understood, I appreciate the effort!
Comment 7 voneiden 2021-01-23 10:55:55 CET
Good news, (significant) progress in resolving the issue has been made: I have USB acquisition in "Display" mode working.  "History" mode is still throwing an error which I need to investigate, but I imagine that should not be too hard to fix as it already works in TCP mode.
Comment 8 Andy 2021-01-24 09:03:05 CET
(In reply to voneiden from comment #7)
> Good news, (significant) progress in resolving the issue has been made: I
> have USB acquisition in "Display" mode working.  "History" mode is still
> throwing an error which I need to investigate, but I imagine that should not
> be too hard to fix as it already works in TCP mode.

Excellent news, well done!!
Comment 9 voneiden 2021-02-02 21:09:53 CET
Not sure if the patch is going to make it to nightly anytime soon (or ever), so I've made my own pulseview win64 release, if you dare and want to try it out. Available at https://github.com/voneiden/libsigrok/releases/tag/siglent-xe-1
Comment 10 Andy 2021-05-28 09:58:18 CEST
(In reply to voneiden from comment #9)
> Not sure if the patch is going to make it to nightly anytime soon (or ever),
> so I've made my own pulseview win64 release, if you dare and want to try it
> out. Available at
> https://github.com/voneiden/libsigrok/releases/tag/siglent-xe-1

Hey Voneiden,

Well done!! That is working on a Windows 10 VM for me with the USB interface!!

Andy
Comment 11 Rock12 2023-07-05 14:44:50 CEST
If you're constantly on the go, portability becomes a significant factor to consider. Laptops come in various sizes, from ultra-lightweight models to larger, more powerful ones. https://fitlaptops.com/best-laptops-under-600/