Skip to contentSkip to conversation

EasyCAP (534d:0021) not offering native 720x576

DISCUSSION Jiri Slaby 3 participants 7 messages Jan 4, 2023 – Jan 6, 2023 Media (V4L/DVB)

lore
Share & tools
lore

Jiri Slaby

author
#0 lore raw

Hi!

I bought a (cheap) video grabber to convert few remaining VHSs. It's this (full lsusb -v output at the end):
Bus 003 Device 014: ID 534d:0021 MacroSilicon MS210x Video Grabber [EasierCAP]
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 239 Miscellaneous Device
bDeviceSubClass 2
bDeviceProtocol 1 Interface Association
bMaxPacketSize0 64
idVendor 0x534d MacroSilicon
idProduct 0x0021 MS210x Video Grabber [EasierCAP]
bcdDevice 1.21

  iManufacturer           1 MACROSILICON
  iProduct                2 AV TO USB2.0
  iSerial                 3 20150130
  bNumConfigurations      1

But it offers resolutions only up to 720x480. In Windows, I can grab the standard PAL's 720x576. Is there any way to force the native res in UVC? Or can you point me the way how to debug/fix this?

Thanks.

Dumps and logs follow.

===============================

Three /dev/video devices are created. Two UVCs (3+5) and one real video (4):

$ for aa in 3 4 5; do echo "== $aa =="; v4l2-ctl -d /dev/video$aa --all; done
== 3 ==
Driver Info:
        Driver name      : uvcvideo
        Card type        : Integrated_Webcam_HD: Integrate
        Bus info         : usb-0000:00:14.0-5
        Driver version   : 6.1.2
        Capabilities     : 0x84a00001
                Video Capture
                Metadata Capture
                Streaming
                Extended Pix Format
                Device Capabilities
        Device Caps      : 0x04a00000
                Metadata Capture
                Streaming
                Extended Pix Format
Media Driver Info:
        Driver name      : uvcvideo
        Model            : Integrated_Webcam_HD: Integrate
        Serial           : 0001
        Bus info         : usb-0000:00:14.0-5
        Media version    : 6.1.2
        Hardware revision: 0x00006012 (24594)
        Driver version   : 6.1.2
Interface Info:
        ID               : 0x03000005
        Type             : V4L Video
Entity Info:
        ID               : 0x00000004 (4)
        Name             : Integrated_Webcam_HD: Integrate
        Function         : V4L2 I/O
Priority: 2
Format Metadata Capture:
        Sample Format   : 'UVCH' (UVC Payload Header Metadata)
        Buffer Size     : 10240
== 4 ==
Driver Info:
        Driver name      : uvcvideo
        Card type        : AV TO USB2.0
        Bus info         : usb-0000:3c:00.0-1.1
        Driver version   : 6.1.2
        Capabilities     : 0x84a00001
                Video Capture
                Metadata Capture
                Streaming
                Extended Pix Format
                Device Capabilities
        Device Caps      : 0x04200001
                Video Capture
                Streaming
                Extended Pix Format
Media Driver Info:
        Driver name      : uvcvideo
        Model            : AV TO USB2.0
        Serial           : 20150130
        Bus info         : usb-0000:3c:00.0-1.1
        Media version    : 6.1.2
        Hardware revision: 0x00000121 (289)
        Driver version   : 6.1.2
Interface Info:
        ID               : 0x03000002
        Type             : V4L Video
Entity Info:
        ID               : 0x00000001 (1)
        Name             : AV TO USB2.0
        Function         : V4L2 I/O
        Flags            : default
        Pad 0x01000007   : 0: Sink
          Link 0x0200000d: from remote pad 0x100000a of entity 
'Processing 2' (Video Pixel Formatter): Data, Enabled, Immutable
Priority: 2
Video input : 0 (Camera 1: ok)
Format Video Capture:
        Width/Height      : 720/480
        Pixel Format      : 'MJPG' (Motion-JPEG)
        Field             : None
        Bytes per Line    : 0
        Size Image        : 614400
        Colorspace        : sRGB
        Transfer Function : Rec. 709
        YCbCr/HSV Encoding: ITU-R 601
        Quantization      : Default (maps to Full Range)
        Flags             :
Crop Capability Video Capture:
        Bounds      : Left 0, Top 0, Width 720, Height 480
        Default     : Left 0, Top 0, Width 720, Height 480
        Pixel Aspect: 1/1
Selection Video Capture: crop_default, Left 0, Top 0, Width 720, Height 480, Flags:
Selection Video Capture: crop_bounds, Left 0, Top 0, Width 720, Height 480, Flags:
Streaming Parameters Video Capture:
        Capabilities     : timeperframe
        Frames per second: 25.000 (25/1)
        Read buffers     : 0
== 5 ==
Driver Info:
        Driver name      : uvcvideo
        Card type        : AV TO USB2.0
        Bus info         : usb-0000:3c:00.0-1.1
        Driver version   : 6.1.2
        Capabilities     : 0x84a00001
                Video Capture
                Metadata Capture
                Streaming
                Extended Pix Format
                Device Capabilities
        Device Caps      : 0x04a00000
                Metadata Capture
                Streaming
                Extended Pix Format
Media Driver Info:
        Driver name      : uvcvideo
        Model            : AV TO USB2.0
        Serial           : 20150130
        Bus info         : usb-0000:3c:00.0-1.1
        Media version    : 6.1.2
        Hardware revision: 0x00000121 (289)
        Driver version   : 6.1.2
Interface Info:
        ID               : 0x03000005
        Type             : V4L Video
Entity Info:
        ID               : 0x00000004 (4)
        Name             : AV TO USB2.0
        Function         : V4L2 I/O
Priority: 2
Format Metadata Capture:
        Sample Format   : 'UVCH' (UVC Payload Header Metadata)
        Buffer Size     : 10240

===============================

$ v4l2-ctl -d /dev/video4 --list-formats-ext
ioctl: VIDIOC_ENUM_FMT
        Type: Video Capture
        [0]: 'MJPG' (Motion-JPEG, compressed)
                Size: Discrete 480x320
                        Interval: Discrete 0.040s (25.000 fps)
                Size: Discrete 640x480
                        Interval: Discrete 0.040s (25.000 fps)
                        Interval: Discrete 0.050s (20.000 fps)
                        Interval: Discrete 0.067s (15.000 fps)
                        Interval: Discrete 0.100s (10.000 fps)
                Size: Discrete 720x480
                        Interval: Discrete 0.040s (25.000 fps)
                        Interval: Discrete 0.050s (20.000 fps)
                        Interval: Discrete 0.067s (15.000 fps)
                        Interval: Discrete 0.100s (10.000 fps)
        [1]: 'YUYV' (YUYV 4:2:2)
                Size: Discrete 480x320
                        Interval: Discrete 0.040s (25.000 fps)

===============================

dmesg (w/ debug enabled) says:
usb 3-1.1: New USB device found, idVendor=534d, idProduct=0021, bcdDevice= 1.21
usb 3-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 3-1.1: Product: AV TO USB2.0
usb 3-1.1: Manufacturer: MACROSILICON
usb 3-1.1: SerialNumber: 20150130
usb 3-1.1: Probing generic UVC device 1.1
usb 3-1.1: Found format MJPEG
usb 3-1.1: - 480x320 (25.0 fps)
usb 3-1.1: - 640x480 (25.0 fps)
usb 3-1.1: - 720x480 (25.0 fps)
usb 3-1.1: Found format YUV 4:2:2 (YUYV)
usb 3-1.1: - 480x320 (25.0 fps)
usb 3-1.1: Found UVC 1.00 device AV TO USB2.0 (534d:0021)
usb 3-1.1: Scanning UVC chain:
OT 3 <- PU 2 <- IT 1
usb 3-1.1: Found a valid video chain (1 -> 3)
usb 3-1.1: UVC non compliance - GET_DEF(PROBE) not supported. Enabling workaround.
usb 3-1.1: UVC device initialized
hid-generic 0003:534D:0021.000F: hiddev98,hidraw7: USB HID v1.10 Device [MACROSILICON AV TO USB2.0] on usb-0000:3c:00.0-1.1/input4 usb 3-1.1: uvc_v4l2_open
usb 3-1.1: uvc_v4l2_release
usb 3-1.1: uvc_v4l2_open
usb 3-1.1: uvc_v4l2_release
usb 3-1.1: uvc_v4l2_open
usb 3-1.1: uvc_v4l2_release
usb 3-1.1: uvc_v4l2_open
usb 3-1.1: uvc_v4l2_release
usb 3-1.1: uvc_v4l2_open
usb 3-1.1: Control 0x00980900 not found
usb 3-1.1: uvc_v4l2_release
usb 3-1.1: uvc_v4l2_open
usb 3-1.1: uvc_v4l2_release
usb 3-1.1: uvc_v4l2_open
usb 3-1.1: Control 0x00980900 not found
usb 3-1.1: uvc_v4l2_release
usb 3-1.1: uvc_v4l2_open
usb 3-1.1: uvc_v4l2_release

===============================

Full lsusb:
Bus 003 Device 014: ID 534d:0021 MacroSilicon MS210x Video Grabber [EasierCAP] Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 239 Miscellaneous Device
bDeviceSubClass 2
bDeviceProtocol 1 Interface Association
bMaxPacketSize0 64
idVendor 0x534d MacroSilicon
idProduct 0x0021 MS210x Video Grabber [EasierCAP]
bcdDevice 1.21

  iManufacturer           1 MACROSILICON
  iProduct                2 AV TO USB2.0
  iSerial                 3 20150130
  bNumConfigurations      1

Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 0x01bb
bNumInterfaces 5
bConfigurationValue 1
iConfiguration 0
bmAttributes 0x80
(Bus Powered)
MaxPower 500mA
Interface Association:
bLength 8
bDescriptorType 11
bFirstInterface 0
bInterfaceCount 2
bFunctionClass 14 Video
bFunctionSubClass 3 Video Interface Collection
bFunctionProtocol 0
iFunction 0
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 0
bInterfaceClass 14 Video
bInterfaceSubClass 1 Video Control
bInterfaceProtocol 0
iInterface 0
VideoControl Interface Descriptor:
bLength 13
bDescriptorType 36
bDescriptorSubtype 1 (HEADER)
bcdUVC 1.00
wTotalLength 0x0033
dwClockFrequency 24.000000MHz
bInCollection 1
baInterfaceNr( 0) 1
VideoControl Interface Descriptor:
bLength 18
bDescriptorType 36
bDescriptorSubtype 2 (INPUT_TERMINAL)
bTerminalID 1
wTerminalType 0x0201 Camera Sensor
bAssocTerminal 0
iTerminal 0
wObjectiveFocalLengthMin 0
wObjectiveFocalLengthMax 0
wOcularFocalLength 0
bControlSize 3
bmControls 0x00000000
VideoControl Interface Descriptor:
bLength 11
bDescriptorType 36
bDescriptorSubtype 5 (PROCESSING_UNIT)
Warning: Descriptor too short
bUnitID 2
bSourceID 1
wMaxMultiplier 0
bControlSize 2
bmControls 0x00000000
iProcessing 0
bmVideoStandards 0x09
None
SECAM - 625/50
VideoControl Interface Descriptor:
bLength 9
bDescriptorType 36
bDescriptorSubtype 3 (OUTPUT_TERMINAL)
bTerminalID 3
wTerminalType 0x0101 USB Streaming
bAssocTerminal 0
bSourceID 2
iTerminal 0
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 0
bNumEndpoints 0
bInterfaceClass 14 Video
bInterfaceSubClass 2 Video Streaming
bInterfaceProtocol 0
iInterface 0
VideoStreaming Interface Descriptor:
bLength 15
bDescriptorType 36
bDescriptorSubtype 1 (INPUT_HEADER)
bNumFormats 2
wTotalLength 0x00d1
bEndpointAddress 0x83 EP 3 IN
bmInfo 0
bTerminalLink 3
bStillCaptureMethod 0
bTriggerSupport 0
bTriggerUsage 0
bControlSize 1
bmaControls( 0) 0
bmaControls( 1) 0
VideoStreaming Interface Descriptor:
bLength 11
bDescriptorType 36
bDescriptorSubtype 6 (FORMAT_MJPEG)
bFormatIndex 1
bNumFrameDescriptors 3
bFlags 1
Fixed-size samples: Yes
bDefaultFrameIndex 2
bAspectRatioX 0
bAspectRatioY 0
bmInterlaceFlags 0x00
Interlaced stream or variable: No
Fields per frame: 1 fields
Field 1 first: No
Field pattern: Field 1 only
bCopyProtect 0
VideoStreaming Interface Descriptor:
bLength 30
bDescriptorType 36
bDescriptorSubtype 7 (FRAME_MJPEG)
bFrameIndex 1
bmCapabilities 0x00
Still image unsupported
wWidth 480
wHeight 320
dwMinBitRate 768000
dwMaxBitRate 196608000
dwMaxVideoFrameBufferSize 307200
dwDefaultFrameInterval 400000
bFrameIntervalType 1
dwFrameInterval( 0) 400000
VideoStreaming Interface Descriptor:
bLength 42
bDescriptorType 36
bDescriptorSubtype 7 (FRAME_MJPEG)
bFrameIndex 2
bmCapabilities 0x00
Still image unsupported
wWidth 640
wHeight 480
dwMinBitRate 768000
dwMaxBitRate 196608000
dwMaxVideoFrameBufferSize 614400
dwDefaultFrameInterval 400000
bFrameIntervalType 4
dwFrameInterval( 0) 400000
dwFrameInterval( 1) 500000
dwFrameInterval( 2) 666666
dwFrameInterval( 3) 1000000
VideoStreaming Interface Descriptor:
bLength 42
bDescriptorType 36
bDescriptorSubtype 7 (FRAME_MJPEG)
bFrameIndex 3
bmCapabilities 0x00
Still image unsupported
wWidth 720
wHeight 480
dwMinBitRate 768000
dwMaxBitRate 196608000
dwMaxVideoFrameBufferSize 691200
dwDefaultFrameInterval 400000
bFrameIntervalType 4
dwFrameInterval( 0) 400000
dwFrameInterval( 1) 500000
dwFrameInterval( 2) 666666
dwFrameInterval( 3) 1000000
VideoStreaming Interface Descriptor:
bLength 6
bDescriptorType 36
bDescriptorSubtype 13 (COLORFORMAT)
bColorPrimaries 1 (BT.709,sRGB)
bTransferCharacteristics 1 (BT.709)
bMatrixCoefficients 4 (SMPTE 170M (BT.601))
VideoStreaming Interface Descriptor:
bLength 27
bDescriptorType 36
bDescriptorSubtype 4 (FORMAT_UNCOMPRESSED)
bFormatIndex 2
bNumFrameDescriptors 1
guidFormat
{32595559-0000-0010-8000-00aa00389b71}
bBitsPerPixel 16
bDefaultFrameIndex 1
bAspectRatioX 0
bAspectRatioY 0
bmInterlaceFlags 0x00
Interlaced stream or variable: No
Fields per frame: 2 fields
Field 1 first: No
Field pattern: Field 1 only
bCopyProtect 0
VideoStreaming Interface Descriptor:
bLength 30
bDescriptorType 36
bDescriptorSubtype 5 (FRAME_UNCOMPRESSED)
bFrameIndex 1
bmCapabilities 0x00
Still image unsupported
wWidth 480
wHeight 320
dwMinBitRate 36864000
dwMaxBitRate 36864000
dwMaxVideoFrameBufferSize 307200
dwDefaultFrameInterval 400000
bFrameIntervalType 1
dwFrameInterval( 0) 400000
VideoStreaming Interface Descriptor:
bLength 6
bDescriptorType 36
bDescriptorSubtype 13 (COLORFORMAT)
bColorPrimaries 1 (BT.709,sRGB)
bTransferCharacteristics 1 (BT.709)
bMatrixCoefficients 4 (SMPTE 170M (BT.601))
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 1
bNumEndpoints 1
bInterfaceClass 14 Video
bInterfaceSubClass 2 Video Streaming
bInterfaceProtocol 0
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x83 EP 3 IN
bmAttributes 5
Transfer Type Isochronous
Synch Type Asynchronous
Usage Type Data
wMaxPacketSize 0x1400 3x 1024 bytes
bInterval 1
Interface Association:
bLength 8
bDescriptorType 11
bFirstInterface 2
bInterfaceCount 2
bFunctionClass 1 Audio
bFunctionSubClass 1 Control Device
bFunctionProtocol 0
iFunction 4 USB2.0 MIC
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 2
bAlternateSetting 0
bNumEndpoints 0
bInterfaceClass 1 Audio
bInterfaceSubClass 1 Control Device
bInterfaceProtocol 0
iInterface 4 USB2.0 MIC
AudioControl Interface Descriptor:
bLength 9
bDescriptorType 36
bDescriptorSubtype 1 (HEADER)
bcdADC 1.00
wTotalLength 0x0026
bInCollection 1
baInterfaceNr(0) 3
AudioControl Interface Descriptor:
bLength 12
bDescriptorType 36
bDescriptorSubtype 2 (INPUT_TERMINAL)
bTerminalID 1
wTerminalType 0x0201 Microphone
bAssocTerminal 0
bNrChannels 2
wChannelConfig 0x0003
Left Front (L)
Right Front (R)
iChannelNames 0
iTerminal 0
AudioControl Interface Descriptor:
bLength 8
bDescriptorType 36
bDescriptorSubtype 6 (FEATURE_UNIT)
bUnitID 2
bSourceID 1
bControlSize 1
bmaControls(0) 0x03
Mute Control
Volume Control
iFeature 0
AudioControl Interface Descriptor:
bLength 9
bDescriptorType 36
bDescriptorSubtype 3 (OUTPUT_TERMINAL)
bTerminalID 3
wTerminalType 0x0101 USB Streaming
bAssocTerminal 0
bSourceID 2
iTerminal 0
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 3
bAlternateSetting 0
bNumEndpoints 0
bInterfaceClass 1 Audio
bInterfaceSubClass 2 Streaming
bInterfaceProtocol 0
iInterface 4 USB2.0 MIC
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 3
bAlternateSetting 1
bNumEndpoints 1
bInterfaceClass 1 Audio
bInterfaceSubClass 2 Streaming
bInterfaceProtocol 0
iInterface 4 USB2.0 MIC
AudioStreaming Interface Descriptor:
bLength 7
bDescriptorType 36
bDescriptorSubtype 1 (AS_GENERAL)
bTerminalLink 3
bDelay 0 frames
wFormatTag 0x0001 PCM
AudioStreaming Interface Descriptor:
bLength 11
bDescriptorType 36
bDescriptorSubtype 2 (FORMAT_TYPE)
bFormatType 1 (FORMAT_TYPE_I)
bNrChannels 1
bSubframeSize 2
bBitResolution 16
bSamFreqType 1 Discrete
tSamFreq[ 0] 96000
Endpoint Descriptor:
bLength 9
bDescriptorType 5
bEndpointAddress 0x82 EP 2 IN
bmAttributes 1
Transfer Type Isochronous
Synch Type None
Usage Type Data
wMaxPacketSize 0x0100 1x 256 bytes
bInterval 4
bRefresh 0
bSynchAddress 0
AudioStreaming Endpoint Descriptor:
bLength 7
bDescriptorType 37
bDescriptorSubtype 1 (EP_GENERAL)
bmAttributes 0x00
bLockDelayUnits 0 Undefined
wLockDelay 0x0000
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 4
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 3 Human Interface Device
bInterfaceSubClass 0
bInterfaceProtocol 0
iInterface 0
HID Device Descriptor:
bLength 9
bDescriptorType 33
bcdHID 1.10
bCountryCode 33 US
bNumDescriptors 1
bDescriptorType 34 Report
wDescriptorLength 23
Report Descriptors:
** UNAVAILABLE **
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0004 1x 4 bytes
bInterval 16
Device Qualifier (for other device speed):
bLength 10
bDescriptorType 6
bcdUSB 2.00
bDeviceClass 239 Miscellaneous Device
bDeviceSubClass 2
bDeviceProtocol 1 Interface Association
bMaxPacketSize0 64
bNumConfigurations 0
Device Status: 0x0000
(Bus Powered)

Signature · 2 lines
js
suse labs
#1 lore raw

Hi Jiri

I think that /dev/video3 belongs to your notebook webcam, not to the EasyCAP.

720x480 I believe is the NTSC resolution. Can you try starting the VHS, *before* you connect the grabber to the USB? Maybe that way the device realises that it should be working in PAL not in NTSC.

Regards!

#2 lore raw
Quoted 5 lines · Ricardo Ribalda

Hi Jiri

I think that /dev/video3 belongs to your notebook webcam, not to the EasyCAP.

That looks correct.

Quoted 3 lines

720x480 I believe is the NTSC resolution. Can you try starting the VHS, *before* you connect the grabber to the USB? Maybe that way the device realises that it should be working in PAL not in NTSC.

Good idea. The device advertises a maximum resolution of 720x480 in the UVC descriptors it exposes to the host, so there's nothing the driver can really do to obtain 720x576.

If plugging an active PAL source to the device before plugging it to the USB port doesn't help, another option for investigation is to capture USB traffic under Windows to check what happens there.

Signature · 3 lines
Regards,

Laurent Pinchart
author
#3 lore raw
Quoted 8 lines · Laurent Pinchart
Quoted 5 lines · Ricardo Ribalda

Hi Jiri

I think that /dev/video3 belongs to your notebook webcam, not to the EasyCAP.

That looks correct.

Yes, you are right -- only 2 devices (4+5) are created. I don't know why I thought there are 3.

Quoted 1 line
Quoted 1 line

720x480 I believe is the NTSC resolution.

Ah, that makes sense. Which leads me to: sometimes, the picture distorts after I start playing the video. It's skewed and halves of the picture switched [1]. I assume the driver expects NTSC@720x480, but the device sends PAL@720x576, actually. Sometimes, there are also color strips.

[1] https://hci.fi.muni.cz/~xslaby/n/skew.jpg

Quoted 7 lines

Can you try starting the

Quoted 2 lines

VHS, *before* you connect the grabber to the USB? Maybe that way the device realises that it should be working in PAL not in NTSC.

Good idea. The device advertises a maximum resolution of 720x480 in the UVC descriptors it exposes to the host, so there's nothing the driver can really do to obtain 720x576.

That doesn't help. Maybe it would sound foolish (I don't know the internals), but would it make sense to re-read UVC parameters on each device start in open? Only as a debug aid to see if they change.

Quoted 3 lines

If plugging an active PAL source to the device before plugging it to the USB port doesn't help, another option for investigation is to capture USB traffic under Windows to check what happens there.

OK, I can try it. I have win10 virt machine set up. So that should be easy using usbmon. Except I don't know how to read the mon dumps. I should start at Documentation/usb/usbmon.rst, I believe.

thanks,

Signature · 2 lines
js
suse labs
#4 lore raw

Hi Jiri

Quoted 27 lines · Jiri Slaby
Quoted 8 lines · Laurent Pinchart
Quoted 5 lines · Ricardo Ribalda

Hi Jiri

I think that /dev/video3 belongs to your notebook webcam, not to the EasyCAP.

That looks correct.

Yes, you are right -- only 2 devices (4+5) are created. I don't know why I thought there are 3.

Quoted 1 line
Quoted 1 line

720x480 I believe is the NTSC resolution.

Ah, that makes sense. Which leads me to: sometimes, the picture distorts after I start playing the video. It's skewed and halves of the picture switched [1]. I assume the driver expects NTSC@720x480, but the device sends PAL@720x576, actually. Sometimes, there are also color strips.

[1] https://hci.fi.muni.cz/~xslaby/n/skew.jpg

Quoted 4 lines

Can you try starting the

Quoted 2 lines

VHS, *before* you connect the grabber to the USB? Maybe that way the device realises that it should be working in PAL not in NTSC.

Quoted 7 lines
Quoted 3 lines

Good idea. The device advertises a maximum resolution of 720x480 in the UVC descriptors it exposes to the host, so there's nothing the driver can really do to obtain 720x576.

That doesn't help. Maybe it would sound foolish (I don't know the internals), but would it make sense to re-read UVC parameters on each device start in open? Only as a debug aid to see if they change.

UVC is weird. The parameters are part of the USB descriptor, and the only way to change those is to re-enumerate.

Some HDMI receivers simulate a usb disconnect every time the resolution of the source changes... If the hdmi signal is not very good imaging the party :)

Quoted 8 lines
Quoted 4 lines

If plugging an active PAL source to the device before plugging it to the USB port doesn't help, another option for investigation is to capture USB traffic under Windows to check what happens there.

OK, I can try it. I have win10 virt machine set up. So that should be easy using usbmon. Except I don't know how to read the mon dumps. I should start at Documentation/usb/usbmon.rst, I believe.

TL/DR:
modprobe usbmon
sudo wireshark; select the usbmonX device where your device is attached

Good luck ;)

Quoted 6 lines

thanks,
--
js
suse labs

Signature · 1 line
Ricardo Ribalda
author
#5 lore raw

Hi,

Quoted 8 lines · Ricardo Ribalda
Quoted 7 lines
Quoted 3 lines

If plugging an active PAL source to the device before plugging it to the USB port doesn't help, another option for investigation is to capture USB traffic under Windows to check what happens there.

OK, I can try it. I have win10 virt machine set up. So that should be easy using usbmon. Except I don't know how to read the mon dumps. I should start at Documentation/usb/usbmon.rst, I believe.

Quoted 5 lines

TL/DR:
modprobe usbmon
sudo wireshark; select the usbmonX device where your device is attached

Good luck ;)

This is the last SET CUR (the "Commit" one) Windows do:
Setup Data

    bmRequestType: 0x21
    bRequest: SET CUR (0x01)
    Control Selector: Commit (0x02)
    Interface: 0x01
    Entity: 0x00
    wLength: 26
    Probe/Commit Info
        bmHint: 0x0001, dwFrameInterval
        bFormatIndex: 1
        bFrameIndex: 2
        dwFrameInterval: 400000
        wKeyFrameRate: 0
        wPFrameRate: 0
        wCompQuality: 0
        wCompWindow: 0
        wDelay: 0
        dwMaxVideoFrameSize: 691200
        dwMaxPayloadTransferSize: 3072
    Data Fragment: 01000102801a060000000000000000000000008c0a00000c0000

I assume the Win program only pretends (recodes) as 720x576. In fact -- IMO, it grabs only 640x480. 691200 above is 2*720*480 and lsusb says "bFrameIndex: 2" is this:

VideoStreaming Interface Descriptor:
bLength 42
bDescriptorType 36
bDescriptorSubtype 7 (FRAME_MJPEG)
bFrameIndex 2
bmCapabilities 0x00
Still image unsupported
wWidth 640
wHeight 480
dwMinBitRate 768000
dwMaxBitRate 196608000
dwMaxVideoFrameBufferSize 614400
dwDefaultFrameInterval 400000
bFrameIntervalType 4
dwFrameInterval( 0) 400000
dwFrameInterval( 1) 500000
dwFrameInterval( 2) 666666
dwFrameInterval( 3) 1000000

Holy crap. Can someone recommend a cheap full PAL device?

FWIW, full pcap of a piece of video grabbed in Win is at:
https://hci.fi.muni.cz/~xslaby/n/av-win.pcap

thanks,

Signature · 1 line
js
author
#6 lore raw
In reply to Jiri Slaby
Quoted 3 lines · Jiri Slaby

Ah, that makes sense. Which leads me to: sometimes, the picture distorts after I start playing the video. It's skewed and halves of the picture switched [1]. I assume the driver expects NTSC@720x480, but the device sends PAL@720x576, actually. Sometimes, there are also color strips.

[1] https://hci.fi.muni.cz/~xslaby/n/skew.jpg

FWIW taking only every third line of it and applying this math on the offset:
offset_in_bitmap = x + 2*576*y/480;
makes some parts of the picture what they should be. I have no idea if it helps anything though ;). IOW, the skew at the bottom of the picture seems to be 576*2=1172 pixels for whatever reasons.

thanks,

Signature · 3 lines
-- 
js
suse labs