Bug 478545 - Pulling uvcvideo device while open confuses HAL, causes permission problems
Pulling uvcvideo device while open confuses HAL, causes permission problems
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: hal (Show other bugs)
10
All Linux
low Severity medium
: ---
: ---
Assigned To: Richard Hughes
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-12-31 13:57 EST by James Ettle
Modified: 2009-09-10 05:06 EDT (History)
2 users (show)

See Also:
Fixed In Version: hal-0.5.12-29.20090226git.fc11.x86_64
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-09-10 05:06:05 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description James Ettle 2008-12-31 13:57:47 EST
Description of problem:
Pulling the plug on a uvcvideo device while the device is open confuses HAL, and results in permissions being denied to it when it's re-attached.

Version-Release number of selected component (if applicable):
kernel-2.6.27.10-167.fc10.x86_64
hal-0.5.12-12.20081027git.fc10.x86_64
udev-127-3.fc10.x86_64
libv4l-0.5.7-1.fc10.x86_64

How reproducible:
Always.

Steps to Reproduce:
1. Start Cheese, wait for preview to show.
2. Disconnect or use hotkey to disable camera. 
3. Close Cheese.
4. Reconnect camera.
5. Attempt to start Cheese --- not permission denied on /dev/video0.
6. Check what HAL thinks, note extra camera device that wasn't there before.
7. Disconnect camera.
8. Reconnect, wait some. If it doesn't work now, goto 7.
  
Actual results:
HAL confusion, permissions denied.

Expected results:
No confusion.

Additional info:
The sequence Close Cheese -> Detach -> Attach -> Start Cheese works OK with no confusion or permission problems.

Only one such device shows up in sysfs, although a number may be present in HAL.

When it's working,
[james@rhapsody ~]$ ls -Z /dev/video0
crw-rw----  root root system_u:object_r:v4l_device_t:s0 /dev/video0
[james@rhapsody ~]$ chacl -l /dev/video0
/dev/video0 [u::rw-,u:james:rw-,g::rw-,m::rw-,o::---]

Following a live-yank and reconnect,
[james@rhapsody ~]$ ls -Z /dev/video0
crw-rw----  root root system_u:object_r:v4l_device_t:s0 /dev/video0
[james@rhapsody ~]$ chacl -l /dev/video0
/dev/video0 [u::rw-,g::rw-,o::---]

After a number of live-yank cycles,
[james@rhapsody ~]$ hal-find-by-capability --capability video4linux
/org/freedesktop/Hal/devices/usb_device_402_5606_noserial_if0_video4linux_2
/org/freedesktop/Hal/devices/usb_device_402_5606_noserial_if0_video4linux_1
/org/freedesktop/Hal/devices/usb_device_402_5606_noserial_if0_video4linux_0
/org/freedesktop/Hal/devices/usb_device_402_5606_noserial_if0_video4linux

dmesg info on the camera:
uvcvideo: Found UVC 1.00 device USB2.0 Camera (0402:5606)
uvcvideo: UVC non compliance - GET_DEF(PROBE) not supported. Enabling workaround.
input: USB2.0 Camera as /devices/pci0000:00/0000:00:1a.7/usb1/1-2/1-2:1.0/input/input27
usb 1-2: New USB device found, idVendor=0402, idProduct=5606
usb 1-2: New USB device strings: Mfr=0, Product=1, SerialNumber=0
usb 1-2: Product: USB2.0 Camera
Comment 1 James Ettle 2009-04-11 06:58:00 EDT
Still present with:

kernel-2.6.29.1-68.fc11.x86_64
hal-0.5.12-26.20090226git.fc11.x86_64
DeviceKit-003-1.x86_64
udev-139-4.fc11.x86_64
libv4l-0.5.9-1.fc11.x86_64
Comment 2 James Ettle 2009-06-16 09:25:59 EDT
Still shows up with

kernel-2.6.29.5-186.fc11.x86_64
hal-0.5.12-26.20090226git.fc11.x86_64
DeviceKit-003-1.x86_64
udev-141-3.fc11.x86_64
Comment 3 Scott Glaser 2009-09-09 08:32:41 EDT
Have you tried with the latest hal package in Fedora 11 or tried Rawhide? In
either case, can you let us know whether the issue is still happening, and give
the current version of the HAL packages you're using?

-- 
Fedora Bugzappers volunteer triage team
https://fedoraproject.org/wiki/BugZappers
Comment 4 James Ettle 2009-09-10 05:06:05 EDT
Seems to be behaving itself now with:

hal-0.5.12-29.20090226git.fc11.x86_64
DeviceKit-003-1.x86_64
udev-141-6.fc11.x86_64

and a 2.6.31-rc9 kernel.

Note You need to log in before you can comment on or make changes to this bug.