<div dir="ltr">Again, apologies for my ignorance - are you suggesting that if the NUT application was built against openusb this would probably be fixed?<br><div><br></div><div>If so I'm happy to give this a try - any idea how can I tell NUT to build against openusb instead of libusb?</div><div><br></div><div>Regards,</div><div>Richard</div></div><br><div class="gmail_quote">On Sun, Apr 5, 2015 at 2:28 AM Charles Lepple <<a href="mailto:clepple@gmail.com">clepple@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">On Apr 4, 2015, at 8:53 PM, Richard Flint <<a href="mailto:richard.flint@gmail.com" target="_blank">richard.flint@gmail.com</a>> wrote:<br></div><div style="word-wrap:break-word"><div><br><blockquote type="cite"><div style="font-family:Helvetica;font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">I have used the truss command as directed. I have attached both the driver output and the last few sections of truss output leading to the hang. Both outputs end at the CTRL+C i pressed when i was forced to end the processes.</div><div style="font-family:Helvetica;font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br></div><div style="font-family:Helvetica;font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">Hope this is helpful. Please bear with me if i didn't run it with the right options etc - as I mentioned, I'm a little new to Solaris.</div></blockquote><div><br></div></div></div><div style="word-wrap:break-word"><div><div>Well, it did provide some information, but I'll be honest that I don't know what else we can get from truss.</div><div><br></div><div>Stepping back a bit, here is the stack:</div><div><br></div><div>upsc --- upsd --- nutdrv_qx --- libusb -+- Solaris kernel --- UPS</div></div><div><br></div><div>truss is tracing at the "+" sign: the boundary between user space and kernel space.</div><div><br></div><div>When the driver gets a valid response, the truss log looks like this:</div><div><br></div><div><div><font face="Courier New">5834:      Q u i c k   u p d a t e . . .</font></div><div><font face="Courier New">5834:   write(2, "\n", 1)                               = 1</font></div><div><font face="Courier New">5834:   write(5, 0x082DA320, 16)                        = 16</font></div><div><font face="Courier New">5834:      !\t\002\0\0\b\0 Q S\r\0\0\0\0\0</font></div><div><font face="Courier New">5834:   write(2, "   1 6 1", 4)                         = 4</font></div><div><font face="Courier New">5834:   write(2, " .", 1)                               = 1</font></div><div><font face="Courier New">5834:   write(2, " 3 9 5 1 0 8", 6)                     = 6</font></div><div><font face="Courier New">5834:   write(2, "\t", 1)                               = 1</font></div><div><font face="Courier New">5834:   write(2, " s e n d :   Q S", 8)                 = 8</font></div><div><font face="Courier New">5834:   write(2, "\n", 1)                               = 1</font></div><div><font face="Courier New">5834:   open("/dev/usb/665.5161/0/if0in1stat", O_RDWR)  = 8</font></div><div><font face="Courier New">5834:   write(8, "01", 1)                               = 1</font></div><div><font face="Courier New">5834:   open("/dev/usb/665.5161/0/if0in1", O_RDONLY)    = 9</font></div><div><font face="Courier New"><b>5834:   read(9, " ( 2 4 5 . 4   2", 8)                  = 8</b></font></div><div><font face="Courier New">5834:   close(9)                                        = 0</font></div><div><font face="Courier New">5834:   close(8)                                        = 0</font></div><div>...</div><div><br></div><div>The failed poll at the end looks like this:</div><div><br></div><div><font face="Courier New">5834:      Q u i c k   u p d a t e . . .</font></div><div><font face="Courier New">5834:   write(2, "\n", 1)                               = 1</font></div><div><font face="Courier New">5834:   write(5, 0x082DA320, 16)        (sleeping...)</font></div><div><font face="Courier New">5834:   write(5, 0x082DA320, 16)                        = 16</font></div><div><font face="Courier New">5834:      !\t\002\0\0\b\0 Q S\r\0\0\0\0\0</font></div><div><font face="Courier New">5834:   write(2, "   1 6 9", 4)                         = 4</font></div><div><font face="Courier New">5834:   write(2, " .", 1)                               = 1</font></div><div><font face="Courier New">5834:   write(2, " 8 5 8 9 3 0", 6)                     = 6</font></div><div><font face="Courier New">5834:   write(2, "\t", 1)                               = 1</font></div><div><font face="Courier New">5834:   write(2, " s e n d :   Q S", 8)                 = 8</font></div><div><font face="Courier New">5834:   write(2, "\n", 1)                               = 1</font></div><div><font face="Courier New">5834:   open("/dev/usb/665.5161/0/if0in1stat", O_RDWR)  = 8</font></div><div><font face="Courier New">5834:   write(8, "01", 1)                               = 1</font></div><div><font face="Courier New">5834:   open("/dev/usb/665.5161/0/if0in1", O_RDONLY)    = 9</font></div><div><font face="Courier New"><b>5834:   read(9, 0xFC9BC650, 8)          (sleeping...)</b></font></div><div>^C</div></div><div><br></div><div>I did run across a comment in the NUT <a href="http://configure.ac" target="_blank">configure.ac</a> that says "dnl FIXME: Sun's libusb doesn't support timeout (so blocks notification)". This is unfortunate, since other libusb platforms will time out after ~5 seconds, and most of the drivers have retry logic to handle that.</div><div><br></div><div>I couldn't find any relevant source code when searching for Solaris libusb 0.1.7 with Google. Do you have any other information about the libusb that is installed there?</div><div><br></div><div>There is also this fork of libusb that claims to support Solaris, and the code seems to have timeouts: <a href="http://sourceforge.net/projects/openusb/" target="_blank">http://sourceforge.net/projects/openusb/</a></div></div><div style="word-wrap:break-word"><div><br></div><div>
<span style="border-collapse:separate;border-spacing:0px"><div>-- </div><div>Charles Lepple</div><div>clepple@gmail</div><div><br></div></span><br>

</div>
<br></div></blockquote></div>