jpoet / HauppaugeUSB

MythTV wrapper around the Hauppauge HD-PVR2/Colossus2 driver
GNU General Public License v3.0
16 stars 5 forks source link

Stuck in disconnected loop #9

Open jwittkoski opened 5 years ago

jwittkoski commented 5 years ago

My device was plugged in so I'm not sure how it got in this state, but the messages continue indefinitely and a CTRL-C does NOT stop the process.

$ /opt/Hauppauge/bin/hauppauge2 -s E505-00-00D656E8 -i 3 -a 3 -d 2 -o test.ts
000:00:00.022780 C [main] hauppauge2.cpp:344 (main) - Initializing [Bus: 1, Port: 5] E505-00-00D656E8
000:00:00.291421 N [main] HauppaugeDev.cpp:501 (Open) - Opening Hauppauge USB device.
000:00:01.430321 E [main] USBif.cpp:550 (bulkWrite) - cannot bulk write to endpoint 0x01: No such device (it may have been disconnected)
000:00:01.430455 E [main] USBif.cpp:474 (controlMessage) - cannot send control message: No such device (it may have been disconnected)
000:00:01.441681 E [main] USBif.cpp:474 (controlMessage) - cannot send control message: No such device (it may have been disconnected)
000:00:01.442841 E [main] USBif.cpp:474 (controlMessage) - cannot send control message: No such device (it may have been disconnected)
000:00:01.553087 E [main] USBif.cpp:550 (bulkWrite) - cannot bulk write to endpoint 0x01: No such device (it may have been disconnected)
000:00:01.553202 E [main] USBif.cpp:474 (controlMessage) - cannot send control message: No such device (it may have been disconnected)
000:00:01.564418 E [main] USBif.cpp:474 (controlMessage) - cannot send control message: No such device (it may have been disconnected)
000:00:01.565569 E [main] USBif.cpp:474 (controlMessage) - cannot send control message: No such device (it may have been disconnected)
000:00:01.675803 E [main] USBif.cpp:550 (bulkWrite) - cannot bulk write to endpoint 0x01: No such device (it may have been disconnected)
000:00:01.675895 E [main] USBif.cpp:474 (controlMessage) - cannot send control message: No such device (it may have been disconnected)
000:00:01.687118 E [main] USBif.cpp:474 (controlMessage) - cannot send control message: No such device (it may have been disconnected)
000:00:01.688268 E [main] USBif.cpp:474 (controlMessage) - cannot send control message: No such device (it may have been disconnected)
000:00:01.798487 E [main] USBif.cpp:550 (bulkWrite) - cannot bulk write to endpoint 0x01: No such device (it may have been disconnected)
000:00:01.798592 E [main] USBif.cpp:474 (controlMessage) - cannot send control message: No such device (it may have been disconnected)

... messages continue ...
stevenviola commented 5 years ago

I've also observed the same behavior in #4. What I ended up doing was to patch USBif.cpp to add an error callback function if any USB errors are detected. This way, when the USB cable is unplugged, the application can gracefully shutdown, and close the video context properly. I'm not sure how MythTV will deal with that, but if it will restart the application than this could be a good solution.

If we think it's something that would be useful, I could put together a PR for this. In my application, it has been working very well to handle errors. This might also avoid the situation you encountered in #8 as well.

jwittkoski commented 5 years ago

I definitely think that cleanly exiting in this situation is a better outcome. It's easier to detect a failure has occurred and address it.

@jpoet would you be interested in including @stevenviola's patch file with the other patches?

jpoet commented 5 years ago

Yes, absolutely.

I will try to take a look at Steven's work within the next couple of days.

jpoet commented 5 years ago

jwittkoski, when you get a chance, please let me know if the latest version fixes this.

kocoman2 commented 1 year ago

getting this error also still, why and how to solve thx