BF: remove incorrect code on removing eyetracker generated by builder#6526
Conversation
|
This seems fine to remove, though as you suggest in your PR to the sr research plugin I think it would be better to implement |
I actually tried that implementation first but realized that it conflicts with how ioHub server client likes to be closed. Basically if I get the sense that Sol just had a different way of handling closing devices in It might be better to let the ioHub server process handle the start/stop of ioHub devices and not try to What I was suggesting in my PR to the sr-research plugin repo is to implement |
This BF is a bit complicated to explain. Essentially I was trying to figure out why is EyeLink eyetrackers not properly shutdown at the end of an experiment, which led me to these lines of code generated by builder that look like they are meant to shut down an eyetracker.
However, if we look at the removeDevice() method, it relies on an exposed
close()method. But for all ioHub devices, they are hosted on separate processes and accessed through ioHubDeviceView instances over a server client. Therefore, callingdeviceManager.removeDevice('eyetracker')doesn't actually shut down an eyetracker process (or in fact, any ioHub devices stored in this dictionary). TheioHubeyetracker is only shutdown when the ioServer is stopped as a part of thecore.quit()procedures. TheterminateHubProcess()method calls_close()on each of the ioHub devices, includingEyeTrackerDevicesuch as for the mousegaze.I'm proposing to remove these confusing lines when generating script from builder, since they don't actually shut down eyetrackers. My primary problem of not closing EyeLink correctly is actually caused by something related:
_close()isn't even implemented in thepsychopy-sr-researchpackage, which I'll PR to that repo to fix.