obs-studio icon indicating copy to clipboard operation
obs-studio copied to clipboard

28.0.1-5 OBS causes uvcvideo to blank cameras after exiting and loads the wrong default properties

Open zDEFz opened this issue 3 years ago • 5 comments

Operating System Info

Other

Other OS

reproducable, 2 different devices: 1.Desktop PC Arch Linux (x86) 2. Arch Linux (m1 arm64)

OBS Studio Version

Git

OBS Studio Version (Other)

28.0.1-5 (GIT)

OBS Studio Log URL

https://obsproject.com/logs/XkrZjuTzTkl4HhhW

OBS Studio (partial) blank/failing camera log

https://obsproject.com/logs/-YZjqDIYbvAXPq5a

Expected Behavior

  1. When OBS exits, and then when it is launched again, all webcams are still shown
  2. Default value of 'Zoom, Continuous', 'Pan Speed', 'Tilt Speed' is set to the minimum value upon creating new camera and loading it

Current Behavior

  1. When OBS exits, and then when it is launched again, some webcams are blank or not loaded at all
  2. Default value of 'Zoom, Continuous', 'Pan Speed', 'Tilt Speed' is set to the maximum value and my PTZ cameras go crazy

Steps to Reproduce

  1. Add webcam: NexiGo N970P to OBS. Exit OBS and Open OBS again ...
  2. Create a new cam and load the N970P camera. Look at the values 'Zoom, Continuous', 'Pan Speed', 'Tilt Speed' is set to the maximum value

Anything else we should know?

This camera is having Flash Memory to retain its settings and takes ~1 second to initialize. I use up to 4 of them at a time. But the problems relating blanking out also happen with only 1 camera connected. This issue is only existing on Linux. It doesnt matter which kernel or Device I use. It happens on any machine.

As a workaround, it helps to issue 'sudo rmmod uvcvideo; sudo modprobe uvcvideo'

That problem is not present in 'cheese' or 'guvcview', Zoom or any other application!

The issue regarding zooming and panning like crazy when a settings dialog is opened or OBS has been started are only happening on newly created cameras with the said values and the default values of '3' loaded, which is the maximum. Changing it afterwards to the minimum value fixes the issue.

This issue is no more present under Windows, after Hotfix 28.0.1. It was present in 28.0.0


I am in contact with the manufacturer and we found out that those problems are exclusive to ArchLinux / Linux.

zDEFz avatar Sep 07 '22 02:09 zDEFz

This issue is no more present under Windows, after Hotfix 28.0.1. It was present in 28.0.0

This sounds like on Windows, this was fixed by https://github.com/obsproject/obs-studio/commit/bfa2053b083e36952fc182957ddc0ca035d59dd6 (the revert of #5480). I'm not sure what in the linux-v4l2 code would cause this on Linux.

RytoEX avatar Sep 07 '22 02:09 RytoEX

This issue is no more present under Windows, after Hotfix 28.0.1. It was present in 28.0.0

This sounds like on Windows, this was fixed by bfa2053 (the revert of #5480). I'm not sure what in the linux-v4l2 code would cause this on Linux.

You mean the issue with OBS loading the max. values of 'Zoom, Continuous', 'Pan Speed', 'Tilt Speed' , right? That one got fixed under Windows with the hotfix, but still present under Linux. Under Windows those properties are not even available, only Linux. But yet they were set for some reason.

The blanking of the cams upon re-entering OBS (after exit) is another mentioned issue.

zDEFz avatar Sep 07 '22 02:09 zDEFz

Just to clarify, the Windows and Linux video capture device sources are entirely separate, and do not share code so these issues might be somewhat similar in the end result, but are not related.

Fenrirthviti avatar Sep 08 '22 05:09 Fenrirthviti

I have wrote a workaround script that https://termbin.com/gq6v

  • allows virtual cameras before start and reloads uvcvideo 3 seconds after it has exited.

  • adds a delay to execute the script before executing the uvcvideo reload. Otherwise, the workaround doesnt seem to work consistently.

  • I have set 'Zoom, Continuous', 'Pan Speed', 'Tilt Speed' to -3 so my cameras won't go crazy cause right now theres a issue with camera firmware. The other issue listed is camera independent.

  • And I have turned buffering to disabled on all cameras so it wont be laggy.

zDEFz avatar Sep 10 '22 23:09 zDEFz

Without the script: 1x launch obs= cams working then exiting 1x launch obs= cams not working then exiting Launch OBS again, cams working

I think its OBS not waiting long enough or so

zDEFz avatar Sep 17 '22 09:09 zDEFz

1x launch obs= cams working then exiting 1x launch obs= cams not working then exiting Launch OBS again, cams working

I get this exact behaviour. The workaround does not work for me. Also manually tried various longer sleep lengths between obs exit -> unload uvcvideo -> load uvcvideo. No difference. Lenovo Legion 5 Pro (2021) - AMD Ryzen 7 5800H Built-in webcam Arch Linux

kendrak24 avatar Sep 29 '22 19:09 kendrak24

1x launch obs= cams working then exiting 1x launch obs= cams not working then exiting Launch OBS again, cams working

I get this exact behaviour. The workaround does not work for me. Also manually tried various longer sleep lengths between obs exit -> unload uvcvideo -> load uvcvideo. No difference. Lenovo Legion 5 Pro (2021) - AMD Ryzen 7 5800H Built-in webcam Arch Linux

Today I made a service that disables uvcvideo by default and I had to improve my workaround. Can you try to only launch through the command line, issueing obs with the updated function? The service to disable uvcvideo by default, I made for my own privacy / interest. Completely optional.

You might want to delete the last line sh -c "obs || sleep 3; sudo rmod uvcvideo" Why? Cause it unloads all cameras when obs is closed. Perhaps you don't want this. But for me, who is only using the cameras when OBS is running, this is wanted.

https://termbin.com/w91s

zDEFz avatar Oct 02 '22 07:10 zDEFz

Suddenly my lenovo laptop camera works fine all the time, without any workaround. Restarted obs many times without any issue. It could be that the obs-studio package on Arch was updated to 28.0.2-2.

After testing the workaround above, and then discover it was no longer needed in my case, I did the following setup:

/etc/modules-load.d/obs-cam.conf

v4l2loopback

/etc/modprobe.d/obs-cam.conf

options v4l2loopback devices=1
options v4l2loopback video_nr=10
options v4l2loopback card_label="OBS-Cam"
options v4l2loopback exclusive_caps=1

kendrak24 avatar Oct 02 '22 12:10 kendrak24

Updated to the most recent package, 28.0.2-2. Negative. With multiple webcams like I have, the issue is present as before

** Not fixed.**

zDEFz avatar Oct 02 '22 21:10 zDEFz

Still an issue. Using 28.10 Beta

Literally have to reload uvcvideo. By the way, heres my updated function/workaround. https://termbin.com/th83c

New log: https://obsproject.com/logs/AUmEPf4kGpr_vnCU

zDEFz avatar Oct 21 '22 03:10 zDEFz