All of lore.kernel.org
 help / color / mirror / Atom feed
* PWC ioctl inappropriate for device (Regression)
@ 2012-06-09 17:06 Bernard GODARD
  2012-06-09 21:08 ` Hans de Goede
  0 siblings, 1 reply; 4+ messages in thread
From: Bernard GODARD @ 2012-06-09 17:06 UTC (permalink / raw)
  To: linux-media

Dear all,

I am using a Philips Toucam Pro 2 webcam with the program qastrocam-g2
(astronomy program that use some specific functions of the PWC
driver).
I have been using this program with this camera for a long time on
different Linux distributions without a problem.

With Ubuntu 12.04, I now get a kernel oops. See bug report:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1010028

I have installed mainline kernel 3.4rc6 on my Ubuntu box to check if
the oops was fixed upstream. Now I am not getting the oops anymore but
the IOCTL used to get/set the camera parameters are failing:


astro@saturn:~$ qastrocam-g2
<init> : Avifile RELEASE-0.7.48-120122-05:53-../src/configure
<init> : Available CPU flags: fpu vme de pse tsc msr pae mce cx8 apic
sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall
nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow rep_good nopl extd_apicid
pni cx16 la
<init> : 2200.00 MHz AMD Athlon(tm) 64 X2 Dual Core Processor 4200+ detected
Getting Standard: Inappropriate ioctl for device
setWhiteBalance: Inappropriate ioctl for device
getWhiteBalance: Inappropriate ioctl for device
getWhiteBalance: Inappropriate ioctl for device
VIDIOCPWCGAGC: Inappropriate ioctl for device
ioctl (VIDIOCGWIN): Inappropriate ioctl for device
mmap: Invalid argument
VIDIOCPWCGDYNNOISE: Inappropriate ioctl for device
VIDIOCPWCGCONTOUR: Inappropriate ioctl for device
VIDIOCPWCSCONTOUR: Inappropriate ioctl for device
VIDIOCPWCGDYNNOISE: Inappropriate ioctl for device
VIDIOCPWCGCONTOUR: Inappropriate ioctl for device
VIDIOCPWCGDYNNOISE: Inappropriate ioctl for device
VIDIOCPWCGAGC: Inappropriate ioctl for device
VIDIOCPWCSAGC: Inappropriate ioctl for device
getWhiteBalance: Inappropriate ioctl for device
VIDIOCPWCSAGC: Inappropriate ioctl for device
VIDIOCPWCSSHUTTER: Inappropriate ioctl for device
VIDIOCPWCGAGC: Inappropriate ioctl for device
getWhiteBalance: Inappropriate ioctl for device
VIDIOCPWCGAGC: Inappropriate ioctl for device
VIDIOCPWCGAGC: Inappropriate ioctl for device
VIDIOCPWCGAGC: Inappropriate ioctl for device
VIDIOCPWCGAGC: Inappropriate ioctl for device
VIDIOCPWCGAGC: Inappropriate ioctl for device
VIDIOCPWCGAGC: Inappropriate ioctl for device
VIDIOCPWCGAGC: Inappropriate ioctl for device
VIDIOCPWCGAGC: Inappropriate ioctl for device
VIDIOCPWCGAGC: Inappropriate ioctl for device
VIDIOCPWCGAGC: Inappropriate ioctl for device
VIDIOCPWCGAGC: Inappropriate ioctl for device
VIDIOCPWCGAGC: Inappropriate ioctl for device
VIDIOCPWCGAGC: Inappropriate ioctl for device
VIDIOCPWCGAGC: Inappropriate ioctl for device
VIDIOCPWCGAGC: Inappropriate ioctl for device
VIDIOCPWCGAGC: Inappropriate ioctl for device
VIDIOCPWCGAGC: Inappropriate ioctl for device
VIDIOCPWCGAGC: Inappropriate ioctl for device
VIDIOCPWCGAGC: Inappropriate ioctl for device

...

Thank you,

Kind regards,

       Bernard

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: PWC ioctl inappropriate for device (Regression)
  2012-06-09 17:06 PWC ioctl inappropriate for device (Regression) Bernard GODARD
@ 2012-06-09 21:08 ` Hans de Goede
  2012-06-11 14:34   ` Bernard GODARD
  0 siblings, 1 reply; 4+ messages in thread
From: Hans de Goede @ 2012-06-09 21:08 UTC (permalink / raw)
  To: Bernard GODARD; +Cc: linux-media

Hi,

On 06/09/2012 07:06 PM, Bernard GODARD wrote:
> Dear all,
>
> I am using a Philips Toucam Pro 2 webcam with the program qastrocam-g2
> (astronomy program that use some specific functions of the PWC
> driver).
> I have been using this program with this camera for a long time on
> different Linux distributions without a problem.
>
> With Ubuntu 12.04, I now get a kernel oops. See bug report:
> https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1010028
>
> I have installed mainline kernel 3.4rc6 on my Ubuntu box to check if
> the oops was fixed upstream. Now I am not getting the oops anymore

Good!

 > but the IOCTL used to get/set the camera parameters are failing:
>
>
> astro@saturn:~$ qastrocam-g2
> <init> : Avifile RELEASE-0.7.48-120122-05:53-../src/configure
> <init> : Available CPU flags: fpu vme de pse tsc msr pae mce cx8 apic
> sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall
> nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow rep_good nopl extd_apicid
> pni cx16 la
> <init> : 2200.00 MHz AMD Athlon(tm) 64 X2 Dual Core Processor 4200+ detected
> Getting Standard: Inappropriate ioctl for device
> setWhiteBalance: Inappropriate ioctl for device
> getWhiteBalance: Inappropriate ioctl for device
> getWhiteBalance: Inappropriate ioctl for device
> VIDIOCPWCGAGC: Inappropriate ioctl for device
> ioctl (VIDIOCGWIN): Inappropriate ioctl for device
> mmap: Invalid argument
> VIDIOCPWCGDYNNOISE: Inappropriate ioctl for device
> VIDIOCPWCGCONTOUR: Inappropriate ioctl for device
> VIDIOCPWCSCONTOUR: Inappropriate ioctl for device
> VIDIOCPWCGDYNNOISE: Inappropriate ioctl for device
> VIDIOCPWCGCONTOUR: Inappropriate ioctl for device
> VIDIOCPWCGDYNNOISE: Inappropriate ioctl for device
> VIDIOCPWCGAGC: Inappropriate ioctl for device
> VIDIOCPWCSAGC: Inappropriate ioctl for device
> getWhiteBalance: Inappropriate ioctl for device
> VIDIOCPWCSAGC: Inappropriate ioctl for device
> VIDIOCPWCSSHUTTER: Inappropriate ioctl for device
> VIDIOCPWCGAGC: Inappropriate ioctl for device
> getWhiteBalance: Inappropriate ioctl for device
> VIDIOCPWCGAGC: Inappropriate ioctl for device
> VIDIOCPWCGAGC: Inappropriate ioctl for device
> VIDIOCPWCGAGC: Inappropriate ioctl for device
> VIDIOCPWCGAGC: Inappropriate ioctl for device
> VIDIOCPWCGAGC: Inappropriate ioctl for device
> VIDIOCPWCGAGC: Inappropriate ioctl for device
> VIDIOCPWCGAGC: Inappropriate ioctl for device
> VIDIOCPWCGAGC: Inappropriate ioctl for device
> VIDIOCPWCGAGC: Inappropriate ioctl for device
> VIDIOCPWCGAGC: Inappropriate ioctl for device
> VIDIOCPWCGAGC: Inappropriate ioctl for device
> VIDIOCPWCGAGC: Inappropriate ioctl for device
> VIDIOCPWCGAGC: Inappropriate ioctl for device
> VIDIOCPWCGAGC: Inappropriate ioctl for device
> VIDIOCPWCGAGC: Inappropriate ioctl for device
> VIDIOCPWCGAGC: Inappropriate ioctl for device
> VIDIOCPWCGAGC: Inappropriate ioctl for device
> VIDIOCPWCGAGC: Inappropriate ioctl for device
> VIDIOCPWCGAGC: Inappropriate ioctl for device

As the names of the ioctls imply these are (were) custom pwc
ioctls, these were added in the v4l1 days as the v4l1 api did not
have a way to expose the desired functionality in a standard manner.

Support for the v4l1 API has been removed a number of kernel releases
ago and at the same time the pwc specific ioctls have been marked
as deprecated. And with kernel 3.2 they have finally been removed.

The same results can be achieved with the standard v4l2
VIDIOC_S_CTRL and VIDIOC_G_CTRL ioctls. I'm sorry to hear that the
removal of the custom pwc ioctls is causing problems for you, but
we really don't want to have any unneeded driver specific ioctls
with v4l2 devices.

So the qastrocam-g2 program needs to be modified to use the standard
controls interface to modify these settings on newer kernels.

Can you please send a bug report to qastrocam-g2 about this and add
me in the CC ?

Thanks,

Hans

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: PWC ioctl inappropriate for device (Regression)
  2012-06-09 21:08 ` Hans de Goede
@ 2012-06-11 14:34   ` Bernard GODARD
  2012-06-11 18:15     ` Hans de Goede
  0 siblings, 1 reply; 4+ messages in thread
From: Bernard GODARD @ 2012-06-11 14:34 UTC (permalink / raw)
  To: Hans de Goede; +Cc: linux-media

Hi Hans,

Thank you for your reply.

I will try to do the fix in qastrocam-g2 myself as this program does
not currently have a maintainer.

Regards,

On Sat, Jun 9, 2012 at 9:08 PM, Hans de Goede <hdegoede@redhat.com> wrote:
> Hi,
>
>
> On 06/09/2012 07:06 PM, Bernard GODARD wrote:
>>
>> Dear all,
>>
>> I am using a Philips Toucam Pro 2 webcam with the program qastrocam-g2
>> (astronomy program that use some specific functions of the PWC
>> driver).
>> I have been using this program with this camera for a long time on
>> different Linux distributions without a problem.
>>
>> With Ubuntu 12.04, I now get a kernel oops. See bug report:
>> https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1010028
>>
>> I have installed mainline kernel 3.4rc6 on my Ubuntu box to check if
>> the oops was fixed upstream. Now I am not getting the oops anymore
>
>
> Good!
>
>
>> but the IOCTL used to get/set the camera parameters are failing:
>>
>>
>>
>> astro@saturn:~$ qastrocam-g2
>> <init> : Avifile RELEASE-0.7.48-120122-05:53-../src/configure
>> <init> : Available CPU flags: fpu vme de pse tsc msr pae mce cx8 apic
>> sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall
>> nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow rep_good nopl extd_apicid
>> pni cx16 la
>> <init> : 2200.00 MHz AMD Athlon(tm) 64 X2 Dual Core Processor 4200+
>> detected
>> Getting Standard: Inappropriate ioctl for device
>> setWhiteBalance: Inappropriate ioctl for device
>> getWhiteBalance: Inappropriate ioctl for device
>> getWhiteBalance: Inappropriate ioctl for device
>> VIDIOCPWCGAGC: Inappropriate ioctl for device
>> ioctl (VIDIOCGWIN): Inappropriate ioctl for device
>> mmap: Invalid argument
>> VIDIOCPWCGDYNNOISE: Inappropriate ioctl for device
>> VIDIOCPWCGCONTOUR: Inappropriate ioctl for device
>> VIDIOCPWCSCONTOUR: Inappropriate ioctl for device
>> VIDIOCPWCGDYNNOISE: Inappropriate ioctl for device
>> VIDIOCPWCGCONTOUR: Inappropriate ioctl for device
>> VIDIOCPWCGDYNNOISE: Inappropriate ioctl for device
>> VIDIOCPWCGAGC: Inappropriate ioctl for device
>> VIDIOCPWCSAGC: Inappropriate ioctl for device
>> getWhiteBalance: Inappropriate ioctl for device
>> VIDIOCPWCSAGC: Inappropriate ioctl for device
>> VIDIOCPWCSSHUTTER: Inappropriate ioctl for device
>> VIDIOCPWCGAGC: Inappropriate ioctl for device
>> getWhiteBalance: Inappropriate ioctl for device
>> VIDIOCPWCGAGC: Inappropriate ioctl for device
>> VIDIOCPWCGAGC: Inappropriate ioctl for device
>> VIDIOCPWCGAGC: Inappropriate ioctl for device
>> VIDIOCPWCGAGC: Inappropriate ioctl for device
>> VIDIOCPWCGAGC: Inappropriate ioctl for device
>> VIDIOCPWCGAGC: Inappropriate ioctl for device
>> VIDIOCPWCGAGC: Inappropriate ioctl for device
>> VIDIOCPWCGAGC: Inappropriate ioctl for device
>> VIDIOCPWCGAGC: Inappropriate ioctl for device
>> VIDIOCPWCGAGC: Inappropriate ioctl for device
>> VIDIOCPWCGAGC: Inappropriate ioctl for device
>> VIDIOCPWCGAGC: Inappropriate ioctl for device
>> VIDIOCPWCGAGC: Inappropriate ioctl for device
>> VIDIOCPWCGAGC: Inappropriate ioctl for device
>> VIDIOCPWCGAGC: Inappropriate ioctl for device
>> VIDIOCPWCGAGC: Inappropriate ioctl for device
>> VIDIOCPWCGAGC: Inappropriate ioctl for device
>> VIDIOCPWCGAGC: Inappropriate ioctl for device
>> VIDIOCPWCGAGC: Inappropriate ioctl for device
>
>
> As the names of the ioctls imply these are (were) custom pwc
> ioctls, these were added in the v4l1 days as the v4l1 api did not
> have a way to expose the desired functionality in a standard manner.
>
> Support for the v4l1 API has been removed a number of kernel releases
> ago and at the same time the pwc specific ioctls have been marked
> as deprecated. And with kernel 3.2 they have finally been removed.
>
> The same results can be achieved with the standard v4l2
> VIDIOC_S_CTRL and VIDIOC_G_CTRL ioctls. I'm sorry to hear that the
> removal of the custom pwc ioctls is causing problems for you, but
> we really don't want to have any unneeded driver specific ioctls
> with v4l2 devices.
>
> So the qastrocam-g2 program needs to be modified to use the standard
> controls interface to modify these settings on newer kernels.
>
> Can you please send a bug report to qastrocam-g2 about this and add
> me in the CC ?
>
> Thanks,
>
> Hans

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: PWC ioctl inappropriate for device (Regression)
  2012-06-11 14:34   ` Bernard GODARD
@ 2012-06-11 18:15     ` Hans de Goede
  0 siblings, 0 replies; 4+ messages in thread
From: Hans de Goede @ 2012-06-11 18:15 UTC (permalink / raw)
  To: Bernard GODARD; +Cc: linux-media

Hi,

On 06/11/2012 04:34 PM, Bernard GODARD wrote:
> Hi Hans,
>
> Thank you for your reply.
>
> I will try to do the fix in qastrocam-g2 myself as this program does
> not currently have a maintainer.

Thanks! Please let me know if you need any help.

If programs like qastrocam-g2 are going to depend on some of the
custom v4l2 ctrls pwc has (so controls not using a standard ctrl id),
then one of the first steps would be to make the ctrl ids for all the
custom controls available in a public header file.

Which means writing a (simple) kernel patch, currently
drivers/media/video/pwc/pwc-v4l.c in the kernel has:

#define PWC_CID_CUSTOM(ctrl) ((V4L2_CID_USER_BASE | 0xf000) + custom_ ## ctrl)

and:

enum { custom_autocontour, custom_contour, custom_noise_reduction,
         custom_awb_speed, custom_awb_delay,
         custom_save_user, custom_restore_user, custom_restore_factory };

And then in various places uses things like:

PWC_CID_CUSTOM(autocontour)

I think it would be best to make a new include/media/pwc.h file, which
then would contain things like:

PWC_CID_AUTOCONTOUR (V4L2_CID_USER_BASE | 0xf000)
PWC_CID_CONTOUR     (V4L2_CID_USER_BASE | 0xf001)

And then in drivers/media/video/pwc/pwc-v4l.c replace PWC_CID_CUSTOM(autocontour)
with PWC_CID_AUTOCONTOUR, etc. It would be good to keep the order the same, as
in the enum, this way your modified qastrocam-g2 will work with the current
kernel too, as the ids are then unchanged.

Another something to look at is the V4L2_CID_AUTO_WHITE_BALANCE control,
which uses a menu, rather then being the standard boolean. The very latest
kernel code has a new standardized ctrl for auto-whitebalance controls
which are a menu, see:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commitdiff;h=e40a05736d4503950ec303610a51f838bd59cdc1

It would be nice if you could do a patch to move pwc over to this too. Note
that pwc will move over to this sooner or later (probably sooner, so if you
don't feel up to doing a patch for this yourself let me know and I'll do one),
as making qastrocam-g2 work only with the current V4L2_CID_AUTO_WHITE_BALANCE
and not with the future V4L2_CID_AUTO_N_PRESET_WHITE_BALANCE control means
it will break again in the future :/

This does mean that if you want the modified qastrocam-g2 to work both with
current kernels and with newer kernels where pwc has moved over to
V4L2_CID_AUTO_N_PRESET_WHITE_BALANCE, you need to support both. You can simply
do a VIDIOC_QUERYCTRL on both to see which one is present to support both.

Regards,

Hans

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-06-11 18:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-09 17:06 PWC ioctl inappropriate for device (Regression) Bernard GODARD
2012-06-09 21:08 ` Hans de Goede
2012-06-11 14:34   ` Bernard GODARD
2012-06-11 18:15     ` Hans de Goede

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.