Re: /bsd: uvideo0: could not SET probe request: STALLED

2023-01-07 Thread Robert Alessi
On Tue, Dec 27, 2022 at 09:25:00PM +0100, Bodie wrote:
> This one may help a little too
> 
> https://community.silabs.com/s/article/the-role-of-stall-handshake-packet-in-usb-transfer?language=en_US

I would like to express again my grateful thanks for the help
provided.  I had the opportunity to test another webcam and Iridium
could use it without any problems.  So this issue could presumably be
hardware-related in the end.

What can be said is the webcam that Iridium couldn't access to is able
to go to a resolution up to 3840x2880 which I never could use with
video(1) without getting an mmap error message.  However, it can be
accessed in raw mode with e.g. fswebcam, so I can use my device as an
overhead scanner for books, which is fine.

For information, my limits are as follows:
$ ulimit -a
time(cpu-seconds)unlimited
file(blocks) unlimited
coredump(blocks) 0
data(kbytes) 1572864
stack(kbytes)4096
lockedmem(kbytes)87381
memory(kbytes)   16182924
nofiles(descriptors) 512
processes256

Could it be that Iridium unsuccessfully tried to probe the device via
mmap up to this resolution?

Anyway, the good news is that using another device now gives excellent
results.

Thank you!

-- Robert



Re: /bsd: uvideo0: could not SET probe request: STALLED

2022-12-27 Thread Bodie
On Tue Dec 27, 2022 at 7:38 PM CET, Robert Alessi wrote:
> On Tue, Dec 27, 2022 at 07:14:46PM +0100, Bodie wrote:
>
> [...]
>
> > You may find this interesting:
> > 
> > https://www.usb.org/documents?search=video%5B%5D=49%5B%5D=55_per_page=50
> > 
> > 4.3.1.1 Video Probe and Commit Controls
> > The streaming parameters selection process is based on a shared negotiation 
> > model between the
> > host and the video streaming interface, taking into account the following 
> > features:
> > -  shared nature of the USB
> > -  interdependency of streaming parameters
> > -  payload independence
> > -  modification of streaming parameters during streaming
> > This negotiation model is supported by the Video Probe and Commit controls. 
> > The Probe control
> > allows retrieval and negotiation of streaming parameters. When an 
> > acceptable combination of
> > streaming parameters has been obtained, the Commit control is used to 
> > configure the hardware
> > with the negotiated parameters from the Probe control.
> > 
> > Based on issues reported in Linux with various camera often pointing
> > to too big bandwith and fixing the problem with setting up
> > different stream size you may try to play with settings over
> > video(1) to set different formats for your stream as Chrome-based
> > browsers are probably trying to set camera differently then FF
> > (but is just my guess really based on info so far plus those
> > specs documents describing STALL protocol as well)
>
> Thank you again, quite relevant!  So I will try to play with different
> settings to see what happens.  Hopefully, I will succeed.  In any case
> I will report here the results.
>

This one may help a little too

https://community.silabs.com/s/article/the-role-of-stall-handshake-packet-in-usb-transfer?language=en_US

> I am truly grateful for your time.
>
> -- Robert



Re: /bsd: uvideo0: could not SET probe request: STALLED

2022-12-27 Thread Robert Alessi
On Tue, Dec 27, 2022 at 07:14:46PM +0100, Bodie wrote:

[...]

> You may find this interesting:
> 
> https://www.usb.org/documents?search=video%5B%5D=49%5B%5D=55_per_page=50
> 
> 4.3.1.1 Video Probe and Commit Controls
> The streaming parameters selection process is based on a shared negotiation 
> model between the
> host and the video streaming interface, taking into account the following 
> features:
> -  shared nature of the USB
> -  interdependency of streaming parameters
> -  payload independence
> -  modification of streaming parameters during streaming
> This negotiation model is supported by the Video Probe and Commit controls. 
> The Probe control
> allows retrieval and negotiation of streaming parameters. When an acceptable 
> combination of
> streaming parameters has been obtained, the Commit control is used to 
> configure the hardware
> with the negotiated parameters from the Probe control.
> 
> Based on issues reported in Linux with various camera often pointing
> to too big bandwith and fixing the problem with setting up
> different stream size you may try to play with settings over
> video(1) to set different formats for your stream as Chrome-based
> browsers are probably trying to set camera differently then FF
> (but is just my guess really based on info so far plus those
> specs documents describing STALL protocol as well)

Thank you again, quite relevant!  So I will try to play with different
settings to see what happens.  Hopefully, I will succeed.  In any case
I will report here the results.

I am truly grateful for your time.

-- Robert



Re: /bsd: uvideo0: could not SET probe request: STALLED

2022-12-27 Thread Robert Alessi
On Tue, Dec 27, 2022 at 06:30:10PM +0100, Bodie wrote:

[...]

> What does it say in usbdevs(8) output? (with multiple -v)

I have this:

$ usbdevs -vvv
Controller /dev/usb0:
[...]
addr 06: 2e5a:0b1d , 4K Document Camera
high speed, power 500 mA, config 1, rev 1.33, iSerial 01.00.00
driver: uvideo0
driver: uaudio0

> I suppose over video(1) it works correctly, right?

Yes, video(1) works perfectly, and so does ffplay to take just this one.

[...]

> > I tried hard so far to understand what this message could mean. Could
>  anynone give me some pointer?
> If you take a look in /usr/src/sys/dev/usb on files uvideo.{c,h} you
> will find aroudn the line 1628 your error:
> 
> error = usbd_do_request(sc->sc_udev, , probe_data);
> if (error) {
>   printf("%s: could not SET probe request: %s\n",
>   DEVNAME(sc), usbd_errstr(error));
>   return (USBD_INVAL);
> }
> 
> in uvideo.h is defined table 4.47 for Video probe and commit controls

Thank you so much!  I feel embarrassed for not having thought of doing
this.  Yet I still can't figure out why this error is triggered by
iridium, chromium and the like and not by firefox.  I will look into
this thoroughly.

> You may take a look at Linux issues for some ideas too
> https://bbs.archlinux.org/viewtopic.php?id=263649

Interesting.  This shows at least that the webcam may work with one
application and not with another.

> But maybe your camera is not exactly UVC standard 

You will find the model that I own here:
https://www.viisan.com/en/product/P4U.html

According to the specs, it is UVC-compliant and claimed to be "driver
free"...  But one never knows.  Before moving to OpenBSD I have used
it under linux without problem, but I have only ever used it with
firefox.  So I still have to test it with chromium under linux.

> or maybe it needs firmware which is not available for you under
> OpenBSD?

I tried to install uvideo-firmware-1.2p3.tgz with no success.  This
however comes as no surprise.

I would be *very interested* in any advice about a fully supported
high quality webcam under OpenBSD.  It should work with any major
browser.

Thank you so much again!

-- R.



Re: /bsd: uvideo0: could not SET probe request: STALLED

2022-12-27 Thread Bodie
On Tue Dec 27, 2022 at 6:30 PM CET, Bodie wrote:
> On Tue Dec 27, 2022 at 5:07 PM CET, Robert Alessi wrote:
> > Hi,
> >
> > This is a follow-up of
> > https://marc.info/?l=openbsd-misc=167188879329774=2
> >
> > My camera device is listed as follows:
> >
> > $ video -q -f /dev/video0
> > video device /dev/video0:
> >   encodings: yuy2
> >   frame sizes (width x height, in pixels) and rates (in frames per second):
> > 640x360: 30, 15, 10
> > 640x480: 30, 15, 10
> > 960x540: 15, 10
> > 1024x768: 10
> > 1280x720: 10
> >   controls: brightness, contrast, saturation, hue, gamma, sharpness,
> >   white_balance_temperature, backlight_compensation
> >
>
> What does it say in usbdevs(8) output? (with multiple -v) 
> I suppose over video(1) it works correctly, right?
>

You may find this interesting:

https://www.usb.org/documents?search=video%5B%5D=49%5B%5D=55_per_page=50

4.3.1.1 Video Probe and Commit Controls
The streaming parameters selection process is based on a shared negotiation 
model between the
host and the video streaming interface, taking into account the following 
features:
-  shared nature of the USB
-  interdependency of streaming parameters
-  payload independence
-  modification of streaming parameters during streaming
This negotiation model is supported by the Video Probe and Commit controls. The 
Probe control
allows retrieval and negotiation of streaming parameters. When an acceptable 
combination of
streaming parameters has been obtained, the Commit control is used to configure 
the hardware
with the negotiated parameters from the Probe control.

Based on issues reported in Linux with various camera often pointing
to too big bandwith and fixing the problem with setting up
different stream size you may try to play with settings over
video(1) to set different formats for your stream as Chrome-based
browsers are probably trying to set camera differently then FF
(but is just my guess really based on info so far plus those
specs documents describing STALL protocol as well)

> > When plugged in:
> >
> > # tail -f /var/log/messages
> > Dec 27 16:40:19 localhost /bsd: uvideo0 at uhub0 port 2 configuration 1 
> > interface 0 " 4K Document Camera" rev 2.00/1.33 addr 2
> > Dec 27 16:40:19 localhost /bsd: video0 at uvideo0
> > Dec 27 16:40:19 localhost /bsd: uaudio0 at uhub0 port 2 configuration 1 
> > interface 3 " 4K Document Camera" rev 2.00/1.33 addr 2
> > Dec 27 16:40:19 localhost /bsd: uaudio0: class v1, high-speed, sync, 
> > channels: 0 play, 2 rec, 2 ctls
> > Dec 27 16:40:19 localhost /bsd: audio1 at uaudio0
> >
> > Even so, I can't access it from some browsers, such as iridium,
> > chromium, otter-browser or qutebrowser.  As soon as I allow sharing
> > the device, I get an error message saying that the device is
> > inaccessible and may be used by another application.  Here is what I
> > get in /var/log/messages:
> >
> > # tail -f /var/log/messages 
> > Dec 27 16:59:10 localhost /bsd: uvideo0: could not SET probe request: 
> > STALLED
> >
> > I would add that firefox-esr can access it.
> >
> > I tried hard so far to understand what this message could mean. Could
>  anynone give me some pointer?
> If you take a look in /usr/src/sys/dev/usb on files uvideo.{c,h} you
> will find aroudn the line 1628 your error:
>
> error = usbd_do_request(sc->sc_udev, , probe_data);
> if (error) {
>   printf("%s: could not SET probe request: %s\n",
>   DEVNAME(sc), usbd_errstr(error));
>   return (USBD_INVAL);
> }
>
> in uvideo.h is defined table 4.47 for Video probe and commit controls
>
> You may take a look at Linux issues for some ideas too
> https://bbs.archlinux.org/viewtopic.php?id=263649
>
> But maybe your camera is not exactly UVC standard or maybe it needs
> firmware which is not available for you under OpenBSD?
>
> > I would be very grateful.
> >
> > -- Robert



Re: /bsd: uvideo0: could not SET probe request: STALLED

2022-12-27 Thread Bodie
On Tue Dec 27, 2022 at 5:07 PM CET, Robert Alessi wrote:
> Hi,
>
> This is a follow-up of
> https://marc.info/?l=openbsd-misc=167188879329774=2
>
> My camera device is listed as follows:
>
> $ video -q -f /dev/video0
> video device /dev/video0:
>   encodings: yuy2
>   frame sizes (width x height, in pixels) and rates (in frames per second):
>   640x360: 30, 15, 10
>   640x480: 30, 15, 10
>   960x540: 15, 10
>   1024x768: 10
>   1280x720: 10
>   controls: brightness, contrast, saturation, hue, gamma, sharpness,
>   white_balance_temperature, backlight_compensation
>

What does it say in usbdevs(8) output? (with multiple -v) 
I suppose over video(1) it works correctly, right?

> When plugged in:
>
> # tail -f /var/log/messages
> Dec 27 16:40:19 localhost /bsd: uvideo0 at uhub0 port 2 configuration 1 
> interface 0 " 4K Document Camera" rev 2.00/1.33 addr 2
> Dec 27 16:40:19 localhost /bsd: video0 at uvideo0
> Dec 27 16:40:19 localhost /bsd: uaudio0 at uhub0 port 2 configuration 1 
> interface 3 " 4K Document Camera" rev 2.00/1.33 addr 2
> Dec 27 16:40:19 localhost /bsd: uaudio0: class v1, high-speed, sync, 
> channels: 0 play, 2 rec, 2 ctls
> Dec 27 16:40:19 localhost /bsd: audio1 at uaudio0
>
> Even so, I can't access it from some browsers, such as iridium,
> chromium, otter-browser or qutebrowser.  As soon as I allow sharing
> the device, I get an error message saying that the device is
> inaccessible and may be used by another application.  Here is what I
> get in /var/log/messages:
>
> # tail -f /var/log/messages 
> Dec 27 16:59:10 localhost /bsd: uvideo0: could not SET probe request: STALLED
>
> I would add that firefox-esr can access it.
>
> I tried hard so far to understand what this message could mean. Could
 anynone give me some pointer?
If you take a look in /usr/src/sys/dev/usb on files uvideo.{c,h} you
will find aroudn the line 1628 your error:

error = usbd_do_request(sc->sc_udev, , probe_data);
if (error) {
printf("%s: could not SET probe request: %s\n",
DEVNAME(sc), usbd_errstr(error));
return (USBD_INVAL);
}

in uvideo.h is defined table 4.47 for Video probe and commit controls

You may take a look at Linux issues for some ideas too
https://bbs.archlinux.org/viewtopic.php?id=263649

But maybe your camera is not exactly UVC standard or maybe it needs
firmware which is not available for you under OpenBSD?

> I would be very grateful.
>
> -- Robert