You are not logged in.

#1 2022-06-26 04:32:19

douglascast
Member
Registered: 2016-05-07
Posts: 22

Capture card driver compile

Hello to everyone.

I have a Elgato 4k60 Pro Mk.2, internal capture card for HDMI stuff like video-games, another computer attached to it and etc. But thanks to the lack hardware support of the manufacture, for no one surprise, there is no driver support. Please just understand that I've quit windows 11 and back to Arch today.

I've found out this "reverse engineering project" on GIT, it "seens" to work, but there  no compile instructions on README.md, I've searched on AUR but no lucky.

So, someone can help me with a start point to follow? To se if I can for some miracle compile it and maybe get things working?

And another question, there is some kind of "request page" to AUR? A list to ask someone with a heart fullfiled with love for arch users and some free time, to help with new apps (and / or drivers)? I've tryied to search for something similar, but english it's not my default language, and maybe I've missed some search term.

TY all.

Offline

#2 2022-07-09 15:06:58

sinx
Member
Registered: 2019-06-02
Posts: 17

Re: Capture card driver compile

There is a `Makefile` in the project. I think you can just use `make` to build the driver. Then, there are few more targets :
— `load` and `unload` : to load or unload the compiled driver
— `stream_xxxxx` : seems to be some usage example (I don't know a lot about that)

The `Makefile` does not seem to have any `install` target, but you can call the `load` one when you want to use the driver.

See also https://docs.kernel.org/kbuild/modules.html, it explains some parts of the `Makefile`.

Offline

#3 2022-07-10 11:21:04

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,911

Re: Capture card driver compile

https://github.com/stoth68000/sc0710 wrote:

Jun 26 2022 - Use tag e2908371f4c2b28ea613622815dcf2b4739d3bb7 for Centos 3.10 kernels. After this we're moving to Ubuntu 5.x kernels.

The Makefile has lines with sudo and uses yum, so it may require lots of adjustments to work on archlinux

douglascast wrote:

And another question, there is some kind of "request page" to AUR? A list to ask someone with a heart fullfiled with love for arch users and some free time, to help with new apps (and / or drivers)? I've tryied to search for something similar, but english it's not my default language, and maybe I've missed some search term.

Normally I'd direct you to the AUR Issues, Discussion & PKGBUILD Requests (sub-)board , but to get this to work you need people with lots of kernel & driver experience/knowledge, not lots of packaging .


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#4 2022-07-10 16:02:53

loqs
Member
Registered: 2014-03-06
Posts: 17,321

Re: Capture card driver compile

Very rough build that compiles for 5.18

PKGBUILD

# This is an example PKGBUILD file. Use this as a start to creating your own,
# and remove these comments. For more information, see 'man PKGBUILD'.
# NOTE: Please fill out the license field for your package! If it is unknown,
# then please put 'unknown'.

# Maintainer: Your Name <youremail@domain.com>
pkgname=sc0710
pkgver=r77.e2a013a
pkgrel=1
pkgdesc="Driver for the Elgato 4k60 Pro Mk.2"
arch=('x86_64')
url="https://github.com/stoth68000/sc0710.git"
license=('GPL')
depends=(linux)
makedepends=(git linux-headers)
source=("git+https://github.com/stoth68000/sc0710.git"
         sc0710-5.18.patch)
md5sums=('SKIP'
         '8c03ebff9f4c14daa85083afa35c4849')

prepare() {
  cd $pkgname
  patch -Np1 -i ../sc0710-5.18.patch
}

pkgver() {
  cd $pkgname
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

build() {
  cd $pkgname
  make KVERSION=$(cat /usr/src/linux/version)
  
}

package() {
  install -Dt "$pkgdir"/usr/lib/modules/$(cat /usr/src/linux/version) $pkgname/sc0710.ko
}

sc0710-5.18.patch

diff --git a/sc0710-dma-chain.c b/sc0710-dma-chain.c
index 856928f..2241a1d 100644
--- a/sc0710-dma-chain.c
+++ b/sc0710-dma-chain.c
@@ -105,7 +105,7 @@ void sc0710_dma_chain_free(struct sc0710_dma_channel *ch, int nr)
 	chain->enabled = 0;
 
 	for (i = 0; i < chain->numAllocations; i++) {
-		pci_free_consistent(dev->pci, dca->buf_size, dca->buf_cpu, dca->buf_dma);
+		dma_free_coherent(&dev->pci->dev, dca->buf_size, dca->buf_cpu, dca->buf_dma);
 		dca++;
 	}
 }
@@ -136,7 +136,7 @@ int sc0710_dma_chain_alloc(struct sc0710_dma_channel *ch, int nr, int total_tran
 
 		dca->enabled = 1;
 		dca->buf_size = size;
-		dca->buf_cpu = pci_alloc_consistent(dev->pci, dca->buf_size, &dca->buf_dma);
+		dca->buf_cpu = dma_alloc_coherent(&dev->pci->dev, dca->buf_size, &dca->buf_dma, GFP_KERNEL);
 		if (dca->buf_cpu == 0)
 			return -1;
 
diff --git a/sc0710-dma-chains.c b/sc0710-dma-chains.c
index b6e6382..588e95b 100644
--- a/sc0710-dma-chains.c
+++ b/sc0710-dma-chains.c
@@ -51,7 +51,7 @@ void sc0710_dma_chains_free(struct sc0710_dma_channel *ch)
 	int i;
 
 	/* Free up the SG table */
-	pci_free_consistent(ch->dev->pci, ch->pt_size, ch->pt_cpu, ch->pt_dma);
+	dma_free_coherent(&ch->dev->pci->dev, ch->pt_size, ch->pt_cpu, ch->pt_dma);
 
 	for (i = 0; i < ch->numDescriptorChains; i++) {
 		sc0710_dma_chain_free(ch, i);
diff --git a/sc0710-dma-channel.c b/sc0710-dma-channel.c
index 69c6fb2..e21cd75 100644
--- a/sc0710-dma-channel.c
+++ b/sc0710-dma-channel.c
@@ -425,7 +425,7 @@ int sc0710_dma_channel_alloc(struct sc0710_dev *dev, u32 nr, enum sc0710_channel
 	/* allocate the descriptor table, its contigious. */
 	ch->pt_size = PAGE_SIZE * 2;
 
-	ch->pt_cpu = pci_alloc_consistent(dev->pci, ch->pt_size, &ch->pt_dma);
+	ch->pt_cpu = dma_alloc_coherent(&dev->pci->dev, ch->pt_size, &ch->pt_dma, GFP_KERNEL);
 	if (ch->pt_cpu == 0)
 		return -1;
 
@@ -529,7 +529,7 @@ int sc0710_dma_channel_resize(struct sc0710_dev *dev, u32 nr, enum sc0710_channe
 	/* allocate the descriptor table, its contigious. */
 	ch->pt_size = PAGE_SIZE * 2;
 
-	ch->pt_cpu = pci_alloc_consistent(dev->pci, ch->pt_size, &ch->pt_dma);
+	ch->pt_cpu = dma_alloc_coherent(&dev->pci->dev, ch->pt_size, &ch->pt_dma, GFP_KERNEL);
 	if (ch->pt_cpu == 0)
 		return -1;
 

Offline

Board footer

Powered by FluxBB