Bug 43291 - pwc: /dev/video0 device confusion
Summary: pwc: /dev/video0 device confusion
Status: RESOLVED OBSOLETE
Alias: None
Product: Other
Classification: Unclassified
Component: Other (show other bugs)
Hardware: All Linux
: P1 high
Assignee: other_other
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-24 15:00 UTC by udo
Modified: 2015-02-20 15:43 UTC (History)
3 users (show)

See Also:
Kernel Version: 3.3.x and before
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description udo 2012-05-24 15:00:00 UTC
Have a Linux system with:

Bus 006 Device 002: ID 0471:0311 Philips (or NXP) PCVC740K ToUcam Pro [pwc]
Bus 006 Device 003: ID 0471:0311 Philips (or NXP) PCVC740K ToUcam Pro [pwc]

(two identical pwc driver cams)

Have e.g. vlc operate on /dev/video1
Then try to start another vlc on on /dev/video0.

Notice the error:

Your input can't be opened:
VLC is unable to open the MRL 'v4l2:///dev/video0'. Check the log for details.


$ fuser -v /dev/video0
$ fuser -v /dev/video1
                     USER        PID ACCESS COMMAND
/dev/video1:         udo        6215 F...m vlc
$
Comment 1 udo 2012-05-24 18:37:52 UTC
I tried media_build from http://git.linuxtv.org/media_build.git without change in the behaviour described above.

Linux video capture interface: v2.00
WARNING: You are using an experimental version of the media stack.
	As the driver is backported to an older kernel, it doesn't offer
	enough quality for its usage in production.
	Use it with care.
Latest git patches (needed if you report a bug to linux-media@vger.kernel.org):
	abed623ca59a7d1abed6c4e7459be03e25a90a1e [media] radio-sf16fmi: add support for SF16-FMD
	e243c3c4f7305310a283cd2f762f889a48dad90a [media] rc-loopback: remove duplicate line
	75c7dbcab43865ea247747ffbf5ab48da75ba5ce [media] patch for Asus My Cinema PS3-100 (1043:48cd)
pwc: Philips PCVC740K (ToUCam Pro)/PCVC840 (ToUCam II) USB webcam detected.
pwc: Registered as video0.
input: PWC snapshot button as /devices/pci0000:00/0000:00:13.1/usb6/6-1/input/input8
pwc: Philips PCVC740K (ToUCam Pro)/PCVC840 (ToUCam II) USB webcam detected.
pwc: Registered as video1.
input: PWC snapshot button as /devices/pci0000:00/0000:00:13.1/usb6/6-3/input/input9
usbcore: registered new interface driver Philips webcam
Comment 2 udo 2012-05-24 18:49:39 UTC
Also, with media_build pwc:

usbcore: registered new interface driver Philips webcam
ohci_hcd 0000:00:13.1: leak ed ffff8800cf8082d0 (#85) state 2
ohci_hcd 0000:00:13.1: leak ed ffff8800cf808320 (#85) state 2
pwc: isoc_init() submit_urb 0 failed with error -28
ohci_hcd 0000:00:13.1: leak ed ffff8800cf808370 (#85) state 2
ohci_hcd 0000:00:13.1: leak ed ffff8800cf8083c0 (#85) state 2
ohci_hcd 0000:00:13.1: leak ed ffff8800cf808410 (#85) state 2
pwc: isoc_init() submit_urb 0 failed with error -28
ohci_hcd 0000:00:13.1: leak ed ffff8800cf808460 (#85) state 2
Comment 3 Hans de Goede 2012-05-24 18:54:22 UTC
VLC points out that you should be checking its log file for errors, did you?

My first hunch would be, and the comment you just added with the -28 errors confirms this,  that since you're running 2 cams you're running out of USB 1 bandwidth. Please do an lsusb and if both cams are on the same bus, try moving them around until they are each on a separate bus.
Comment 4 udo 2012-05-24 18:59:59 UTC
I will try moving them around but I do suspect that although the separate bus might help, it is not the root cause for not being able to open /dev/video0 while /dev/video1 is in use.
I will keep you updated!
Comment 5 udo 2012-05-24 19:02:28 UTC
I changed cams around to: 
Bus 005 Device 003: ID 0471:0311 Philips (or NXP) PCVC740K ToUcam Pro [pwc]
Bus 006 Device 003: ID 0471:0311 Philips (or NXP) PCVC740K ToUcam Pro [pwc]

And now I can run two vlc instances with the two cams.
Comment 6 Alan 2015-02-19 17:23:20 UTC
This bug relates to a very old kernel. Closing as obsolete.
Comment 7 udo 2015-02-20 03:27:57 UTC
Was the PWC driver even maintained since then?
Where could I check?
Comment 8 Alan 2015-02-20 15:43:28 UTC
git log will tell you if you have the tree checked out.  According to the logs Hans Verkuil has bee doing some work on it.

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