Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ocasional PICO_INVALID_HANDLE during detection of ps6000 scopes #103

Open
alexxcons opened this issue Feb 2, 2022 · 4 comments
Open

Ocasional PICO_INVALID_HANDLE during detection of ps6000 scopes #103

alexxcons opened this issue Feb 2, 2022 · 4 comments
Labels
bug Something isn't working external priority::medium

Comments

@alexxcons
Copy link
Collaborator

alexxcons commented Feb 2, 2022

...
-- Staring flowgraph --
ERROR: No ps6000 device found
ERROR: Exception in /home/bel/schwinn/lnx/git/gr-digitizers/lib/digitizer_block_impl.cc:544: initialize failed. ErrorCode: Ps6000:12
RTDeviceClass::specificInit finished!
NOTICE: timebase cannot be obtained: PICO_INVALID_HANDLE - There is no device with the handle value passed.
NOTICE:     estimated timebase will be used...
...

Observed on fel0049

The bug is reproducable, until pico6000Con/ps6000Con is called once. After that, things work fine again:

-- Staring flowgraph --
INFO: Searching for scope with serial: 'EZ506/056'
INFO: ... found scope with serial: 'EZ506/056'
INFO: Serials match, scope 'EZ506/056' found.
INFO: Triggering enabled for picoscope: 'EZ506/056' Trigger source: 'AUX' threshold: '0.7' direction: '0'.

So that native picotec application does some magic which we currently dont do .. to be investigated.

The ps6000Con source code can be found here: https://gitlab.com/al.schwinn/picodrivertest or can be downloaded somewhere on the picotec website

@alexxcons alexxcons added bug Something isn't working external priority::medium labels Feb 2, 2022
@alexxcons
Copy link
Collaborator Author

alexxcons commented Feb 2, 2022

The ps6000Con application does memset(&(allUnits[devCount]),0,sizeof (UNIT)); on the deviceHandle before passing it to ps6000OpenUnit (which in theory should fill that handle, no matter what was inside before).

Currently testing if that does the trick. (I cannot reproduce the bug just like that, so I will run the fesa class for some weeks and see if the bug occurs again)

Edit: Nope, that did not do the trick. It just happened again

@alexxcons
Copy link
Collaborator Author

alexxcons commented Feb 2, 2022

I just placed a std::cout in front of the ps6000OpenUnit loop during debugging which resolved the problem for that attempt (wtf???)

Here my debugging branch:
https://github.com/fair-acc/gr-digitizers/blob/%23103_ps6000_ocassional_PICO_INVALID_HABLE/lib/picoscope_6000_impl.cc#L445

Suppose that was rather luck, and ha no real relevance.

@RalphSteinhagen
Copy link
Member

... such things/observations often indicate data race and other potential threading issues.

@alexxcons
Copy link
Collaborator Author

alexxcons commented Feb 2, 2022

... such things/observations often indicate data race and other potential threading issues.

Hmm, the used variables all have local scope, and fel0049 only runs a single ps6000 (There is as well a boost::mutex::scoped_lock used to protect from concurrent access, though that is only relevant for dal006 which runs two ps6000 in parallel)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working external priority::medium
Projects
None yet
Development

No branches or pull requests

2 participants