Hi
I added the navail = TouchEventAvail(dev) line and write the number out. It is indeed counting down before it freezes (see below).Yep, that output looks exactly as expected with properly working queue management. With the current, just updated, PTB beta, Matlab shouldn't crash anymore, but the queue should simply silently overflow if it doesn't get emptied quick enough.So as far as i'm concerned, PTB either works as expected, or the problem can't be resolved without me having convenient access to proper touchscreen hw.Yes, I can increase the value for numSlots again, finding a value that does not lead to a segmentation fault. However, my reasoning to reduce the number was that I actually get touch events in pretty fast cycles, since, similar to my first chaotic example test script, I run an ongoing while loop and check for events in every iteration, i.e. within a couple of milliseconds. Therefore I did not see the need to pre-allocate a huge buffer.Right in principle, but you'd have to make sure the buffer is always big enough that it could cope with a multi-second pause if your script would be paused/stalled on something. And the default queue size of 100000 slots doesn't consume more than 62 MB even with 5 touchscreens active, a tiny amount of memory on modern multi-GB RAM machines.I can't see however, how the current code in PTB Beta could possibly freeze, even with a tiny queue. The worst that should happen would be loss of some touch events, e.g., from a finger motion trajectory.If a freeze indeed happens and this is not a bug in your script, but something that also happens with our scripts, then i'm out of ideas and could only debug this with a suitable touchscreen. Donations welcome.-mariowolf1 touches still in queue0 touches still in queue1 touches still in queue0 touches still in queue1 touches still in queue0 touches still in queue0 touches still in queue0 touches still in queue2 touches still in queue1 touches still in queue0 touches still in queue2 touches still in queue1 touches still in queue0 touches still in queue3 touches still in queue3 touches still in queue2 touches still in queue1 touches still in queue0 touches still in queue1 touches still in queue0 touches still in queue0 touches still in queue0 touches still in queue0 touches still in queue0 touches still in queue0 touches still in queue1 touches still in queue0 touches still in queue0 touches still in queue1 touches still in queue0 touches still in queue0 touches still in queue0 touches still in queue0 touches still in queue1 touches still in queue0 touches still in queue0 touches still in queue0 touches still in queue0 touches still in queue1 touches still in queue0 touches still in queue0 touches still in queue0 touches still in queue0 touches still in queue1 touches still in queue0 touches still in queue0 touches still in queue