Hello,
Thnxs,Gerald.

First ,Gerald said:
but 5 should arouse suspicions when
there are only 2 endpoints in that setting.

if you look at the descriptor I have in /proc/bus/usb/devices or at the link
I added last time
(http://www.qbik.ch/usb/devices/showdescr.php?id=2515. ) you will see:



T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=12 MxCh= 0 D: Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1 P: Vendor=046d ProdID=08b2 Rev= 0.00 C:* #Ifs= 3 Cfg#= 1 Atr=a0 MxPwr=500mA I: If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=Philips webcam E: Ad=82(I) Atr=03(Int.) MxPS= 1 Ivl=32ms E: Ad=85(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms I: If#= 0 Alt= 1 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=Philips webcam E: Ad=82(I) Atr=03(Int.) MxPS= 1 Ivl=32ms E: Ad=85(I) Atr=01(Isoc) MxPS= 196 Ivl=1ms I: If#= 0 Alt= 2 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=Philips webcam E: Ad=82(I) Atr=03(Int.) MxPS= 1 Ivl=32ms E: Ad=85(I) Atr=01(Isoc) MxPS= 292 Ivl=1ms I: If#= 0 Alt= 3 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=Philips webcam E: Ad=82(I) Atr=03(Int.) MxPS= 1 Ivl=32ms E: Ad=85(I) Atr=01(Isoc) MxPS= 448 Ivl=1ms I: If#= 0 Alt= 4 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=Philips webcam E: Ad=82(I) Atr=03(Int.) MxPS= 1 Ivl=32ms E: Ad=85(I) Atr=01(Isoc) MxPS= 592 Ivl=1ms I: If#= 0 Alt= 5 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=Philips webcam E: Ad=82(I) Atr=03(Int.) MxPS= 1 Ivl=32ms E: Ad=85(I) Atr=01(Isoc) MxPS= 704 Ivl=1ms I: If#= 0 Alt= 6 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=Philips webcam E: Ad=82(I) Atr=03(Int.) MxPS= 1 Ivl=32ms E: Ad=85(I) Atr=01(Isoc) MxPS= 776 Ivl=1ms I: If#= 0 Alt= 7 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=Philips webcam E: Ad=82(I) Atr=03(Int.) MxPS= 1 Ivl=32ms E: Ad=85(I) Atr=01(Isoc) MxPS= 840 Ivl=1ms I: If#= 0 Alt= 8 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=Philips webcam E: Ad=82(I) Atr=03(Int.) MxPS= 1 Ivl=32ms E: Ad=85(I) Atr=01(Isoc) MxPS= 896 Ivl=1ms I: If#= 0 Alt= 9 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=Philips webcam E: Ad=82(I) Atr=03(Int.) MxPS= 1 Ivl=32ms E: Ad=85(I) Atr=01(Isoc) MxPS= 960 Ivl=1ms I: If#= 0 Alt=10 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=Philips webcam E: Ad=82(I) Atr=03(Int.) MxPS= 1 Ivl=32ms E: Ad=85(I) Atr=01(Isoc) MxPS= 960 Ivl=1ms .............. .............. ..............

As I understand  there are more than 2 (in fact, more than 5) EndPoints;


Second:
I did try to add usb_set_interface(pdev->udev, 0, 0)
before usb_set_interface(pdev->udev, 0, 1); and it still hangs in the same place.



Third:
I tried usb_set_interface(pdev->udev, 0, 3) and it works !
It does not solve my problem because I must have
alternate setting 0 (to be accurate, what I must have is it's mxPs which is 196
or lower) .When using alternate setting 3 I can grab with the webcam with no
problem ; and in kernel log I see that
MaxPacket size is 448 (and this is in accordance with alternate setting 3, see
above).


But still usb_pipeendpoint() and pdev->vendpoint returns 5 as before;
I do not understand from where is this "5" , in all three cases: when using alternate
setting 1 and 2 and 3. In fact I do not understand its meaning.


Fourth :
Gerald said:
Try getting the device status
just after changing the setting to see if the setting that you choose
did not stall the camera.

If you can be more specific: what and how should I do it (which method
to call and what to check ) in order to find out if the setting that I choose
did not stall the camera ,I will be thankful; I am quite a newbie in USB matters.



Regards, Q. John


From: [EMAIL PROTECTED]
To: John Que <[EMAIL PROTECTED]>
CC: [EMAIL PROTECTED]
Subject: Re: [linux-usb-devel] usb_set_interface() to a different alternate setting
Date: Tue, 29 Jun 2004 15:07:22 -0500


Quoting John Que <[EMAIL PROTECTED]>:

> 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 ?


There are cameras that stall when changing to alternate settings.  For
those types, it is necessary to stop the camera by changing to alternate
setting 0, and then choose another alternate setting.

> 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 ?)
>
This may be dependent on the device, but 5 should arouse suspicions when
there are only 2 endpoints in that setting.  Try getting the device status
just after changing the setting to see if the setting that you choose
did not stall the camera.

> 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 [EMAIL PROTECTED] 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
>

good luck,
gerald



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




-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to