knarfS / smuview

SmuView is a GUI for sigrok that supports power supplies, electronic loads and all sorts of measurement devices like multimeters, LCR meters and so on.
GNU General Public License v3.0
130 stars 25 forks source link

Hang and high cpu after device disconnect #16

Open ettom opened 4 years ago

ettom commented 4 years ago

Describe the bug Smuview hangs and uses 100% CPU when the connection to the power supply is lost (e.g by turning the power supply off). The UI recovers after a while, but a process with the name of /tmp/.mount_smuvieD7pmN9/usr/bin/smuview --driver=korad-kaxxxxp:conn=/dev/ttyACM0 keeps using 100% CPU.

Driver: korad-kaxxxxp, actual model: Tenma 72-2540

To Reproduce Steps to reproduce the behavior:

  1. smuview --driver=korad-kaxxxxp:conn=/dev/ttyACM0
  2. Interrupt the serial connection by turning the device off or by unplugging the cable
  3. SmuView hangs

Expected behavior SmuView does not hang and indicates that the connection has been lost.

Screenshots or log

Configurable::init(): Init  "Tenma 72-2540"  - key  "Regulation"
Configurable::init(): Init  "Tenma 72-2540"  - key  "Over Current Protection Enabled"
Configurable::init(): Init  "Tenma 72-2540"  - key  "Over Voltage Protection Enabled"
Configurable::init(): Init  "Tenma 72-2540"  - key  "Enabled"
Configurable::init(): Init  "Tenma 72-2540"  - key  "Current Limit"
Configurable::init(): Init  "Tenma 72-2540"  - key  "Current"
Configurable::init(): Init  "Tenma 72-2540"  - key  "Voltage Target"
Configurable::init(): Init  "Tenma 72-2540"  - key  "Voltage"
Init channel  "V" , channel_start_timestamp =  "2020.05.11 20:46:10.535"
Init channel  "I" , channel_start_timestamp =  "2020.05.11 20:46:10.535"
Init analog base signal  "V [V DC]"
Init analog time signal  "V [V DC]" , signal_start_timestamp_ =  "2020.05.11 20:46:10.535"
Init analog base signal  "I [A DC]"
Init analog time signal  "I [A DC]" , signal_start_timestamp_ =  "2020.05.11 20:46:10.535"
Init channel  "" , channel_start_timestamp =  "2020.05.11 20:46:10.535"
Init analog base signal  "P [W]"
Init analog time signal  "P [W]" , signal_start_timestamp_ =  "2020.05.11 20:46:10.535"
Init channel  "" , channel_start_timestamp =  "2020.05.11 20:46:10.535"
Init analog base signal  "R [Ω]"
Init analog time signal  "R [Ω]" , signal_start_timestamp_ =  "2020.05.11 20:46:10.535"
Init channel  "" , channel_start_timestamp =  "2020.05.11 20:46:10.535"
Init analog base signal  "Wh [Wh]"
Init analog time signal  "Wh [Wh]" , signal_start_timestamp_ =  "2020.05.11 20:46:10.535"
Init channel  "" , channel_start_timestamp =  "2020.05.11 20:46:10.535"
Init analog base signal  "Ah [Ah]"
Init analog time signal  "Ah [Ah]" , signal_start_timestamp_ =  "2020.05.11 20:46:10.535"
Start aquisition for  "Tenma 72-2540" ,  aquisition_start_timestamp_ =  "2020.05.11 20:46:10.535"
sr: serial-libsp: Write error (5): Input/output error.
sr: korad-kaxxxxp: Error sending command: -1.
Configurable::set_config(): Failed to set config key  "Enabled" .  generic/unspecified error
sr: serial-libsp: Write error (5): Input/output error.
sr: korad-kaxxxxp: Error sending command: -1.

Enviroment (please complete the following information): 0.0.4 AppImage on Arch Linux

knarfS commented 4 years ago

This is a known problem with the underlying libsigrok or libserialport, but it's not very high on my priority list atm :) A workaround is to disconnect the device in SmuView before unplugging it / turning it off.

I leave this issue open as a reminder for me.