Community-maintained, AI-assisted, heavily patched Linux driver for the AVerMedia GC573 (PCI 1461:0054, subsystem 1461:5730).
Modernized for recent kernels. Experimental — development and testing only.
Last aligned with code: 2026-05-18 · Phase 3 (color / byte-order validation)
Note
Vendor blob: The driver links against AverMediaLib_64.a in the repository root (~565 KB, tracked in git). The Makefile copies it into driver/AverMediaLib_64.o at build time. See Legal — redistribution of this precompiled archive may be restricted.
Note
After every kernel upgrade, rebuild the module. vermagic must match uname -r (modinfo cx511h).
Kernel compatibility: Builds and runs on 6.19.x–7.x with matching headers (tested on CachyOS / Arch-style Clang kernels). There is no portable prebuilt .ko in the repo — always run ./build.sh LLVM=1 CC=clang on the machine (and kernel) you use.
| Feature | Status | Description |
|---|---|---|
| Build / Toolchain | Requires LLVM=1 CC=clang; GCC may fail on Clang-built kernels; uses AverMediaLib_64.a from repo root |
|
| Module Loading | ✅ [OK] | insmod.sh loads deps + driver/cx511h.ko, restores audio if PipeWire blocked |
| Signal Detection | 🟡 [PARTIAL] | HDMI lock via ITE6805 events; 4K inputs forced to 1080p in software (ITE6805_LOCK handler) |
| IRQ / Interrupts | ✅ [OK] | MSI with INTx fallback (pci_model.c) |
| System Stability | 🟡 [WORKAROUND] | Stable when avoiding I2C writes; hdmirxwr() during stream can still freeze |
| DMA Transfer | ✅ [OK] | Continuous streaming: doorbell MMIO 0x304 + IRQ ACK MMIO 0x10 per buffer |
| Capture Content | 🟡 [UNVERIFIED] | DMA path active; correct colors need frame dump + format check (see Debugging) |
| Driver Unload | ✅ [OK] | unload.sh: rmmod → PCI unbind → rmmod -f; audio services restored |
| Audio Capture | ✅ [OK] | ALSA AVerMedia CL511H: S16_LE/S24_LE, 32–192 kHz, 2 channels |
| General Use | ❌ [NO] | Not for daily use / production |
| Phase | Status | Description |
|---|---|---|
| Phase 1 (Reverse Engineering) | ✅ COMPLETE | Builds on modern kernels, probe, FPGA/ITE6805 bring-up |
| Phase 2 (Continuous Streaming) | 🟡 COMPLETE* | DMA/IRQ/doorbell at 60 fps; all I2C writes in stream_on skipped |
| Phase 3 (Color Correction) | 🟡 IN PROGRESS | FPGA CSC (MMIO 0x1040); byte-order / vip_cfg validation open |
| Phase 4 (Production Ready) | ⏳ PENDING | Robust PM, OBS/GStreamer, fixed test scripts, no I2C deadlock |
*Phase 2: End-to-end streaming uses the FPGA MMIO path only (
0x10,0x304,0x1040). ITE6805 register writes that the Windows driver performs instream_onare disabled.
Load from driver/ (or pass parameters to insmod):
cd driver
sudo insmod cx511h.ko force_input_mode=1
# Runtime: echo 1 | sudo tee /sys/module/cx511h/parameters/force_input_mode| Parameter | Type | Default | Description |
|---|---|---|---|
force_input_mode |
int | 0 | 0=Auto, 1=YUV422 BT.709, 2=YUV444 BT.709, 3=RGB Full, 4=RGB Limited |
debug_pixel_format |
int | -1 | -1=Auto; 0–3=YUYV/UYVY/YVYU/VYUY; 4–11=RGB variants (see aver_xilinx.h) |
auto_test_byteorder |
int | 0 | 1=On stream_on, cycle YUV byte orders 0–3 and log first pixels (see Known Issue #11) |
| Parameter | Type | Default | Description |
|---|---|---|---|
no_signal_pic |
charp | NULL | Bitmap when no input signal |
copy_protetion_pic |
charp | NULL | Bitmap for copy-protected content (typo preserved in symbol name) |
led_pin_r |
int | 3 | Red LED GPIO (-1=disabled) |
led_pin_g |
int | 4 | Green LED GPIO (-1=disabled) |
led_pin_b |
int | 5 | Blue LED GPIO (-1=disabled) |
Important
Kernel command line (GRUB / systemd-boot):
ibt=off iommu=ptibt=off—AverMediaLib_64.ahas no ENDBR64; Makefile uses-fcf-protection=noneandMODULE_INFO(ibt, "N")as extra mitigation.iommu=pt— passthrough mode for DMA.
- Kernel headers for running kernel (
/lib/modules/$(uname -r)/build) base-devel,llvm,clangAverMediaLib_64.ain repository root (included in clone)
# Build (output: driver/cx511h.ko, copy to project root)
./build.sh LLVM=1 CC=clang
# Verify vermagic
modinfo cx511h.ko | grep vermagic
# Load
sudo ./insmod.shbuild.sh copies cx511h.ko to the project root; insmod.sh loads driver/cx511h.ko (always the freshest build after build.sh).
sudo ./install.sh # requires cx511h.ko in project root
sudo ./insmod.sh # or: modprobe cx511h (after depmod)Install path: /lib/modules/$(uname -r)/kernel/drivers/media/avermedia/
Recommended: use ffplay / ffmpeg with explicit UYVY — avoid v4l2-ctl for streaming tests (see Known Issues).
sudo ./insmod.sh
# UYVY = FPGA native output in auto mode
ffplay -f v4l2 -input_format uyvy422 -video_size 1920x1080 -framerate 60 /dev/video0
sudo ./unload.sh./gst_1.0_raw_video.sh 0
./gst_1.0_raw_video_audio.sh 0Warning
Both scripts call v4l2-ctl (can hang the machine) and derive height from the wrong v4l2-ctl field — prefer ffplay until the scripts are fixed. Video should use UYVY from the card, not YUY2/YV12 without videoconvert from the correct capture format.
Source: driver/board/cx511h/board_v4l2.c → cx511h_stream_on().
- I2C reads —
ite6805_get_frameinfo(),get_workingmode(),get_colorspace(),get_sampingmode()(reads only; safe today) - CPU — fill
vip_cfg(resolution, framerate, colorspace, bypass, pixel format; optionalforce_input_mode) - MMIO —
aver_xilinx_enable_video_streaming(FALSE);msleep(50) - MMIO —
aver_xilinx_config_video_process(&vip_cfg) - MMIO —
pci_model_mmio_write(0x1040, csc_value)— FPGA CSC - MMIO —
msleep(200); optional pixel-format debug (debug_pixel_format/auto_test_byteorder) - MMIO —
aver_xilinx_enable_video_streaming(TRUE) - MMIO —
pci_model_mmio_write(0x304, 0x01)— initial doorbell
YUV422 from userspace is mapped to FPGA UYVY unless debug_pixel_format overrides.
| Operation | Registers | Mechanism |
|---|---|---|
| TTL pixel mode | 0xc0, 0xc1, 0xbd, 0xbe, 0xc4 | goto skip_ttl_config at start |
| HDMI video unmute | 0xb0, 0xa0, 0x02 | empty SKIPPING block |
| ITE68051 streaming | 0x20, 0x86, 0x90, 0xA0–A2, 0xA4, 0xB0 | empty SKIPPING block |
| RX deskew | vendor | empty SKIPPING block |
| ITE6805 CSC sync | 0x6b, 0x6c, 0x6e, 0x2a | empty SKIPPING block |
| HDCP / freerun | — | commented out |
Reason: hdmirxwr() during streaming can deadlock the ITE6805 I2C bus. CSC and stream control use MMIO instead.
v4l2_model_buffer_done()pci_model_mmio_write(0x304, 0x01)— doorbellpci_model_mmio_write(0x10, 0x02)— IRQ ACKwmb()KERN_DEBUGframe count once per minute (~3600 frames @ 60 fps)
aver_xilinx_enable_video_streaming(FALSE) only — no I2C teardown.
| Layer | Files | Purpose |
|---|---|---|
| Entry | driver/entry.c |
module_init, PCI ID table, softdeps, IBT disable |
| Context | driver/cxt_mgr.c |
Reference-counted handles |
| Board | driver/board/cx511h/board_config.c |
Probe/remove, init order |
| Board | driver/board/cx511h/board_v4l2.c |
V4L2, streaming, CSC, doorbell |
| Board | driver/board/cx511h/board_i2c.c |
I2C, ITE6805 @ 0x58 |
| Board | driver/board/cx511h/board_gpio.c |
GPIO (reset pin 0, HPD pin 2) |
| Board | driver/board/cx511h/board_alsa.c |
ALSA PCM |
| Utils | driver/utils/pci/pci_model.c |
PCI, MMIO, IRQ, DMA |
| Utils | driver/utils/v4l2/*.c |
V4L2, videobuf2, framegrabber |
| Blob | AverMediaLib_64.a (repo root) |
Precompiled vendor FPGA / ITE6805 logic |
LLVM=1 CC=clangon Clang-kernel distros-fcf-protection=none,-fno-stack-protector,MODULE_INFO(ibt, "N")- Blob:
cp AverMediaLib_64.a→AverMediaLib_64.ovia custom kbuild rule
- PCI handle · 2. I2C manager · 3. GPIO manager · 4. Memory manager · 5. Task manager
aver_xilinx_init+aver_xilinx_init_registers· 7. I2C busI2C_BUS_COM· 8. Board GPIOboard_i2c_init· 10. ITE6805 attach (with linker-section fallback) · 11. Bitmap overlay- ALSA · 13. V4L2
- Name:
AVerMedia CL511H(subsystem0x5730) - Formats: S16_LE, S24_LE
- Rates: 32 / 44.1 / 48 / 96 / 192 kHz
- Channels: 2 (stereo PCM device;
alsa_model.c) - Buffer:
period_size = 7680×4(30720 bytes), up to 128 periods (board_alsa.c)
Legacy board_suspend / board_resume wired from PCI setup — not migrated to dev_pm_ops (see Known Issue #10).
| Script | Purpose |
|---|---|
build.sh |
make -C driver, copy cx511h.ko to root |
insmod.sh |
Modprobe vb2/snd deps, insmod driver/cx511h.ko, audio restore |
unload.sh |
rmmod → unbind PCI → rmmod -f; restore PipeWire |
install.sh |
Install .ko under /lib/modules/.../avermedia/, depmod -a |
gst_1.0_raw_video.sh |
Legacy GStreamer test — see warnings above |
gst_1.0_raw_video_audio.sh |
Legacy A/V test — see warnings above |
| Tool | Purpose |
|---|---|
check_patterns.py |
Stack-canary pattern count in binaries |
patch_library.py |
NOP stack-canary prologue/epilogue |
scan_epilogues.py |
List xor %gs:0x28 epilogue variants |
- Status: workaround in
stream_on - Issue:
hdmirxwr()(I2C write) to ITE6805 during/around streaming can freeze the system. - Impact: TTL, unmute, streaming, CSC I2C sequences skipped; MMIO path used instead.
- Reads (
ite6805_get_*) still run instream_onand event handlers.
- Status: needs hardware validation
- Issue: YUYV vs UYVY mismatch between FPGA and userspace.
- Try:
debug_pixel_format=0..3, or ffplay with each ofuyvy422/yuyv422/yvyu422/vyuy422. - Workaround:
-input_format uyvy422in ffmpeg/ffplay.
- Driver advertises many pixel formats; hardware path uses UYVY for YUV422 in auto mode.
- Always set capture format explicitly in applications.
- Status: mitigated by
unload.sh(PipeWire / WirePlumber /ffplay).
- Status: known
- Issue:
v4l2-ctl(especially--stream-mmap, format probing, or scripts that call it) can trigger I2C traffic and hang. - Prefer:
ffplay/ffmpegwith explicit formats; rawddonly while streaming.
- Status: unchanged — use
LLVM=1 CC=clangon Clang-built kernels.
- Status: under investigation
- Location:
board_v4l2.c~506–507 - Issue:
vactive = width,hactive = height(swapped vs usual timing names). Bypass tables use the same convention — test before “fixing”.
- Status: operational note (not a code bug)
- Issue: Module must be rebuilt after each kernel update; vermagic mismatch prevents load.
- Fix:
./build.sh LLVM=1 CC=clangthen reload.
- Hardware realistically: YUV422 (UYVY). OBS/GStreamer may pick an unsupported FourCC.
- PCI driver uses legacy suspend hooks; should move to
dev_pm_opsfor long-term 7.x maintenance.
- Status: misleading on its own
- Issue:
dump_first_pixels()reads the DMA physical address via PCI MMIO offset, not CPU-mapped buffer memory — dmesg output may not reflect real frame bytes. Prefer userspacedd+xxd(below).
- Status: broken / risky
- Issue: wrong height parsing; calls
v4l2-ctl; video caps use YV12/YUY2 without matching capture format.
- Status: software limited
- On lock, widths > 1920 are forced to 1920×1080@60 in
cx511h_ite6805_event()— true 4K capture not implemented.
| Register | Value | Role |
|---|---|---|
| 0x10 | 0x02 |
IRQ ACK per buffer |
| 0x304 | 0x01 |
Doorbell (next buffer) |
| 0x1040 | dynamic | CSC (422 mode, RGB→YUV, matrix bits [10:8]) |
| Reg | Device | Notes |
|---|---|---|
| 0x20, 0x86, 0x90, 0xA0–A2, 0xA4, 0xB0 | ITE68051 | Streaming enable chain |
| 0x6b, 0x6c, 0x6e, 0x2a | ITE6805 | CSC sync |
| 0xc0, 0xc1, … | ITE6805 | TTL / SDR pixel mode |
First step for color problems: dump one frame while HDMI source is active and compare hex patterns.
sudo ./insmod.sh
# Start capture in another terminal, e.g. ffplay ... &
sleep 2
sudo dd if=/dev/video0 of=frame_raw.bin bs=4147200 count=1
xxd frame_raw.bin | head -4| Hex pattern | Likely meaning |
|---|---|
10 80 10 80... |
Black YUV — DMA ok, muted/no picture |
00 00 00 00... |
No DMA data |
80 10 80 10... |
Byte order swap (UYVY ↔ YUYV) |
| Varying | Real pixels — tune format/CSC |
# Kernel log
dmesg | grep -iE 'cx511h-csc|cx511h-phase2|cx511h-color|cx511h-dma|cx511h-pixfmt'
# Module parameters (from driver/)
cd driver && sudo rmmod cx511h 2>/dev/null; sudo insmod cx511h.ko debug_pixel_format=1
# Force input colorspace interpretation (from driver/)
cd driver && sudo rmmod cx511h 2>/dev/null; sudo insmod cx511h.ko force_input_mode=1
# ffplay format sweep (safe)
for fmt in uyvy422 yuyv422 yvyu422 vyuy422; do
ffplay -f v4l2 -input_format $fmt -video_size 1920x1080 -framerate 60 /dev/video0
doneCaution
Do not rely on auto_test_byteorder=1 alone — confirm with userspace dd/xxd.
- Register probing and Windows-driver comparison
- V4L2 / videobuf2 callback tracing
- Iterative testing on real GC573 hardware
- AI-assisted analysis (clearly experimental)
Interoperability-focused community project (EU Directive 2009/24/EC Art. 6). AVerMedia trademarks and the vendor blob belong to their respective owners.
Caution
AverMediaLib_64.a is a precompiled vendor archive — check license/redistribution before publishing binaries or forks.
Community project, not supported by AVerMedia. Use at your own risk.
Repository: github.com/Everlite/Avermedia-GC573-Linux
Maintained by Everlite · Thanks to derrod for earlier work.