florentbr / OWON-VDS1022

Unofficial release for the OWON VDS1022/I Oscilloscope
262 stars 45 forks source link

Software crashing on Linux #23

Closed User-McUserface closed 3 years ago

User-McUserface commented 3 years ago

Tried installing software on my Manjaro KDE desktop.

Everything installed and launched alright but the graph refresh rate seemed very low.

When I pressed ctrl+enter (auto setting), the software struggle for a bit and stopped with message "WriteContent Err and DisConnect".

florentbr commented 3 years ago

Could be that there's not enough amps on the USB port or too much noise. Try to connect it to an external power supply like a smartphone charger.

I experienced this kind of failure once. It was because the USB port couldn't be accessed in time due to high CPU usage from another application. So make sure that there's nothing else monopolising the resources or ports.

I've been using this scope on a 15 years old compaq nx7000 without any issues so far.

Could you post the exception ? To view the exception, simply run owon-vds-tiny from a console.

User-McUserface commented 3 years ago

Could you post the exception?

Sure, here it is. This is all that happened from the moment I pressed ctrl+enter to the moment I closed the window after all the prompts.

Sorry about formatting, I don't know why the newlines are being ignored.

I somewhat doubt that it's the matter of lacking power because I've plugging the main line in the high powered port of a pretty fancy motherboard, and to be on the safe side, I also plugged in the second plug too (the branch off the main plug on the pc end).

`wrEmpty trg set 16 bits: [toBytesString: ]00000000 00000000

arg[9~2] >> 0x0 arg[1~0] 000 index[2~0] >> 0x42 [Send: ] 0xb, 1, 0x3 @CHL_ON_ADD , 0xb 0x0 0x0 0x0 0x1 , 0x3 [Response: ] resNum: 5, value: 1 , 0x53 0x1 0x0 0x0 0x0 [Send: ] 0x10c, 1, 0x0 @EMPTY_ADD , 0xc 0x1 0x0 0x0 0x1 , 0x0 [Response: ] resNum: 5, value: 1314212940 , 0x53 0x4c 0x4c 0x55 0x4e [Send: ] 0x111, 1, 0xffffffa0 @channel_ch1_ADD , 0x11 0x1 0x0 0x0 0x1 , 0xa0 [Response: ] resNum: 5, value: 3 , 0x53 0x3 0x0 0x0 0x0 [Send: ] 0x116, 2, 0x229 @volt_gain_ch1_ADD , 0x16 0x1 0x0 0x0 0x2 , 0x29 0x2 [Response: ] resNum: 5, value: 3 , 0x53 0x3 0x0 0x0 0x0 [Send: ] 0x10a, 2, 0x1e4 @zero_off_ch1_ADD , 0xa 0x1 0x0 0x0 0x2 , 0xe4 0x1 [Response: ] resNum: 5, value: 3 , 0x53 0x3 0x0 0x0 0x0 [Send: ] 0x24, 2, 0x0 @TRG_ADD , 0x24 0x0 0x0 0x0 0x2 , 0x0 0x0 [Response: ] resNum: 5, value: 1 , 0x53 0x1 0x0 0x0 0x0 [Send: ] 0x26, 1, 0x0 @trg_holdoff_arg_ch1_ADD , 0x26 0x0 0x0 0x0 0x1 , 0x0 [Response: ] resNum: 5, value: 1 , 0x53 0x1 0x0 0x0 0x0 [Send: ] 0x27, 1, 0x42 @trg_holdoff_index_ch1_ADD , 0x27 0x0 0x0 0x0 0x1 , 0x42 [Response: ] resNum: 5, value: 1 , 0x53 0x1 0x0 0x0 0x0 [Send: ] 0x2e, 2, 0x444e @[edge_level_ch1_ADD] @0x2e, 2 bytes , 0x2e 0x0 0x0 0x0 0x2 , 0x4e 0x44 [Response: ] resNum: 5, value: 1 , 0x53 0x1 0x0 0x0 0x0 wrEmpty trg set 16 bits: [toBytesString: ]00000000 00000000

arg[9~2] >> 0x0 arg[1~0] 000 index[2~0] >> 0x42 trg set 16 bits: [toBytesString: ]10000000 00000000

arg[9~2] >> 0x0 arg[1~0] 000 index[2~0] >> 0x42 wrEmpty trg set 16 bits: [toBytesString: ]11000000 00000000

arg[9~2] >> 0x0 arg[1~0] 000 index[2~0] >> 0x42 wrEmpty trg set 16 bits: [toBytesString: ]10000000 00000000

arg[9~2] >> 0x0 arg[1~0] 000 index[2~0] >> 0x42 wrEmpty trg set 16 bits: [toBytesString: ]11000000 00000000

arg[9~2] >> 0x0 arg[1~0] 000 index[2~0] >> 0x42 wrEmpty ...START AUTOSET... .......routOut..... >> CH1, AutoStatus: Init checkOff >> CH1, checkOffCount: 0, allCheckCount: 0 min: 48 , max: 111 , pk: 63 checkOut Input >> CH1 .......routOut..... >> CH2, AutoStatus: Init checkOff >> CH2, checkOffCount: 0, allCheckCount: 0 min: -51 , max: -49 , pk: 2 checkOut Input >> CH2 [Send: ] 0xb, 1, 0x3 @CHL_ON_ADD , 0xb 0x0 0x0 0x0 0x1 , 0x3 [Response: ] resNum: 5, value: 1 , 0x53 0x1 0x0 0x0 0x0 [Send: ] 0x26, 1, 0x0 @trg_holdoff_arg_ch1_ADD , 0x26 0x0 0x0 0x0 0x1 , 0x0 [Response: ] resNum: 5, value: 1 , 0x53 0x1 0x0 0x0 0x0 [Send: ] 0x27, 1, 0x42 @trg_holdoff_index_ch1_ADD , 0x27 0x0 0x0 0x0 0x1 , 0x42 [Response: ] resNum: 5, value: 1 , 0x53 0x1 0x0 0x0 0x0 [Send: ] 0x2e, 2, 0xf600 @[edge_level_ch1_ADD] @0x2e, 2 bytes , 0x2e 0x0 0x0 0x0 0x2 , 0x0 0xf6 [Response: ] resNum: 5, value: 1 , 0x53 0x1 0x0 0x0 0x0 [Send: ] 0x24, 2, 0xc000 @TRG_ADD , 0x24 0x0 0x0 0x0 0x2 , 0x0 0xc0 [Response: ] resNum: 5, value: 1 , 0x53 0x1 0x0 0x0 0x0 [Send: ] 0x2a, 1, 0x0 @trg_holdoff_arg_ch2_ADD , 0x2a 0x0 0x0 0x0 0x1 , 0x0 [Response: ] resNum: 5, value: 1 , 0x53 0x1 0x0 0x0 0x0 [Send: ] 0x2b, 1, 0x42 @trg_holdoff_index_ch2_ADD , 0x2b 0x0 0x0 0x0 0x1 , 0x42 [Response: ] resNum: 5, value: 1 , 0x53 0x1 0x0 0x0 0x0 [Send: ] 0x30, 2, 0xf600 @[edge_level_ch2_ADD] @0x30, 2 bytes , 0x30 0x0 0x0 0x0 0x2 , 0x0 0xf6 [Response: ] resNum: 5, value: 1 , 0x53 0x1 0x0 0x0 0x0 [Send: ] 0x6, 1, 0x0 @SYNCOUTPUT_ADD , 0x6 0x0 0x0 0x0 0x1 , 0x0 [Response: ] resNum: 5, value: 1 , 0x53 0x1 0x0 0x0 0x0 [Send: ] 0x52, 4, 0xfa0 @TIMEBASE_ADD , 0x52 0x0 0x0 0x0 0x4 , 0xa0 0xf 0x0 0x0 [Response: ] resNum: 5, value: 1 , 0x53 0x1 0x0 0x0 0x0 [Send: ] 0x9, 1, 0x1 @SAMPLE_ADD , 0x9 0x0 0x0 0x0 0x1 , 0x1 [Response: ] resNum: 5, value: 1 , 0x53 0x1 0x0 0x0 0x0 [Send: ] 0xa, 1, 0x0 @SLOWMOVE_ADD , 0xa 0x0 0x0 0x0 0x1 , 0x0 [Response: ] resNum: 5, value: 1 , 0x53 0x1 0x0 0x0 0x0 [Send: ] 0x5a, 2, 0x9f1 @[PRE_TRG_ADD] @0x5a, 2 bytes , 0x5a 0x0 0x0 0x0 0x2 , 0xf1 0x9 [Response: ] resNum: 5, value: 1 , 0x53 0x1 0x0 0x0 0x0 [Send: ] 0x56, 4, 0x9fb @[SUF_TRG_ADD] @0x56, 4 bytes , 0x56 0x0 0x0 0x0 0x4 , 0xfb 0x9 0x0 0x0 [Response: ] resNum: 5, value: 1 , 0x53 0x1 0x0 0x0 0x0 [Send: ] 0x10c, 1, 0x1 @EMPTY_ADD , 0xc 0x1 0x0 0x0 0x1 , 0x1 [Response: ] resNum: 5, value: 1314212940 , 0x53 0x4c 0x4c 0x55 0x4e [Send: ] 0x111, 1, 0xffffffa0 @channel_ch1_ADD , 0x11 0x1 0x0 0x0 0x1 , 0xa0 [Response: ] resNum: 5, value: 3 , 0x53 0x3 0x0 0x0 0x0 [Send: ] 0x116, 2, 0x229 @volt_gain_ch1_ADD , 0x16 0x1 0x0 0x0 0x2 , 0x29 0x2 [Response: ] resNum: 5, value: 3 , 0x53 0x3 0x0 0x0 0x0 [Send: ] 0x10a, 2, 0x236 @zero_off_ch1_ADD , 0xa 0x1 0x0 0x0 0x2 , 0x36 0x2 [Response: ] resNum: 5, value: 3 , 0x53 0x3 0x0 0x0 0x0 [Send: ] 0x110, 1, 0xffffffa0 @channel_ch2_ADD , 0x10 0x1 0x0 0x0 0x1 , 0xa0 [Response: ] resNum: 5, value: 3 , 0x53 0x3 0x0 0x0 0x0 [Send: ] 0x114, 2, 0x228 @volt_gain_ch2_ADD , 0x14 0x1 0x0 0x0 0x2 , 0x28 0x2 [Response: ] resNum: 5, value: 3 , 0x53 0x3 0x0 0x0 0x0 [Send: ] 0x108, 2, 0x214 @zero_off_ch2_ADD , 0x8 0x1 0x0 0x0 0x2 , 0x14 0x2 [Response: ] resNum: 5, value: 3 , 0x53 0x3 0x0 0x0 0x0 [Send: ] 0x2e, 2, 0xc4ce @[edge_level_ch1_ADD] @0x2e, 2 bytes , 0x2e 0x0 0x0 0x0 0x2 , 0xce 0xc4 [Response: ] resNum: 5, value: 1 , 0x53 0x1 0x0 0x0 0x0 [Send: ] 0x30, 2, 0x2832 @[edge_level_ch2_ADD] @0x30, 2 bytes , 0x30 0x0 0x0 0x0 0x2 , 0x32 0x28 [Response: ] resNum: 5, value: 1 , 0x53 0x1 0x0 0x0 0x0 ch.ntb.usb.USBTimeoutException: LibusbJava.usb_bulk_read: No error at com.owon.uppersoft.vds.core.usb.CDevice.readBulk(CDevice.java:374) at com.owon.uppersoft.dso.source.usb.USBSource.acceptResponse(USBSource.java:135) at com.owon.uppersoft.dso.source.usb.USBSourceManager.acceptResponse(USBSourceManager.java:52) at com.owon.uppersoft.vds.source.comm.data.GetDataRunner2$1.acceptResponse(GetDataRunner2.java:102) at com.owon.uppersoft.vds.source.comm.data.GetDataRunner2.acceptNMData(GetDataRunner2.java:219) at com.owon.uppersoft.vds.source.comm.data.GetDataRunner2.routineGetData(GetDataRunner2.java:190) at com.owon.uppersoft.vds.source.comm.data.GetDataRunner2.getData(GetDataRunner2.java:124) at com.owon.uppersoft.dso.source.comm.AbsGetDataRunner.getDataT(AbsGetDataRunner.java:33) at com.owon.uppersoft.dso.source.comm.Flow.run(Flow.java:99) at com.owon.uppersoft.dso.global.ControlAppsTiny$1.run(ControlAppsTiny.java:38) sleep 50 ms on fail sleep 50 ms on fail sleep 50 ms on fail sleep 50 ms on fail sleep 50 ms on fail sleep 50 ms on fail sleep 50 ms on fail sleep 50 ms on fail sleep 50 ms on fail sleep 50 ms on fail sleep 50 ms on fail sleep 50 ms on fail sleep 50 ms on fail sleep 50 ms on fail sleep 50 ms on fail sleep 50 ms on fail sleep 50 ms on fail sleep 50 ms on fail sleep 50 ms on fail onFail: Wed Feb 17 19:25:50 GET 2021 tryRescue... tryRescue fail sleep 50 ms on fail windowClosing `

florentbr commented 3 years ago

The exception indicates that the USB connexion was lost. It's also possible that the device felt in an unexpected state due to a bad calibration.

To pinpoint the issue : Try a different power supply and USB cable to exclude an hardware issue Try to run the device on a light live usb like MX linux to exclude an OS issue Try each volt base on both channels with a DC coupling and look for an outstanding value in the calibration (F2) Run Autoset multiple time and check if it occurs randomly or always after sending : @[edge_level_ch2_ADD] @0x30, 2 bytes , 0x30 0x0 0x0 0x0 0x2 , 0x32 0x28

User-McUserface commented 3 years ago

To pinpoint the issue

I tried almost everything you suggested. Even booted into a Win partition I haven't used in months. Everything worked perfectly there connected exactly like on linux.

Long story short, on linux it works but only when connected to one particular USB port (out of 4 exactly similar ones). Who knows why, but what I do know is that I'm not qualified to find out :D

Thank you for all your suggestions and prompt replies :+1:

florentbr commented 3 years ago

Well, if it works fine on the same USB port on Windows, either Linux handles the power differently or it's a driver issue. Check the logs for a clue with journalctl --since "10 min ago".

You could try to use a different libusb driver. Run

sudo rm -f /usr/lib/owon-vds-tiny/libusb-0.1.so.4
sudo pacman -S libusb-compat

It will force the app to use the libusb driver from the Arch repo. Then relaunch the app to see if there's a difference. To switch back, just reinstall the app.

User-McUserface commented 3 years ago

I dug around some more in the motherboard manual and confirmed that the port is indeed high power (3A in fact), but also that it's USB 3.1 and controlled by an ASMedia controller.

I think it's safe-ish to assume that there's something fishy going on with drivers for that controller on linux, while on windows everything is dandy because of the manufacturer supplied drivers.

florentbr commented 3 years ago

It looks like it's an issue between libusb and the ASMedia controller : https://github.com/libusb/libusb/search?q=Asmedia&type=issues

It's probably been been fixed in libusb 1.0. Unfortunately this app rely on libusb 0.1 which is no longer maintained and has a different API.

florentbr commented 3 years ago

I switched the driver to libusb-compat which allows applications written for libusb-0.1 to work with libusb-1.0. The release 1.0.33-cf12 should now work with your ASMedia controller.