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

Razer Kiyo Pro Ultra PCAP needed #19

Open
soyersoyer opened this issue Apr 27, 2023 · 29 comments
Open

Razer Kiyo Pro Ultra PCAP needed #19

soyersoyer opened this issue Apr 27, 2023 · 29 comments

Comments

@soyersoyer
Copy link
Owner

soyersoyer commented Apr 27, 2023

The Razer Kiyo Pro Ultra is the new 'best webcam'. It would be cool to support its special features.
If you have one, please capture USB communication with Wireshark while changing special settings in windows with synapse.

@pohlt
Copy link

pohlt commented Jun 1, 2023

I should get mine next week and will hopefully find the time to provide the required information...

@soyersoyer
Copy link
Owner Author

soyersoyer commented Jun 1, 2023

That's cool!
I will need an usb vendor and product id, the output of the lsusb -v -d vendorid:productid, and the usb traffic sniffed with wireshark+USBPcap for every non standard control while changing its values. One control per pcap file to make it easier, and the values you set.

@pohlt
Copy link

pohlt commented Jun 6, 2023

Got my Kiyo Pro Ultra this morning. \o/

"non standard" are all the messages which are not identifed in the info string I guess: "Zoom (absolute)" is recognized, "Unit 6 control 0x1" is not, right?

Do you need:

  • sent SET CUR Request packages
  • anything sent to the device
  • responses (which responses because if I include the image stream is gets BIG)

Should I send it as PM? I can also put it on my Google Drive and share the folder with you. What's most convenient for you?

@soyersoyer
Copy link
Owner Author

Yes, there are standard uvc controls, that wireshark/linux uvc/anything handles well. Other controls can usually be used with extension units.
Could you filter with frame.protocols == "usb:usbvideo"?
Then you can upload them to google drive and post the links here or create a git repo for them.

@pohlt
Copy link

pohlt commented Jun 6, 2023

Here's a first try with the preview resolution and the 2d/3d noise reduction. Please find the captures and the desciption file here.

Once I see how you would add it to your repo, I might be able to do the rest by myself and create a PR.

USB ID: 1532:0E08 (rev 0821)

@soyersoyer
Copy link
Owner Author

These look different than the kiyo pro traffic. Where is the "Unit 6 control 0x1" thing?

@pohlt
Copy link

pohlt commented Jun 6, 2023

For some reason, they are called differently when I load the capture file. But I just checked the data fragment (e.g. Data Fragment: c00e010100000000) and they are exactly what you get in the "Unit 6 control 0x1" thing.

@soyersoyer
Copy link
Owner Author

soyersoyer commented Jun 6, 2023

Ah, okey :)

So the noise reduction values in changing order:
c00e020000000000
c00e010100000000
c00e020100000000
c00e010100000000
c00e020100000000
c00e010000000000
c00e010100000000
c00e020100000000

I assume
2D_NR_OFF = c00e020000000000
2D_NR_ON = c00e020100000000
3D_NR_OFF = c00e010000000000
3D_NR_ON = c00e010100000000

I only need an extension unit guid to reliably get the bUnitID from the code.
This can get from lsusb -v -d 1532:0E08|grep -B 2 guidExtensionCode

The preview resolution changes should work without any modification. It shouldn't use these control things.

@pohlt
Copy link

pohlt commented Jun 6, 2023

❯ lsusb -v -d 1532:0E08 | grep -B 2 guidExtensionCode
Couldn't open device, some information will be missing
        bDescriptorSubtype      6 (EXTENSION_UNIT)
        bUnitID                 2
        guidExtensionCode         {2c49d16a-32b8-4485-3ea8-643a152362f2}
--
        bDescriptorSubtype      6 (EXTENSION_UNIT)
        bUnitID                 6
        guidExtensionCode         {23e49ed0-1178-4f31-ae52-d2fb8a8d3b48}

@soyersoyer
Copy link
Owner Author

soyersoyer commented Jun 6, 2023

Same as Kiyo Pro.
I've created a branch .
Could you try it?

@pohlt
Copy link

pohlt commented Jun 7, 2023

Works! I can't tell the difference for 2D NR on/off (it's the same with Synapse), but turning 3D NR on/off is very obvious. Awesome! Thanks a lot!

I'll let you know when I have more captures.

@pohlt
Copy link

pohlt commented Jun 7, 2023

Exposure - Auto Mode

Metering

  • Average: c00e040000000000
  • Center: c00e040100000000
  • Face: c00e040500000000

Compensation

The range is -3 - 3 for Average and _Center. The range is -1 to 3 for Face.

  • -3.0: c00e050000000000
  • -2.8: c00e050200000000
  • -2.6: c00e050400000000
  • ...
  • 0.0: c00e051e00000000
  • ...
  • +3.0: c00e053c00000000

Synapse also offers the values in between (e.g. -2.9), but the sent value is rounded to one of the values listed above (e.g. cc00e0502). We could try to send the values in between (e.g. c00e050_1_00000000, but YMMV).

Exposure - Manual Mode

ISO Value

  • ISO 100: c009010100000000
  • ISO 200: c009010200000000
  • ISO 400: c009010300000000
  • ISO 800: c009010400000000
  • ISO 1600: c009010500000000
  • ISO 3200: c009010600000000
  • ISO 6400: c009010700000000

Shutter Speed

If you remove the trailing "00" byte, the last three bytes give you the shutter speed in µs.
Example: 0x01f4 = 500 µs = 1/2000 s

  • 1/2000 s: c00905000001f400
  • 1/1600 s: c009050000027100
  • 1/1280 s: c009050000030d00
  • 1/1000 s: c00905000003e800
  • 1/800 s: c00905000004e200
  • 1/640 s: c009050000061a00
  • 500, 400, 320, 250, 200, 160, 120, 100, 90, 75, 60, 50, 40, 33, 30, 25, 24, 20, 17, 16, 15, 13, 12, 11
  • 1/10 s: c00905000186a000

@pohlt
Copy link

pohlt commented Jun 7, 2023

Focus - Auto

Mode

  • Standard: c00a010000000000
  • Face: c00a010100000000

Tracking:

  • Passive: ff06010000000000
  • Responsive: ff06000000000000

Lighting Type

  • Standard: c00a010000000000
  • Stylized: c00a010000000001

Image

Mirror Video

  • on: c00e030100000000
  • off: c00e030000000000

@pohlt
Copy link

pohlt commented Jun 8, 2023

Lens Distortion

  • off: ff01000300000000
  • on: ff01010300000000

Same settings (like this one) need the camera to be restarted to show their effect.

@soyersoyer
Copy link
Owner Author

soyersoyer commented Jun 8, 2023

Shutter speed is interesting, there is UVC control for that. Doesn't it use the V4L2_CID_EXPOSURE_ABSOLUTE (CT_EXPOSURE_TIME_ABSOLUTE_CONTROL)?
Could you post the output of the ./cameractrls.py -l?

@soyersoyer
Copy link
Owner Author

soyersoyer commented Jun 8, 2023

I've added the new controls to kiyoproultra.

@pohlt
Copy link

pohlt commented Jun 9, 2023

Shutter speed is interesting, there is UVC control for that. Doesn't it use the V4L2_CID_EXPOSURE_ABSOLUTE (CT_EXPOSURE_TIME_ABSOLUTE_CONTROL)? Could you post the output of the ./cameractrls.py -l?

❯ python cameractrls.py  -l
Basic / Crop
 zoom_absolute = 150    ( default: 110 min: 100 max: 400 )
 pan_absolute = 0       ( default: 0 min: -36000 max: 36000 step: 3600 )
 tilt_absolute = 0      ( default: 0 min: -36000 max: 36000 step: 3600 )
Basic / Focus
 focus_automatic_continuous = 0 ( default: 1 min: 0 max: 1 )
 focus_absolute = 115   ( default: 1 min: 1 max: 450 )
Exposure / Exposure
 auto_exposure = manual_mode    ( default: aperture_priority_mode values: manual_mode, aperture_priority_mode )
 exposure_time_absolute = 156   ( default: 156 min: 3 max: 2047 )
 exposure_dynamic_framerate = 1 ( default: 0 min: 0 max: 1 )
 gain = 29      ( default: 0 min: 0 max: 255 )
Exposure / Dynamic Range
 backlight_compensation = 1     ( default: 0 min: 0 max: 1 )
Color / Balance
 white_balance_automatic = 0    ( default: 1 min: 0 max: 1 )
 white_balance_temperature = 3490       ( default: 5000 min: 2800 max: 7500 step: 10 )
Color / Color
 brightness = 128       ( default: 128 min: 0 max: 255 )
 contrast = 128 ( default: 128 min: 0 max: 255 )
 saturation = 128       ( default: 128 min: 0 max: 255 )
 sharpness = 128        ( default: 128 min: 0 max: 255 )
Advanced / Power Line
 power_line_frequency = 50_hz   ( default: 60_hz values: disabled, 50_hz, 60_hz )
Advanced / Processing
 kiyo_pro_ultra_nr_2d = None    ( values: off, on )
 kiyo_pro_ultra_nr_3d = None    ( values: off, on )
Advanced / Other
 kiyo_pro_ultra_distortion_correction = None    ( values: off, on )
Capture / Capture
 pixelformat = NV12     ( values: YUYV, MJPG, H264, NV12 )
 resolution = 640x480   ( values: 640x480, 640x360, 1280x720, 1920x1080, 2560x1440, 3840x2160 )
 fps = 30       ( values: 60, 30, 24, 20, 15, 10, 5 )
Capture / Info
 card = Razer Kiyo Pro Ultra
 driver = uvcvideo
 path = /dev/video0
 real_path = /dev/video0
Settings / Save
 systemd_save           ( buttons: save )

@pohlt
Copy link

pohlt commented Jun 9, 2023

  • All of the exposure-related stuff seems to work, but depending on manual or auto mode, some parameters should be disabled (I split the exposure stuff in two section: auto, manual).
  • Focus-related parameters seems to work.
  • Advanced parameters are fine, too, but "Lens Distortion Compensation" need a stream restart to show an effect.

There's still some HDR stuff missing, but we've covered about 90% now I guess. 🥳
This is great. Thanks a lot!

One thing I don't understand: The automatic white balance is way too warm. I always have to set it manually to about 4500 to not look like I'm sitting in front of a crackling bonfire. AWB works fine in Win 11. 🤔

@soyersoyer
Copy link
Owner Author

soyersoyer commented Jun 9, 2023

It is interesting, that it has an H264 encoder, but the specification page doesn't mention it.
The specs says it has 82°- 72° field of view. Does it have a control for it in Synapse? Or only 640x480 has 72° FoV?
Could you post the output of the v4l2-ctl --list-formats-ext?

What happens if you change the exposure_time_absolute? Does it have the same effect as shutter speed? (the former is in 100 µs)

The nonfunctional AWB is interesting. Does it work outside Synapse in Win?

@soyersoyer
Copy link
Owner Author

soyersoyer commented Jun 9, 2023

The FoV is 72° with Lens distortion compensation, without 82°.
The manual says, Synapse has a save button. Could you capture it?
The exposure_time_absolute is in 100µs, but I think they want 1µs precision (closer to 1/60s), so we also have a shutter speed control.
What is the shutter speed value at 1/60? (16666 or 16667)

@pohlt
Copy link

pohlt commented Jun 9, 2023

Could you post the output of the v4l2-ctl --list-formats-ext?

❯ v4l2-ctl --list-formats-ext
ioctl: VIDIOC_ENUM_FMT
        Type: Video Capture

        [0]: 'YUYV' (YUYV 4:2:2)
                Size: Discrete 640x480
                        Interval: Discrete 0.017s (60.000 fps)
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.042s (24.000 fps)
                        Interval: Discrete 0.050s (20.000 fps)
                        Interval: Discrete 0.067s (15.000 fps)
                        Interval: Discrete 0.100s (10.000 fps)
                        Interval: Discrete 0.200s (5.000 fps)
                Size: Discrete 640x360
                        Interval: Discrete 0.017s (60.000 fps)
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.042s (24.000 fps)
                        Interval: Discrete 0.050s (20.000 fps)
                        Interval: Discrete 0.067s (15.000 fps)
                        Interval: Discrete 0.100s (10.000 fps)
                        Interval: Discrete 0.200s (5.000 fps)
                Size: Discrete 1280x720
                        Interval: Discrete 0.017s (60.000 fps)
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.042s (24.000 fps)
                        Interval: Discrete 0.050s (20.000 fps)
                        Interval: Discrete 0.067s (15.000 fps)
                        Interval: Discrete 0.100s (10.000 fps)
                        Interval: Discrete 0.200s (5.000 fps)
                Size: Discrete 1920x1080
                        Interval: Discrete 0.017s (60.000 fps)
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.042s (24.000 fps)
                        Interval: Discrete 0.050s (20.000 fps)
                        Interval: Discrete 0.067s (15.000 fps)
                        Interval: Discrete 0.100s (10.000 fps)
                        Interval: Discrete 0.200s (5.000 fps)
        [1]: 'MJPG' (Motion-JPEG, compressed)
                Size: Discrete 640x480
                        Interval: Discrete 0.017s (60.000 fps)
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.042s (24.000 fps)
                        Interval: Discrete 0.050s (20.000 fps)
                        Interval: Discrete 0.067s (15.000 fps)
                        Interval: Discrete 0.100s (10.000 fps)
                        Interval: Discrete 0.200s (5.000 fps)
                Size: Discrete 640x360
                        Interval: Discrete 0.017s (60.000 fps)
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.042s (24.000 fps)
                        Interval: Discrete 0.050s (20.000 fps)
                        Interval: Discrete 0.067s (15.000 fps)
                        Interval: Discrete 0.100s (10.000 fps)
                        Interval: Discrete 0.200s (5.000 fps)
                Size: Discrete 1280x720
                        Interval: Discrete 0.017s (60.000 fps)
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.042s (24.000 fps)
                        Interval: Discrete 0.050s (20.000 fps)
                        Interval: Discrete 0.067s (15.000 fps)
                        Interval: Discrete 0.100s (10.000 fps)
                        Interval: Discrete 0.200s (5.000 fps)
                Size: Discrete 1920x1080
                        Interval: Discrete 0.017s (60.000 fps)
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.042s (24.000 fps)
                        Interval: Discrete 0.050s (20.000 fps)
                        Interval: Discrete 0.067s (15.000 fps)
                        Interval: Discrete 0.100s (10.000 fps)
                        Interval: Discrete 0.200s (5.000 fps)
                Size: Discrete 2560x1440
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.042s (24.000 fps)
                        Interval: Discrete 0.050s (20.000 fps)
                        Interval: Discrete 0.067s (15.000 fps)
                        Interval: Discrete 0.100s (10.000 fps)
                        Interval: Discrete 0.200s (5.000 fps)
                Size: Discrete 3840x2160
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.042s (24.000 fps)
                        Interval: Discrete 0.050s (20.000 fps)
                        Interval: Discrete 0.067s (15.000 fps)
                        Interval: Discrete 0.100s (10.000 fps)
                        Interval: Discrete 0.200s (5.000 fps)
        [2]: 'H264' (H.264, compressed)
                Size: Discrete 640x480
                        Interval: Discrete 0.017s (60.000 fps)
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.042s (24.000 fps)
                        Interval: Discrete 0.050s (20.000 fps)
                        Interval: Discrete 0.067s (15.000 fps)
                        Interval: Discrete 0.100s (10.000 fps)
                        Interval: Discrete 0.200s (5.000 fps)
                Size: Discrete 640x360
                        Interval: Discrete 0.017s (60.000 fps)
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.042s (24.000 fps)
                        Interval: Discrete 0.050s (20.000 fps)
                        Interval: Discrete 0.067s (15.000 fps)
                        Interval: Discrete 0.100s (10.000 fps)
                        Interval: Discrete 0.200s (5.000 fps)
                Size: Discrete 1280x720
                        Interval: Discrete 0.017s (60.000 fps)
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.042s (24.000 fps)
                        Interval: Discrete 0.050s (20.000 fps)
                        Interval: Discrete 0.067s (15.000 fps)
                        Interval: Discrete 0.100s (10.000 fps)
                        Interval: Discrete 0.200s (5.000 fps)
                Size: Discrete 1920x1080
                        Interval: Discrete 0.017s (60.000 fps)
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.042s (24.000 fps)
                        Interval: Discrete 0.050s (20.000 fps)
                        Interval: Discrete 0.067s (15.000 fps)
                        Interval: Discrete 0.100s (10.000 fps)
                        Interval: Discrete 0.200s (5.000 fps)
        [3]: 'NV12' (Y/UV 4:2:0)
                Size: Discrete 640x480
                        Interval: Discrete 0.017s (60.000 fps)
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.042s (24.000 fps)
                        Interval: Discrete 0.050s (20.000 fps)
                        Interval: Discrete 0.067s (15.000 fps)
                        Interval: Discrete 0.100s (10.000 fps)
                        Interval: Discrete 0.200s (5.000 fps)
                Size: Discrete 640x360
                        Interval: Discrete 0.017s (60.000 fps)
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.042s (24.000 fps)
                        Interval: Discrete 0.050s (20.000 fps)
                        Interval: Discrete 0.067s (15.000 fps)
                        Interval: Discrete 0.100s (10.000 fps)
                        Interval: Discrete 0.200s (5.000 fps)
                Size: Discrete 1280x720
                        Interval: Discrete 0.017s (60.000 fps)
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.042s (24.000 fps)
                        Interval: Discrete 0.050s (20.000 fps)
                        Interval: Discrete 0.067s (15.000 fps)
                        Interval: Discrete 0.100s (10.000 fps)
                        Interval: Discrete 0.200s (5.000 fps)
                Size: Discrete 1920x1080
                        Interval: Discrete 0.017s (60.000 fps)
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.042s (24.000 fps)
                        Interval: Discrete 0.050s (20.000 fps)
                        Interval: Discrete 0.067s (15.000 fps)
                        Interval: Discrete 0.100s (10.000 fps)
                        Interval: Discrete 0.200s (5.000 fps)
                Size: Discrete 2560x1440
                        Interval: Discrete 0.033s (30.000 fps)
                        Interval: Discrete 0.042s (24.000 fps)
                        Interval: Discrete 0.050s (20.000 fps)
                        Interval: Discrete 0.067s (15.000 fps)
                        Interval: Discrete 0.100s (10.000 fps)
                        Interval: Discrete 0.200s (5.000 fps)
                Size: Discrete 3840x2160
                        Interval: Discrete 0.042s (24.000 fps)
                        Interval: Discrete 0.050s (20.000 fps)
                        Interval: Discrete 0.067s (15.000 fps)
                        Interval: Discrete 0.100s (10.000 fps)
                        Interval: Discrete 0.200s (5.000 fps)

@pohlt
Copy link

pohlt commented Jun 9, 2023

The exposure time setting is weird:

  • The image looks the same for any value between 3 and 2046.
  • Only for 2047 the image is much brighter (actually too bright).

The shutter time setting behaves much more predictable and as expected.

The two settings seem to influence each other:

  • If I change the exposure time to any value between 3-2046, the shutter time seems to be set implicitly to a value of about 30,000.
  • If I set the exposure time to 2047 (image too bright), it seems to be reset to a value between 3-2046 when I set any shutter time value.

@pohlt
Copy link

pohlt commented Jun 9, 2023

What is the shutter speed value at 1/60? (16666 or 16667)

It's 16666.

@soyersoyer
Copy link
Owner Author

I've added a better slider for the shutter speed.

@pohlt
Copy link

pohlt commented Jun 9, 2023

Save seems to be c003a80000000000.
Right before the save, there's a c0090a0000000000.

Even if I don't change anything, there are often c009060000000000 and c009080000000000 in the mix.

@soyersoyer
Copy link
Owner Author

Save added.
Do they return anything? There is a query if the control parameter is 0x02, (not 0x01).

@Bleuzen
Copy link

Bleuzen commented Sep 7, 2023

Hi, what is the current state of this?
Any help needed?

@pohlt
Copy link

pohlt commented Sep 7, 2023

I'm currently too busy to contribute so if you own a Kiyo feel free to fill in the gaps. There is some basic support, though.

@soyersoyer
Copy link
Owner Author

Did the save work?

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

3 participants