UbuntuThis forum is for the discussion of Ubuntu Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm running Ubuntu Lynx on an AMD dual-core machine that has a Hauppauge PVR-150 card and a Logitech webcam (recently installed).
The webcam seemed to preempt the /dev/video0 identity but ran fine under Cheese for about 2 weeks. Suddenly, yesterday neither the webcam nor the PVR will run. I removed Cheese and the webcam but still no success.
When I run ivtv-tune c-3 to check video0 I get:
Failed to open /dev/video0
I checked and there is a /dev/video0 file.
I tried creating a udev rule and making the webcam video5 but that didn't help.
I still get the video0 failure message even after doing a complete removal of Cheese and the webcam so that takes care of any conflict.
I have no idea what is wrong or how to fix it. Does anyone have any suggestions?
dmesg shows entries indicating that it sees both the Haupaugge card and the webcam so I seem to have a problem with /dev/video0 rather than a HW problem.
I'm not sure it will accomplish anything, but I might try removing the webcam, booting and fetching the contents of dmesg. Then I'd attach the cam and do a new reading of dmesg to see if any difference between the two shed any light on what seems to look like an assignment conflict.
I'm afraid I'm kind of shooting in the dark here, as I don't have a webcam. I do have a system with Lucid that has a Hauppauge card, (I'm not sure which model, offhand), and it shows /dev/video0, as well as video24 and 32.
Last edited by Rambo_Tribble; 09-14-2010 at 04:50 PM.
Thanks for the suggestions. That's what I ended up trying and I have the webcam back.
I think the original problem may have been caused by trying to hook up two of the same kind of webcams (same Logitech models). The OS couldn't tell them apart even when I assigned them each a different video number in a udev rule. The manufacturer and model id is the same. Maybe the problem would have gone away in the udev rule if they were different models or manufacturers.
Anyway, just one webcam and things are working again.
By any chance, do you know if there's a way of solving this problem of multiple copies of the same model HW with a udev rule?
I'm glad to hear you have made some progress. Unfortunately, my knowledge of udev isn't sufficient to answer your question. My only thought is, that if the cameras have different MAC addresses, that might make it possible to get udev to differentiate between them.
"Identical" devices can still be differentiated with udev rules by matching on the physical USB socket they are plugged into. You'll have to make a note to yourself so you remember which socket to plug which device into.
It's a while since I played with this but try looking at your cameras like this (I have a single USB cam (= 2 "virtual" identical devices, as long as I only use one at a time ), that is registered as /dev/video1 when I plug it in):
Plug it into "front USB socket" then
Code:
tred@laptop:~$ udevadm info -ap $(udevadm info -q path -n /dev/video1) > frontvid
Unplug it, wait a moment, plug it into "rear USB socket" then
The interesting bits are coloured,
Once you have established what the positional information you need to differentiate between the cameras is, you'll need a udev rule something like this:
Hello, I'm raising an old thread here because it seems to be the most relevant my search has turned up...
I'm having a similar problem on a laptop, but I don't have the option of 'disconnecting' the camera to reset it. I was using it with Cheese, just fine, but for some reason it has recently stopped functioning.
Looking at dmesg, udevadm, etc. doesn't seem to reveal anything obvious. So I'm at a loss... also, note that if I do plug in another USB camera, it mounts at /dev/video1 and functions as expected.
Is there a way to 'simulate' an internal camera being disconnected? Or something else I can try?
Your laptop camera is probably seen as a USB device. lsusb should list it, along with vendor : product ID codes. If it is listed,
please tell us what it says.
It is surprising that a second USB camera appears at /dev/video1 as
this suggests the built-in one was detected (presumably as /dev/video0).
It is unusual for cameras to stop working suddenly.
What distro of linux are you using, have you changed anything since the
camera was last working?
Is there anything in the BIOS to enable it? Or a function-key combination?
You could try booting a live distro from CD, and see if that can use your
built-in camera.
Quote:
Is there a way to 'simulate' an internal camera being disconnected?
Hello, the attached file is output from udevadm with lsusb appended below.
I'm writing from a usb distro now, and there's no difference.
ubuntu@ubuntu:~$ lsusb
Bus 002 Device 003: ID 1005:b113 Apacer Technology, Inc. Handy Steno 2.0/HT203
Bus 002 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 005: ID 04f2:b183 Chicony Electronics Co., Ltd
Bus 001 Device 004: ID 138a:0007 DigitalPersona, Inc
Bus 001 Device 003: ID 03f0:231d Hewlett-Packard
Bus 001 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
and udevadm seems to provide similar values as well...
Cheese also has the same response, no Error messages, it opens fine, but then just shows a blank empty screen... if I didn't know better, I'd think I left the lens cap on!!
Sorry, also should mention I'm running 11.04 ubuntu
Last edited by washakie; 08-29-2011 at 12:53 PM.
Reason: release info
Your camera seems to be 04F2:B183 = "HP Webcam [2 MP Macro]" (took me a while to search on this, can you confirm it?)
Searching google returns precious little for this device, which might mean that it works perfectly with linux (as most HP stuff does), or that yours is just broken.
I've googled around to see other ways to test. The only I've come across that is helpful so far is VLC. Trying to open /dev/video0 I get the following output on the command line:
[0x17693c0] v4l2 demux error: cannot set input (Device or resource busy)
[0x17693c0] v4l2 demux error: cannot set input (Device or resource busy)
[0x1589b20] v4l2 access error: cannot set input (Device or resource busy)
libv4l2: error attempting to open more then 16 video devices
[0x1589b20] v4l2 access error: cannot set input (Device or resource busy)
[0x174f830] main input error: open of `v4l2:///dev/video0' failed: (null)
Then I thought to go back to cheese and run it from the command line to capture some output. I get this:
ubuntu@ubuntu:~$ cheese
libv4l2: error setting pixformat: Device or resource busy
So it seems somehow that /dev/video0 is getting 'grabbed' up by something else, but I don't know what?! It's as if the fix could be what the OP did, just unplug it and replug it, but I can't do that in this case... any further suggestions?
So it seems somehow that /dev/video0 is getting 'grabbed' up by something else, but I don't know what?
What other stuff have you recently installed? (motion maybe,) before your camera broke?
lsof /dev/video0 may give you some idea as to what might be grabbing the device.
If this does not help you, please start a new thread, with a suitable title, the body containing good information: your distro, camera details (please confirm these, as above) from lsusb
If you do this (and I think you should) I'd appreciate it if you posted a link to your new thread here, so I can be informed, and then follow it up.
I suspect the OP's to this original post have solved it, are long gone, or have lost interest.
Unfortunately, I'm quite sure it is a hardware problem. My last post was in error (too many terminals open). On one terminal as a regular user I was trying to use streamer to take a picture with the web cam. In another terminal (tab) as root, I was doing the tests that produced the results I posted... thus, it was 'streamer' that was grabbing the device. Once I CTRL-C'd streamer (which was 'waiting for output', but otherwise showed no errors associated with /dev/video0), the other tests ran, but also only provided a black screen.
The last clue, is that the little blue LED light doesn't come on either. So I'm just not sure what is happening, but suspect it must be a connection that has gone bad. I plugged in two other webcams (one embedded in my second monitor and another external) and everything worked fine!
Thanks for your feedback. I learned about udevadm and now lsof
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.