tolga9009 / elgato-gchd

DISCONTINUED. Reverse engineering the Elgato Game Capture HD to make it work under Linux.
Other
282 stars 36 forks source link

Pause breaks the elgato-gchd #13

Open Glog78 opened 8 years ago

Glog78 commented 8 years ago

Just a small feedback -> i used mpv to play the stream and paused the stream. That works for a few seconds but if you leave it on a longer it breaks it. The reset when closing the driver didn't recover it, so i had to replug the card.

tolga9009 commented 8 years ago

Thanks for reporting. This is due to the nature of a FIFO pipe. The driver starts to run, as soon as you open the file. Even if you close the file, the FIFO still gets filled with up-to-date data.

However, if you pause your video player, you're breaking the FIFO. The driver wants to write data, but it needs to be read first (First-In-First-Out), to free up space for incoming data.

Pausing the read will stop device communication and break streaming.

Unfortunately, this is currently not fixable. If you're done streaming / using the device, close the file or your video player and stop the terminal. If you want to stream again, you can do that without replugging.

tolga9009 commented 8 years ago

I have removed the `wontfix´ label. Actually, I have an idea how to fix this. The device gets configured, as soon as the FIFO is opened. Once the device is configured, it constantly needs a buffer to write to.

Once the FIFO is closed / paused, the device temporarily has no buffer to fill - it fails and doesn't respond anymore. However, we could just create another function, which doesn't write to the FIFO, but into an empty array, as long as the FIFO is not opened again. We would need some kind of a flag or watcher function, deciding whether to write to disk / FIFO or empty buffer.

I will work on this with low priority, but I will work on it. Thanks for reporting!

tolga9009 commented 8 years ago

Commit 8a84df8d4ea6a82d32fbfb0711d73a38eac55f1d fixes this issue. Pausing or stopping the FIFO will no longer break the device. However, pausing might still break the video stream. Reopening the file should fix the issue in such cases. You no longer need to stop the terminal or to replug the device, if you need to pause or stop the video and continue later.

Cheers, Tolga

tolga9009 commented 8 years ago

Reopening this issue again. Seems like it was not the correct way to fix this issue. The official drivers are somehow able to recover from such a state, we need to analyze it.

seveirein commented 8 years ago

The current dev build should address this issue. Maybe not perfectly.