analogdevicesinc / alice

Active Learning Interface for Circuits and Electronics
Other
16 stars 4 forks source link

Alice 1.3 does not work with current libsmu #2

Closed balbirthomas closed 4 years ago

balbirthomas commented 4 years ago

The Latest Alice version 1.3 fails to connect with ADALM-1000 using current libsmu as shown below

user@pc: alice
No Init File Read
Traceback (most recent call last):
  File "/home/user/bin/alice", line 18339, in <module>
    ConnectDevice()
  File "/home/user/bin/alice", line 16660, in ConnectDevice
    session.add_all()
  File "pysmu/libsmu.pyx", line 200, in pysmu.libsmu.Session.add_all (/home/user/src/utilities/libsmu/bindings/python/pysmu/libsmu.cpp:4449)
pysmu.exceptions.SessionError: failed scanning and/or adding all supported devices: Device or resource busy

This was report as a libsmu issue in https://github.com/analogdevicesinc/libsmu/issues/127 . As pointed out in that issue the add_all() function is redundant with the current libsmu. However commenting out session.add_all() still leads to an error show below

Skipping dev1
Skipping dev2
20312044374D4334203530323630333
2.17 D
Session sample rate: 100000
Traceback (most recent call last):
  File "/home/bt/bin/alice", line 18591, in <module>
    ConnectDevice()
  File "/home/bt/bin/alice", line 16918, in ConnectDevice
    SelectBoard()
  File "/home/bt/bin/alice", line 16975, in SelectBoard
    CHA.mode = Mode.HI_Z_SPLIT # Put CHA in Hi Z split mode
  File "/usr/lib/python2.7/dist-packages/enum/__init__.py", line 390, in __getattr__
    raise AttributeError(name)
AttributeError: HI_Z_SPLIT

So it looks like Alice 1.3 is out of sync with changes in LibSMU.

My software stack is OS : Debian GNU/Linux v10 (Buster) libsmu : Built from git (sha 9bf56333f008f56bc10a5e85927cb617ccc30b0f ) alice : Version-1.3 from Alice's git repository

Should you need any further information I would be happy to help.

Regards

damercer commented 4 years ago

On Windows the current source code for ALICE 1.3 works with the master version of libsmu so this is a libsmu on Linux only issue. It will be fixed when the overall issue with libsmu under Linux is solved.

Nothing I can do about it until then.

Thanks for point this out however.

Doug

damercer commented 4 years ago

Looking at your error message more closely you are getting the error when it tries to use the Mode.HI_Z_SPLIT option and that was added to libsmu a long time ago so I think you have not installed the most recent version of libsmu master.

Again I'm not a Linux user so I don't know how to do anything specific on Linux but you probably need to completely remove the version you have now and clone the libsmu source from the latest master again and recompile from the beginning.

Doug

balbirthomas commented 4 years ago

Thank you for your response Doug.

As suggested I did delete my libsmu git repository, cloned master again, and rebuilt libsmu. This did indeed fix the problem. However I still had to comment out both the session.add_all() lines in Alice 1.3, otherwise I got the "Device or resource busy" mentioned above. Once I commented out the two lines I was able to generate all wave shapes on ChA and view them on ChB. I am closing this ticket but you may want to update Alice with removal of "session.add_all()", since this is also suggested by the libsmu ticket linked above. Thank you very much for your help.

Just for your reference the git reversion of libsmu I had been using had sha : dda38f62644a942e425ebe89164599256a3b6924. This commit was made on Tue Aug 20 by Alexandra Trifan and has title "Small modifications for Python 3.6 and 3.7." . My git repository was cloned more than year ago. I had kept it updated (using git pull) and had not modified its commits in any way. I also did git grep in the repository (with last commit dated Aug 20), to check if HI_Z_SPLIT was defined. And indeed it was (see below)

libsmu$ git grep HI_Z_SPLIT
bindings/python/pysmu/libsmu.pyx:    HI_Z_SPLIT = 3
include/libsmu/libsmu.hpp:      HI_Z_SPLIT,
src/device_m1000.cpp:        if ((m_mode[channel] != HI_Z)  && (m_mode[channel] != HI_Z_SPLIT)) {
src/device_m1000.cpp:           case HI_Z_SPLIT: {

Thank you for supporting Linux as best as you can. I would gladly help with any beta testing. I wish I understood the Alice source code better to help with debugging. Some internals documentation may help.

damercer commented 4 years ago

Glad to hear that you now have a working version of libsmu. I just posted a new copy of the source code with the suggested change for Linux. It also adds two new waveform shapes to AWG CH A. The last couple of versions have included some changes to allow smoother transition to Python 3.7 by just doing a 2to3 conversion.