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

Changing camera resolution breaks the camera portal #10399

Open
shetozz opened this issue Mar 17, 2024 · 7 comments
Open

Changing camera resolution breaks the camera portal #10399

shetozz opened this issue Mar 17, 2024 · 7 comments
Labels
Dependency Issue Issue is in external library or dependency, not OBS itself Linux Affects Linux

Comments

@shetozz
Copy link

shetozz commented Mar 17, 2024

Operating System Info

Other

Other OS

Fedora 39 workstation eddition

OBS Studio Version

30.1.0

OBS Studio Version (Other)

No response

OBS Studio Log URL

https://obsproject.com/logs/hsHQW4pOfOAh58Ey

OBS Studio Crash Log URL

No response

Expected Behavior

Changing camera resolution should keep the camera working.

Current Behavior

Changing the camera resolution breaks the portal -camera turns off and the video freezes-, and changing it back doesn't fix it. You have to restart OBS.

Steps to Reproduce

  1. Create a new camera source using the pipewire camera portal.
  2. Change the resolution from the dropdown menu.
  3. the camera source will break, you'll have to.
    ...

Anything else we should know?

No response

@mihawk90
Copy link

Have you tested if you are getting the same result when using the V4L2 capture instead?

I can say from my own experience that some capture devices are just buggy like that. They don't allow changing capture parameters until turned off and on. This was consistent with other camera-applications.

Not doubting there could be an issue, just wanting to make sure this is actually related to the portal implementation.

@shetozz
Copy link
Author

shetozz commented Mar 17, 2024

Have you tested if you are getting the same result when using the V4L2 capture instead?

Yeah, using the V4L2 works as expected, but I found another way to get the bug to go away other than restarting the app, I can just change the camera source in the portal settings and change it back.

@kkartaltepe kkartaltepe added the Linux Affects Linux label Mar 17, 2024
@tytan652 tytan652 added the Dependency Issue Issue is in external library or dependency, not OBS itself label Mar 24, 2024
@GeorgesStavracas
Copy link
Member

Hi @shetozz, can you please reproduce this issue while you run $ pw-mon in a terminal, and share the output with us?

Please double check if the logs don't contain sensitive information before uploading them!

@shetozz
Copy link
Author

shetozz commented Apr 4, 2024

@GeorgesStavracas
obs.txt

@stephematician
Copy link

I see this same behaviour too.

Seems to give pipewire a hard time, as audio drops out in firefox and I have to restart the pipewire service.

Here's the debug output:

info: [camera-portal] Selected resolution for 'libcamera_input.__SB_.PCI0.GP17.XHC1.RHUB.PRT1-1.3_1.0-046d_0825'
info: [camera-portal] Selected format for 'libcamera_input.__SB_.PCI0.GP17.XHC1.RHUB.PRT1-1.3_1.0-046d_0825'
info: [camera-portal] selected camera 'libcamera_input.__SB_.PCI0.GP17.XHC1.RHUB.PRT1-1.3_1.0-046d_0825'
info: [camera-portal] Updating pixel formats
info: [camera-portal] Selected format for 'libcamera_input.__SB_.PCI0.GP17.XHC1.RHUB.PRT1-1.3_1.0-046d_0825'
info: [camera-portal] Selected resolution for 'libcamera_input.__SB_.PCI0.GP17.XHC1.RHUB.PRT1-1.3_1.0-046d_0825'
info: [pipewire] Renegotiating stream
info: [camera-portal] Updating device libcamera_input.__SB_.PCI0.GP17.XHC1.RHUB.PRT1-1.3_1.0-046d_0825
info: [pipewire] Stream 0x70839c0034a0 state: "error" (error: error set output format: -22 (Invalid argument))
error: [pipewire] Error id:5 seq:31 res:-32 (Broken pipe): error set output format: -22 (Invalid argument)
error: [pipewire] Error id:0 seq:255 res:-32 (Broken pipe): connection error
info: [pipewire] Stream 0x70839c0034a0 state: "unconnected" (error: connection error)

@stephematician
Copy link

stephematician commented Oct 8, 2024

Hi @shetozz, can you please reproduce this issue while you run $ pw-mon in a terminal, and share the output with us?

pw-mon crashes immediately.

Here's the pw-mon output pre-crash when I switch from 320x240 [YUYV] to 160x120 [YUYV]:
pipewire_obs_pre_crash.txt

If I restart pipewire and run obs, the camera is at the new resolution. So it does change the settings, but something else fails along the way.

@stephematician
Copy link

stephematician commented Oct 8, 2024

Using journalctl -u pipewire -a -o cat --user -r I scroll down and see that this is where things kick off, some error reported by libcamera:

[0:52:11.277887757] [20407] ERROR Camera camera.cpp:696 Camera in Running state trying configure() requiring state between Acquired and Configured

If I select a camera whose backend is v4l2 (not libcamera) then this crash doesn't happen (there are other glitches, similar to #10588 - I have to switch back and forth sometimes to get a particular framerate working).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dependency Issue Issue is in external library or dependency, not OBS itself Linux Affects Linux
Projects
None yet
Development

No branches or pull requests

6 participants