elgato-gchd icon indicating copy to clipboard operation
elgato-gchd copied to clipboard

Pause breaks the elgato-gchd

Open Glog78 opened this issue 9 years ago • 5 comments

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.

Glog78 avatar Jan 02 '16 01:01 Glog78

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 avatar Jan 02 '16 10:01 tolga9009

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 avatar May 14 '16 06:05 tolga9009

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 avatar May 20 '16 21:05 tolga9009

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.

tolga9009 avatar Jun 02 '16 00:06 tolga9009

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

seveirein avatar Oct 25 '16 23:10 seveirein