stoth68000 / sc0710

Linux driver for the Elgato 4k60 Pro Mk.2
Other
137 stars 18 forks source link

It built and loaded, now how the heck do I use it? #9

Open HisashiASM opened 2 years ago

HisashiASM commented 2 years ago

Sorry if this is a pretty elementary question, as i am new to Linux in general. I am pretty familiar with building projects and all seems well upon a sudo make load. you can see the output below.

make -C /lib/modules/5.15.60-1-MANJARO/build M=/home/hisashiasm/sc0710 modules
make[1]: Entering directory '/usr/lib/modules/5.15.60-1-MANJARO/build'
make[1]: Leaving directory '/usr/lib/modules/5.15.60-1-MANJARO/build'
sudo dmesg -c >/dev/null
sudo cp /dev/null /var/log/debug
#sudo modprobe videobuf2-core
sudo modprobe videobuf2-common
sudo modprobe videodev
#sudo modprobe videobuf-dma-sg
sudo modprobe videobuf-vmalloc
sudo insmod ./sc0710.ko \
    thread_dma_poll_interval_ms=2 \
    dma_status=0

Now how do I see the visual output of said device?

HisashiASM commented 2 years ago

Some fun things to note; Camera shows the option for the Elgato 4K60 Mk 2 in Discord, but it appears black. There was also an option added to input devices.

HisashiASM commented 2 years ago

here is a slice of my strace

read(3, "\17\177\17\177\17\177\17\177\17\177\17\177\17\177\17\177\17\177\17\177\17\177\17\177\17\177\17\177\17\177\17\177"..., 131072) = 83968
write(1, "\17\177\17\177\17\177\17\177\17\177\17\177\17\177\17\177\17\177\17\177\17\177\17\177\17\177\17\177\17\177\17\177"..., 83968) = 83968
read(3, 0x7f32bcb56000, 131072)         = -1 EINVAL (Invalid argument)
write(2, "cat: ", 5cat: )                    = 5
write(2, "/dev/video0", 11/dev/video0)             = 11
openat(AT_FDCWD, "/usr/share/locale/locale.alias", O_RDONLY|O_CLOEXEC) = 4
newfstatat(4, "", {st_mode=S_IFREG|0644, st_size=2998, ...}, AT_EMPTY_PATH) = 0
read(4, "# Locale name alias data base.\n#"..., 4096) = 2998
read(4, "", 4096)                       = 0
close(4)                                = 0
openat(AT_FDCWD, "/usr/share/locale/en_US.UTF-8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en_US.utf8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en_US/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en.UTF-8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en.utf8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
write(2, ": Invalid argument", 18: Invalid argument)      = 18
write(2, "\n", 1
)                       = 1
munmap(0x7f32bcb55000, 139264)          = 0
close(3)                                = 0
close(1)                                = 0
close(2)                                = 0
exit_group(1)                           = ?
+++ exited with 1 +++
HisashiASM commented 2 years ago

tried using the stream1080p build option and using VLC to decode the stream, but the stream would crash abruptly

tribbin commented 2 years ago

@HisashiASM The Makefile contains some examples for capturing/streaming with ffmpeg.

As for me...

It builds, it loads, it probes, it reads, but it encodes at a very low frame rate and the resulting video shows some sort of test-screen that is probably intended for testing sync-timings?

https://imgur.com/eXaOYVL (Top-right corner is output plugged in to my Elgato 4K60.)

Can I be of assistance to @stoth68000 with some more testing on my machine?

robin@debian:~/git/sc0710$ uname -a Linux debian 5.10.0-15-amd64 #1 SMP Debian 5.10.120-1 (2022-06-09) x86_64 GNU/Linux