Giter Club home page Giter Club logo

uvc-gadget's Introduction

uvc-gadget

NOTE: This repository was originally forked from https://github.com/climberhunt/uvc-gadget, which itself was forked from https://github.com/wlhe/uvc-gadget, which is a fork from the original project... so it's a little bit of a mess here. Anyways, this little aside at the top of the README is the only bit that I have updated in the README so far.

To be perfectly honest, I am still trying to learn the ins-and-outs of uvc-gadget and OTG usage before I feel confident enough to make the README actually comprehensible to humans who are not neck-deep in this stuff. I love good documentation, but I hate misleading or hard-to-read documentation.

Anyways, check out https://github.com/geerlingguy/pi-webcam for the downstream and user-friendly usage of this project.

The main thing is you can choose once (for now) between 720p or 1080p when you set this up—the project currently defaults to 720p, but if you want to switch to 1080p, then BEFORE you run this stuff, find the code with 'For 720p' and comment those parts out, and find the code with 'For 1080p' and uncomment those parts. I hope to make this all so much simpler in the future, allowing easier selection.

– geerlingguy

Upstream project uvc-gadget has been updated and continuous maintenance

Please refer to http://git.ideasonboard.org/uvc-gadget.git

UVC gadget userspace enhancement sample application

Fork from
uvc-gadget.git
Apply enhancement Bhupesh Sharma's patchset
UVC gadget test application enhancements
and Robert Baldyga's patchset
Bugfixes for UVC gadget test application

How to use

Usage: ./uvc-gadget [options]

Available options are
    -b             Use bulk mode
    -d             Do not use any real V4L2 capture device
    -f <format>    Select frame format
            0 = V4L2_PIX_FMT_YUYV
            1 = V4L2_PIX_FMT_MJPEG
    -h             Print this help screen and exit
    -i image       MJPEG image
    -m             Streaming mult for ISOC (b/w 0 and 2)
    -n             Number of Video buffers (b/w 2 and 32)
    -o <IO method> Select UVC IO method:
            0 = MMAP
            1 = USER_PTR
    -r <resolution> Select frame resolution:
            0 = 360p, VGA (640x360)
            1 = 720p, WXGA (1280x720)
    -s <speed>     Select USB bus speed (b/w 0 and 2)
            0 = Full Speed (FS)
            1 = High Speed (HS)
            2 = Super Speed (SS)
    -t             Streaming burst (b/w 0 and 15)
    -u device      UVC Video Output device
    -v device      V4L2 Video Capture device

Build

  • host:
    make
  • Cross compile:
    make ARCH=arch CROSS_COMPILE=cross_compiler
    eg:
    make ARCH=arm CROSS_COMPILE=arm-hisiv600-linux-
  • or:
    set ARCH, CROSS_COMPILE, KERNEL_DIR in Makefile

Change log

Initial

uvc-gadget's People

Contributors

climberhunt avatar geerlingguy avatar mackemint avatar rthpjm avatar wlhe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

uvc-gadget's Issues

Make the piwebcam service stoppable

Currently if I run:

sudo systemctl stop piwebcam

It ends up hanging. Probably because the service calls /home/pi/uvc-gadget/piwebcam, which doesn't have a corresponding ExecStop command. That start script ends up running sudo /home/pi/uvc-gadget/uvc-gadget -f1 -s2 -r1 -u /dev/video1 -v /dev/video0, which kinda just fires off then keeps running forever.

Mac OS 12.0.1 Monterey fails to detect the camera

This issue has been worked on over at the showmewebcam project, and has now been resolved (see Issue #164).

It turns out that Monterey has a different behaviour to previous versions of Mac OS, and is more sensitive to the configuration numbering of uvc-gadget.

In multi-gadget.sh the config is currently written to the configs folder /sys/kernel/config/usb_gadget/pi4/configs/c.2, however this is the only configuration. Monterey seems to expect the configuration to be numbered starting at one.
Therefore the config folder should be: /sys/kernel/config/usb_gadget/pi4/configs/c.1

It looks like a simple bounds issue in Monterey.
Currently uvc-gadget presents the configuration as effectively "number 2 of 1 configuration". This gives Monterey a headache! By amending the folder to c.1 uvc-gadget then presents the configuration as "number 1 of 1 configuration" and Monterey is happy.

desktop as webcam

Hi, i am working on an idea and could not think of another way to contact you.
currently i am trying to forward the pi's desktop as a uvc-gadget to a host pc.
and use a serial connection as way back to the pi.

the concept would have a usb composite interface.
uvc-gadget
serial-hid
massstorage-cdrom

the usage would be to use the pi zero-w in combination with a usb-a adapter board as host powered compute stick.
it boots and shows up as cd-rom drive.
on the cd image there will be a little software that shows the pi-desktop via uvc-gadget livestream
and graps the relative keyboard and mouse inputs and forards them via serial to the pi.

the end result would be a secure surf stick with bluetooth and wlan function that has no ethernet connection to the host but can be fully worked with remotely.

it might even be possible to switch from cd-rom to hdd image and present securely downloaded files to the hostfilesystem.

please let me know if you want to join this project.

Best regards,
JR.

uvc-gadget using 98% CPU when not in use

It would be nice if the uvc-gadget process were not quite as much of a CPU hog, at least on the Pi Zero W's ancient CPU.

top - 21:56:20 up 4 min,  3 users,  load average: 0.99, 1.36, 0.68
Tasks: 111 total,   2 running, 109 sleeping,   0 stopped,   0 zombie
%Cpu(s): 16.9 us, 83.1 sy,  0.0 ni,  0.0 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
MiB Mem :    368.7 total,     82.5 free,    100.0 used,    186.2 buff/cache
MiB Swap:    100.0 total,    100.0 free,      0.0 used.    215.2 avail Mem 

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND                                                                                                                        
  436 root      20   0    5940   5168   5100 R  98.4   1.4   2:30.20 uvc-gadget

Is there any way to bring that down? Right now I'm testing supplying a 720p and 1080p stream... maybe I can't have multiple, and I'll have to stick with just one.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.