Skip to content

Set pixel format before setting resolution #102

Description

@koutheir

I'm using the following webcam:

$ lsusb
Bus 002 Device 007: ID 046d:085e Logitech, Inc. BRIO Ultra HD Webcam
...

This webcam supports different resolutions, but that support depends on the selected pixel format. In order to set the resolution 4096x2160, the pixel format has to be MJPG. In the GUI, I configured the webcam to use that pixel format and resolution, and saved it in preset 1. I enabled Start with Systemd in order to set profile 1 automatically. The problem is that the service fails to set the resolution, with the following log:

$ systemctl --user status cameractrlsd
...
cameractrlsd.py[39503]: INFO:root:preset_device: /dev/v4l/by-id/usb-046d_Logitech_BRIO_67FAC438-video-index0
cameractrlsd.py[39503]: WARNING:root:V4L2FmtCtrls: Can't find 4096x2160 in ['1920x1080', '1600x896', '1280x720', '1024x576', '960x540', '848x480', '800x600', '800x448', '640x480', '640x360', '480x270', '440x440', '424x240', '352x288', '340x340', '320x240', '320x180', '176x144', '160x120']
cameractrlsd.py[39503]: WARNING:root:preset_device: failed to load_1: ["V4L2FmtCtrls: Can't find 4096x2160 in ['1920x1080', '1600x896', '1280x720', '1024x576', '960x540', '848x480', '800x600', '800x448', '640x480', '640x360', '480x270', '440x440', '424x240', '352x288', '340x340', '320x240', '320x180', '176x144', '160x120']"]

And that same error also happens when I click on the button 1 in the GUI. But when I click the second time, it works. It seems like the first attempt sets the pixel format, but fails to set the resolution (and that failure doesn't restore the previous configuration), and then the second attempt sets the resolution successfully. However, the cameractrlsd service does not attempt to set profile 1 twice, so it fails its task, and makes it pointless.

If my interpretation of what is going on is correct, then can you make sure to set the pixel format, then only after that enumerate the supported resolutions, and only after that set the resolution?

By the way, cameractrls is really good. Thank you for your efforts!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions