Can't build qc-usb kernel modules with module-assistant

Bug #213114 reported by Ayani
42
This bug affects 1 person
Affects Status Importance Assigned to Milestone
qc-usb (Debian)
Fix Released
Unknown
qc-usb (Ubuntu)
Fix Released
Medium
Unassigned
Nominated for Intrepid by Andres Mujica
Nominated for Jaunty by Andres Mujica

Bug Description

Hello,

When I try to compile qc-usb-source with module-assistant, it doesn't work at all. Please find attached the error log. I am under Hardy Heron version of Ubuntu.

Thank you
--
Ayani

Related branches

Revision history for this message
Ayani (bpoupart) wrote :
Revision history for this message
Jérémie Corbier (jcorbier) wrote :

There is a patch in Debian qc-usb 0.6.6-4 fixing compilation errors against 2.6.24 kernels. Since Hardy is about to be released, this patch won't make it into the archive as soon as I would like it to but it will hopefully be a valid candidate for inclusion later on. Thank you a lot for your bug report. If you find any more issues, please report them the same way.

Changed in qc-usb:
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Alfredo Pironti (alfredo.pironti) wrote :

I can confirm this bug.
Unfortunately, the updated package is not yet in Ubuntu. I would ask once more for it to be included,
because the current one is totally unusable.

As a workaround, you can download the updated debian package, and manually install it. It worked for me.

Regards,
Alfredo

Revision history for this message
peterw (peterw-suprafax) wrote :

What package exactly is the update debian one? Do you know if the package in the ubuntu repos has been fixed?

Revision history for this message
Jérémie Corbier (jcorbier) wrote :

As I said in my previous comment qc-usb 0.6.6-4 fixes this bug. Intrepid currently ships qc-usb 0.6.6-5. It would be a good idea to backport the patch provided by 0.6.6-4 to Hardy since this package is heavily broken in Hardy.

Cheers,

Revision history for this message
Joachim R. (jro) wrote :

Same problem on Intrepid with qc-usb 0.6.6-5.
the first error shows a missing linux/quickcam.h. Does the package qc-usb-qource 0.6.6-5 should have installed a quickcam.h in/usr/include/linux/ ? Or is it possible to force all sources to include quickcam.h in the qc-usb dir of the source tarball ?

Revision history for this message
Fabián Rodríguez (magicfab) wrote :

This also fails to build in Jaunty (alpha 3, updated as of Feb 8 2009), which has qc-usb-source 0.6.6-6.

See the attached log (obtained by using the -t parameter).

Revision history for this message
Jason (siegeljb) wrote :
Download full text (4.5 KiB)

this post was helpful

http://<email address hidden>/msg598000.html

don't forget to add this patch also.

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=502805

I was able to patch the qc-driver.c, but I had to replace the qc-usb.tar.bz2 file in the /usr/src directory because module-assistant kept wiping out the patched file.

the Line numbers weren't quite right. but the general idea atleast let me compile.

---
--- a/qc-driver.c
+++ b/qc-driver.c
@@ -2528,7 +2528,11 @@
    if (qcdebug&QC_DEBUGUSER) PDEBUG("VIDIOCGCAP");
    memset(&b, 0, sizeof(b));
    strcpy(b.name, "Logitech QuickCam USB"); /* Max 31 characters */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
+ b.type = VID_TYPE_CAPTURE | VID_TYPE_SUBCAPTURE;
+#else
    b.type = qc->vdev.type;
+#endif
    b.channels = 1;
    b.audios = 0;
    b.maxwidth = qc->sensor_data.maxwidth;
@@ -3007,7 +3011,9 @@

 static struct video_device qc_v4l_template = {
  name: "QuickCam USB",
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
  type: VID_TYPE_CAPTURE | VID_TYPE_SUBCAPTURE,
+#endif
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
  hardware: VID_HARDWARE_QCAM_USB,
 #endif
---

    Signed-off-by: Hans Verkuil <email address hidden>
    Signed-off-by: Mauro Carvalho Chehab <email address hidden>

Copyright (C) 2008 Stefan Lippers-Hollmann <email address hidden>

--- a/qc-driver.c
+++ b/qc-driver.c
@@ -2255,7 +2255,11 @@ static unsigned int qc_v4l_poll(struct v
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
  struct video_device *dev = video_devdata(file);
 #endif
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,28)
+ struct quickcam *qc = (struct quickcam *)video_get_drvdata(dev);
+#else
  struct quickcam *qc = (struct quickcam *)dev->priv;
+#endif
  struct qc_frame_data *fd = &qc->frame_data;
  int mask;

@@ -2307,7 +2311,11 @@ static int qc_v4l_open(struct video_devi
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
  struct video_device *dev = video_devdata(file);
 #endif
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,28)
+ struct quickcam *qc = video_get_drvdata(dev);
+#else
  struct quickcam *qc = dev->priv;
+#endif
  int r;

  if (qcdebug&QC_DEBUGLOGIC || qcdebug&QC_DEBUGUSER) PDEBUG("qc_v4l_open(qc=%p)", qc);
@@ -2375,7 +2383,11 @@ static void qc_v4l_close(struct video_de
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
  struct video_device *dev = video_devdata(file);
 #endif
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,28)
+ struct quickcam *qc = (struct quickcam *)video_get_drvdata(dev);
+#else
  struct quickcam *qc = (struct quickcam *)dev->priv;
+#endif
  if (qcdebug&QC_DEBUGLOGIC || qcdebug&QC_DEBUGUSER) PDEBUG("qc_v4l_close(dev=%p,qc=%p)",dev,qc);
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
  TEST_BUGR_MSG(qc==NULL, "qc==NULL");
@@ -2423,7 +2435,11 @@ static long qc_v4l_read(struct video_dev
  struct video_device *dev = video_devdata(file);
  int noblock = file->f_flags & O_NONBLOCK;
 #endif
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,28)
+ struct quickcam *qc = (struct quickcam *)video_get_drvdata(dev);
+#else
  struct quickcam *qc = (struct quickcam *)dev->priv;
+#endif
  int frame_len;
  unsigned char *frame;
  long r = 0;...

Read more...

Revision history for this message
John Stephenson (jmdsdf) wrote :

Jason, my system is Linux 2.6.28-7-generic #20-Ubuntu SMP i686 GNU/Linux. I saved the two patches from the links, as copying them from your post produced errors. I ran (as root):

# apt-get install qc-usb-source qc-usb-utils
# cd /usr/src
# tar xvfj qc-usb.tar.bz2
# cd modules/qc-usb
# patch < ~/Desktop/patch1
# patch < ~/Desktop/patch2
# make
# make install

This worked perfectly with no errors! Thanks for pointing me to the patches!

However, I rebooted and then tried:

# modprobe quickcam
FATAL: Module quickcam not found.

Then tried:

# insmod quickcam.ko
insmod: error inserting 'quickcam.ko': -1 Unknown symbol in module

Any thoughts?

Revision history for this message
John Stephenson (jmdsdf) wrote :

Oh btw sorry here's my dmesg output:
[ 1438.072753] quickcam: Unknown symbol video_devdata
[ 1438.073149] quickcam: Unknown symbol video_unregister_device
[ 1438.073347] quickcam: Unknown symbol video_register_device

OH WAIT. I'm an idiot. I just needed to:

# modprobe videodev

then:

# insmod quickcam.ko

Sorry, ignore what I've said. Your solution works PERFECTLY! :) THANK YOU! THANK YOU! THANK YOU!

Revision history for this message
whistle512 (whistle512) wrote :

John,

I tried the cut and paste method and it failed to patch. I got patch1 to work. Where did you get patch2, is there a link?

Thanks for the help,
David
.

Revision history for this message
John Stephenson (jmdsdf) wrote :

David, the links are in Jason's post, but since some copy and paste skill is required, I have attached a zip of the patches.

Revision history for this message
whistle512 (whistle512) wrote :

John,
Your the best person in the world! OK, maybe that's a bit over the top. This noob thanks you for the help.
David
.

Revision history for this message
Jason (siegeljb) wrote :

thanks,

I meant to clean that up that post, I just wanted to get the info out quickly before I forgot. I've got the module built, but unfortunately its crashing when I try to view images with gqcam on Jaunty. see attached log.

-Jason

Revision history for this message
IceSheep (icesheep) wrote :

Unfortunately John's solution doesn't work for me. My system is Linux 2.6.27-11-generic i686 (Intrepid).

The make process fails, see attached file for the messages.

Any suggestions?

Thanks.

Revision history for this message
John Stephenson (jmdsdf) wrote :

Jason, I'm glad to hear the driver compiled. I'm using this with CamServ and it works great (it helps me to run qcset debug=0 to ignore dropped frames from cluttering my syslog). I'll check it with gqcam later to see if it works for me. IceSheep, this set of patches is for 2.6.28 only. Check https://bugs.launchpad.net/ubuntu/+source/linux/+bug/268134 for information on compiling the qc-usb driver for the 2.6.27 kernel.

Revision history for this message
John Stephenson (jmdsdf) wrote :

Jason, I installed gqcam and tested with "gqcam -v /dev/video0 -d test.jpg" and it ran fine and the output file looks good. I'm not sure what's happening with your case. Try removing other USB devices? I remember running into problems with running 3 webcams on one system. I don't really know, sorry.

Revision history for this message
Andres Mujica (andres.mujica) wrote :

John, checking your patch and the one at bug #268134, yours seem more clear than the published there.

Would it be possible for you to integrate that patch into yours?

acording to icesheep output the missing part for your patch (and present at the other bug) is:

--- a/qc-usb-old/qc-memory.c
+++ b/qc-usb/qc-memory.c
@@ -81,12 +81,14 @@ static inline int qc_remap_page_range(unsigned long from, unsigned long pfn, uns
 #define pte_offset(pmd,adr) pte_offset_map(pmd,adr) /* Emulation for a kernel using the new rmap-vm */
 #endif /* Fix by Michele Balistreri <email address hidden> */

+#if LINUX_VERSION_CODE>=KERNEL_VERSION(2,5,3) && LINUX_VERSION_CODE<KERNEL_VERSION(2,6,26)
 #ifndef SetPageReserved
 #define SetPageReserved(p) mem_map_reserve(p)
 #endif
 #ifndef ClearPageReserved
 #define ClearPageReserved(p) mem_map_unreserve(p)
 #endif
+#endif

And also this part would be useful

 #endif
@@ -3159,6 +3158,7 @@ PDEBUG("poisoning qc in qc_usb_init");

   /* Register V4L video device */
   memcpy(&qc->vdev, &qc_v4l_template, sizeof(qc_v4l_template));
+ qc->vdev.parent = &usbdev->dev;

but probably this last part would need a #IFDEF for linux version.

I'm asking this so that bug can be moved to this one, as this one has more chances to get solved for Jaunty and maybe backported to Intrepid.

Thanks in advance.

Changed in qc-usb:
status: Unknown → New
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package qc-usb - 0.6.6-6ubuntu1

---------------
qc-usb (0.6.6-6ubuntu1) jaunty; urgency=low

  * debian/patches: add patch to correctly compile on 2.6.28 kernels
    (LP: #213114).

 -- Jeremie Corbier <email address hidden> Fri, 13 Mar 2009 10:28:44 +0100

Changed in qc-usb:
status: Confirmed → Fix Released
Revision history for this message
Ka-Hing Cheung (kahing) wrote :

with jaunty, I see that in kcompat-2.6.28.patch it sets it to:

+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
+ b.type = VID_TYPE_CAPTURE | VID_TYPE_SUBCAPTURE;
+#else
                        b.type = VID_TYPE_CAPTURE;
+#endif

If I remove the | VID_TYPE_SUBCAPTURE and recompile, the camera (quickcam express) is recognized.

I also had to do `qcset /dev/video0 compat=dblbuf`for the video input to work

Changed in qc-usb (Debian):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.