sccn / lsl_archived

Multi-modal time-synched data transmission over local network
242 stars 134 forks source link

java version is not able to create LSL stream #163

Open JABarios opened 7 years ago

JABarios commented 7 years ago

at least in linux, after compiling java examples, is possible to record streams generated by different sources. But sources generated by java examples are not recognized by ReceivingData example, both python and java version. This is the error: Note: The stream named '(invalid: bad lexical cast: source type value could not be interpreted as target)' could not be recovered automatically if its provider crashed because it does not specify a unique data source ID. Traceback (most recent call last): File "ReceiveData.py", line 10, in inlet = StreamInlet(streams[0]) File "/usr/local/lib/python2.7/dist-packages/pylsl-1.10.4-py2.7.egg/pylsl/pylsl.py", line 642, in init self.sample = self.sample_type() TypeError: 'list' object is not callable

mgrivich commented 7 years ago

Linux Java had an issue in which streams could not be sent and received properly. I have fixed this, which should fix your issue as well. Please update from github, try again, and reopen this issue if it is not resolved.

JABarios commented 7 years ago

Hi, thank you for answering, but i still have the same problem, both in windows 10 and in linux, with java examples. Code now compiles better, excep that in linux is neccesary to unzip the jar. Receiving streams with java code works perfectly, even if streams are created, in localhost, with python examples. Python code receives perfectly streams created by python code. BUT, java examples, and python examples, crash when the stream is created by java code (although the java code that is creating the stream does not crash). So, the problem seems restricted to creation of streams in java, independently of OS.

JABarios commented 7 years ago

I would like to open again the issue, I am still not able to open streams in java (is possible open them in python, a read them in java and python)

2017-01-11 20:22 GMT+01:00 Matthew Grivich notifications@github.com:

Closed #163 https://github.com/sccn/labstreaminglayer/issues/163.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/sccn/labstreaminglayer/issues/163#event-919640335, or mute the thread https://github.com/notifications/unsubscribe-auth/ANKJXzDMiSFYzGJsmQ2OPBwRjiVy172eks5rRSvpgaJpZM4LZsYV .

-- Juan A. Barios Heredero, M.D., PhD Center for Biomedical Technology (CTB) Universidad Politécnica de Madrid Parque Científico y Tecnológico de la UPM Campus de Montegancedo 28223 Pozuelo de Alarcón, Madrid, ES work phone +34 91 336 46 54 www.ctb.upm.es

Hospital Ramón y Cajal Dept. Investigación Unidad de Neurología Experimental

mgrivich commented 7 years ago

Please try the following on Linux: Update from github.

Download jna-4.2.2.jar (http://central.maven.org/maven2/net/java/dev/jna/jna/4.2.2/jna-4.2.2.jar) to LSL/liblsl-Java.

Build the LSL library (liblsl64.so, for example) for your system, and copy it to LSL/liblsl-Java

LSL/liblsl-Java$ javac -cp jna-4.2.2.jar edu/ucsd/sccn/LSL.java examples/SendData.java LSL/liblsl-Java$ javac -cp jna-4.2.2.jar edu/ucsd/sccn/LSL.java examples/ReceiveData.java

LSL/liblsl-Java$ java -Djna.nosys=true -cp "jna-4.2.2.jar:." examples.SendData

Open a new terminal window (don't close the old one). LSL/liblsl-Java$ java -Djna.nosys=true -cp "jna-4.2.2.jar:." examples.ReceiveData

If it's working, you will see streamed data appearing in your receive window. Let me know if, when, and how this fails.

JABarios commented 7 years ago

[image: Imágenes integradas 1]

That's exactly what I have bee trying. And then, the error says:

Note: The stream named '(invalid: bad lexical cast: source type value could not be interpreted as target)' could not be recovered automatically if its provider crashed because it does not specify a unique data source ID. Error while receiving the stream info (Argumento inválido); retrying... Exception in thread "main" edu.ucsd.sccn.LSL$LostException: The stream has been lost. at edu.ucsd.sccn.LSL.check_error(LSL.java:898) at edu.ucsd.sccn.LSL$StreamInlet.info(LSL.java:566) at edu.ucsd.sccn.LSL$StreamInlet.info(LSL.java:567) at examples.ReceiveData.main(ReceiveData.java:13)

And, if I try with the python examples/ReceiveData, same error

Note: The stream named '(invalid: bad lexical cast: source type value could not be interpreted as target)' could not be recovered automatically if its provider crashed because it does not specify a unique data source ID. Traceback (most recent call last): File "examples/ReceiveData.py", line 10, in inlet = StreamInlet(streams[0]) File "/usr/local/lib/python2.7/dist-packages/pylsl-1.10.4-py2.7.egg/pylsl/pylsl.py", line 642, in init self.sample = self.sample_type() TypeError: 'list' object is not callable

But, if a receive with the java program and send with the python example, it works properly [image: Imágenes integradas 2]

Is only my system, or is the same in your computer? maybe is only me, and I have to change the computer. I have no access now to other system, but I don't want to waste your time, if it is something strange related to my setup.

2017-01-17 19:17 GMT+01:00 Matthew Grivich notifications@github.com:

Please try the following on Linux: Update from github.

Download jna-4.2.2.jar (http://central.maven.org/ maven2/net/java/dev/jna/jna/4.2.2/jna-4.2.2.jar) to LSL/liblsl-Java.

Build the LSL library (liblsl64.so, for example) for your system, and copy it to LSL/liblsl-Java

LSL/liblsl-Java$ javac -cp jna-4.2.2.jar edu/ucsd/sccn/LSL.java examples/SendData.java LSL/liblsl-Java$ javac -cp jna-4.2.2.jar edu/ucsd/sccn/LSL.java examples/ReceiveData.java

LSL/liblsl-Java$ java -Djna.nosys=true -cp "jna-4.2.2.jar:." examples.SendData

Open a new terminal window (don't close the old one). LSL/liblsl-Java$ java -Djna.nosys=true -cp "jna-4.2.2.jar:." examples.ReceiveData

If it's working, you will see streamed data appearing in your receive window. Let me know if, when, and how this fails.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/sccn/labstreaminglayer/issues/163#issuecomment-273252273, or mute the thread https://github.com/notifications/unsubscribe-auth/ANKJX_bSftkZuzb5SKUuBHCVWnoFT_jaks5rTQWngaJpZM4LZsYV .

-- Juan A. Barios Heredero, M.D., PhD Center for Biomedical Technology (CTB) Universidad Politécnica de Madrid Parque Científico y Tecnológico de la UPM Campus de Montegancedo 28223 Pozuelo de Alarcón, Madrid, ES work phone +34 91 336 46 54 www.ctb.upm.es

Hospital Ramón y Cajal Dept. Investigación Unidad de Neurología Experimental

mgrivich commented 7 years ago

I suspect that there is some problem with your lab streaming layer installation. Please rename (or delete) the LSL directory and get a fresh copy from github. Rebuild LSL from source and then repeat the Java only Send/Receive test above. What version of Linux are you using?

mgrivich commented 7 years ago

Use https://github.com/sccn/labstreaminglayer/tree/master/LSL/liblsl/project/code.blocks to build LSL.

JABarios commented 7 years ago

ok, I'll try tonight again (I recompiled yesterday, but maybe some library is still hanging somewhere). Is ubuntu 16.04, Do you know if someone is using java version?

2017-01-17 20:39 GMT+01:00 Matthew Grivich notifications@github.com:

Use https://github.com/sccn/labstreaminglayer/tree/master/ LSL/liblsl/project/code.blocks to build LSL.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/sccn/labstreaminglayer/issues/163#issuecomment-273276152, or mute the thread https://github.com/notifications/unsubscribe-auth/ANKJX_HuyNm0ZOgkVGLQjgirIUK1p3HRks5rTRj1gaJpZM4LZsYV .

-- Juan A. Barios Heredero, M.D., PhD Center for Biomedical Technology (CTB) Universidad Politécnica de Madrid Parque Científico y Tecnológico de la UPM Campus de Montegancedo 28223 Pozuelo de Alarcón, Madrid, ES work phone +34 91 336 46 54 www.ctb.upm.es

Hospital Ramón y Cajal Dept. Investigación Unidad de Neurología Experimental

mgrivich commented 7 years ago

Java send/receive working for me. I'm on Ubuntu 14.04.4 LTS.

rodrigohubner commented 7 years ago

@mgrivich @JABarios I have the same problem using "send" in java and "receive" in everything else language. I got the newest LSL program and rebuild using codeblocks. The follow error ocurred when I execute the receive code:

$ java -Djna.nosys=true -cp "jna-4.2.2.jar:." examples.ReceiveData
Resolving an EEG stream...
Note: The stream named '(invalid: bad lexical cast: source type value could not be interpreted as target)' could not be recovered automatically if its provider crashed because it does not specify a unique data source ID.
Error while receiving the stream info (Invalid argument); retrying...
edu.ucsd.sccn.LSL$LostException: The stream has been lost.
    at edu.ucsd.sccn.LSL.check_error(LSL.java:900)
    at edu.ucsd.sccn.LSL$StreamInlet.info(LSL.java:568)
    at edu.ucsd.sccn.LSL$StreamInlet.info(LSL.java:569)
    at examples.ReceiveData.main(ReceiveData.java:14)

Note: I'm using Fedora 25 64 bits. Did you find some solution?