Jump to content

wuhanstudio

Validating
  • Posts

    1
  • Joined

  • Last visited

Posts posted by wuhanstudio

  1. Armbianmonitor:

     

    Hi, 

     

    I was trying to use OrangePi One to add a filter to my USB camera, so that I can apply some image processing to the original input image.

    image.png.557a4c0d86464d5f6e63abe62151908a.png

    The original project uses raspberrypi: https://github.com/likeablob/rpi-wfh-webcam

     

    It captures the image from a USB Camera, then applys some image processing on Raspberry Pi. Lastly, it creates a virtual camera that sends the output image to the PC.

     

    spam_s.gif.e0b10f8e8fc8eb630be3492446d17eed.gif

     

    I would like to achieve the same effect using OrangePi One (Armbian), and the only problem left is to simulate a virtual camera using the USB Gadget.

     

    What I tried:

     

    $ sudo modprobe g_webcam
    
    musb-hdrc.4.auto: failed to start g_webcam: -22

     

    According to this post, a more preferred way to do this is to use configfs:

     

     

    I followed instructions here: 

    https://developer.ridgerun.com/wiki/index.php?title=How_to_use_the_UVC_gadget_driver_in_Linux

     

    But unfortunately, it returned with the same error: Invalid Argument:
     

    sudo modprobe libcomposite dwc2 usb_f_uvc
    
    mkdir -p /sys/kernel/config/usb_gadget/g1
    cd /sys/kernel/config/usb_gadget/g1
    echo 0x0525 > idVendor
    echo 0x0102 > idProduct
    
    mkdir -p strings/0x409
    echo 0123456789 > strings/0x409/serialnumber
    echo $(hostname) > strings/0x409/manufacturer
    echo "UVC Gadget" > strings/0x409/product
    
    mkdir configs/c.1
    mkdir configs/c.1/strings/0x409
    
    mkdir functions/uvc.0
    mkdir -p functions/uvc.0/streaming/uncompressed/u/360p
    
    cat <<EOF > functions/uvc.0/streaming/uncompressed/u/360p/dwFrameInterval
    666666
    1000000
    5000000
    EOF
    
    mkdir functions/uvc.0/streaming/header/h
    cd functions/uvc.0/streaming/header/h
    ln -s ../../uncompressed/u
    cd ../../class/fs
    ln -s ../../header/h
    cd ../../class/hs
    ln -s ../../header/h
    cd ../../class/ss
    ln -s ../../header/h
    cd ../../../control
    mkdir -p header/h
    ln -s header/h class/fs
    ln -s header/h class/ss
    cd ../../../
    
    echo 2048 > functions/uvc.0/streaming_maxpacket
    ln -s functions/uvc.0 configs/c.1
    
    ls /sys/class/udc > UDC

     

    Does this mean the Allwinner H2/H3 USB IP Core does not support g_webcam / usb_f_uvc ?

     

    (Both g_serial and g_eth works, but not g_webcam)

×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines