mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "John Que" <qwejohn@hotmail.com>
To: linux-kernel@vger.kernel.org
Subject: usb_set_interface and alternate setting
Date: Mon, 28 Jun 2004 09:27:59 +0300	[thread overview]
Message-ID: <BAY14-F34N1Xh2RtDQG0001ab2a@hotmail.com> (raw)

Hello,

I work with a logitech 4000 pro WebCam with the pwc driver;
I run it on RH9 linux with 2.4.20-8 kernel.

The driver is part of the linux kernel 2.4.20-8.  (and also above , of 
course).

Now , in  pwc_isoc_init() method  (in pwc-if.c)
there is the following call:
ret = usb_set_interface(pdev->udev, 0, pdev->valternate);

By debugging I saw that it uses alternate setting 2 (pdev->valternate=2).

Now , according to the next Linux Device Driver website , this is the
descriptor for that webcam: (and I verified it by cat /proc/bus/usb/devices)

http://www.qbik.ch/usb/devices/showdescr.php?id=2515

Now , I had tried to use a different alternate setting,1, for which
the Maximum Packet Size (MxPS) is 196.

So I set pdev->valternate to 1 in the beginning of the pwc_isoc_init().

the return value form usb_set_interface() is 0 ; this means success.

I also saw the the return value from usb_maxpacket is 196, which is indeed 
the
max packet size of alternate setting 1.


However, when I try to use a utility like ffmpeg to grab a video sequence it
fails immeditately in the beginning : it simply hangs
in the  pwc_video_ioctl() method. (in the case VIDIOCSYNC: )

I don't understand why; though I added printk() calls almost
everywhere in that case sentence of this pwc_video_ioctl()
it does not reach them ; it simply hangs.

My question is :
Given that descriptor - is it possible and correct to change alternate 
setting like I do ?
Or should I do something else?

Is it OK that the number of endpoint remains 5 in both cases
(when using altenate setting 2,which is the default,and when using
alternate setting 1 ?)

Any help will be appreciated.

The kernel log I got when running the ffmpeg util is below:
(I added some printing info where I thought it can give some hint):

[pwc-if.c] in pwc_isoc_init
[pwc-if.c] in pdev->vendpoint = 5
[pwc-if.c] setting pdev->vmax_packet_size to  196
[pwc-if.c] usb_set_interface ret= 0
[pwc-if.c] pipe size is 164736
[pwc-if.c] epmaxpacketout= 0
epmaxpacketin 196
usb_pipeendpoint 5
[pwc-if.c] pipeout 0
[pwc-if.c] usb_maxpacket returns  196
[pwc-if.c] pipe size is 164736
[pwc-if.c] epmaxpacketout= 0
[pwc-if.c] epmaxpacketin 196
[pwc-if.c] usb_pipeendpoint 5
[pwc-if.c] pipeout 0
[pwc-if.c] usb_maxpacket returns  196
[pwc-if.c]  finished pwc_isoc_init()
[pwc-if.c] finished pwc_video_open
[pwc-if.c] pwc_video_ioctl

[pwc-if.c] case VIDIOCMCAPTURE:
VIDIOCMCAPTURE: 352x288, frame 0, format 15
[pwc-if.c] before pwc_try_video_mode :
pwc Video mode SIF@10 fps is only supported with the decompressor module 
(pwcx).
in pwc_isoc_init
in pdev->vendpoint = 5
[pwc-if.c] setting pdev->vmax_packet_size to  196
[pwc-if.c] usb_set_interface ret= 0
[pwc-if.c] pipe size is 164736
[pwc-if.c] epmaxpacketout= 0
[pwc-if.c] epmaxpacketin 196
[pwc-if.c] usb_pipeendpoint 5
[pwc-if.c] pipeout 0
[pwc-if.c] usb_maxpacket returns  196
[pwc-if.c] pipe size is 164736
[pwc-if.c] epmaxpacketout= 0
[pwc-if.c] epmaxpacketin 196
[pwc-if.c] usb_pipeendpoint 5
[pwc-if.c] pipeout 0
[pwc-if.c] usb_maxpacket returns  196
[pwc-if.c]  finished pwc_isoc_init()
[pwc-if.c] after pwc_try_video_mode :
[pwc-if.c] VIDIOCMCAPTURE done :
[pwc-if.c] pwc_video_ioctl
[pwc-if.c] case VIDIOCMCAPTURE:
VIDIOCMCAPTURE: 352x288, frame 1, format 15
[pwc-if.c] VIDIOCMCAPTURE done :
[pwc-if.c] pwc_video_ioctl
[pwc-if.c] case VIDIOCSYNC:

regards,
John

_________________________________________________________________
Protect your PC - get McAfee.com VirusScan Online 
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963


                 reply	other threads:[~2004-06-28  6:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BAY14-F34N1Xh2RtDQG0001ab2a@hotmail.com \
    --to=qwejohn@hotmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®