Image scaling bug in gspca kernel module.

Bug #93417 reported by Major Andras
34
This bug affects 2 people
Affects Status Importance Assigned to Milestone
gspca (Ubuntu)
Fix Released
Undecided
Unassigned
linux (Ubuntu)
Fix Released
Undecided
Unassigned
linux-source-2.6.20 (Ubuntu)
Won't Fix
Medium
Unassigned

Bug Description

Binary package hint: linux-image-2.6.20-11-generic

There is a bug in the gspca module. I have a Logitech Quickcam Messenger (046d:08da) and when I switch the small view mode, the driver doesn't scale down the image, but crop it. This is a big problem of ekiga users, because in the ekiga the one and only picture grab mode is 176x144.

ProblemType: Bug
Architecture: i386
Date: Sun Mar 18 16:20:46 2007
DistroRelease: Ubuntu 7.04
Uname: Linux andras-desktop 2.6.20-11-generic #2 SMP Thu Mar 15 08:03:07 UTC 2007 i686 GNU/Linux

Revision history for this message
Major Andras (majorandras) wrote :
Revision history for this message
Major Andras (majorandras) wrote :
Changed in linux-source-2.6.20:
assignee: nobody → ubuntu-kernel-team
importance: Undecided → Medium
status: Unconfirmed → Confirmed
Revision history for this message
Brad Johnson (kkhww1902) wrote :

This happens with Feisty and QuickCam Communicate STX (046d:08d7) as well.

Revision history for this message
Brad Johnson (kkhww1902) wrote :

A workaround that seems to work for me is to download, compile and load the vloopback module:

http://www.lavrsen.dk/twiki/pub/Motion/VideoFourLinuxLoopbackDevice/vloopback-1.1-rc1.tar.gz

and then run:

./resize /dev/video0 /dev/video1 640x480 640x480 yuv420p

Then use /dev/video2 for video input. This seems to force ekiga to open the camera at 640x480 and do scaling itself. Too bad there isn't just an option for this in ekiga.

Revision history for this message
Yannick Defais (sevmek) wrote :

Hi,

Ekiga can't guess the driver report falsely it support the asked resolution.

This is a gspca issue, not an ekiga issue.

Luc Saillard wrote this patch to the gscpa driver:
http://saillard.org/ekiga/gspcav1-20070508_force_using_hardware_mode.patch

To install:
$ wget http://mxhaard.free.fr/spca50x/Download/gspcav1-20070508.tar.gz
$ tar xf gspcav1-20070508.tar.gz
$ wget http://saillard.org/ekiga/gspcav1-20070508_force_using_hardware_mode.patch
$ cd gspcav1-20070508
$ patch -p1 < ../gspcav1-20070508_force_using_hardware_mode.patch
$ make
$ sudo make install

This patch need to be tested more, please report success or failure here.

Regards,
Yannick

Revision history for this message
Major Andras (majorandras) wrote :

I tested this patch, but ekiga can't show any image already.
I'm sorry, but this test's result is failure.

Revision history for this message
Yannick Defais (sevmek) wrote :

Hi,

"Ok sorry for the patch, but it's broken i've write it without testing it.

http://www.saillard.org/ekiga/gspcav1-20070508_force_using_hardware_mode_v3.patch

Here the new patch that works for me(tm) and the webcam ZC0302 (0ac8:0302 Z-Star
Microelectronics Corp. ZC0302 WebCam)"

Quote from Luc Saillard.

Can you try this new one?

Regards,
Yannick

Revision history for this message
Major Andras (majorandras) wrote :

Hello

With this patch ekiga works correctly, but there is a small problem.
The brightness slider in ekiga doesn't working. I don't know, that is an ekiga or a driver issue ?

Thanx

Revision history for this message
Yannick Defais (sevmek) wrote :

Hi,

The brightness slider in ekiga doesn't work because you are not in a call.

Call sip:<email address hidden> and, once in the call, try to use the slider.

Regards,
Yannick

Revision history for this message
Origaman (mail-benno-dielmann) wrote :

Seems to affect skype users, too. See

http://forum.skype.com/index.php?showtopic=131041

Revision history for this message
Frodon (frodon) wrote :

I have added the gspca package to the bug description as according to andypoo (skype dev) this seems to be related to the way how gspca is sending datas.
I confirm this bug on 2.6.24 kernel and unfortunately that it now affects skype which was not the case under gutsy.

Hope something can be done but i'm scared that this will be in the hand of gspca devs.

Changed in linux-source-2.6.24:
status: New → Confirmed
Revision history for this message
Yannick Defais (sevmek) wrote :

Hi,

Quoting the previous post: "it now affects skype which was not the case under gutsy."

I think that's wrong. It is probably affecting Skype since it began to do video under Linux. The problem is very ancient (since years) and the gspca devs just do not want to fix it (or lack time...). AFAIK, it is affecting Skype because under some circumstances, Skype reduce the size of the capturing video (320x240 to 160x120, i.e. one quarter the size), probably when it thinks the bandwidth is too small to send the "normal" size. The gspca driver pretend to send the right requested size (160x120); but in fact it just crop from 320x240.

Ekiga has the very same problem as it request by default 176x144 and gspca just crop from 320x240. As part of the Ekiga team, I documented this issue in our wiki: http://wiki.ekiga.org/index.php/Troubleshooting#GSPCA_driver_bug

The problem has been reported upstream since long now and the bad behaviour still remain the same...

Frodon, can you test the patch Luc Saillard provided http://www.saillard.org/ekiga/gspcav1-20070508_force_using_hardware_mode_v3.patch ?

Regards,
Yannick

Revision history for this message
Frodon (frodon) wrote :

Thanks Yannick, i saw your posts in french forum too :)

Do you think i can just patch the gspca sources from the ubuntu repo and compile them from /usr/src/modules/gspca/ ?

Revision history for this message
Yannick Defais (sevmek) wrote :

Hi,

I'm not a coder myself... I had a quick look to the source code in Hardy (8.04) here https://launchpad.net/ubuntu/hardy/+source/gspca/01.00.18-2/+files/gspca_01.00.18-2.tar.gz and it seems the patch can apply.

I would say: copy the patch in /usr/src/modules , then
$ cd gspca
$ patch -p1 < ../gspcav1-20070508_force_using_hardware_mode_v3.patch
then compile it.

The author, Luc Saillard is french and AFAIK is happy to support his work. see: http://www.saillard.org/

Regards,
Yannick

Revision history for this message
Frodon (frodon) wrote :

I applied the patch but it would not compile correctly so i grabbed the latest version of gspca (gspcav1-20071224) and applied manually the patch on gspca_core.c, then i run a make and finally copied the generated gspca.ko to /lib/modules/2.6.24-16-generic/ubuntu/media/gspcav1/gspca.ko and this did not work, i'm still having the same issue.

I will try to contact Luc Saillard.

Revision history for this message
Peng Deng (d6g) wrote :

I also applied the patch to gspcav1-20071224 and compiled successfully. And after replaced the gspca.ko, my webcam won't scale down to 160x120 anymore. At least running "mplayer tv:// -tv driver=v4l:width=160:height=120
" gives me a correct 320x240 video stream and console output like this:

Selected device: Z-star Vimicro zc0301p

 Capabilites: capture

 Device type: 1

 Supported sizes: 320x240 => 640x480
   <<------------- before it was 160x120 => 640x480 here
 Inputs: 1

  0: ZC301-2: (tuner:0, norm:pal)

Using input 'ZC301-2'

Unable to set requested width: 160

Unable to set requested height: 120

And I looked at the source code of gspca_core.c, Luc's patch should do the trick and solve the problem.

Revision history for this message
Peter Harley (pjrharley) wrote :

I just tested. I compiled the patch with gspca-01.00.20 from debian sid and it's fixed the issue as far as I can tell, although I have only tested with mplayer so far not skype or anything else. It probably will work with the source from hardy, I was doing it wrong at first I think, so I downloaded the newer source.

Any chance of getting this included then?

Revision history for this message
Peng Deng (d6g) wrote : Re: [Bug 93417] Re: Image scaling bug in gspca kernel module.

My skype finally gets tested and it works. (Cannot think why it shouldn't :) )

Regarding the inclusion of the patch, I don't know how to put it, but
it seems the way gspca handle the size of video has its own reason, it
tries to provide a full range of dimensions from SCIF to VGA with
every possible size in between, but usually webcams support only
limited number of sizes natively, so gspca will crop the image from
the next available (bigger) native size if the current one is not
supported by the camera.

Luc's patch simply disabled all the sizes which are not natively
supported, which I am ok with. However, I feel a compromised solution
would be to still provide the full range of picture sizes like what it
does now (cause this way makes sure the interfaces across different
cameras are unified), while give the applications that use this driver
hints whether the size they are asking for is a cropped version or a
native one. (Maybe it already has such a feature just I don't know)

On Tue, Jun 3, 2008 at 4:13 PM, mister_pink <email address hidden> wrote:
> I just tested. I compiled the patch with gspca-01.00.20 from debian sid
> and it's fixed the issue as far as I can tell, although I have only
> tested with mplayer so far not skype or anything else. It probably will
> work with the source from hardy, I was doing it wrong at first I think,
> so I downloaded the newer source.
>
> Any chance of getting this included then?
>
> --
> Image scaling bug in gspca kernel module.
> https://bugs.launchpad.net/bugs/93417
> You received this bug notification because you are a direct subscriber
> of the bug.
>

Revision history for this message
Yannick Defais (sevmek) wrote :

Hi,

This is not a solution to do an exception for this particular driver. Implementing workaround for a particular driver?! What about the others? We will just fall back to the situation as it is now: "Why is my image cropped?" OR "Why is this software not using this webcam properly when another can?" One may ask. It should not lie about what it can do and respect the standard. It is up to the application using it to scale the image down if it can not do it. At least, it is what Ekiga does... And from what I've read from the Skype team, this is what they expect too.

Regards,
Yannick

Revision history for this message
Suzan (suzan72) wrote :

I've tried this patch, which didn't worked for the official Skype version.

Now I uninstalled the officially version and installed the Skype packages (skype, skype-common, version 2.0.0.72-0medibuntu1) from the medibuntu respositories. And know, what - it works now with this package! Not sure though, if it is now the patch together with the medibuntu Skype version or only the medibuntu Skype version.

Though the medibuntu packages are somehow different from the original Skype. Thinking about how that can be with a closed source program? To be honest, I have no idea, but it seems something is different. May some of you would try that medibuntu package also?

My machine:
Ubuntu 8.04 (32-bit) and Logitech QuickCam for Notebooks Deluxe, Nvidia Geforce Go 7300, nvidia-glx-new driver

Revision history for this message
ChristianF (christian-fritz) wrote :

I think the reason why the patch isn't working for some people is fairly silly: Ubuntu doesn't place the gspca driver in the default directory, and in particular not the one where the gspca_build script of the gspca source expects and removes it. Hence, the ubuntu driver doesn't get removed and after unloading and reloading the gspca kernel module again the old version is loaded ;-) Do a
  locate gspca | grep ^/lib/modules/`uname -r`
and you'll see what I mean. After removing /lib/modules/`uname -r`/ubuntu/media/gspcav1/gspca.ko, patching the gspca source and building it, it works all fine for me under skype (didn't test ekiga).

For complete instructions, please check out my Skype forum post:
http://forum.skype.com/index.php?showtopic=127561

Hope it helps,
Christian

Revision history for this message
Frodon (frodon) wrote :

It is what i did when i tried the fix and had no success, i have to try with the latest skype version maybe it solves the issue and it is why you're reporting the fix as working which was not the case previous skype version.

Revision history for this message
Launchpad Janitor (janitor) wrote : This bug is now reported against the 'linux' package

Beginning with the Hardy Heron 8.04 development cycle, all open Ubuntu kernel bugs need to be reported against the "linux" kernel package. We are automatically migrating this bug to the new "linux" package. However, development has already began for the upcoming Intrepid Ibex 8.10 release. It would be helpful if you could test the upcoming release and verify if this is still an issue - http://www.ubuntu.com/testing . If the issue still exists, please update this report by changing the Status of the "linux" task from "Incomplete" to "New". We appreciate your patience and understanding as we make this transition. Thanks!

Revision history for this message
Kevin Valentine (kejava) wrote :

Hi, I just tested this using Ubuntu 8.10 (Alpha 3 - Released July 24th, 2008). The image still gets cropped. However, that was a LIVE session of the CD. So before I set this "New", I'll install it, get all the updates, and try again.

Revision history for this message
Kevin Valentine (kejava) wrote :

Confirmed that image cropping is still an issue on 8.10 alpha 3

Changed in linux:
status: Incomplete → New
Revision history for this message
Kevin Valentine (kejava) wrote :

@ Brad Johnson
Just wanted to thank you for suggesting the use of vloopback. I just had a long video conversation with someone using Ekiga. I went with:
./resize /dev/video0 /dev/video1 352x288 176x144 rgb24

@all
In order to get better video quality I had to pass some gain parameters to the gspca module on load:
modprobe gspca GRed=512 GBlue=512 GGreen=512 force_rgb=0

I also tried the patch mentioned earlier. Still got cropping. Luckily this vloopback is at least a temporary solution :)

I didn't get to test with skype yet. What applications are people here using for testing the video cropping? I tend to go back and forth with ekiga, camorama, gqcam, and spcaview. That last one works the best and has no cropping issues. It also gives lots of useful info about your camera. Here's what mine shows:
**************** PROBING CAMERA *********************
Camera found: ICM532 cam
Bridge found: TV8532
StreamId: GBRG Camera
quality 0 autoexpo 1 Timeframe 0 lightfreq 50
Available Resolutions width 640 heigth 480 native
Available Resolutions width 352 heigth 288 native
Available Resolutions width 320 heigth 240 native *
Available Resolutions width 176 heigth 144 native
Available Resolutions width 160 heigth 120 native
unable to probe size !!
*****************************************************

Get spcaview here:
http://mxhaard.free.fr/spca50x/Download/spcaview-20071224.tar.gz

Revision history for this message
Leann Ogasawara (leannogasawara) wrote :

The Ubuntu Kernel Team is planning to move to the 2.6.27 kernel for the upcoming Intrepid Ibex 8.10 release. As a result, the kernel team would appreciate it if you could please test this newer 2.6.27 Ubuntu kernel. There are one of two ways you should be able to test:

1) If you are comfortable installing packages on your own, the linux-image-2.6.27-* package is currently available for you to install and test.

--or--

2) The upcoming Alpha5 for Intrepid Ibex 8.10 will contain this newer 2.6.27 Ubuntu kernel. Alpha5 is set to be released Thursday Sept 4. Please watch http://www.ubuntu.com/testing for Alpha5 to be announced. You should then be able to test via a LiveCD.

Please let us know immediately if this newer 2.6.27 kernel resolves the bug reported here or if the issue remains. More importantly, please open a new bug report for each new bug/regression introduced by the 2.6.27 kernel and tag the bug report with 'linux-2.6.27'. Also, please specifically note if the issue does or does not appear in the 2.6.26 kernel. Thanks again, we really appreicate your help and feedback.

Revision history for this message
Leann Ogasawara (leannogasawara) wrote :

Has anyone been able to test and confirm this is still and issue with Intrepid's final release? Thanks.

Changed in linux:
status: New → Incomplete
Revision history for this message
volkris (volkris) wrote :

Yes, Leann, I'm still seeing the problems described here on more than one fully up-to-date Intrepid computer.

Most unfortunately the vloopback workaround proposed above doesn't work on Intrepid, so we're just sunk.

Revision history for this message
Frodon (frodon) wrote :

For what i'm concerned intrepid fixed this issue for me with skype. I'm using the medibuntu skype package if it matters.

So this bug is behind me now, i hope i'm not just the lucky guy here and that the issue has been really dealt with.

Revision history for this message
Launchpad Janitor (janitor) wrote : Kernel team bugs

Per a decision made by the Ubuntu Kernel Team, bugs will longer be assigned to the ubuntu-kernel-team in Launchpad as part of the bug triage process. The ubuntu-kernel-team is being unassigned from this bug report. Refer to https://wiki.ubuntu.com/KernelTeamBugPolicies for more information. Thanks.

Revision history for this message
Michal Predotka (mpredotka) wrote :

Sometimes I have that problem and sometimes not. I can't find out what it's depend on.

Revision history for this message
volkris (volkris) wrote :

So you have two people still reporting trouble with this bug. Are you sure you want to leave it as won't fix?

Revision history for this message
Andy Whitcroft (apw) wrote : Re: [Bug 93417] Re: Image scaling bug in gspca kernel module.

On Fri, Dec 26, 2008 at 08:09:12AM -0000, Chris Carlin wrote:
> So you have two people still reporting trouble with this bug. Are you
> sure you want to leave it as won't fix?

This is marked as Won't Fix in a version of the kernel which is only
available in a release of Ubuntu which is no longer under support. The
task for the current kernel series is still open Incomplete; normally
this means waiting for information from the submitter.

Revision history for this message
volkris (volkris) wrote :

The recently proposed kernel (2.6.27-12-generic) fixes this bug for me.

volkris (volkris)
Changed in gspca (Ubuntu):
status: Confirmed → Fix Released
Changed in linux (Ubuntu):
status: Incomplete → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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