Page 23 of 33

Re: USB - the Elephant in our Room

Posted: Wed Oct 03, 2012 1:24 pm
by Karbono
alright, I thought I'd post this here, since it seems related:

I have a RPi running Raspbmc and I connected an old Mustek VCAM-300 webcam via a powered USB hub. I can get screenshots from it using:

Code: Select all

streamer -c /dev/video0 -b 10 -o /home/pi/outfile.jpeg
Thing is, after a couple of times, the device "disappears" and I get these errors:

Code: Select all

v4l2: ioctl(fildes = 3 "/dev/video0 (deleted)", request = VIDIOC_DQBUF, struct v4l2_buffer *data = { index = 0, type = V4L2_BUF_TYPE_VIDEO_CAPTURE, memory = V4L2_MEMORY_MMAP }) failed, No such device (19, ENODEV)
libv4l2: error dequeuing buf: No such device
v4l2: ioctl(fildes = 3 "/dev/video0 (deleted)", request = VIDIOC_DQBUF, struct v4l2_buffer *data = { index = 0, type = V4L2_BUF_TYPE_VIDEO_CAPTURE, memory = V4L2_MEMORY_MMAP }) failed, No such device (19, ENODEV)^C
^C - one moment please
libv4l2: error turning off stream: No such device
ioctl VIDIOC_STREAMOFF: No such device
v4l2: ioctl(fildes = 3 "/dev/video0 (deleted)", request = VIDIOC_REQBUFS, struct v4l2_requestbuffers *data = { count = 0, type = V4L2_BUF_TYPE_VIDEO_CAPTURE, memory = V4L2_MEMORY_MMAP }) failed, Device or resource busy (16, EBUSY) because the video4linux character special device is in use by another process or by the system and this prevents the ioctl VIDIOC_REQBUFS system call from operating
I stop the process with CTRL+C and when I try the command again:

Code: Select all

pi@raspberrypi ~ $ streamer -c /dev/video0 -b 10 -o /home/pi/outfile5.jpeg
files / video: JPEG (JFIF) / audio: none
v4l2: open: open(pathname = "/dev/video0", flags = O_RDWR) failed, No such file or directory (2, ENOENT) because there is no "video0" regular file in the pathname "/dev" directory; did you mean the "video1" usb video4linux character special device instead?
vid-open: failed: libv4l
no grabber device available
I need to reconnect the webcam in order to make it work again.

Here's another example when I execute the command several times in a row:

Code: Select all

pi@raspberrypi ~ $ streamer -b 10 -o /home/pi/outfile5.jpeg
files / video: JPEG (JFIF) / audio: none
pi@raspberrypi ~ $ streamer -b 10 -o /home/pi/outfile5.jpeg
files / video: JPEG (JFIF) / audio: none
libv4l2: error turning on stream: Connection timed out
v4l2: ioctl(fildes = 3 "/dev/video0", request = VIDIOC_STREAMON, int *data = { V4L2_BUF_TYPE_VIDEO_CAPTURE }) failed, Connection timed out (110, ETIMEDOUT)
v4l2: oops: select timeout
v4l2: oops: select timeout
v4l2: oops: select timeout
^C^C - one moment please
I know the messages I get probably don't help, since they're just a consequence of the device getting disconnected.... :(

Re: Devices that work and don't

Posted: Wed Oct 03, 2012 2:19 pm
by insanityideas
Itsnothing todo with poly the fuse... the receiver uses way less power than my trusty wired turn of the century optical mouse. At the moment its just an annoyance, as any poject I am likely todo would not require regular keyboard and mouse interaction, ut it does stop hacking about in python or scratchon the thinggggggggggggggg. Ad my oru posts loklike the rabings of a crazy!!!
thradtke wrote: Have you brigded the polyfuses? Maybe the dongle runs on the edge here. Just guessing, of course.

Directly on the Pi's hub, I never had keyboard problems, no matter what I did. Things start getting bad when using a subsequent hub and mixing protocols on it.

Re: USB - the Elephant in our Room

Posted: Thu Oct 18, 2012 6:07 am
by fbutler
gsh wrote:
So I do have another fix available (which will improve the latency further) but it may make some problems worse (like talking to a USB1 keyboard with integrated hub)...


What is likely to work and what is less likely...

1) USB2.0 devices work better than 1.0 or 1.1
You can check if a device is USB 2.0 by doing 'lsusb -v' and looking for the device bcdUSB version it will be 2.0 1.1 or 1.0)

2) USB 1.0 devices, don't use an extra USB hub only one USB1 device per port.

3) Bulk and Interrupt work better than isochronous, (this is mostly assumption from the stuff we've got from your reports). I'm assuming that we're getting hit by the occasional terrible interrupt latency and the streaming camera's / audio devices are over-running their fifo's.


Will try to make another bug fix in the next few days ...

Gordon
Hi, Any updates on when the latest fix will be available for testing?

Re: USB - the Elephant in our Room

Posted: Thu Oct 18, 2012 6:37 am
by jamesh
Been very busy at work last week or two, not sure how much Gordon will have managed to get done, so no news at the moment.

Re: USB - the Elephant in our Room

Posted: Thu Oct 18, 2012 7:20 am
by fbutler
jamesh wrote:Been very busy at work last week or two, not sure how much Gordon will have managed to get done, so no news at the moment.
OK, thanks for the update

Re: USB - the Elephant in our Room

Posted: Thu Oct 18, 2012 11:13 am
by Burngate
jamesh wrote:Been very busy at work last week or two
C'mon! What's more important, earning enough to pay the mortgage and feed the kids, or the Pi?

Re: USB - the Elephant in our Room

Posted: Thu Oct 18, 2012 11:40 am
by gsh
Unfortunately I've been unable to create a more credible improvement for the USB issues we currently have. Improvements to latency actually have a detrimetal effect to some types of transport (split transactions) which isn't going to be fixed any time soon.

So instead I've been spending a little time horsing around with the EHCI interface to see if I can create a software implementation of the EHCI host interface for the DWC_OTG hardware, this would solve our problems because then we can push this code onto the VPU which has a very low interrupt latency and interrupt overhead.

But unfortunately it is going to take time and I could probably do with some volunteers to help do the EHCI interface. I'm hoping to get a simple one in place first (that works with most simple transactions) then people can begin helping in the spirit of open software!

Thanks

Gordon

Re: USB - the Elephant in our Room

Posted: Thu Oct 18, 2012 11:51 am
by jamesh
ECHI??

Re: USB - the Elephant in our Room

Posted: Thu Oct 18, 2012 12:16 pm
by thradtke
Could anyone summarize where we are now? What works and what doesn't?

Could a new board revision fix the problems?

Re: USB - the Elephant in our Room

Posted: Thu Oct 18, 2012 12:56 pm
by jamesh
thradtke wrote:Could anyone summarize where we are now? What works and what doesn't?

Could a new board revision fix the problems?
Changes to the board (except to change the SoC) would make little difference. Gordon could summarise when he gets time.

Re: USB - the Elephant in our Room

Posted: Fri Oct 19, 2012 12:29 am
by p4trykx
So Model A will have the same issues with USB? I thought that the lan/hub chip was to blame.

Re: USB - the Elephant in our Room

Posted: Fri Oct 19, 2012 2:13 am
by Lob0426
p4trykx wrote:So Model A will have the same issues with USB? I thought that the lan/hub chip was to blame.
No it apppears the problem is with the USB drivers from the SoC. They are working on it.

Re: USB - the Elephant in our Room

Posted: Fri Oct 19, 2012 5:20 am
by thradtke
jamesh wrote:Changes to the board (except to change the SoC) would make little difference.
Maybe Broadcom could *modify* the SoC? I imagine these problems might show up on handhelds also.

Re: USB - the Elephant in our Room

Posted: Fri Oct 19, 2012 8:06 am
by jamesh
thradtke wrote:
jamesh wrote:Changes to the board (except to change the SoC) would make little difference.
Maybe Broadcom could *modify* the SoC? I imagine these problems might show up on handhelds also.
Approximate cost to modify the SoC to use a different USB controller, about $3M? Seriously.

The reason the problem doesn't exhibit on handhelds is that they are generally not USB hosts, which is where the problem arises.

Re: USB - the Elephant in our Room

Posted: Fri Oct 19, 2012 8:24 am
by p4trykx
Is there a possibility to use external USB controller in future models?
It would be a little more expensive but probably less than $3 milion ;-).
I have a router with some Broadcom SoC which uses VIA USB controller and it works with all USB devices.

Re: USB - the Elephant in our Room

Posted: Fri Oct 19, 2012 1:06 pm
by javatmn
I appreciate the hardwork Gordon and others made on this issue, but knowing there is little hope to fix it is really disappointing :(

Re: USB - the Elephant in our Room

Posted: Fri Oct 19, 2012 1:41 pm
by Trafalgar
jamesh wrote:Disagree with the conclusion on Pt5. The USB system is not broken, but there do appear to be issues for SOME people. It is being looked at (recent software release for the USB interrupts/s issue for example).

The Foundation does pay attention on on stuff like this!
You've got to be joking. My kid has just got one of these bits of rubbish machines. Mouse won't work (it's new), no help, no support and still same nonsense with power cables and power settings, x months later.

Way to put a 10 year old off computing with bad components (the flash memory shipped with the machine didn't work either) and unfathomable geekery and a lack of guidance. :(

I really just want my money back now.

Re: USB - the Elephant in our Room

Posted: Fri Oct 19, 2012 1:52 pm
by jamesh
Trafalgar wrote:
jamesh wrote:Disagree with the conclusion on Pt5. The USB system is not broken, but there do appear to be issues for SOME people. It is being looked at (recent software release for the USB interrupts/s issue for example).

The Foundation does pay attention on on stuff like this!
You've got to be joking. My kid has just got one of these bits of rubbish machines. Mouse won't work (it's new), no help, no support and still same nonsense with power cables and power settings, x months later.

Way to put a 10 year old off computing with bad components (the flash memory shipped with the machine didn't work either) and unfathomable geekery and a lack of guidance. :(

I really just want my money back now.
So, the >half a million people who seem to get on fine are lying?

Instead of going off on one, why not ask some questions to try and get the problem sorted? Of course, unfathomable geekery we can't do much about, but we can try and help with some guidance, if you go about it the right way. You have claimed 'no help' and yet this is only your second post - you haven't even asked for help here which is the first point of call, so I'd have to take you to task on that one.

Firstly, what do you mean by the 'flash memory' not working. Was the SD card corrupt in some way, or some other issue? What do you mean by cables and power issues? We haven't had any issues in this area commented on here for some time, so can you give us some idea of where your problem lies in this area.

As to the mouse not working, I presume you have got to the stage of the desktop starting up, and at that point he mouse doesn't work. Does the keyboard work? Does the mouse work in another machine (i.e. is it broken). Is it a wired or a wireless mouse - in afct what sort of mouse is it?

Please give us something to work on...

Re: USB - the Elephant in our Room

Posted: Fri Oct 19, 2012 1:53 pm
by RaTTuS
Trafalgar wrote:
jamesh wrote:Disagree with the conclusion on Pt5. The USB system is not broken, but there do appear to be issues for SOME people. It is being looked at (recent software release for the USB interrupts/s issue for example).

The Foundation does pay attention on on stuff like this!
You've got to be joking. My kid has just got one of these bits of rubbish machines. Mouse won't work (it's new), no help, no support and still same nonsense with power cables and power settings, x months later.

Way to put a 10 year old off computing with bad components (the flash memory shipped with the machine didn't work either) and unfathomable geekery and a lack of guidance. :(

I really just want my money back now.
erm it is more than likely not a usb problem but something else - post in a help thread
ranting hear wont help
if you want cash back then go to the supplier not the usb thread

Re: USB - the Elephant in our Room

Posted: Fri Oct 19, 2012 1:55 pm
by jamesh
javatmn wrote:I appreciate the hardwork Gordon and others made on this issue, but knowing there is little hope to fix it is really disappointing :(
Who said there was little hope? Whilst there are still avenues to explore, there is always hope!

Re: USB - the Elephant in our Room

Posted: Fri Oct 19, 2012 1:57 pm
by thradtke
jamesh wrote:Approximate cost to modify the SoC to use a different USB controller, about $3M? Seriously.
That's not much to get a bugfree Pi and an entry to other markets where the USB controller matters, so I'm in good faith we'll see a solution sooner or later :-).

Re: USB - the Elephant in our Room

Posted: Fri Oct 19, 2012 2:29 pm
by fbutler
jamesh wrote:
javatmn wrote:I appreciate the hardwork Gordon and others made on this issue, but knowing there is little hope to fix it is really disappointing :(
Who said there was little hope? Whilst there are still avenues to explore, there is always hope!
Indeed. Gordon's latest update, with the change in approach, makes me more hopeful than ever that a GOOD fix will be found!
gsh wrote:So instead I've been spending a little time horsing around with the EHCI interface to see if I can create a software implementation of the EHCI host interface for the DWC_OTG hardware, this would solve our problems because then we can push this code onto the VPU which has a very low interrupt latency and interrupt overhead.

Re: USB - the Elephant in our Room

Posted: Fri Oct 19, 2012 3:28 pm
by jamesh
thradtke wrote:
jamesh wrote:Approximate cost to modify the SoC to use a different USB controller, about $3M? Seriously.
That's not much to get a bugfree Pi and an entry to other markets where the USB controller matters, so I'm in good faith we'll see a solution sooner or later :-).
$3M spent, on a 3 year old chip when there are much better ways to make money...??? Also, time to do it, about 9-12 months, by which time the chip is even more out of date.

I'm thinking a SW solution..

Re: USB - the Elephant in our Room

Posted: Fri Oct 19, 2012 9:40 pm
by obcd
And how long will it take for a software solution assuming we have one (maybe 2) person(s) working on it in spare time? :(
Maybe a rev. C Pi will be announced soon with a broadcom soc using another
usb implementation, the same way the 512Mbyte Pi suddenly saw the light?
I understand this has to remain a secret as there is still plenty of rev. B stock that needs to be sold.

Re: USB - the Elephant in our Room

Posted: Fri Oct 19, 2012 11:34 pm
by rmistero
Oye !

Like some others my board happens to have problems even without USB devices connected it just the NIC is enough to hang the USB system.. Let's say it comes from a bad batch.. Fair enough.. RMA... 1 in a 1000 Eben says..
But reading this thread I'm really confused about the aim of this board... it aims to be cheap/affordable but then you need to buy expensive class 10 SD card, expensive good PSU, expensive good keyboard... So it is cheap for the foundation, it is not for the poor children... Really good for specialised Electronic shops..

Also, I could read here and there that it was not designed to be used with Wifi adapters or exotic USB adapters like an external HDD.. ( elinux wiki on USB,..), just keyboard and mouse...

The 80's are long time gone..

Anyway, since it seems it was about the children in mind when designed,bla bla bla.. as far as I know, home users use WiFi nowadays. Ok.. It is a computer for "poor" children with a TV (a quite recent/expensive one with a HDMI port) and the TV is 2-10M away from the router modem but that's OK because they are poor so they are supposed to live in small council flats hence no need for WiFi in first place and actually they didn't have Internet.. Same goes with schools.. Everyone knows that schools are rich and can buy 20+ TVs with HDMI ports..

Basically without a steady reliable USB system, this board is useless.. Everyone knows it, especially the "foundation"...

I really like this expression "the Elephant in our Room" . It is perfect, no need to add more, the rest was just bla bla bla and self pity.. Specially this very post.. but it is therapeutic... :p