Bug 176868 - Algorithm to find video devices is not udev friendly and lead to not find webcams
Summary: Algorithm to find video devices is not udev friendly and lead to not find we...
Status: RESOLVED FIXED
Alias: None
Product: kopete
Classification: Applications
Component: Audio/Video Plugin (show other bugs)
Version: unspecified
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: Kopete Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-12-04 10:43 UTC by Olivier Perron
Modified: 2011-01-03 21:40 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Olivier Perron 2008-12-04 10:43:30 UTC
Version:            (using KDE 3.5.10)
OS:                Linux
Installed from:    Debian testing/unstable Packages

kopete first looks at /dev/v4l for something like video*. If it finds /dev/v4l but no video* inside it, then it simply stop to search for any further device and claims there are no video devices on the system.

The issue is that nowadays there are specific rules for udev that tell udev to create "by-path" symlinks to make sure one can access any specific device independently in which order it was connected to the system.

For v4l devices, the "by-path" link is as follows:
/dev/v4l/by-path/pci-0000:00:1d.2-usb-0:2:1.0
with pci-0000:00:1d.2-usb-0:2:1.0 being a unique identifier that always identify the same device.
That "by-path" link actually points to the real device /dev/video0 (or video1, or ...).

Because of this and the way kopete search for video devices, if udev sets a "by-path" link, then kopete does not find any webcam on the system.

The device scaning code should be updated so that the search order is:
1) search for /dev/v4l/by-path/<something>
2) search for /dev/v4l/video*
3/ search for /dev/video*
Comment 1 peter 2009-01-19 23:22:36 UTC
This is a known problem and the ugly hack suggested [1] is "rm -rf /dev/v4l" before using your webcam.


[1] http://wiki.kde.org/tiki-index.php?page=kopete%20webcam%20support
Comment 2 Olivier Perron 2009-01-19 23:30:25 UTC
Peter,
it is a known problem *now* because I've added this entry myself into kde wiki just before filing the bug here. Until that time I (google) could only find references to people facing a at least similar issue if not the same. But no references at all to any workaround or solution.
I had to use gdb on kopete to find what was happening and come up with
a) a workaroud
b) this bug report

Regards
Comment 3 Jo Øiongen 2009-01-20 22:08:11 UTC
This is still an issue for me. Running Kopete 0.60.82 on KDE4.1.96, Kubuntu8.10. Also the same on my OpenSUSE11 install. (But there I do not have the exact versions in front of me;) )

my lsusb gives:

Bus 004 Device 076: ID 046d:0870 Logitech, Inc. QuickCam Express

my ls -l /dev/vi* gives:

crw-rw---- 1 root video 81, 0 2009-01-20 17:26 /dev/video0


and in Kopete I cannot select any device. 
Comment 4 Jo Øiongen 2009-01-20 22:20:04 UTC
Is this bug https://bugs.kde.org/show_bug.cgi?id=181176 caused by what is written above?
Comment 5 Jo Øiongen 2009-01-20 22:24:59 UTC
same with this one https://bugs.kde.org/show_bug.cgi?id=181176
Comment 6 Jo Øiongen 2009-01-20 22:26:53 UTC
Ignore the post above... Sorry!  I meant this one https://bugs.kde.org/show_bug.cgi?id=167332
Comment 7 Lamarque V. Souza 2009-03-21 22:28:19 UTC
Hi, this really seems a duplicate of https://bugs.kde.org/show_bug.cgi?id=167332 I have dropped a comment in there that may help.
Comment 8 Marcelo Vivan Borro 2009-03-23 22:25:38 UTC
@ Lamarque
This happens both in KDE3.5 and 4.2.  It seems to happen in all distros with kernel newer than 2.6.27, since gspca driver was included in kernel.  I'm running opensuse 11.1 here.
Comment 9 Frank Schaefer 2011-01-03 21:40:15 UTC
(In reply to comment #0)
> kopete first looks at /dev/v4l for something like video*. If it finds /dev/v4l
> but no video* inside it, then it simply stop to search for any further device
> and claims there are no video devices on the system.
> ...
> The device scaning code should be updated so that the search order is:
> 1) search for /dev/v4l/by-path/<something>
> 2) search for /dev/v4l/video*
> 3/ search for /dev/video*

KDE 3 is no longer maintained and KDE4 uses Solid to detect available video devices.