Package Details: dsview-git 0.96.r0.g2143be9-1

Git Clone URL: https://aur.archlinux.org/dsview-git.git (read-only)
Package Base: dsview-git
Description: GUI programe for supporting various instruments from DreamSourceLab, including logic analyzer, oscilloscope, etc.
Upstream URL: http://www.dreamsourcelab.com/
Licenses: GPL3
Submitter: anatolik
Maintainer: anatolik
Last Packager: anatolik
Votes: 1
Popularity: 0.015083
First Submitted: 2015-05-16 00:06
Last Updated: 2016-08-14 01:09

Latest Comments

FuzzyCheese commented on 2016-11-21 17:29

Added issue to upstream project.

anatolik commented on 2016-11-21 17:04

FuzzyCheese, could you please send your finding to the upstream project?

FuzzyCheese commented on 2016-11-21 17:01

Hangs on my Arch system and on a fresh Antergos install but works on Ubuntu fresh install.

Symptom: Stays at 100% completion and UI is frozen and must be killed when used with DSLogic hardware.

Crude fix:
Comment out libusb event handling in receive_data function in libsigrok4DSL/hardware/DSL/dslogic.c around line 2365.

--- a/DSView-master/libsigrok4DSL/hardware/DSL/dslogic.c
+++ b/DSView-master/libsigrok4DSL/hardware/DSL/dslogic.c
@@ -2380,11 +2380,11 @@
usb = sdi->conn;

tv.tv_sec = tv.tv_usec = 0;
- libusb_handle_events_timeout_completed(drvc->sr_ctx->libusb_ctx, &tv, &completed);
+//fix libusb_handle_events_timeout_completed(drvc->sr_ctx->libusb_ctx, &tv, &completed);

if (devc->status == DSL_FINISH) {
- if (libusb_try_lock_events(drvc->sr_ctx->libusb_ctx) == 0) {
- if (libusb_event_handling_ok(drvc->sr_ctx->libusb_ctx)) {
+//fix if (libusb_try_lock_events(drvc->sr_ctx->libusb_ctx) == 0) {
+//fix if (libusb_event_handling_ok(drvc->sr_ctx->libusb_ctx)) {
/* Stop GPIF acquisition */
usb = ((struct sr_dev_inst *)devc->cb_data)->conn;
if ((ret = command_stop_acquisition (usb->devhdl)) != SR_OK)
@@ -2393,9 +2393,9 @@
sr_info("%s: Sent acquisition stop command!", __func__);

remove_sources(devc);
- }
- libusb_unlock_events(drvc->sr_ctx->libusb_ctx);
- }
+//fix }
+//fix libusb_unlock_events(drvc->sr_ctx->libusb_ctx);
+//fix }
}

return TRUE;

Details:
The hang occurs because of libusb event handling with multiple threads.?.?
The following line(113) in libsigrok4DSL/hardware/command.c does not return at the end of final transfer:
ret = libusb_control_transfer(devhdl, LIBUSB_REQUEST_TYPE_VENDOR |
LIBUSB_ENDPOINT_OUT, CMD_START, 0x0000, 0x0000,
(unsigned char *)&cmd, sizeof(cmd), 3000);

Used "export LIBUSB_DEBUG=4" to turn on libusb debug and "DSView -l 5" for application logging and it looks like the event is returned to another thread causing the current thread to wait on line 113.

Log(trimmed):
sr: finish_acquisition: send SR_DF_END packet
sr: session: bus: Received SR_DF_END packet.
[ 3.219458] [000042bf] libusb: debug [libusb_alloc_transfer] transfer 0x7f94fc000ed0
[ 3.219463] [000042bf] libusb: debug [libusb_submit_transfer] transfer 0x7f94fc000ed0
[ 3.219466] [000042bf] libusb: debug [add_to_flying_list] arm timerfd for timeout in 3000ms (first in line)
[ 3.219491] [000042bf] libusb: debug [libusb_handle_events_timeout_completed] another thread is doing event handling
...repeats many times....
[ 6.298252] [000042be] libusb: debug [libusb_handle_events_timeout_completed] another thread is doing event handling
[ 6.298330] [000042be] libusb: debug [libusb_cancel_transfer] transfer 0x7f94fc000ed0
[ 6.298338] [000042be] libusb: debug [discard_urbs] URB not found --> assuming ready to be reaped
[ 6.298347] [000042be] libusb: debug [libusb_cancel_transfer] cancel transfer failed error -5
[ 6.298357] [000042be] libusb: warning [handle_timeout] async cancel failed -5 errno=22
[ 6.398431] [000042be] libusb: debug [libusb_handle_events_timeout_completed] another thread is doing event handling

anatolik commented on 2015-07-24 22:11

How do build the package?

I have a fix for this problem in this package https://aur4.archlinux.org/cgit/aur.git/tree/0003-Fix-compile-error.patch?h=dsview-git so you should not see the problem.

Epileftric commented on 2015-07-24 22:08

There was an error when compiling, had to write the following patch

http://pastebin.com/kw4wBTmm

Epileftric commented on 2015-07-24 22:07

There's a error in compilation, fixed with this patch

diff --git a/DSView/pv/mainwindow.cpp b/DSView/pv/mainwindow.cpp
--- mainwindow.cpp.orig 2015-07-24 19:00:36.621046681 -0300
+++ mainwindow.cpp 2015-07-24 19:01:13.749582511 -0300
@@ -739,8 +739,8 @@
s_obj["strigger"] = s->get_trig();
boost::shared_ptr<view::DsoSignal> dsoSig;
if (dsoSig = dynamic_pointer_cast<view::DsoSignal>(s)) {
- s_obj["vdiv"] = QJsonValue::fromVariant(dsoSig->get_vDialValue());
- s_obj["vfactor"] = QJsonValue::fromVariant(dsoSig->get_factor());
+ s_obj["vdiv"] = QString("%1").arg(dsoSig->get_vDialValue());
+ s_obj["vfactor"] = QString("%1").arg(dsoSig->get_factor());
s_obj["coupling"] = dsoSig->get_acCoupling();
s_obj["trigValue"] = dsoSig->get_trigRate();
s_obj["zeroPos"] = dsoSig->get_zeroRate();