Sabrelight (BD-SL-i.MX6) Compiling GSPCA ZC3XX Kernel module

cancel
Showing results for 
Search instead for 
Did you mean: 

Sabrelight (BD-SL-i.MX6) Compiling GSPCA ZC3XX Kernel module

Jump to solution
529 Views
amerello
Contributor I

Hi,

I have a Sabrelight BD-SL-i.MX6 running Debian 7 (3.0.35) and am trying to install a USB Web Cam (Creative Live Camera 041e:4036) which should be compatible with the GSPCA ZC3XX module (mjmwired.net). I understand that the module is not installed on the kernel and this is why i can't use the camera. I would like to compile this kernel module (gspca_zc3xx) but I don't know how to go about this. Any hint is appreciated.

$ lsmod

Module                  Size  Used by

ov5640_camera          17001  0

8192cu                591746  0

ov5642_camera         120170  0

camera_sensor_clock      717  2 ov5642_camera,ov5640_camera

$ lsusb

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Bus 002 Device 002: ID 0424:2513 Standard Microsystems Corp.

Bus 002 Device 003: ID 0b05:17ab ASUSTek Computer, Inc. USB-N13 802.11n Network Adapter (rev. B1) [Realtek RTL8192CU]

Bus 002 Device 004: ID 041e:4036 Creative Technology, Ltd Webcam Live!/Live! Pro

I can see that there is no module loaded:

$ hwinfo --usb

08: USB 00.0: 0000 Unclassified device

  [Created at usb.122]

  Unique ID: R8DB._TDotf3_iAA

  Parent ID: FKGF.1oZjkLRcRcB

  SysFS ID: /devices/platform/fsl-ehci.1/usb2/2-1/2-1.1/2-1.1:1.0

  SysFS BusID: 2-1.1:1.0

  Hardware Class: unknown

  Model: "Creative Webcam Live!/Live! Pro"

  Hotplug: USB

  Vendor: usb 0x041e "Creative Technology, Ltd"

  Device: usb 0x4036 "Webcam Live!/Live! Pro"

  Revision: "1.00"

  Speed: 12 Mbps

  Module Alias: "usb:v041Ep4036d0100dcFFdsc00dp00icFFiscFFipFF"

  Config Status: cfg=new, avail=yes, need=no, active=unknown

  Attached to: #7 (Hub)

$ ls /lib/modules/3.0.35/kernel/drivers/media/video/gspca

gspca_main.ko

Labels (3)
0 Kudos
1 Solution
58 Views
EricNelson
Senior Contributor II

Hi Alejandro,

While it's likely that you can simply copy the one .ko file, you should probably copy the entire tmp/lib/modules/* tree to /lib/modules/ on your rootfs and also copy arch/arm/boot/uImage to your boot partition.

There are times when the use of 'menuconfig' changes the interfaces between the kernel and modules and you need to keep them together.

Most of the time, an issue of this sort will be caught by the kernel and produce a failure during 'modprobe' (module loading), but it's usually not worth the effort to figure out why.

IOW, when in doubt, copy everything (kernel + modules).    

View solution in original post

0 Kudos
4 Replies
58 Views
EricNelson
Senior Contributor II

Hi Alejandro,

You're on the right track here... You'll need to re-compile the kernel after using 'menuconfig' to select the GSPCA camera drivers.

Unless you're running off of a SATA drive, I'd recommend using a cross-compiler to do this, since compilation is painfully slow on SD card.

There are some notes in this post about how to cross-compile the kernel:

     http://boundarydevices.com/cross-compile-i-mx6-kernel-using-ltib-toolchain/

That post is a bit dated though, and you'll want to use branch 'boundary-imx_3.0.35_4.1.0' instead of 1.1.0.

We also recommend the use of the "arm-linux-gnueabihf-" cross-compile from package "gcc-arm-linux-gnueabihf" instead of the LTIB compiler (unless you already have the LTIB-provided compiler installed).

i.e.:

     ~/$ sudo apt-get install gcc-arm-linux-gnueabihf

58 Views
amerello
Contributor I

Thanks a lot Eric!

  I have followed your advice and performed the following steps that allowed me to generate the module gspca_zc3xx.ko

$ git clone git://github.com/boundarydevices/linux-imx6.git

$ git checkout remotes/origin/boundary-imx_3.0.35_4.1.0

$ sudo apt-get install gcc-arm-linux-gnueabihf

$ export ARCH=arm

$ export CROSS_COMPILE=arm-linux-gnueabihf-

$ make nitrogen6x_defconfig

$ make menuconfig

Select:

Device Drivers  --->

    Multimedia support  --->

        [*] Video capture adapters  --->

            [*] V4L USB devices  --->

                <M> GSPCA based webcams  --->

                    <M> SC3XX USB Camera Drivers

Save & Exit

$ make uImage modules

$ mkdir ~/tmp

$ make INSTALL_MOD_PATH=~/tmp modules_install

Now I have the module file ~/tmp/lib/modules/3.0.35-g81fa003/build/drivers/media/video/gspca/gspca_zc3xx.ko. The board has the same kernel version. Would it be sufficient now to just copy this module to /lib/modules/3.0.35/kernel/drivers/media/video/gspca and load it?

Thanks again!

0 Kudos
59 Views
EricNelson
Senior Contributor II

Hi Alejandro,

While it's likely that you can simply copy the one .ko file, you should probably copy the entire tmp/lib/modules/* tree to /lib/modules/ on your rootfs and also copy arch/arm/boot/uImage to your boot partition.

There are times when the use of 'menuconfig' changes the interfaces between the kernel and modules and you need to keep them together.

Most of the time, an issue of this sort will be caught by the kernel and produce a failure during 'modprobe' (module loading), but it's usually not worth the effort to figure out why.

IOW, when in doubt, copy everything (kernel + modules).    

View solution in original post

0 Kudos
58 Views
amerello
Contributor I

Hi Eric,

thanks again! With your advice succeeded in changing the recompiled kernel by copying uImage and the module folder to /lib/modules/3.0.35-g81fa003

Now the drivers are loaded and the camera is working:

$ lsmod

Module                  Size  Used by

ov5642_camera        120777  0

ov5640_camera          17621  0

camera_sensor_clock      721  1 ov5642_camera

gspca_zc3xx            33147  0

gspca_main            17256  1 gspca_zc3xx

0 Kudos