Bug 478545

Summary: Pulling uvcvideo device while open confuses HAL, causes permission problems
Product: [Fedora] Fedora Reporter: James <james>
Component: halAssignee: Richard Hughes <richard>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 10CC: richard, sonarguy
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
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 09:06:05 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description James 2008-12-31 18:57:47 UTC
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 2009-04-11 10:58:00 UTC
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 2009-06-16 13:25:59 UTC
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 12:32:41 UTC
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 2009-09-10 09:06:05 UTC
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.