AVerMedia Live Gamer 4K (GC573) on Linux

Hello, thought I’d share this with you given there are some threads like Any way to set up the AverMedia Live Gamer 4K GC573 in Linux and 4K + HDR Capture Options on here.

(TL;DR below)

In case you’re not aware the Live Gamer 4K (GC573) does not have official Linux support (only Windows 10 x64), however there is a different model made by AVerMedia called the CL511HN which is very similar under the hood. The Windows drivers of it and the GC573 are interchangeable, though not all features work (probably down to different firmware).

Now recently they released a Linux driver for the CL511HN on their download page, of interest is the driver description “Support users to complie driver by themselves.” Now unfortunately this does not mean the driver is fully open-source. They published a binary blob (AverMediaLib_64.a) that seems to contain libraries to interface with the card’s components, but the code that links to the Linux kernel and v4l2 is there and open for us to read/modify. The build/install scripts that are included aren’t great and have a typo but after a bit of mucking around I got it to work:

The driver only officially supports Ubuntu 16.04-20.04 and Kernels up to 5.4.0, this limitation seems to be mainly due to Ubuntu’s kernel still exporting certain symbols that have been removed from the mainline kernel. But since those parts of the driver are open I was able to patch it and get it to work on Fedora 32 as well.

tl;dr: AVerMedia released a semi-open Linux driver for their “enterprise” card that has drivers that are compatible with the LG4K. With a few patches they can be made to work with the consumer variant.


GitHub repository containing driver + patches: https://github.com/derrod/lg4k-linux

Caveats:

  • RGB LEDs will keep blinking red as if the driver isn’t installed
  • Only the YUV 4:2:2 mode seems to work (may be due to firmware differences)
  • Driver does not load automatically and requires manual re-installation every time there’s a kernel update
  • Requires some minor modifications to compile without Ubuntu’s kernel patches, those are in the fedora branch (since I tested it on Fedora 32)

I really don’t know much about Linux driver programming, but from what I’ve read it seems that making the driver load automatically should be fairly trivial by using MODULE_DEVICE_TABLE. Turning off the LEDs may be possible by looking at the Windows/Mac driver and see if there’s a command or something you can send to control them.

Edit: I’ve added the device table export to the entry.c file, the driver will now load automatically on boot.

Edit2: Also done some more poking around, seems like the RGB modes just won’t work on Linux, which is a shame. Maybe somebody can dig deeper into the other drivers to see if we can still get that on Linux.

I’ve also confirmed that the Linux driver requires the latest firmware (´2019.12.05´) to be flashed, this cannot be done on Linux currently so unless you’re lucky and your card comes with it you’ll have to boot into Windows at least once.

3 Likes

That is very cool. I’ll look into that even tho the GC573 already works (sort of, see my issues in my thread), but a (semi-)official driver is definitely nice to have.

Is there any chance you could get an RPM built for that? Or is that too much? :stuck_out_tongue:

/edit
Nevermind, I should read properly… I thought you were referring to the Live Gamer Ultra :smiley: Anyway still cool :slight_smile:

also CC @FurryJackman you might be interested in this?

There might be trouble with the binary blob so you cannot release a pre-made driver because it needs the binary blob and redistribution of the binary blob might be prohibited.

The biggest breakthrough would be 4K 60p capture if it’s possible, because there doesn’t exist 4K 60p capture for under the $800 the Magewell currently sells for.

This could help transition “All Games Done Quick” to Linux if they can use Avermedia PCI-E cards. Get in touch with their stream engineers and see if you can get them to take a look at this.

I don’t plan on releasing this as a package or anything, but I might write a script that downloads the original driver from AverMedia’s website, applies the patches and the compiles it. That would probably be fine. Right now I just put everything on GitHub because why not.

4K60 capture works on Linux, it’s just limited to 4:2:2. No idea why RGB doesn’t work, it does on Windows and I think macOS (with the Live Gamer BOLT, which is basically the Live Gamer 4K but in an external Thunderbolt box).

I’m friends with some of the GDQ engineers, I don’t think they have any interest to switch to Linux, in part due to some of the features they rely on very heavily such as the browser source not working or not being feature complete on Linux (e.g. missing hardware acceleration).

That’s not true. Since version 25 they now ship with a Browser source on Linux.

The third party alternative even lists OBS’ official solution over their third party solution:

You could ask Tk-Glitch to help with the scripts since most of his Wine build scripts are popular. Since this can contribute to Linux Gaming, he’d be a good person to get onboard with scripts and build environments.

Our official builds actually don’t ship with a browser source right now due to some outstanding issues that I’m not entirely familiar with (I do not maintain the Linux builds). But I should’ve been more precise there, while the browser source itself works, some features like hardware acceleration don’t. I think there’s also some other stuff but I’d have to cross-check.

You can fork the bazukas read-only repo and try to improve upon it. Since the actual OBS browser source remains broken, might be time for another fork that has working hardware acceleration.

If only it were that easy… I think CEF just doesn’t support certain features on macOS and Linux, and it also doesn’t work on Windows with newer Chromium builds due to internal changes that CEF hasn’t caught up with. But this is getting awfully off-topic.

Tk-Glitch should be able to get something like Vagrant or similar working to build the driver, and can provide the groundwork so it can run in a Docker container. I would highly suggest getting in touch with him for this project.