Microsoft lifecam linux drivers

Linux Mint Forums

Forum rules
Before you post please read how to get help. Topics in this forum are automatically closed 6 months after creation.

Webcam: Microsoft LifeCam HD-3000

Post by ZeonOtaku » Tue Sep 04, 2012 12:49 pm

I’ve been doing research, and there’s some driver called «uvcvideo». In addition to checking Mint Linux which says that the HD-3000 works, I’ve checked this website: http://www.ideasonboard.org/uvc/ and it’s listed that the MSLC HD-3000 is supported by that driver. I’ve also installed GIT and followed the instructions:

sudo git clone git://linuxtv.org/media_build.git cd media_build sudo ./build sudo make install 
Checking if the needed tools for Linux Mint 10 Julia are available ERROR: please install "lsdiff", otherwise, build won't work. ERROR: please install "Proc::ProcessTable", otherwise, build won't work. I don't know distro Linux Mint 10 Julia. So, I can't provide you a hint with the package names. Be welcome to contribute with a patch for media-build, by submitting a distro-specific hint to linux-media@vger.kernel.org Build can't procceed as 2 dependencies are missing at ./build line 265.

I proceed to sudo make install

But at this point, I really don’t know what to do. Never made a driver before (I guess that’s what this process is doing) — and if so, what’s next?

Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 3 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.

Источник

Webcam setup

Most probably your webcam will work out of the box. Permissions to access video devices (e.g. /dev/video0 ) are handled by udev, there is no configuration necessary.

Loading

Most recent webcams are UVC (USB Video Class) compliant and are supported by the generic uvcvideo kernel driver module. To check that your webcam is recognized, see the journal just after you plug the webcam in. You should see something like this:

kernel: sn9c102: V4L2 driver for SN9C10x PC Camera Controllers v1:1.24a usb 1-1: SN9C10[12] PC Camera Controller detected (vid/pid 0x0C45/0x600D) usb 1-1: PAS106B image sensor detected usb 1-1: Initialization succeeded usb 1-1: V4L2 device registered as /dev/video0 usb 1-1: Optional device control through 'sysfs' interface ready usbcore: registered new driver sn9c102

Some pre-UVC webcams are also supported via the gspca kernel driver module. See the gspca cards list for a non-exhaustive list of supported devices under this framework.

Otherwise, if your webcam is not supported by the kernel’s drivers, an external driver is necessary. The first step is to identify the name of the webcam, using for example lsusb . Then you can check webcam devices for information and resources about webcams. Once you find a driver compatible with the webcam, you can load the module at boot.

Note: The Linux kernel to userspace API used to control webcams is named Video4Linux2, v4l2 for short. All applications which support v4l2 will work with the kernel’s drivers.

Читайте также:  Creating makefiles in linux

Configuration

If you want to configure brightness, color and other webcam parameters (e.g. in the case when out-of-the-box colors are too bluish/reddish/greenish) you may use a variety of applications. Some specific webcams such as the Logitech Brio or the Razer Kiyo Pro might require a specific application for some of their specific options such as HDR. Changing any settings in an application that configures V4L settings will generally change those settings for all applications using those cameras unless they override those settings themselves.

Command line

v4l-utils installs a command line tool, v4l2-ctl . To list all video devices:

To list the configurable settings of a video device:

$ v4l2-ctl -d /dev/video0 --list-ctrls

Alternatively, you can use cameractrls :

$ cameractrls -c brightness=128

Graphical

For generic graphical webcam configuration tools your can use either qv4l2 from v4l-utils or guvcview . In addition to this, cameractrls contains cameractrlsgtk which allows you to configure some camera-specific features for the Logitech Brio as well as the Razer Kiyo Pro on top of supporting all the other v4l options.

Persisting configuration changes

Configuration made via V4L2 does not persist after the webcam is disconnected and reconnected. It is possible to use v4l2-ctl with Udev rules in order to set some configuration each time a particular camera is connected.

For example, to set a default zoom setting on a particular Logitech webcam each time it is connected, add a udev rule like this:

/etc/udev/rules.d/99-logitech-default-zoom.rules
SUBSYSTEM=="video4linux", KERNEL=="video8*", ATTR=="0", ATTRS=="046d", ATTRS=="0892", RUN+="/usr/bin/v4l2-ctl -d $devnode --set-ctrl=zoom_absolute=170"

The above rule is valid for the Logitech C920 HD Pro Webcam — hardware ID 046d:0892.

The device’s vendor id and product id can be found using lsusb . These are unique per product and do not change unless the product gets a new hardware revision.

To find udev attributes like the product name and serial, see Udev#List the attributes of a device. It is also possible to set a static name for a video device).

Disable internal laptop webcam

Sometimes we might want to disable a laptop’s internal webcam so that only the one attached via USB is showing. This can be done with a udev rule. First we will need the device’s vendor id and the product id from lsusb

Bus 001 Device 008: ID 1bcf:28c1 Sunplus Innovation Technology Inc. Integrated_Webcam_HD

Then we add new udev rule to remove the device as soon as it is detected:

/etc/udev/rules.d/40-disable-internal-webcam.rules
ACTION=="add", ATTR=="1bcf", ATTR=="28c1", RUN="/bin/sh -c 'echo 1 >/sys/\$devpath/remove'"

Disable webcam completely

To disable webcam completely, you can blacklist the uvcvideo kernel module. For example:

Applications

xawtv

This is a basic Video4Linux2 device viewer, and although it is intended for use with TV tuner cards, it works well with webcams. It will display what your webcam sees in a window.

VLC

VLC can also be used to view and record your webcam. In VLC’s Media menu, open the Capture Device. dialog and enter the video and audio device files. Or from the command line, for example:

$ vlc v4l2://:input-slave=alsa://:v4l-vdev="/dev/video0"

This will make VLC mirror your webcam.

  • To take stills, simply choose Snapshot in the Video menu.
  • To record the stream, add a —sout argument to the command line, e.g.
$ vlc v4l://:v4l-vdev="/dev/video0":v4l-adev="/dev/audio2" --sout "#transcode:duplicate>"

Note that by default this will not display the video. In order to see what you are recording, you need to add the display as a destination to the argument (which will slow down the operation):

Читайте также:  Linux свой драйвер usb

MPlayer

To use MPlayer to take snapshots from your webcam run this command from the terminal:

$ mplayer tv:// -tv driver=v4l2:width=640:height=480:device=/dev/video0 -fps 15 -vf screenshot

From here you have to press s to take the snapshot. The snapshot will be saved in the current folder as shotXXXX.png . If you want to record video continuous:

$ mencoder tv:// -tv driver=v4l2:width=640:height=480:device=/dev/video0:forceaudio:adevice=/dev/dsp -ovc lavc -oac mp3lame -lameopts cbr:br=64:mode=3 -o filename.avi

Press Ctrl+c to end the recording.

To play video with MPlayer using MJPEG as the pixelformat instead of the default, which in most cases is YUYV, you can run the following:

$ mplayer tv:// -tv driver=v4l2:width=640:height=480:device=/dev/video0:outfmt=mjpeg -fps 15

mpv

To use mpv to take snapshots from your webcam, run this command from the terminal:

$ mpv av://v4l2:/dev/video0 --profile=low-latency --untimed

From here you have to press s to take the snapshot. The snapshot will be saved in your current folder as mpv-shotNNNN.jpg .

To use MJPEG as the pixelformat instead of the default, which in most cases is YUYV, you can run the following instead:

$ mpv --demuxer-lavf-format=video4linux2 --demuxer-lavf-o-set=input_format=mjpeg av://v4l2:/dev/video0

In some cases this can lead to drastic improvements in quality and performance (5FPS -> 30FPS for example).

To adjust webcam settings, including the resolution, see the mpv documentation.

FFmpeg

See v4l2loopback#Use cases for various examples, where FFmpeg is used to output video to a v4l2 device, which can be used as a webcam.

For laptops without a webcam, an IP camera can be used as an alternative to droidcam which does not keep the extra webcam device hanging around. For android, something like IP webcam can be hosted on the phone, then use the IP camera as a video input for the laptop. First, install linux-headers and v4l2loopback-dkms , then connect to the video source as /dev/video0 using v4l2loopback with 192.168.1.xxx being the IP address of the phone:

# modprobe v4l2loopback exclusive_caps=1 $ ffmpeg -i http://192.168.1.xxx:8080/video -vf format=yuv420p -f v4l2 /dev/video0

Note: exclusive_caps=1 helps solve the issue of the video input not usable on some Chrome/WebRTC applications [1].

Troubleshooting

V4L1 support

Version 2.6.27 of the Linux kernel dropped support for the legacy Video4Linux (1) API. Pixel format decoding has been pushed to user space, since Video4Linux version 2 does not support kernel space decoding. The libv4l library provides userland applications with pixel decoding services and will be used by most programs. Other compatibility layers are also available.

If your device is created but your image looks strange (e.g. nearly completely green), you probably need this.

If the application has V4L2 support but no pixelformat support then use the following command:

LD_PRELOAD=/usr/lib/libv4l/v4l2convert.so application

If the application only supports the older version of V4L, use this command:

LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so application

Tip: You also might want to put a line like the following into /etc/profile or xprofile so you do not have to type that long command all the time: export LD_PRELOAD=/usr/lib/libv4l/v4l2convert.so or export LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so

Читайте также:  Кали линукс для хакеров

For 32-bit multilib applications, install the lib32-v4l-utils package and replace /usr/lib/libv4l/ by /usr/lib32/libv4l/ in the above commands.

xawtv with nvidia card

If you are using an nvidia graphic card, and get an error like

X Error of failed request: XF86DGANoDirectVideoMode Major opcode of failed request: 139 (XFree86-DGA) Minor opcode of failed request: 1 (XF86DGAGetVideoLL) Serial number of failed request: 69 Current serial number in output stream: 69

you should instead run it as $ xawtv -nodga

Microsoft Lifecam Studio/Cinema

Under certain configurations, the Microsoft lifecam studio/cinema may request too much usb bandwidth and fail see Uvcvideo FAQ. In this case, change the buffering by loading the uvcvideo driver with quirks=0x80 . Add it to /etc/modprobe.d/uvcvideo.conf :

## fix bandwidth issue for lifecam studio/cinema options uvcvideo quirks=0x80

Note: If delays are visible in the logs, or the camera works periodically, this workaround should apply generally. Bigger values such as quirks=0x100 are possible.

Skype

When testing the webcam, note the following:

  • The echobot does not support videochat. Do not use it for testing your webcam.
  • Skype might recognize different video/camera devices (/dev/video*). These will be listed as something like «integrated camera. » in a dropdown menu in the camera settings. Try each camera and wait a few seconds, because it takes time to switch to a different camera.

Check bandwidth used by USB webcams

When running multiple webcams on a single USB bus, they may saturate the bandwidth of the USB bus and not work properly. You can diagnose this with the usbtop tool from the usbtop AUR package.

Invert the video stream

If your video stream is inverted, you can make a new virtual video camera which inverts the inverted video. You need to install v4l-utils and also v4l2loopback-dkms . Create the virtual video camera:

Check the name of the newly created camera:

$ v4l2-ctl --list-devices Dummy video device (0x0000) (platform:v4l2loopback-000): /dev/video1

Then you can run ffmpeg to read from your actual webcam (here /dev/video0 ) and invert it and feed it to the virtual camera:

$ ffmpeg -f v4l2 -i /dev/video0 -vf "vflip" -f v4l2 /dev/video1

Here vflip inverts the video stream vertically. Use hflip to invert it horizontally.

Note that the format argument yuv420p might be needed to avoid an error, otherwise there might not be any video stream and a black screen will be shown [2]. In other words:

$ ffmpeg -f v4l2 -i /dev/video0 -vf "hflip,format=yuv420p" -f v4l2 /dev/video1

You can then use the «Dummy» camera in your applications instead of the «Integrated» camera.

Bad image quality

If you experience images being too bright, too dark, too exposed or any other, you can install v4l2ucp AUR to tweak your image output.

Logitech Quickcam Pro 9000

Install libwebcam-git AUR to enable autofocus control. After the installation, disconnect and reconnect your camera to trigger the newly added udev rules.

Источник

Оцените статью
Adblock
detector