[PD] Re: hanging hid object?

Hans-Christoph Steiner hans at eds.org
Tue Jul 11 02:01:55 CEST 2006


We should keep this on the list since other people besides me can  
answer this question, perhaps quicker too, and it might be of general  
interest.

On Jul 6, 2006, at 1:55 PM, pix wrote:

> hey hans,
>
> i was wondering if you have experienced this behaviour where, on  
> linux,
> the hid the hid object hangs if the device disappears (even only
> briefly) while hid has it open?
>
> i thought it might have just been the problem that the device was
> getting a new device file name when it returned, but i have now done
> some udev trickery to make sure the steim junxion box we are using
> always gets the same event number, and the problem still persists.
>
> once the device disappears hid no longer responds to close or open
> messages.
>
> it would be cool if there was a work around because we occasionally  
> have
> problems with the junxion box we are using 'winking out' for just long
> enough for linux to kill off the device.

Hmm, I haven't seen that, but its not surprising that it would hang.   
Basically, the object is reading that file handle every 5 ms, or  
whatever you set the poll time to.  So if sometime reads from a non- 
existant filehandle that's open, then it'll hang, no matter how you  
are doing it.

I have used the junxionbox some and I haven't seen that problem.  I  
think the best way to solve that problem would be to figure out  
what's causing the junxionbox to wink out.  Its in beta test so I  
think they would be interested to hear about that problem.  I was  
just at STEIM for three weeks working with Rene and Taku, who are  
working on the junxionbox.  Taku performs with his junxion-related  
devices, so he's dealt with a lot of these issues.

I can't think of anything offhand as an easy workaround.  You might  
be able to test the filehandle before reading from it, but I am  
worried about the overhead that might introduce.  A key part of hid  
is making it as low latency as possible, and not to take a ton of  
CPU.  Such a check might be pretty minimal but running it 200 times a  
second adds up.  Can any of the big time Linux heads think of a way  
to deal with this?

.hc

------------------------------------------------------------------------

The arc of history bends towards justice.     - Dr. Martin Luther  
King, Jr.






More information about the Pd-list mailing list