stoth68000 / sc0710

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

No picture / black screen / test picture? #13

Open Subtixx opened 1 year ago

Subtixx commented 1 year ago

I just moved recently to linux and have barely any idea about it. So here comes my attempt at asking for help in the hope somebody can help (since it seems this repo is abandoned).

Everything compiles and the driver is loaded successfully. However VLC is saying it can't open the device, V4L2 says "Inappropriate ioctl for device" and ffmpeg is either outputting blackframes (when played back in VLC) or a test picture (No idea if this is a testpicture from the driver or from ffplay)?

video4linux2,v4l2 @ 0x7f8710000c80] ioctl(VIDIOC_G_FMT): Inappropriate ioctl for device
/dev/video2: Inappropriate ioctl for device

dmesg shows the following:

[12295.454454] sc0710[0]: sc0710_video_open() dev=video1 type=vid-cap
[12295.454479] sc0710[0]: vidioc_streamon(ch#0)
[12295.454481] sc0710_dma_channels_resize()
[12295.454486] sc0710[0]: sc0710_dma_chain_free(ch#0)
[12295.454491] sc0710[0]: sc0710_dma_chain_free(ch#1)
[12295.454497] sc0710[0]: sc0710_dma_chain_free(ch#2)
[12295.454503] sc0710[0]: sc0710_dma_chain_free(ch#3)
[12295.454510] sc0710[0] channel 0 resized for framesize 4147200
[12295.455840] sc0710[0] channel 0 allocated
[12295.455844] sc0710[0] ch#0 pt_cpu 000000001d127def  pt_dma aae46000  pt_size 8192
[12295.455868] sc0710[0]: sc0710_dma_chain_free(ch#0)
[12295.455870] sc0710[0]: sc0710_dma_chain_free(ch#1)
[12295.455871] sc0710[0]: sc0710_dma_chain_free(ch#2)
[12295.455872] sc0710[0]: sc0710_dma_chain_free(ch#3)
[12295.455874] sc0710[0] channel 1 resized for framesize 4147200
[12295.455883] sc0710[0] channel 1 allocated
[12295.455884] sc0710[0] ch#1 pt_cpu 0000000071d5fc3e  pt_dma cb2ae000  pt_size 8192
[12295.455902] sc0710_dma_channels_start()
[12296.461478] sc0710[0]: sc0710_vid_timeout(ch#0)
[12296.463145] sc0710[0]: sc0710_video_release() dev=video1 type=vid-cap
[12296.463149] sc0710[0]: vidioc_streamoff()
[12296.463150] sc0710_dma_channels_stop()
[12300.136523] sc0710[0]: sc0710_video_open() dev=video1 type=vid-cap
[12300.136547] sc0710[0]: vidioc_streamon(ch#0)
[12300.136549] sc0710_dma_channels_resize()
[12300.136554] sc0710[0]: sc0710_dma_chain_free(ch#0)
[12300.136560] sc0710[0]: sc0710_dma_chain_free(ch#1)
[12300.136564] sc0710[0]: sc0710_dma_chain_free(ch#2)
[12300.136570] sc0710[0]: sc0710_dma_chain_free(ch#3)
[12300.136574] sc0710[0] channel 0 resized for framesize 4147200
[12300.138413] sc0710[0] channel 0 allocated
[12300.138416] sc0710[0] ch#0 pt_cpu 000000001d127def  pt_dma b337e000  pt_size 8192
[12300.138440] sc0710[0]: sc0710_dma_chain_free(ch#0)
[12301.154734] sc0710[0]: sc0710_vid_timeout(ch#0)
[12302.171381] sc0710[0]: sc0710_vid_timeout(ch#0)
[12303.181362] sc0710[0]: sc0710_vid_timeout(ch#0)
[12304.194682] sc0710[0]: sc0710_vid_timeout(ch#0)
[12305.211328] sc0710[0]: sc0710_vid_timeout(ch#0)
[12306.221313] sc0710[0]: sc0710_vid_timeout(ch#0)
[12307.234624] sc0710[0]: sc0710_vid_timeout(ch#0)
[12308.247939] sc0710[0]: sc0710_vid_timeout(ch#0)
[12309.264591] sc0710[0]: sc0710_vid_timeout(ch#0)
[12310.277905] sc0710[0]: sc0710_vid_timeout(ch#0)
[12311.287902] sc0710[0]: sc0710_vid_timeout(ch#0)
[12312.301207] sc0710[0]: sc0710_vid_timeout(ch#0)
[12313.314524] sc0710[0]: sc0710_vid_timeout(ch#0)
[12314.327840] sc0710[0]: sc0710_vid_timeout(ch#0)
[12315.344484] sc0710[0]: sc0710_vid_timeout(ch#0)

and then it keeps spamming the timeout message.

Subtixx commented 1 year ago

Okay so implementing some more things I can get the following:

image

Mainly the following:

    .vidioc_enum_fmt_vid_cap = vidioc_enum_fmt_vid_cap,
    .vidioc_g_fmt_vid_cap   = vidioc_g_fmt_vid_cap,
    .vidioc_try_fmt_vid_cap = vidioc_try_fmt_vid_cap,
    .vidioc_s_fmt_vid_cap   = vidioc_s_fmt_vid_cap,

    .vidioc_enum_fmt_vid_out = vidioc_enum_fmt_vid_out,
    .vidioc_g_fmt_vid_out   = vidioc_g_fmt_vid_out,
    .vidioc_try_fmt_vid_out = vidioc_try_fmt_vid_out,
    .vidioc_s_fmt_vid_out   = vidioc_s_fmt_vid_out,

make test results in the following:

C0 80 C0 80 C0 80 C0 80 C0 80 C0 [repeating]
[..]
A0 86 20 86 A0 86 20 70 40 70 2F 70 40 70 2F 70 40 [repeating]

I have attached the file: frame.bin.zip

NogradThGin commented 1 year ago

Where did you get functions like vidioc_g_fmt_vid_out and the others ? I would like to give it a try.

As it's seem abandonned for the moment, maybe let's go for a fork.

Subtixx commented 1 year ago

I botched it in using some other V4L2 code from Github. The main issue with this is testing is a nightmare... (Everytime it doesn't work, I have to restart my whole pc to unload the driver)

stoth68000 commented 1 year ago

Choosing not to work on it, is not the same as choosing to abandon it. The project isn’t abandoned.

On Tue, Apr 4, 2023 at 14:42 Vincent Huriaux @.***> wrote:

Where did you get functions like vidioc_g_fmt_vid_out and the others ? I would like to give it a try.

As it's seem abandonned for the moment, maybe let's go for a fork.

— Reply to this email directly, view it on GitHub https://github.com/stoth68000/sc0710/issues/13#issuecomment-1496433536, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEEERBH4FSL227TBZOPETCLW7RTQJANCNFSM6AAAAAAT7J2PCM . You are receiving this because you are subscribed to this thread.Message ID: @.***>

-- Steven Toth - Kernel Labs http://www.kernellabs.com +1.646.355.8490

NogradThGin commented 1 year ago

My bad. Seen a 4 hours old commit (at the moment) after posting this. Should have modified

PseudoResonance commented 1 year ago

Everytime it doesn't work, I have to restart my whole pc to unload the driver

In my case, the issue was Pulseaudio using the device. I just stopped it before unloading and restarted it afterwards as a quick fix.

systemctl --user stop pulseaudio.socket
sudo rmmod sc0710
sync
systemctl --user start pulseaudio.socket