Skip to content

Instantly share code, notes, and snippets.

@andersondanilo
Last active December 10, 2024 22:00
Show Gist options
  • Save andersondanilo/3c66fff45e27cbedfb0cb5cc5cc6d0eb to your computer and use it in GitHub Desktop.
Save andersondanilo/3c66fff45e27cbedfb0cb5cc5cc6d0eb to your computer and use it in GitHub Desktop.
ms2109 linux (MacroSilicon USB Video)

Play

ffplay -f video4linux2 -framerate 60 -video_size 1920x1080 -input_format mjpeg /dev/video2

You can try other video number (video3, video4)

Maybe you need:

Create: /etc/udev/rules.d/91-hdmi-to-usb-ms2109.rules With:

# 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'"

Reload: sudo udevadm control --reload-rules

then unplug and replug, and it should start working.

Info source

https://www.mjt.me.uk/posts/fixing-missing-macrosilicon-ms2109/ https://bbs.archlinux.org/viewtopic.php?pid=1919811#p1919811

@jeffbrl
Copy link

jeffbrl commented Dec 10, 2024

Appreciate the notes on this. I can't get /dev/video devices to show up in WSL2/Debian Bookworm despite adding the udev rules. I am using usbip to attach the device to debian. It shows up in dmesg and lsusb. If anyone has this working, please share.

[131905.976346] vhci_hcd vhci_hcd.0: Device attached
[131906.420435] usb 1-1: new high-speed USB device number 3 using vhci_hcd
[131906.591278] usb 1-1: SetAddress Request (3) to port 0
[131906.629336] usb 1-1: New USB device found, idVendor=534d, idProduct=2109, bcdDevice=21.00
[131906.630105] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[131906.630780] usb 1-1: Product: usb video
[131906.631139] usb 1-1: Manufacturer: MACROSILICON
[131906.642774] hid-generic 0003:534D:2109.0002: hiddev96,hidraw0: USB HID v1.10 Device [MACROSILICON usb video] on usb-vhci_hcd.0-1/input4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment