14 Replies Latest reply on Sep 16, 2014 5:00 AM by AlexT_Intel

    problem with setting up logitech webcam on galileo

    Daniel05

      I've recently finding out how to link my webcam to galileo

      my webcam : logitech quickcam chat

      I've plugged it thru the USB host, and i can see it in lsusb

      I've noticed that my webcam needs a driver called gspca , spc5xx and I've got many problems installing it

      I've read lots and lots of threads about it but nothing worked for me

      I've also downloaded the package by using opkg from http://iotdk.intel.com/ipk/ because i've found out it includes gspca for clanton and I've installed it(however it doesn't include spc5xx)

      the problem is that I can't even modprobe or insmod gspca_main

      P.S I've also made video/0 nodes but didn't workout for me

      I am a newbie in linux

      I really need some help

        • 2. Re: problem with setting up logitech webcam on galileo
          Liam

          I have had success with a Logitech webcam (and some other no-name webcams) on the Galileo, using python and opencv to talk to them and capture images. Works fine.

           

          But only when using the clanton-full build (eglibc based), this did not work for me using the standard uclibc image. Although I wanted to use opencv, I did not try non-opencv methods.

           

          See Intel Galileo - Building Linux Image - Malinov Family Web Presence for a description of how to build an eglibc-based image using Yocto: this takes a long time, and a Linux workstation or VM. I think there are some pre-build images out there too, search this forum for links.

           

          The other trick to getting it working was that to after plugging in the cam, you have to

           

          $modprobe uvcvideo

           

          to make it load the video drivers.

           

          Good luck

          Liam

          • 3. Re: problem with setting up logitech webcam on galileo
            Daniel05

            i know that the uvc driver is already installed in the image

            but not the gspca driver

            I think it is about the installation of the driver

            there are plenty of compling errors when I "Make" the driver

            • 4. Re: problem with setting up logitech webcam on galileo
              AlexT_Intel

              The eglibc image is definitely not needed to make gspca webcam to work.

               

              I'll elaborate tomorrow, but in general there's a recipe you can use to enable gspca support when building the Linux image out of the BSP. Check out github.com/alext-mkrs/meta-alex-galileo.

               

              If you don't feel like building it yourself, check out my package repo at alextgalileo.altervista.org. I can't recall if I already have the gspca kernel module package there or not, but if not I can build one. I'll check it out tomorrow.

              • 5. Re: problem with setting up logitech webcam on galileo
                Daniel05

                Alex, thanks for the reply

                I'm a newbie in the linux world so building a linux image sounds hard for me(But I'll try)

                I've been to your pkgrepo site and could find the module package before however I found gspca_main module here:

                http://iotdk.intel.com/ipk/

                 

                 

                but my webcam definitely need the gspca_spc5xx driver to scan it

                If you can build one for me, that would be really wonderful

                thanks a lot

                 

                there is also a question I may ask:

                after i do

                opkg update

                I can't do opkg install gspca_main

                I've check the error mesg and it said that /linux/build is missing

                I've changed the kernel directory and a lot of library direcories in the makefile but lots of error pop up when making it

                • 6. Re: problem with setting up logitech webcam on galileo
                  AlexT_Intel

                  Sorry, looks like it would take me more time to build those-my internet and computer access is intermittent at the moment.

                   

                  As far as the opkg error-do you get it with my pkgrepo or the one you mentioned? Genarally it looks a little strange/vague, could you please post the full output verbatim?

                  • 7. Re: problem with setting up logitech webcam on galileo
                    BalaK_Intel

                    Hi Daniel05,

                    I have a Logitech Quickcam 310 and managed to connect it using the UVC drivers/libraries. I am able to do still pictures, but not managed to do live streams yet. Is there any specific reason why you are trying to go the gspca way?

                    This article helped me quite a bit:

                    http://wiki.openwrt.org/doc/howto/usb.video

                    • 8. Re: problem with setting up logitech webcam on galileo
                      BalaK_Intel

                      Hi Daniel,

                      I managed to get mjpg-streamer also going with the Logitech Quickcam 310. Of course I had to do a lot of compiles  myself on the latest versions of source code and libraries. The input with a livestream still doesn't work (fails to detect a UVC driver based camera), but there is a way to loop photos using fswebcam and feed that into the mjpg-streamer app. This works well and is good enough for my usage. I tried quite a bit of AlexT's libraries/apps including 'motion' and AlexT's .ipk threw Segmentation fault, while the version that I compiled from the latest version of code fails to detect the UVC livestream again. From a lot of research, I found that a YUV option is supported by a raspberry pi and works well there, but unable to find out something similar for Galileo. My last rendezvous with Linux was around 12 years back when I was barely out of school, of course that is before I got my hands dirty with Galileo starting 2 months ago. Let me know if you want to proceed with this UVC option and I'll be happy to help. Would like to take this opportunity to thanks AlexT!

                      Thanks!

                      • 9. Re: problem with setting up logitech webcam on galileo
                        AlexT_Intel

                        @Daniel05, looks like teh question is now marked as "assumed answered", could you please share your solution if you were able to make it work? I'm sure that would be beneficial for a lot of people.

                         

                        If you still need help - could you please tell me the exact model of your webcam, as @BalaK_Intel mentioned uvcvideo driver may be a better fit. It's already included into the Galileo's distribution, so you can always test if it detects your webcam by modprobing it and then plugging in the webcam.

                         

                        BalaK_Intel - motion package from my repo shouldn't produce segfaults... What can produce those is a libav, which is IIRC included out of teh box, but is incorrectly compiled and not working. My repo contains the recompiled version, which is free of the problem and motion works fine for me (though with a different webcam). Try to remove current libav you have + motion package itself, then install motion again - it will pull the proper libav from the repo as a dependency and it should work after that. If it doesn't - feel free to post in the thread where I announced the motion's availability, we'll check it out.

                        • 10. Re: problem with setting up logitech webcam on galileo
                          krish_22

                          hi AlexT_Intel

                           

                          I am facing problem in video capturing and saving using USB webcam ( Logitech C130 )using opencv in intel galileo

                          I am using LSB compatible image(eglibc base)

                          I have successfully captured an Image using webcam

                          for Image capturing I have set

                                    $modprobe uvcvideo nodrop=1 timeout=5000

                           

                          Now I want to capture an Image and save it into my Intel galileo board.


                          I have already posted my question in community but still my error is not resolved

                          link is Intel galileo video capturing and saving using webcam using opencv

                           

                          each and every time my program save the video( not exactly ) but it is of size 5KB every time

                          and it shows me "Illegal Instruction"

                           

                          I have found that it throws me this error from my "cvWriteFrame" function of Opencv.

                           

                          Please help me to resolve this error

                           

                          thanx in advance

                           

                          my code and output I have attached with this.

                          ======================================================================================

                          code:

                          ------------------------------------------------------------

                          #include <highgui.h>

                          #include "opencv2/highgui/highgui.hpp"

                          #include <cv.h>

                          #include <time.h>

                          #include <stdio.h>

                          #include <unistd.h>

                          int main(int argc, char** argv)

                          {

                              int i=0,j=0;

                           

                              CvCapture* capture = cvCaptureFromCAM(0);

                             

                              cvSetCaptureProperty(capture, CV_CAP_PROP_FRAME_WIDTH, 320);

                              cvSetCaptureProperty(capture, CV_CAP_PROP_FRAME_HEIGHT, 240);

                           

                              CvSize size = cvSize((int)cvGetCaptureProperty( capture,CV_CAP_PROP_FRAME_WIDTH),(int)cvGetCaptureProperty( capture,CV_CAP_PROP_FRAME_HEIGHT));

                              IplImage* frame;

                                  

                              CvVideoWriter *writer = cvCreateVideoWriter( "video.avi" , CV_FOURCC('I','Y','U','V'), 1 ,size, 1);

                           

                              if(writer==NULL)

                                  printf("Goes in Doubt\n");

                           

                              if(!writer)

                                  printf("writer is false\n");

                           

                              else

                                  printf("Everything is running fine.\n");   

                           

                                   while(1)

                                   {   

                                      frame = cvQueryFrame(capture);

                                      printf("before query frame success\n");          // this printf is for test purpose   

                                      if(!frame)

                                              break;

                                      printf("query frame successful\n");                    // this printf is for test purpose

                           

                                       j = cvWriteFrame(writer, frame);

                                       printf("writer = %d\n",j);

                           

                                       if(!writer)

                                                 printf("Writer is false again\n");

                                       else

                                                printf("Everything is running fine.\n");   

                           

                                       if(i==10)

                                       {

                                                   cvReleaseCapture(&capture);

                                                   break;

                                       }

                                       else

                                               i++;

                                    }

                                    printf("Release\n");   

                                   return 0;

                          }

                           

                          --------------------------------------------------------------------------------------------------------------------------

                           

                          Output is :

                          ===============================================

                           

                          root@clanton:/kishan# ./video

                          VIDIOC_QUERYMENU: Invalid argument

                          VIDIOC_QUERYMENU: Invalid argument

                          VIDIOC_QUERYMENU: Invalid argument

                          VIDIOC_QUERYMENU: Invalid argument

                          VIDIOC_QUERYMENU: Invalid argument

                          VIDIOC_QUERYMENU: Invalid argument

                          VIDIOC_QUERYMENU: Invalid argument

                          VIDIOC_QUERYMENU: Invalid argument

                          VIDIOC_QUERYMENU: Invalid argument

                          VIDIOC_QUERYMENU: Invalid argument

                          VIDIOC_QUERYMENU: Invalid argument

                          VIDIOC_QUERYMENU: Invalid argument

                          VIDIOC_QUERYMENU: Invalid argument

                          VIDIOC_QUERYMENU: Invalid argument

                          Everything is running fine.

                          before query frame success

                          query frame successful

                          Illegal instruction

                          root@clanton:/kishan#

                           

                          ========================================================

                           

                          size of video

                          ------------------------------------------------------------------------------------

                           

                          root@clanton:/kishan# ls -al video.avi

                          -rw-r--r-- 1 root root 5672 Aug 13 03:13 video.avi

                          root@clanton:/kishan#

                          --------------------------------------------------------------------------------

                          • 11. Re: problem with setting up logitech webcam on galileo
                            AlexT_Intel

                            Out of this thread: OpenCV projects ? I see that you're getting an error in the libavcodec. I think I know what's the problem and I have it fixed for a while now in the package, which is in my repo at alextgalileo.altervista.org. Try reinstalling the package from the repo and you should be good. The reason is that assembler optimizations aren't disabled in the Yocto recipe for the compilation in the BSP-provided recipe and after identifying the x86 processor, compile process compiles in a couple of instructions in asm macros, which aren't available on Quark.

                            • 12. Re: problem with setting up logitech webcam on galileo
                              krish_22

                              thanx AlexT_Intel

                               

                              will you please tell me from where to download the package.. I have open your website "alextgalileo.altervista.org".

                              please tell me which package I have to install?

                              • 13. Re: problem with setting up logitech webcam on galileo
                                mhahn

                                Alternatively you might want to give the new eglibc (+uclibc for Arduino IDE compatibility) IoT devkit image a try:

                                https://software.intel.com/en-us/iot/getting-started

                                It also comes with a repo in case you are missing a package

                                • 14. Re: problem with setting up logitech webcam on galileo
                                  AlexT_Intel

                                  Here are the instructions for configuring the repo connection on your board: http://alextgalileo.altervista.org/package-repo-configuration-instructions.html. Read the whole page, note at the bottom is meaningful. Make a backup of your SD card just in case something goes wrong.

                                   

                                  After that you'll need to reinstall the libav packages, the best is probably reinstall them all.

                                   

                                  So run

                                  opkg remove --force-depends libavcodec53 libavdevice53 libavfilter53 libavformat53 libavfilter2 libavutil51 libav

                                  to remove and then

                                  opkg install libavcodec53 libavdevice53 libavfilter53 libavformat53 libavfilter2 libavutil51 libav

                                  to install the updated ones from the repo