All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tolga Cakir <tolga@cevel.net>
To: Steven Toth <stoth@kernellabs.com>
Cc: Linux-Media <linux-media@vger.kernel.org>
Subject: Elgato Game Capture HD on Linux
Date: Sun, 3 Jan 2016 19:26:31 +0100	[thread overview]
Message-ID: <568967D7.60403@cevel.net> (raw)
In-Reply-To: <CALzAhNXOzR-HXLANQvT=GeskxmiHSJgd1TffrHy_pVhLeQXdTQ@mail.gmail.com>

Hi Steven,


I wish you a happy new year, it's been a while. I've made great success 
on the Elgato Game Capture HD driver for Linux - the major features are 
working. Currently, it's supporting capturing / streaming HDMI with 
1080p30 and 720p60, and component with 1080p30, 1080i60, 720p60 and 
576p50 (PAL). Eventhough I've just quickly hacked together everything, 
I've learned alot.

The official Mac OS X drivers included files with comments. They were my 
cheatsheet. One important thing, I've just recently figured out: the 
official driver is not doing stuff sequentially, like I've always 
assumed. It's doing many things in parallel using threads. This is the 
reason, why reverse engineering has been a nightmare for me, cause lots 
of unrelated, random packets showed up and I couldn't interpret them. No 
two USB logs looked nearly the same - there were always differences. 
Sometimes major, sometimes minor.

There seems to be one thread, which is trying to receive bulk data on 
endpoints 0x04 and 0x01 (maybe even one thread per endpoint?), without 
any sleep. This was causing LOTS of USB log entries in conjunction with 
my USB hardware analyzer - talking about 5 - 8 million lines for 20 seconds.

Another thread is constantly checking the input source's information, 
like resolution (small sleeps, unlike bulk receive). If it changes, this 
thread writes new, customized configuration to the device. I have logged 
lots of different traffic and am sure, that I can track this down.

There seems to be another thread, which seems to do just the things, I 
was actually trying to track down in the first place: plain simple 
device setup / initialization. Just sending over some packets, like 
bitrate configuration and video output resolution. Luckily, most of 
these values are commented in Elgato's official Mac OS X driver and I've 
also figured out, how most of them work 
(https://github.com/tolga9009/elgato-gchd/blob/master/commands.h).

Eventhough lots and lots of refactoring is urgently waiting for me 
(honestly, I'm ashamed of it), I think it's atleast a good point to 
start. I'm gonna work on refactoring / tidying up next major hacking 
session in about 2 - 3 months. You can find the latest code here: 
https://github.com/tolga9009/elgato-gchd. Looking forward to port this 
over to V4L2, once the refactoring is done.

If you're interested in how things turned out, I've even uploaded a 
small video presentation on YouTube: 
https://youtu.be/rpm6TJu6HkE?t=6m34s. You can skip it to around 6:30, 
cause I'm just showing how to compile & firmware extraction first.


Cheers,
Tolga

      reply	other threads:[~2016-01-03 19:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-09  1:48 Support for Elgato Game Capture HD / MStar MST3367CMK Tolga Cakir
2014-05-09 12:38 ` Steven Toth
2014-12-22 21:07   ` Tolga Cakir
2014-12-22 23:42     ` Steven Toth
2016-01-03 18:26       ` Tolga Cakir [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=568967D7.60403@cevel.net \
    --to=tolga@cevel.net \
    --cc=linux-media@vger.kernel.org \
    --cc=stoth@kernellabs.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.