Hi, I noticed that the LSL stream name is always the same "random" string from the getRandomString function. I think this is actually always the same string due to the way C implements rand()?
|
void getRandomString(char *s, const int len) |
|
{ |
|
int i = 0; |
|
static const char alphanum[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; |
|
for (i=0; i < len; ++i){ s[i] = alphanum[rand() % (sizeof(alphanum) - 1)];} |
|
s[len] = 0; |
|
} |
This causes problems, for example, when trying to stream from multiple headsets to LSL at the same time. A simple fix would be to use the streamName variable for the LSL stream name instead of source_id here:
|
info = lsl_create_streaminfo((char*)streamName,"EEG",numberOfChannels,samplingRate,cft_float32,source_id); |
This might be a bug in the LSL C API but the first parameter (streamName) doesn't actually seem to set the stream name. The stream name comes from the last parameter (source_id in this case).
Hi, I noticed that the LSL stream name is always the same "random" string from the
getRandomStringfunction. I think this is actually always the same string due to the way C implementsrand()?App-WearableSensing/CLI/dsi2lsl.c
Lines 171 to 177 in 827d177
This causes problems, for example, when trying to stream from multiple headsets to LSL at the same time. A simple fix would be to use the
streamNamevariable for the LSL stream name instead ofsource_idhere:App-WearableSensing/CLI/dsi2lsl.c
Line 199 in 827d177
This might be a bug in the LSL C API but the first parameter (
streamName) doesn't actually seem to set the stream name. The stream name comes from the last parameter (source_idin this case).