Linux Media Controller development
 help / color / mirror / Atom feed
From: Oliver Collyer <ovcollyer@mac.com>
To: Andrey Utkin <andrey_utkin@fastmail.com>
Cc: linux-media@vger.kernel.org
Subject: Re: uvcvideo error on second capture from USB device, leading to V4L2_BUF_FLAG_ERROR
Date: Mon, 05 Sep 2016 23:32:10 +0300	[thread overview]
Message-ID: <A7196057-BFD6-4CF4-8386-7101688FC3F6@mac.com> (raw)
In-Reply-To: <20160905201935.wpgtrtt7e4bjjylo@zver>


> On 5 Sep 2016, at 23:19, Andrey Utkin <andrey_utkin@fastmail.com> wrote:
> 
> On Mon, Sep 05, 2016 at 10:43:49PM +0300, Oliver Collyer wrote:
>> I do not have any knowledge of uvcvideo and the associated classes apart from the studying I’ve done the past day or two, but it seems likely that error -71 and the later setting of V4L2_BUF_FLAG_ERROR are linked. Also, the fact it only happens in captures after the first one suggests something isn’t being cleared down or released properly in uvcvideo/v4l2-core at the end of the first capture.
>> 
>> Let me know what I need to do next to further narrow it down.
> 
> Have tried to reproduce this (with kernel 4.6.0 and fresh build of
> ffmpeg) with uvcvideo-driven laptop webcam, and it doesn't happen to me.
> Also -EPROTO in uvcvideo comes from low-level USB stuff, see
> drivers/media/usb/uvc/uvc_status.c:127:
> 
> 	case -EPROTO:		/* Device is disconnected (reported by some
> 				 * host controller). */
> 
> So it seems like hardware misbehaves. To further clairify situation, I
> have such question: do the devices work in other operation systems on
> the same machine?
> 

Yes, they work perfectly with dshow on Windows on on multiple PCs including this one.

> Reviewing your original email mentioning that two different devices
> reproduce same problem, which is apparently related to disconnection in
> the middle of USB communication, I came to me that the connected device
> may be underpowered. So,
> - try plugging your devices through reliable _active_ USB hub,
> - use the most reliable cables you can get,
> - plug into USB 3.0 port if available - it should provide more power
>   than 1.0 and 2.0.

I will experiment with different ports and report back.

Still, I’m not sure how that suggestion fits with the fact that it always works perfectly after "modprobe -r uvcvideo && modprobe uvcvideo” and only fails again once the capture is stopped and restarted?

Perhaps some kind of “quirk” can be added for these devices that does some extra clearing up/re-initializing at the start of the capture - kind of like *some* of what reloading the module does but only for the specific device.

> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


  reply	other threads:[~2016-09-05 20:32 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-03  9:24 uvcvideo error on second capture from USB device, leading to V4L2_BUF_FLAG_ERROR Oliver Collyer
2016-09-04 19:25 ` Andrey Utkin
2016-09-04 19:55   ` Oliver Collyer
2016-09-05 19:43   ` Oliver Collyer
2016-09-05 20:19     ` Andrey Utkin
2016-09-05 20:32       ` Oliver Collyer [this message]
2016-09-06 10:51       ` Oliver Collyer
2016-09-06 12:28         ` Andrey Utkin
2016-09-06 17:26           ` Oliver Collyer
2016-09-10  7:37           ` Oliver Collyer
2016-09-10 10:14             ` Andrey Utkin
2016-09-10 10:21               ` Oliver Collyer
2016-09-10 10:58                 ` Andrey Utkin
2016-09-10 11:11                   ` Oliver Collyer

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=A7196057-BFD6-4CF4-8386-7101688FC3F6@mac.com \
    --to=ovcollyer@mac.com \
    --cc=andrey_utkin@fastmail.com \
    --cc=linux-media@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