{"action":"created","issue":{"url":"https://api.github.com/repos/umlaeute/v4l2loopback/issues/172","repository_url":"https://api.github.com/repos/umlaeute/v4l2loopback","labels_url":"https://api.github.com/repos/umlaeute/v4l2loopback/issues/172/labels{/name}","comments_url":"https://api.github.com/repos/umlaeute/v4l2loopback/issues/172/comments","events_url":"https://api.github.com/repos/umlaeute/v4l2loopback/issues/172/events","html_url":"https://github.com/umlaeute/v4l2loopback/issues/172","id":312327766,"node_id":"MDU6SXNzdWUzMTIzMjc3NjY=","number":172,"title":"Invalid IOCTL call in 4.16","user":{"login":"sarnex","id":7064844,"node_id":"MDQ6VXNlcjcwNjQ4NDQ=","avatar_url":"https://avatars1.githubusercontent.com/u/7064844?v=4","gravatar_id":"","url":"https://api.github.com/users/sarnex","html_url":"https://github.com/sarnex","followers_url":"https://api.github.com/users/sarnex/followers","following_url":"https://api.github.com/users/sarnex/following{/other_user}","gists_url":"https://api.github.com/users/sarnex/gists{/gist_id}","starred_url":"https://api.github.com/users/sarnex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sarnex/subscriptions","organizations_url":"https://api.github.com/users/sarnex/orgs","repos_url":"https://api.github.com/users/sarnex/repos","events_url":"https://api.github.com/users/sarnex/events{/privacy}","received_events_url":"https://api.github.com/users/sarnex/received_events","type":"User","site_admin":false},"labels":[{"id":103895270,"node_id":"MDU6TGFiZWwxMDM4OTUyNzA=","url":"https://api.github.com/repos/umlaeute/v4l2loopback/labels/bug","name":"bug","color":"e11d21","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":13,"created_at":"2018-04-08T18:26:28Z","updated_at":"2018-06-28T11:53:49Z","closed_at":"2018-05-28T09:07:15Z","author_association":"CONTRIBUTOR","body":"Enviroment\r\n\r\n- v4l2loopback version: 0.11.0 compiled from source commit 05a03e2\r\n- Kernel version: 4.16 (Linux pc 4.16.0-gentoo)\r\n- Distribution (+version): Gentoo Unstable\r\n\r\nProblem\r\n\r\nI cannot use v4l2loopback in 4.16. Reverting to 4.15 works fine. When I try, I get an error about invalid arguments to an IOCTL.\r\n````\r\n[v4l2 @ 0x55e3b5747220] ioctl(VIDIOC_G_FMT): Invalid argument\r\nCould not write header for output file #0 (incorrect codec parameters ?): Invalid argument\r\nError initializing output stream 0:0 -- \r\n````\r\nSteps to reproduce:\r\n\r\n1) Load v4l2loopback\r\n\r\n2) Run this script in FFMPEG:\r\n\r\n````\r\nffmpeg -f x11grab -r 30 -s 2560x1440 -i :0.0+1920,0 -vcodec rawvideo -pix_fmt yuv420p -threads 16 -f v4l2 /dev/video0\r\n````\r\n\r\nResults of above:\r\n````\r\nffmpeg version 3.4.2 Copyright (c) 2000-2018 the FFmpeg developers                                                                                                                           \r\n  built with gcc 7.3.0 (Gentoo 7.3.0 p1.0)                                                                                                                                                   \r\n  configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --docdir=/usr/share/doc/ffmpeg-3.4.2-r1/html --mandir=/usr/share/man --enable-shared --cc=x86_64-pc-linux-gnu-gcc --cxx=x86_64-pc-linux-gnu-g++ --ar=gcc-ar --optflags='-flto=16 -fuse-linker-plugin -floop-interchange -ftree-loop-distribution -floop-strip-mine -floop-block -ftree-vectorize -march=native -O2 -pipe -mindirect-branch=thunk' --disable-static --enable-avfilter --enable-avresample --disable-stripping --enable-nonfree --disable-indev=oss --disable-indev=jack --disable-outdev=oss --enable-bzlib --disable-runtime-cpudetect --disable-debug --disable-gcrypt --disable-gnutls --disable-gmp --enable-gpl --enable-hardcoded-tables --enable-iconv --disable-lzma --enable-network --disable-opencl --enable-openssl --enable-postproc --disable-libsmbclient --enable-ffplay --enable-sdl2 --enable-vaapi --enable-vdpau --enable-xlib --enable-libxcb --enable-libxcb-shm --enable-libxcb-xfixes --enable-zlib --disable-libcdio --disable-libiec61883 --disable-libdc1394 --disable-libcaca --disable-openal --enable-opengl --disable-libv4l2 --enable-libpulse --disable-libdrm --disable-libopencore-amrwb --disable-libopencore-amrnb --disable-libfdk-aac --disable-libopenjpeg --enable-libbluray --disable-libcelt --disable-libgme --disable-libgsm --disable-mmal --disable-libmodplug --disable-libopus --disable-libilbc --disable-librtmp --disable-libssh --disable-libspeex --enable-librsvg --enable-libvorbis --disable-libvpx --disable-libzvbi --disable-appkit --disable-libbs2b --disable-chromaprint --disable-libflite --disable-frei0r --disable-libfribidi --disable-fontconfig --disable-ladspa --disable-libass --enable-libfreetype --disable-librubberband --disable-libzmq --disable-libzimg --disable-libsoxr --enable-pthreads --disable-libvo-amrwbenc --enable-libmp3lame --disable-libkvazaar --disable-nvenc --disable-libopenh264 --disable-libsnappy --disable-libtheora --disable-libtwolame --disable-libwavpack --enable-libwebp --enable-libx264 --disable-libx265 --enable-libxvid --disable-armv5te --disable-armv6 --disable-armv6t2 --disable-neon --disable-vfp --disable-vfpv3 --disable-armv8 --disable-mipsdsp --disable-mipsdspr2 --disable-mipsfpu --disable-altivec --disable-amd3dnow --disable-amd3dnowext --disable-fma4 --disable-xop --cpu=host --enable-lto --disable-doc --disable-htmlpages --enable-manpages\r\n  libavutil      55. 78.100 / 55. 78.100\r\n  libavcodec     57.107.100 / 57.107.100\r\n  libavformat    57. 83.100 / 57. 83.100\r\n  libavdevice    57. 10.100 / 57. 10.100\r\n  libavfilter     6.107.100 /  6.107.100\r\n  libavresample   3.  7.  0 /  3.  7.  0\r\n  libswscale      4.  8.100 /  4.  8.100\r\n  libswresample   2.  9.100 /  2.  9.100\r\n  libpostproc    54.  7.100 / 54.  7.100\r\n[x11grab @ 0x55f0964d6420] Stream #0: not enough frames to estimate rate; consider increasing probesize\r\nInput #0, x11grab, from ':0.0+1920,0':\r\n  Duration: N/A, start: 1523211730.953105, bitrate: N/A\r\n    Stream #0:0: Video: rawvideo (BGR[0] / 0x524742), bgr0, 2560x1440, 30 fps, 1000k tbr, 1000k tbn, 1000k tbc\r\nStream mapping:\r\n  Stream #0:0 -> #0:0 (rawvideo (native) -> rawvideo (native))\r\nPress [q] to stop, [?] for help\r\nHERE 1\r\n4\r\nBEFORE\r\n[v4l2 @ 0x55f0964e2220] ioctl(VIDIOC_G_FMT): Invalid argument\r\nCould not write header for output file #0 (incorrect codec parameters ?): Invalid argument\r\nError initializing output stream 0:0 -- \r\nConversion failed!\r\n````\r\n\r\nI was not able to find what changed in 4.16 through the kernel release notes.\r\n\r\nThank you, and let me know if you need any more information\r\n\r\nSarnex"},"comment":{"url":"https://api.github.com/repos/umlaeute/v4l2loopback/issues/comments/401009296","html_url":"https://github.com/umlaeute/v4l2loopback/issues/172#issuecomment-401009296","issue_url":"https://api.github.com/repos/umlaeute/v4l2loopback/issues/172","id":401009296,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMTAwOTI5Ng==","user":{"login":"BrettRyland","id":18440126,"node_id":"MDQ6VXNlcjE4NDQwMTI2","avatar_url":"https://avatars3.githubusercontent.com/u/18440126?v=4","gravatar_id":"","url":"https://api.github.com/users/BrettRyland","html_url":"https://github.com/BrettRyland","followers_url":"https://api.github.com/users/BrettRyland/followers","following_url":"https://api.github.com/users/BrettRyland/following{/other_user}","gists_url":"https://api.github.com/users/BrettRyland/gists{/gist_id}","starred_url":"https://api.github.com/users/BrettRyland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BrettRyland/subscriptions","organizations_url":"https://api.github.com/users/BrettRyland/orgs","repos_url":"https://api.github.com/users/BrettRyland/repos","events_url":"https://api.github.com/users/BrettRyland/events{/privacy}","received_events_url":"https://api.github.com/users/BrettRyland/received_events","type":"User","site_admin":false},"created_at":"2018-06-28T11:53:49Z","updated_at":"2018-06-28T11:53:49Z","author_association":"NONE","body":"Hi, I'm still experiencing this bug (`VIDIOC_G_FMT: failed: Invalid argument`) despite the fix by @flipreverse. My system is running `Linux debian 4.16.0-2-amd64 #1 SMP Debian 4.16.16-2 (2018-06-22) x86_64 GNU/Linux` and v4l2loopback.ko is built from the current master.\r\n\r\nHere is the `dmesg` output from running `sudo modprobe v4l2loopback debug=3 video_nr=20; v4l2-ctl -d /dev/video20 --get-fmt-video`\r\n```\r\n[45901.156946] /home/brett/Programming/github/v4l2loopback/v4l2loopback.c:2369[v4l2loopback_init_module]\r\n[45901.156947] /home/brett/Programming/github/v4l2loopback/v4l2loopback.c:2341[zero_devices]\r\n[45901.156948] v4l2-loopback[2410]: creating v4l2loopback-device #0\r\n[45901.156950] /home/brett/Programming/github/v4l2loopback/v4l2loopback.c:2175[v4l2_loopback_init]\r\n[45901.156951] /home/brett/Programming/github/v4l2loopback/v4l2loopback.c:2075[init_vdev]\r\n[45901.156952] /home/brett/Programming/github/v4l2loopback/v4l2loopback.c:2100[init_vdev]\r\n[45901.156952] /home/brett/Programming/github/v4l2loopback/v4l2loopback.c:2106[init_capture_param]\r\n[45901.156957] v4l2-loopback[2251]: buffer_size = 0 (=0)\r\n[45901.156957] /home/brett/Programming/github/v4l2loopback/v4l2loopback.c:1987[allocate_buffers]\r\n[45901.156958] /home/brett/Programming/github/v4l2loopback/v4l2loopback.c:2256[v4l2_loopback_init]\r\n[45901.156999] v4l2-loopback[2431]: module installed\r\n[45901.157000] v4l2loopback driver version 0.11.0 loaded\r\n[45901.159584] /home/brett/Programming/github/v4l2loopback/v4l2loopback.c:1827[v4l2_loopback_open]\r\n[45901.159586] v4l2-loopback[1851]: opened dev:00000000b45fee18 with image:          (null)\r\n[45901.159587] /home/brett/Programming/github/v4l2loopback/v4l2loopback.c:1852[v4l2_loopback_open]\r\n[45901.159594] video20: VIDIOC_QUERYCAP: driver=v4l2 loopback, card=Dummy video device (0x0000), bus=platform:v4l2loopback-000, version=0x00041010, capabilities=0x85208003, device_caps=0x85208003\r\n[45901.159667] /home/brett/Programming/github/v4l2loopback/v4l2loopback.c:1861[v4l2_loopback_close]\r\n[45901.159668] /home/brett/Programming/github/v4l2loopback/v4l2loopback.c:1976[try_free_buffers]\r\n[45901.159669] /home/brett/Programming/github/v4l2loopback/v4l2loopback.c:1959[free_buffers]\r\n[45901.159670] v4l2-loopback[1960]: freeing image@          (null) for dev:00000000b45fee18\r\n[45901.159671] /home/brett/Programming/github/v4l2loopback/v4l2loopback.c:1880[v4l2_loopback_close]\r\n[45901.160176] /home/brett/Programming/github/v4l2loopback/v4l2loopback.c:1827[v4l2_loopback_open]\r\n[45901.160178] v4l2-loopback[1851]: opened dev:00000000b45fee18 with image:          (null)\r\n[45901.160180] /home/brett/Programming/github/v4l2loopback/v4l2loopback.c:1852[v4l2_loopback_open]\r\n[45901.160351] video20: VIDIOC_QUERYCAP: driver=v4l2 loopback, card=Dummy video device (0x0000), bus=platform:v4l2loopback-000, version=0x00041010, capabilities=0x85208003, device_caps=0x85208003\r\n[45901.160358] video20: VIDIOC_QUERY_EXT_CTRL: id=0x980001, type=6, name=User Controls, min/max=0/0, step=0, default=0, flags=0x00000044, elem_size=4, elems=1, nr_of_dims=0, dims=0,0,0,0\r\n[45901.160365] video20: VIDIOC_QUERY_EXT_CTRL: id=0x980001, type=6, name=User Controls, min/max=0/0, step=0, default=0, flags=0x00000044, elem_size=4, elems=1, nr_of_dims=0, dims=0,0,0,0\r\n[45901.160371] video20: VIDIOC_QUERY_EXT_CTRL: id=0x98f900, type=2, name=keep_format, min/max=0/1, step=1, default=0, flags=0x00000000, elem_size=4, elems=1, nr_of_dims=0, dims=0,0,0,0\r\n[45901.160384] video20: VIDIOC_QUERY_EXT_CTRL: id=0x98f901, type=2, name=sustain_framerate, min/max=0/1, step=1, default=0, flags=0x00000000, elem_size=4, elems=1, nr_of_dims=0, dims=0,0,0,0\r\n[45901.160394] video20: VIDIOC_QUERY_EXT_CTRL: id=0x98f902, type=1, name=timeout, min/max=0/100000, step=1, default=0, flags=0x00000000, elem_size=4, elems=1, nr_of_dims=0, dims=0,0,0,0\r\n[45901.160401] video20: VIDIOC_QUERY_EXT_CTRL: id=0x98f903, type=2, name=timeout_image_io, min/max=0/1, step=1, default=0, flags=0x00000000, elem_size=4, elems=1, nr_of_dims=0, dims=0,0,0,0\r\n[45901.160408] video20: VIDIOC_QUERY_EXT_CTRL: error -22: id=0xc098f903, type=0, name=, min/max=0/0, step=0, default=0, flags=0x00000000, elem_size=0, elems=0, nr_of_dims=0, dims=0,0,0,0\r\n[45901.160418] /home/brett/Programming/github/v4l2loopback/v4l2loopback.c:801[vidioc_g_fmt_cap]\r\n[45901.160418] video20: VIDIOC_G_FMT: error -22: type=vid-cap, width=0, height=0, pixelformat=\r\n[45901.160444] /home/brett/Programming/github/v4l2loopback/v4l2loopback.c:1861[v4l2_loopback_close]\r\n[45901.160447] /home/brett/Programming/github/v4l2loopback/v4l2loopback.c:1976[try_free_buffers]\r\n[45901.160448] /home/brett/Programming/github/v4l2loopback/v4l2loopback.c:1959[free_buffers]\r\n[45901.160449] v4l2-loopback[1960]: freeing image@          (null) for dev:00000000b45fee18\r\n[45901.160451] /home/brett/Programming/github/v4l2loopback/v4l2loopback.c:1880[v4l2_loopback_close]\r\n[45901.160918] /home/brett/Programming/github/v4l2loopback/v4l2loopback.c:1827[v4l2_loopback_open]\r\n[45901.160919] v4l2-loopback[1851]: opened dev:00000000b45fee18 with image:          (null)\r\n[45901.160920] /home/brett/Programming/github/v4l2loopback/v4l2loopback.c:1852[v4l2_loopback_open]\r\n[45901.160924] video20: VIDIOC_QUERYCAP: driver=v4l2 loopback, card=Dummy video device (0x0000), bus=platform:v4l2loopback-000, version=0x00041010, capabilities=0x85208003, device_caps=0x85208003\r\n[45901.160929] /home/brett/Programming/github/v4l2loopback/v4l2loopback.c:1861[v4l2_loopback_close]\r\n[45901.160931] /home/brett/Programming/github/v4l2loopback/v4l2loopback.c:1976[try_free_buffers]\r\n[45901.160931] /home/brett/Programming/github/v4l2loopback/v4l2loopback.c:1959[free_buffers]\r\n[45901.160932] v4l2-loopback[1960]: freeing image@          (null) for dev:00000000b45fee18\r\n[45901.160933] /home/brett/Programming/github/v4l2loopback/v4l2loopback.c:1880[v4l2_loopback_close]\r\n```\r\n"}}
{"actor":{"display_login":"BrettRyland"}}