Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need To Reboot Computer To Use #597

Open
pasjrwoctx opened this issue Aug 11, 2023 · 2 comments
Open

Need To Reboot Computer To Use #597

pasjrwoctx opened this issue Aug 11, 2023 · 2 comments
Assignees

Comments

@pasjrwoctx
Copy link

Ok so Everytime I go to use gphoto2 so that I can stream my camera to obs, I have to reboot my computer first, and then if I stop streaming and take a break, in order to start again, I have to reboot again, other wise I get this before I have to reboot.

pasjrwoctx@philip-alienware18:~$ gphoto2 --stdout --capture-movie | ffmpeg -i - -vcodec rawvideo -pix_fmt yuv420p -threads 8 -f v4l2 /dev/video0
Capturing preview frames as movie to 'stdout'. Press Ctrl-C to abort.
ffmpeg version 5.1.2-3ubuntu1 Copyright (c) 2000-2022 the FFmpeg developers
built with gcc 12 (Ubuntu 12.2.0-14ubuntu2)
configuration: --prefix=/usr --extra-version=3ubuntu1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libglslang --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librist --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --disable-sndio --enable-libjxl --enable-pocketsphinx --enable-librsvg --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-libplacebo --enable-librav1e --enable-shared
libavutil 57. 28.100 / 57. 28.100
libavcodec 59. 37.100 / 59. 37.100
libavformat 59. 27.100 / 59. 27.100
libavdevice 59. 7.100 / 59. 7.100
libavfilter 8. 44.100 / 8. 44.100
libswscale 6. 7.100 / 6. 7.100
libswresample 4. 7.100 / 4. 7.100
libpostproc 56. 6.100 / 56. 6.100
[mjpeg @ 0x562572d0e380] Format mjpeg detected only with low score of 25, misdetection possible!
Input #0, mjpeg, from 'pipe:':
Duration: N/A, bitrate: N/A
Stream #0:0: Video: mjpeg (Baseline), yuvj422p(pc, bt470bg/unknown/unknown), 640x424, 25 tbr, 1200k tbn
Stream mapping:
Stream #0:0 -> #0:0 (mjpeg (native) -> rawvideo (native))
[swscaler @ 0x562572d29900] [swscaler @ 0x562572d37e80] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x562572d29900] [swscaler @ 0x562572d607c0] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x562572d29900] [swscaler @ 0x562572d88ec0] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x562572d29900] [swscaler @ 0x562572db15c0] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x562572d29900] [swscaler @ 0x562572dd9cc0] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x562572d29900] [swscaler @ 0x562572e02800] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x562572d29900] [swscaler @ 0x562572e2b140] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x562572d29900] [swscaler @ 0x562572e53c80] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x562572d29900] [swscaler @ 0x562572d37e80] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x562572d29900] [swscaler @ 0x562572e69cc0] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x562572d29900] [swscaler @ 0x562572e000c0] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x562572d29900] [swscaler @ 0x562572d4de40] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x562572d29900] [swscaler @ 0x562572d76440] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x562572d29900] [swscaler @ 0x562572d9f8c0] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x562572d29900] [swscaler @ 0x562572e45080] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x562572d29900] [swscaler @ 0x562572e1fc40] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x562572d29900] [swscaler @ 0x562572d37e80] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x562572d29900] [swscaler @ 0x562572e31c00] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x562572d29900] [swscaler @ 0x562572d4f2c0] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x562572d29900] [swscaler @ 0x562572d646c0] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x562572d29900] [swscaler @ 0x562572e1d040] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x562572d29900] [swscaler @ 0x562572defd80] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x562572d29900] [swscaler @ 0x562572da0000] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x562572d29900] [swscaler @ 0x562572e45fc0] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x562572d29900] [swscaler @ 0x562572d37e80] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x562572d29900] [swscaler @ 0x562572e31c00] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x562572d29900] [swscaler @ 0x562572d4fa00] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x562572d29900] [swscaler @ 0x562572d64b00] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x562572d29900] [swscaler @ 0x562572e1db40] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x562572d29900] [swscaler @ 0x562572defd80] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x562572d29900] [swscaler @ 0x562572da1440] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x562572d29900] [swscaler @ 0x562572e475c0] deprecated pixel format used, make sure you did set range correctly
[video4linux2,v4l2 @ 0x562572d10d80] ioctl(VIDIOC_G_FMT): Invalid argument
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Error initializing output stream 0:0 --
Conversion failed!

Here is the results from --debug --debug-logfile=debug.log

0.000082 main (2): ALWAYS INCLUDE THE FOLLOWING LINES WHEN SENDING DEBUG MESSAGES TO THE MAILING LIST:
0.000108 main (2): gphoto2 2.5.28
0.000125 main (2): gphoto2 has been compiled with the following options:
0.000128 main (2): + gcc (C compiler used)
0.000132 main (2): + popt (mandatory, for handling command-line parameters)
0.000135 main (2): + exif (for displaying EXIF information)
0.000138 main (2): + cdk (for accessing configuration options)
0.000141 main (2): + aa (for displaying live previews)
0.000144 main (2): + jpeg (for displaying live previews in JPEG format)
0.000148 main (2): + readline (for easy navigation in the shell)
0.000160 main (2): libgphoto2 2.5.30
0.000164 main (2): libgphoto2 has been compiled with the following options:
0.000167 main (2): + standard camlib set (ax203 canon digigr8 dimagev directory docupen jl2005a jl2005c kodak_dc240 lumix mars pentax ptp2 ricoh_g3 sierra sonix sq905 st2205 topfield tp6801)
0.000174 main (2): + gcc (C compiler used)
0.000177 main (2): + no ltdl (for portable loading of camlibs)
0.000180 main (2): + EXIF (for special handling of EXIF files)
0.000185 main (2): libgphoto2_port 0.12.1
0.000189 main (2): libgphoto2_port has been compiled with the following options:
0.000192 main (2): + iolibs: disk ptpip serial usb1 usbdiskdirect usbscsi
0.000195 main (2): + gcc (C compiler used)
0.000198 main (2): + no ltdl (for portable loading of iolibs)
0.000202 main (2): + EXIF (for vusb)
0.000205 main (2): + USB (libusb1, for USB cameras)
0.000208 main (2): + serial (for serial cameras)
0.000211 main (2): + no resmgr (serial port access and locking)
0.000214 main (2): + no ttylock (serial port locking)
0.000218 main (2): + no lockdev (serial port locking)
0.000221 main (2): CAMLIBS env var not set, using compile-time default instead
0.000224 main (2): IOLIBS env var not set, using compile-time default instead
0.000228 main (2): invoked with following arguments:
0.000231 main (2): --debug
0.000235 main (2): --debug-logfile=debug.log
0.000246 load_settings (2): Creating gphoto config directory ('/home/pasjrwoctx/.gphoto')
0.000272 load_settings (2): Loading settings from file '/home/pasjrwoctx/.gphoto/settings'.
0.000349 gp_camera_free (2): Freeing camera...
0.000354 gp_port_free (2): Freeing port...
0.000370 gp_filesystem_reset (2): resetting filesystem
0.000374 gp_filesystem_lru_clear (2): Clearing fscache LRU list...
0.000377 gp_filesystem_lru_clear (2): fscache LRU list already empty
0.000381 delete_all_folders (2): Internally deleting all folders from '/'...
0.000384 lookup_folder (2): Lookup folder '/'...
0.000388 lookup_folder (2): Found! / is 0x55abf0608940
0.000391 recurse_delete_folder (2): Recurse delete folder 0x55abf0608940//
0.000395 delete_all_files (2): Delete all files in folder 0x55abf0608940//

Any help would be great, Its a real bummer and pain to have to stop everything to reboot just to us gphoto2

@pasjrwoctx
Copy link
Author

Ok so I just found out that if I do the following,
sudo modprobe -r v4l2loopback
sudo modprobe v4l2loopback
sudo depmod -a

everything works, but I have to do that every freaking time. Any ideas why?

@msmeissn
Copy link
Contributor

(depmod -a is not needed above)

Your workaround seems to show it gets stuck somewhere in the v4l2loopback driver in the kernel. Perhaps they fixed this in a newer v4l2loopback version.

@msmeissn msmeissn self-assigned this Aug 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants