nuclearsandwich / surface3-archlinux

Archlinux on the Microsoft Surface Pro 3
69 stars 4 forks source link

Cameras #12

Open Vistaus opened 10 years ago

Vistaus commented 10 years ago

I really have no clue how to get the cameras working. There doesn't seem to be any driver floating around the net either. But at least we know that Arch recognizes them as being Microsoft Lifecams (actually, lshw tells us that):

-usb:2 UNCLAIMED description: Video product: Microsoft LifeCam Front vendor: QCM physical id: 7 bus info: usb@1:7 version: 21.52 capabilities: usb-2.00 configuration: maxpower=250mA speed=480Mbit/s -usb:3 UNCLAIMED description: Video product: Microsoft LifeCam Rear vendor: QCM physical id: 8 bus info: usb@1:8 version: 21.52 capabilities: usb-2.00 configuration: maxpower=250mA speed=480Mbit/s

Vistaus commented 10 years ago

Actually, I just found the driver. It's in the Surface Pro 3 Driver Pack from the Microsoft website. It's in the folder ~/Surface Pro 3 - October 2014/Microsoft/TrueColor/ (for some reason, they've named the folder and driver files "TrueColor" but the install Inf clearly shows it's the driver for the LifeCam cameras)

Now we only need to find a way to get that driver working on Linux somehow...

benasse commented 10 years ago

The 2 cameras are working if you add the following lines in "linux-3.17/drivers/media/usb/uvc/uvc_driver.c"

     /* Microsoft Surface Pro 3 Front */
     { .match_flags          = USB_DEVICE_ID_MATCH_DEVICE
                             | USB_DEVICE_ID_MATCH_INT_INFO,
       .idVendor             = 0x045e,
       .idProduct            = 0x07be,
       .bInterfaceClass      = USB_CLASS_VIDEO,
       .bInterfaceSubClass   = 1,
       .bInterfaceProtocol   = 1 },
     /* Microsoft Surface Pro 3 Rear */
     { .match_flags          = USB_DEVICE_ID_MATCH_DEVICE
                             | USB_DEVICE_ID_MATCH_INT_INFO,
       .idVendor             = 0x045e,
       .idProduct            = 0x07bf,
       .bInterfaceClass      = USB_CLASS_VIDEO,
       .bInterfaceSubClass   = 1,
       .bInterfaceProtocol   = 1 },
altercation commented 10 years ago

Have you submitted this to the uvc mailing list? They seem very open to adding in support for new devices. http://www.ideasonboard.org/uvc/

Vistaus commented 9 years ago

That is very cool, benasse! :) I'll try it out ASAP when I'm compile the 3.18 rcX kernel (3.17 patched is too unstable for me compared to 3.16 patched, so hopefully 3.18 will be better).

Vistaus commented 9 years ago

I can confirm that adding those lines works great for 3.18 rc5 :) I'm not taking much photos with the rear camera, but it would be handy if GNOME devs added a switch button in the main layout as switching via Preferences is a bit cumbersome :P But it seems to work great though :)

benasse commented 9 years ago

@altercation : yes, i just did

paulhandy commented 9 years ago

has this patch been upstreamed yet?

altercation commented 9 years ago

Paul, I believe benasse has pinged uvc mailing list a couple times but I haven't seen anyone reply. I don't know if it would help to check in on the issue on the list as well, but it might. http://sourceforge.net/p/linux-uvc/mailman/message/33135203/

colorprint commented 9 years ago

cam patch file: https://dl.dropboxusercontent.com/u/4080500/patch/cam.patch

benasse commented 9 years ago

I am new in the world of linux kernel and apply patch. Will the patch applied upstream by the redhat team, by this ticket : https://bugzilla.redhat.com/show_bug.cgi?id=1192065 , or should i re-pinged uvc mailing list ?

labbott commented 9 years ago

If someone is able to add a Signed-off-by (https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/SubmittingPatches#n407) you will probably be able to find someone to help get the patch in. Please review the requirements for adding a Signed-off-by. It isn't super hard, http://developercertificate.org/.

CtrlZvi commented 9 years ago

I reimplemented this patch without using the one listed here as a reference. That way I could add the Signed-off-by line. I'm about to submit the patch to the appropriate mailing list, but I'd like to list @Vistaus as the Reporter. Is that okay with you, @Vistaus ?

txomon commented 9 years ago

@CtrlZvi have you been able to submit it upstream? What is the state of the patch? I don't mind testing it

CtrlZvi commented 9 years ago

@txomon I have submitted it upstream, but it looks like nothing has come of it yet. You can follow the thread at http://article.gmane.org/gmane.linux.drivers.video-input-infrastructure/94430/match=zvi and the patch status at https://patchwork.linuxtv.org/patch/31087/. I'd be very appreciative if you'd test it.

txomon commented 9 years ago

@CtrlZvi It is working correctly, both cameras. It is at the end the same patch as the one posted here.

benkevan commented 9 years ago

The correct fix isn't to explicitly add the devices but enable UVC to detect 1.5 devices:

https://patchwork.linuxtv.org/patch/31818/

I've confirmed the above linked patch on Surface Pro 3 running openSUSE Tumbleweed with patched 4.3.0 kernel.