Macrosilicon MS2100 HDMI To USB 3.0 Video Capture Card

daf@daftitanium:~$ lsusb
Bus 003 Device 101: ID 534d:2109 MacroSilicon USB Video
cat /var/log/syslog

Oct 2 11:31:13 daftitanium kernel: [738079.626765] usb 3-3: new high-speed USB device number 102 using xhci_hcd
Oct 2 11:31:13 daftitanium kernel: [738079.778290] usb 3-3: New USB device found, idVendor=534d, idProduct=2109, bcdDevice=21.00
Oct 2 11:31:13 daftitanium kernel: [738079.778298] usb 3-3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
Oct 2 11:31:13 daftitanium kernel: [738079.778301] usb 3-3: Product: USB Video
Oct 2 11:31:13 daftitanium kernel: [738079.778303] usb 3-3: Manufacturer: MACROSILICON
Oct 2 11:31:13 daftitanium kernel: [738079.780434] usb 3-3: Found UVC 1.00 device USB Video (534d:2109)
Oct 2 11:31:13 daftitanium kernel: [738079.789530] hid-generic 0003:534D:2109.006D: hiddev5,hidraw12: USB HID v1.10 Device [MACROSILICON USB Video] on usb-0000:00:14.0-3/input4
Oct 2 11:31:13 daftitanium mtp-probe: checking bus 3, device 102: "/sys/devices/pci0000:00/0000:00:14.0/usb3/3-3"
Oct 2 11:31:13 daftitanium mtp-probe: bus: 3, device: 102 was not an MTP device
Oct 2 11:31:13 daftitanium systemd-udevd[1632161]: controlC2: Process '/usr/sbin/alsactl -E HOME=/run/alsa -E XDG_RUNTIME_DIR=/run/alsa/runtime restore 2' failed with exit code 99.
Oct 2 11:31:13 daftitanium mtp-probe: checking bus 3, device 102: "/sys/devices/pci0000:00/0000:00:14.0/usb3/3-3"
Oct 2 11:31:13 daftitanium mtp-probe: bus: 3, device: 102 was not an MTP device
Oct 2 11:31:14 daftitanium Thunar[1632166]: thunar-volman: Unsupported USB device type "usb".
Oct 2 11:31:14 daftitanium Thunar[1632194]: thunar-volman: Unsupported USB device type "snd-usb-audio".
Oct 2 11:31:14 daftitanium Thunar[1632198]: thunar-volman: Unsupported USB device type "usbhid".
Oct 2 11:31:14 daftitanium Thunar[1632203]: thunar-volman: Unsupported USB device type "snd-usb-audio".
Oct 2 11:31:14 daftitanium Thunar[1632207]: thunar-volman: Unsupported USB device type "uvcvideo".
Oct 2 11:31:14 daftitanium Thunar[1632213]: thunar-volman: Unsupported USB device type "uvcvideo"
dmesg

[726177.717306] usb 3-1.3.2.2: new full-speed USB device number 100 using xhci_hcd
[726177.821220] usb 3-1.3.2.2: New USB device found, idVendor=046d, idProduct=c52f, bcdDevice=30.00
[726177.821231] usb 3-1.3.2.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[726177.821234] usb 3-1.3.2.2: Product: USB Receiver
[726177.821237] usb 3-1.3.2.2: Manufacturer: Logitech
[726177.829229] logitech-djreceiver 0003:046D:C52F.0069: hidraw9: USB HID v1.11 Mouse [Logitech USB Receiver] on usb-0000:00:14.0-1.3.2.2/input0
[726177.887265] logitech-djreceiver 0003:046D:C52F.006A: hiddev4,hidraw10: USB HID v1.11 Device [Logitech USB Receiver] on usb-0000:00:14.0-1.3.2.2/input1
[726177.947216] logitech-djreceiver 0003:046D:C52F.006A: device of type eQUAD step 4 DJ (0x04) connected on slot 1
[726177.955492] input: Logitech M280/320/275 as /devices/pci0000:00/0000:00:14.0/usb3/3-1/3-1.3/3-1.3.2/3-1.3.2.2/3-1.3.2.2:1.1/0003:046D:C52F.006A/0003:046D:4057.006B/input/input113
[726177.955798] logitech-hidpp-device 0003:046D:4057.006B: input,hidraw11: USB HID v1.11 Mouse [Logitech M280/320/275] on usb-0000:00:14.0-1.3.2.2/input1:1
[726185.749246] logitech-hidpp-device 0003:046D:4057.006B: HID++ 4.5 device connected.
[726997.019684] input: DAF QC (AVRCP) as /devices/virtual/input/input114
[736305.306332] usb 3-4: new high-speed USB device number 101 using xhci_hcd
[736305.457861] usb 3-4: New USB device found, idVendor=534d, idProduct=2109, bcdDevice=21.00
[736305.457869] usb 3-4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[736305.457871] usb 3-4: Product: USB Video
[736305.457873] usb 3-4: Manufacturer: MACROSILICON
[736305.459960] usb 3-4: Found UVC 1.00 device USB Video (534d:2109)
[736305.462657] hid-generic 0003:534D:2109.006C: hiddev5,hidraw12: USB HID v1.10 Device [MACROSILICON USB Video] on usb-0000:00:14.0-4/input4
[736440.565674] usb 3-4: USB disconnect, device number 101
[738079.626765] usb 3-3: new high-speed USB device number 102 using xhci_hcd
[738079.778290] usb 3-3: New USB device found, idVendor=534d, idProduct=2109, bcdDevice=21.00
[738079.778298] usb 3-3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[738079.778301] usb 3-3: Product: USB Video
[738079.778303] usb 3-3: Manufacturer: MACROSILICON
[738079.780434] usb 3-3: Found UVC 1.00 device USB Video (534d:2109)
[738079.789530] hid-generic 0003:534D:2109.006D: hiddev5,hidraw12: USB HID v1.10 Device [MACROSILICON USB Video] on usb-0000:00:14.0-3/input4

FROM: https://www.mjt.me.uk/posts/fixing-missing-macrosilicon-ms2109/

I brought a cheap (£10) HDMI-to-USB2 capture device based on the Macrosilicon 2109 – but I encountered a problem where it didn’t appear at /dev/video* when plugged in, despite dmesg showing some recognition of the device.

Fortunately, Nikola_F on the Arch Linux forums had already found the problem and offered a solution: The device is wrongly being treated as a USB audio device. You can confirm this by checking four new symlinks appear in ls -l /sys/bus/usb/drivers/snd-usb-audio/ when you insert the device.

To fix it, I created new udev rules (in a file like /etc/udev/rules.d/91-hdmi-to-usb-ms2109.rules ) to apply Nikola_F’s fix automatically:

# For HDMI-to-USB adaptor:
SUBSYSTEM=="usb", DRIVER=="snd-usb-audio", ATTRS{idProduct}=="2109", ATTRS{idVendor}=="534d", \
RUN+="/bin/sh -c 'echo -n $kernel > /sys/bus/usb/drivers/snd-usb-audio/unbind'"

SUBSYSTEM=="usb", DRIVER=="snd-usb-audio", ATTRS{idProduct}=="2109", ATTRS{idVendor}=="534d", \
ATTR{bInterfaceNumber}=="00", RUN+="/bin/sh -c 'sleep 1; echo -n $kernel > /sys/bus/usb/drivers/uvcvideo/bind'"

Give it a sudo udevadm control --reload-rules then unplug and replug, and it should start working.

This disables the audio function of the HDMI-to-USB converter, but I wasn’t using it anyway. More careful rule-writing could probably solve that problem.
Other hints for using the MS2109

I was able to stream video from the device at 1080p with

ffplay -f video4linux2 -framerate 50 -video_size 1920x1080 -input_format mjpeg /dev/video0

The device seemed to struggle if mjpeg wasn’t used – presumably a lack of USB bandwidth. If you want to use it with software you can’t convince to ask for mjpeg, you can create a loopback camera and use ffmpeg to read mjpeg from the capture card and output regular video to the loopback camera, like so:

sudo apt-get install ffmpeg v4l2loopback-utils

sudo modprobe v4l2loopback devices=1 video_nr=10 card_label="LoopbackCam" exclusive_caps=1
ffmpeg -f video4linux2 -framerate 50 -video_size 1920x1080 -input_format mjpeg -i /dev/video0 -f v4l2 -pix_fmt yuv420p /dev/video10

more at: https://bbs.archlinux.org/viewtopic.php?pid=1919811#p1919811 and
https://www.diyaudio.com/community/threads/macrosilicon-2109-cheap-usb-hdmi-a-v-capture.357873/


Posted

in

,

by