| Reference | Downloads | Github

EEG: send stimulus triggers as HDMI or VGA output


I am running an EEG experiment for which I would like to send event triggers to the EEG recording computer.
For stimulus presentation, I am using a laptop that does not have a parallel port (and if possible, we don’t want to have intervening adaptors etc.), but VGA, HDMI, USB and ethernet interfaces. The EEG system receives digital inputs via a Dual Link DVI-I interface.
Now the most straightforward solution would be to send triggers from Psychopy via HDMI or VGA output pins to the DVI-I input pins with a regular HDMI/VGA to DVI-I adaptor and a HDMI or VGA cable. Is there any way to control the HDMI or VGA pins explicitly in my Psychopy code, just like I can control the parallel port?

Thanks for your help!

Good luck with that!

I highly doubt this will be possible. Either at the sending or the receiving end, you are highly unlikely to be able to either read or write to pins on those ports. All we can control is the information sent to the graphics card to create an image on screen. The card then controls how that information is translated for the analog or digital video out protocols. We don’t get direct control over that: the parallel port is special in that way. The parallel port is a relic of bygone era: we don’t otherwise get that “close to the metal” in a modern computer.

If you want to use the video signal to send EEG triggers, what some people do is use a photodiode to directly measure changes in illumination from the screen. This is actually a great way to do it, as it measures the actual time of the stimulus changing on screen, incorporating all of the possible lags and variances along the way, rather than when we think in our code that the stimulus was displayed (and would actually be more accurate than theoretically monitoring the VGAS/DVI port).

Thanks for your help, Michael!

We are actually using a photodiode right now, but the experience in the data we have collected so far is that our signal is subject to a lot of noise (moving cables etc…) that sometimes makes signal processing and offline estimation of onset and offset times a real pain. Then, the diode signal increases and decreases quite sluggishly (due to an attempt on filtering noise) and this makes discovering fast stimulus sequences hard. If you have any suggestion on a very nice microcircuit minimizing those issues, I would be more than grateful!

By adding a cable to send triggers to the EEG system, we wanted to have a back-up solution in case our diode leaves us for some reason, and secondly, make data preprocessing easier. But it sounds like we will have to deal with that, at least with our EEG system. Hopefully newer systems solve this issue more efficiently.

Have you tried a USB to parallel adapter? It may introduce some amount of lag, but sounds like it might be more reliable than your current photodiode setup.

Is the EEG networkable? UDP messages are very easy to send from Python and are reliable and quick.

We are using a relatively old medical system with quite limited possibilities, so there’s no networking etc. In terms of USB to parallel port, the Labjack team told me that converting first to the labjack and then to DVI is feasible but highly custom-built and probably not very precise.

Good news is, we managed to improve the diode setup to provide more boxcar-like signals and a good SNR and I think it is an acceptable solution now.

Thanks for your help!

1 Like