Page 2 of 9
Re: running g.USBamp with BCI2000 using Windows 11
Posted: 11 Apr 2024, 08:35
by mellinger
We could not reproduce your gUSBamp with BCI2000 on Windows 11.
It seems your Surface Pro 5 is not compatible with Windows 11:
https://support.microsoft.com/en-us/sur ... ed09f9058e
Depending on processor, I would at least not suggest using a Microsoft Surface Pro to run BCI2000.
For now I just want to be able to save the output from the USBamp, something I couldn't do in g.USBamp demo. Please share the link how.
There is no link available for that, but it's not too complicated:
* In BCI2000Launcher, choose the gUSBamp source, the DummySignalProcessing, and the DummyApplication.
* Setup the gUBSamp source as before, and specify the parameter file in BCI2000Launcher.
* Choose an output directory in BCI2000Launcher.
* Click Launch.
* In the Operator module, click SetConfig and Start.
* When done with the recording, click Suspend.
* Your data file will be available at the location chosen before.
* Every time you click Start, a new data file will be created at the same location, with file names being numbered automatically.
Let me know if you have further questions.
Re: running g.USBamp with BCI2000 using Windows 11
Posted: 11 Apr 2024, 09:43
by whwilbur
mellinger wrote: 11 Apr 2024, 08:35
We could not reproduce your gUSBamp with BCI2000 on Windows 11.
It seems your Surface Pro 5 is not compatible with Windows 11:
https://support.microsoft.com/en-us/sur ... ed09f9058e
Depending on processor, I would at least not suggest using a Microsoft Surface Pro to run BCI2000.
I just checked the windows version of my Surface Pro 2017 now and surprised to find out I am running Windows 10 all this time (see below). I thought I was running Windows 11

I'll try to reinstall Windows to see if the Buffer Overflow will go away. But based on the following, the processor is fast enough, is it not? Btw.. did your mean above the gUSBamp with BCI2000 is not compatible with Windows 11 that is why you can't reproduce it? Or did you mean you can't reproduce the Buffer overflow error? Note my source is Netech EEG simulator at 10uV 50Hz with 1000Hz Bandwidth set. The noise is much at about 3uV to 5uV. So perhaps there may be more information from my gUSBamp that BCI2000 may not handle in the roundtrip?
Thanks for your great patience.
For now I just want to be able to save the output from the USBamp, something I couldn't do in g.USBamp demo. Please share the link how.
There is no link available for that, but it's not too complicated:
* In BCI2000Launcher, choose the gUSBamp source, the DummySignalProcessing, and the DummyApplication.
* Setup the gUBSamp source as before, and specify the parameter file in BCI2000Launcher.
* Choose an output directory in BCI2000Launcher.
* Click Launch.
* In the Operator module, click SetConfig and Start.
* When done with the recording, click Suspend.
* Your data file will be available at the location chosen before.
* Every time you click Start, a new data file will be created at the same location, with file names being numbered automatically.
Let me know if you have further questions.
Re: running g.USBamp with BCI2000 using Windows 11
Posted: 11 Apr 2024, 10:48
by whwilbur
to continue above (see last message).. I just used dummysignal processing and dummyapplication as you suggested.. still too many buffer overflow after Start. and the log says halting device acquisition and lost connection. My Surface pro 2017 is too slow? (see spec in my last message)

Re: running g.USBamp with BCI2000 using Windows 11
Posted: 11 Apr 2024, 10:52
by mellinger
But based on the following, the processor is fast enough, is it not?
It's a 2-core mobile processor with low TDP, so it may not provide a lot of processing power all the time, especially when cooled passively (without a fan). But a decade ago, we were running BCI2000 on similar processors, and it ran fine.
From your screen shot, I can see that your configured block duration is 1.67ms. (Block duration is SampleBlockSize divided by SamplingRate.) This is quite ambitious, I would suggest 10 or 20ms at least. If you don't want to use BCI2000 for other than just recording EEG, there is no reason to stick to small block durations, so 50ms or 100ms is also OK. Just increase SampleBlockSize until the computer can keep up with the data.
Re: running g.USBamp with BCI2000 using Windows 11
Posted: 11 Apr 2024, 20:10
by whwilbur
mellinger wrote: 11 Apr 2024, 10:52
But based on the following, the processor is fast enough, is it not?
It's a 2-core mobile processor with low TDP, so it may not provide a lot of processing power all the time, especially when cooled passively (without a fan). But a decade ago, we were running BCI2000 on similar processors, and it ran fine.
From your screen shot, I can see that your configured block duration is 1.67ms. (Block duration is SampleBlockSize divided by SamplingRate.) This is quite ambitious, I would suggest 10 or 20ms at least. If you don't want to use BCI2000 for other than just recording EEG, there is no reason to stick to small block durations, so 50ms or 100ms is also OK. Just increase SampleBlockSize until the computer can keep up with the data.
Using SampleBlockSize of 50 instead of 8 and creating 10ms block duration seems more stable. But I noticed any multitasking can produce the missing bytes or buffer overflow.
I tried to save it as EDF so I can load it at EDFBrowser. I set the following to EDF instead of DAT.
However, when I ran EDFbrowser loading the file in data saved as EDF. I got the following error:
I googled and researched about it. I found the following site and others:
https://www.bci2000.org/mediawiki/index ... le_Formats
"EDF File Format
--FileFormat=EDF
EDF (European Data Format) is a standard for biosignal data especially popular in the area of sleep research.
EDF is limited to 16 bit data.
BCI2000 state variables will be mapped to additional signal channels.
BCI2000 parameters cannot be represented in EDF format. Setting the SaveAdditionalParameterFile parameter to 1 will save a separate BCI2000 parameter file along with the EDF data file.
Output in EDF format is implemented by the EDFFileWriter component."
I tried to add SaveAdditionalParameterFile 1 to the USBAMP.prm like this:
Storage:BCI2000FileWriter string FileFormat= EDF SaveAdditionalParameterFile = 1 // format of data file (readonly)
or this
Storage:BCI2000FileWriter string FileFormat= EDF // format of data file (readonly)
Storage:BCI2000FileWriter string SaveAdditionalParameterFile 1
but it won't run with the system log error messsage;
Script error: OnConnect, line 1: Could not load "C:/Users/AlbeP/Desktop/BCI2000.x64.bundled/usbamp.prm" as a parameter file.
I also put SaveAdditionalParameterFile 1 inside the BCI2000Launcher
It didn't work too as the word SaveadditionalParameter become part of the filename of the EDF
I even tried to put it in the batch file. But it didn't work either.
So how do you make the EDFBrowser load up the EDF file without error. I planned to extract the state vector from the BCI2000 EDF so the EDFWriter and even Matcad full version can load it properly with 100% data like in the raw.
I need to analyze them under FFT to extract signal in the 10uV range with frequency up to 1000Hz so I need the file to be unaltered and loadable in EDFwriter and Matcad. I'm first studying the frequencies before I would use BCI2000 signal processing to filter the raw data for any augmentation efforts.
Thank you. I read the documentations and your book for several hours.
Re: running g.USBamp with BCI2000 using Windows 11
Posted: 12 Apr 2024, 05:46
by mellinger
To use EDF data format, you need to specify "--FileFormat=EDF" on the command line when starting up the source module.
Unfortunately, you cannot do this in BCI2000Launcher, so you need to use a batch file for that purpose.
Make a copy of the StimulusPresentation_gUSBamp batch file, and rename it to your liking. Then, open the batch file in a text editor by right-clicking and choosing "Edit" or "Edit with Notepad".
Around the middle of the batch file, you will find the names of the signal processing module ("P3SignalProcessing") and of the application module ("StimulusPresentation"). Replace these with "DummySignalProcessing" and "DummyApplication", respectively.
Further, there is a line that loads the gUSBamp-specific parameter file. Replace that with the path to your own parameter file.
Save the batch file, and make sure it works by double-clicking it.
Now, to add the "--FileFormat=EDF" part, edit the batch file again, and locate the line that starts up gUSBampSource. There, after "--local", add
"--FileFormat=EDF" and make sure it's separated by space characters before and after.
Save the batch file, and double-click. If everything works, you will have a data file with a ".edf" extension rather than ".dat".
Re: running g.USBamp with BCI2000 using Windows 11
Posted: 12 Apr 2024, 11:27
by whwilbur
mellinger wrote: 12 Apr 2024, 05:46
To use EDF data format, you need to specify "--FileFormat=EDF" on the command line when starting up the source module.
Unfortunately, you cannot do this in BCI2000Launcher, so you need to use a batch file for that purpose.
Make a copy of the StimulusPresentation_gUSBamp batch file, and rename it to your liking. Then, open the batch file in a text editor by right-clicking and choosing "Edit" or "Edit with Notepad".
Around the middle of the batch file, you will find the names of the signal processing module ("P3SignalProcessing") and of the application module ("StimulusPresentation"). Replace these with "DummySignalProcessing" and "DummyApplication", respectively.
Further, there is a line that loads the gUSBamp-specific parameter file. Replace that with the path to your own parameter file.
Save the batch file, and make sure it works by double-clicking it.
Now, to add the "--FileFormat=EDF" part, edit the batch file again, and locate the line that starts up gUSBampSource. There, after "--local", add
"--FileFormat=EDF" and make sure it's separated by space characters before and after.
Save the batch file, and double-click. If everything works, you will have a data file with a ".edf" extension rather than ".dat".
I did everything as instructed above. When running it. I got the following error:
So I googled everthing about the int16. I found many references and read about SignalType=Int16 which I entered iinto the prm file, the batch file.. but still it won't work.
I inserted in prm file each, and both the following, but file won't load with error.
Source:Signal%20Properties int Signaltype=int16
Source:gUSBamp int Signaltype=Int16
I tried putting in batch:
Start executable gUSBampSource --local --FileFormat=EDF --SignalType=int16
System log still showed the error "Signal data type must be int16 for EDF files.".
I can't find Signaltype in the BCI2000Launcher either.
So where are you supposed to put Signaltype=int16 and how to place it right?
And I read the following at google books:
https://books.google.com.ph/books?id=20 ... pe&f=false
What must be the value in SourceChGain? It got error when I put 10000. The original is 1 1 1 1 1 1 1 1
Thank you.
Re: running g.USBamp with BCI2000 using Windows 11
Posted: 12 Apr 2024, 14:39
by mellinger
So where are you supposed to put Signaltype=int16 and how to place it right?
Execute your batch file. In the Operator window, click "Config". Then, go to the "Source" tab and there to the "Signal Properties" section.
Locate the "SignalType" parameter, and set it to "int16".
Then, click "Save Parameters" and save your parameters in place of your existing parameter file.
Re: running g.USBamp with BCI2000 using Windows 11
Posted: 12 Apr 2024, 14:42
by mellinger
What must be the value in SourceChGain? It got error when I put 10000. The original is 1 1 1 1 1 1 1 1
A good value for int16 data is 0.003muV. Open the Operator's config dialog and locate "Source"->"SignalProperties"->"SourceChGain".
There, enter "0.003muV" as many times as you have channels.
Save your parameter file as described in the previous post.
Re: running g.USBamp with BCI2000 using Windows 11
Posted: 12 Apr 2024, 17:32
by whwilbur
mellinger wrote: 12 Apr 2024, 14:39
So where are you supposed to put Signaltype=int16 and how to place it right?
Execute your batch file. In the Operator window, click "Config". Then, go to the "Source" tab and there to the "Signal Properties" section.
Locate the "SignalType" parameter, and set it to "int16".
Then, click "Save Parameters" and save your parameters in place of your existing parameter file.
But the problem is. There is no "SignalType" parameter in the Signal Properties or I could have easily seen it and set it, and not tried manually. See below.
Why is SignalType not there in the choices above? And how to set it manually in the batch or prm file? Note there is none mentioned at the reference itself (see image at url below) and I'm using the latest version:
https://www.bci2000.org/mediawiki/index ... :LSLSource
Re: running g.USBamp with BCI2000 using Windows 11
Posted: 13 Apr 2024, 10:44
by mellinger
I must apologize, the SignalType parameter was removed from the gUSBamp source a while ago.
So you need to use either GDF or BCI2000 as the output format.
Re: running g.USBamp with BCI2000 using Windows 11
Posted: 13 Apr 2024, 10:54
by whwilbur
mellinger wrote: 13 Apr 2024, 10:44
I must apologize, the SignalType parameter was removed from the gUSBamp source a while ago.
So you need to use either GDF or BCI2000 as the output format.
Why was it removed? What old version still has the Signaltype parameter?
It won't work even if I manually put Signaltype manually at batch?
EDFWriter can't run GDF so need to find old version of the BCI2000.. or is it removed right from the gUSBamp.dll?
Re: running g.USBamp with BCI2000 using Windows 11
Posted: 13 Apr 2024, 11:26
by mellinger
The SignalType parameter was removed in r5094, 8 years ago, because no one was using it, and it made the code overly complicated (because it implied reverse-applying the SourceChGain prior to forwarding the data).
You cannot use the EDF data format. You can use the GDF data format, or the BCI2000 data format.
Which data format you use depends on the tools you intend to use.
Re: running g.USBamp with BCI2000 using Windows 11
Posted: 13 Apr 2024, 11:37
by whwilbur
mellinger wrote: 13 Apr 2024, 11:26
The SignalType parameter was removed in r5094, 8 years ago, because no one was using it, and it made the code overly complicated (because it implied reverse-applying the SourceChGain prior to forwarding the data).
You cannot use the EDF data format. You can use the GDF data format, or the BCI2000 data format.
Which data format you use depends on the tools you intend to use.
Ok. I was able to run it and save as GDF and load it at EEGLab in Matcad. I was able to convert it in EEGlab from GDF to EDF too.
However, EDFBrowser couldn't run the converted EDF with the following error. If someone has tried another converter that works where the GDF is converted to EDF and loadable by EDFBrowser without error. Please let me know the converter name. Thanks.

Re: running g.USBamp with BCI2000 using Windows 11
Posted: 13 Apr 2024, 19:01
by whwilbur
Please see the comparisons between the output from BCI2000 (using GDF) on the top and the bottom using gUSBdemo. The output from BCI2000 appears noisier.
They both have same settings. 4800Hz sampling with 1000Hz bandwidth and Netech EEG input of 10uV, 50Hz. The BCI2000 output has more high frequency noise. Can you account where the extra noises coming from? Like when the application does a roundtrip from Source to DummySignal Generator, DummyAppliction, User and Operator. Can they introduce additional noises?
Compare to output directly from Source, without passing thru the DummySignalGenerator, DummyApplication, User. Can the Source output be cleaner?
Also when the Source got the signal from gUSBamp.dll What format is the data stream? Is it the same one that goes to the gUSBamp demo? Or did Gtec somehow makes the output to third party application noisier so as not to compete with their original $5000 g.recorder software?
Since BCI@000 is open source. What would it take to stream the data directly to source and save directly to GDF without having to pass through DummySignalGenerator, DummyApplications which may perhaps introduce more noses?