User avatar
Mortimer
Posts: 809
Joined: Sun Jun 10, 2012 3:57 pm

Re: USB - the Elephant in our Room

Thu Aug 09, 2012 8:02 pm

The Labtec keyboards behave in the same way as most wired USB mice. Plug them via the little adapter and the internal logic of the keyboard behaves as a PS/2 keyboard instead.

obcd
Posts: 917
Joined: Sun Jul 29, 2012 9:06 pm

Re: USB - the Elephant in our Room

Thu Aug 09, 2012 8:03 pm

If the keyboards come with a ps/2-usb adapter, they should be usb compliant. The lower voltage shouldn't be an issue in that case.
Honestly, I have never seen a keyboard with such an adapter. They are very common on mice. It proves again that the Pi is a good learning device...
An usb memory stick need more than the 100mA provided by the Pi to operate. Connect it to a bus powered hub and to your pc, and it will complain about using 2 power as well. It's like that by design, and I don't think someone ever told that such a device could be connected directly without issues. If there really is a need for such a setup, you can bridge the polyfuses and solder a wire from the 5V to the supply pin's of the usb connectors. If your supply adapter is up to the job, the usb stick will work happily ever after. Be aware that this will void your warranty. lsusb -vv shows a lot of information about your connected usb devices, including the current they need to operate. Manufactures sometimes lie about this, but the device will never consume less than indicated there.

juggle
Posts: 9
Joined: Thu Aug 02, 2012 1:44 pm

Re: USB - the Elephant in our Room

Thu Aug 09, 2012 8:08 pm

jamesh wrote:...
Can you supply information on the particular PS2 adapter you are using, might make it easier to see what the problem is. Also, do USB keyboards/mice work ok? Which should prove whether it's the adapter or not.
It is one of these.

I don't have any USB keyboards or mice, which is why I bought this adapter.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 18192
Joined: Sat Jul 30, 2011 7:41 pm

Re: USB - the Elephant in our Room

Thu Aug 09, 2012 8:20 pm

juggle wrote:
jamesh wrote:...
Can you supply information on the particular PS2 adapter you are using, might make it easier to see what the problem is. Also, do USB keyboards/mice work ok? Which should prove whether it's the adapter or not.
It is one of these.

I don't have any USB keyboards or mice, which is why I bought this adapter.
Shame about lack of USB stuff - we throw the damn things away at work when new desktops come in. Been trying to persuade them to donate to me to then donate elsewhere but some dodgy recycling rule or iomething means they prefer to send them to ewaste handlers for disposal. Bonkers.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Please direct all questions to the forum, I do not do support via PM.

User avatar
abishur
Posts: 4478
Joined: Thu Jul 28, 2011 4:10 am
Location: USA
Contact: Website

Re: USB - the Elephant in our Room

Thu Aug 09, 2012 8:22 pm

Jim JKla wrote:Could be that keyboard has been built as a USB it would be interesting if that adaptor will work with a wide range of keyboards.
As one who has had such convertors in the past the answer is no. At least on the keyboards I tried it with (which was really sad to me since one of them was, and always shall be the most amazing keyboard ever)
Dear forum: Play nice ;-)

pygmy_giant
Posts: 1562
Joined: Sun Mar 04, 2012 12:49 am

Re: USB - the Elephant in our Room

Thu Aug 09, 2012 8:24 pm

I successfully use a ps2 maouse and a ps3 keyboard with the Pi via an active converter

its one of these: http://www.ebay.co.uk/itm/USB-Male-to-2 ... 23208638e4

- I agree with abishur - you cant beat the good responsive 'clack' of an olden fashioned keyboard!

User avatar
abishur
Posts: 4478
Joined: Thu Jul 28, 2011 4:10 am
Location: USA
Contact: Website

Re: USB - the Elephant in our Room

Thu Aug 09, 2012 8:46 pm

pygmy_giant wrote:I successfully use a ps2 maouse and a ps3 keyboard with the Pi via an active converter - cant beat the good responsive 'clack' of an olden fashioned keyboard!
Ah, that raises an important distinction here. *Active* PS/2 convertors (which are extremely hit and miss even on my Windows Box) have a fairly good chance of working. *Passive* convertors PS/2 are much more sporadic, depend on the keyboard or mouse to have the ability to act as a USB device to begin with, and, from what I'm hearing, must be used with a powered USB hub (or the USB currant work around that Lob has worked out)
Kernel wrote:The recent discussion has prompted me to reply to this thread.

1, To those saying the problem is rare:
I have two Pis - one from Farnell, one from RS made of different components in different weeks, powered by good power supplies (not chargers, one of them being the official RS's supply)

I have intended to run them headless and have an usb stick connected to them to provide some storage space. This USB stick can't be used on neither of them, as in each case it appears as if it was disconnect and then appears as a new usb device later (sda..sdb..). The time it takes for this to happen depends on the usage. Simple test to make this always happen - I've not been able to successfully complete mkfs on it - ever.
Interestingly if instead of the USB stick, the sd card is used for writing, the Pis run flawlessly even with heavy ethernet usage.

I don't consider USB mass storage a nonstandard USB device and writing/reading/even formatting unconcievable usage scenario.
So your argument that this isn't rare is that the same *single* device didn't work on both your pis?
2,
To those saying it's power causing the issues

Wasn't the USB power connector presented as something to make it easy for people to reuse what they already have - with those in 3rd world countries that are worse off in mind as well?
Turns out it's the exact opposite, causing problems, making people (who can afford to) buy and try all sorts of PSUs, hubs..
Actually, the issue with regards to power is not that there isn't enough power coming into the device, but that the USB ports have fuses limiting the amount of power heading *out* of the Pi. Now my two cents on future revisions of the pi is that the fuses on the USB ports need to be upped to 500mA and the limiting fuse at the power port needs to be upped by an Amp. If that means that there needs to be an extra fuse in front of the SoC, that's fine by me, but I'm not the one who has to weigh the pros/cons of the various components and price increases that might bring ;-)
3, To those saying the Pi was not intended to do this, people are not being paid, etc... [snip]
It depends on what you're referring to what people are saying the pi isn't intended to do. If you mean plug in a thumb drive, I personally would say the pi should be designed to do this and things need to be rectified so it can. If you're talking about hooking 5 usb->serial devices then be a little realistic here! I would also point out that your cheap nasbox had others work out *all* the details for you to do what it's done. It had it's bug stage but you came on late enough in the game to skip over it.

Of course this stuff is frustrating. *NO ONE* is trying to deny that. What people are trying to do is say let's all take a deep breath and let those who know how to fix this kind of thing have time to do so before we go rampaging around calling it a piece of junk because it doesn't work with the exact setup you have; especially if that particular setup involves support of legacy ports.
Dear forum: Play nice ;-)

User avatar
Jim JKla
Posts: 2218
Joined: Sun Jan 29, 2012 11:15 pm
Location: Newcastle upon Tyne UK

Re: USB - the Elephant in our Room

Thu Aug 09, 2012 8:55 pm

pygmy_giant wrote:I agree with abishur - you cant beat the good responsive 'clack' of an olden fashioned keyboard!
I have to agree the squish of a spectrum was not quite the same but without that squish I would not be here. ;)
Noob is not derogatory the noob is just the lower end of the noob--geek spectrum being a noob is just your first step towards being an uber-geek ;)

If you find a solution please post it in the wiki the forum dies too quick

pygmy_giant
Posts: 1562
Joined: Sun Mar 04, 2012 12:49 am

Re: USB - the Elephant in our Room

Thu Aug 09, 2012 8:59 pm

theres a fetish for you - I bet you could sell clothing made from those keyboard membranes to a very niche market on the web for considerable sums

of course there's no real reason why we have to use the usb for keyboard input - my I2C add-on board has a PS2 slot and someone else is working on a GPIO / mouse / keyboard interface
Last edited by pygmy_giant on Thu Aug 09, 2012 9:13 pm, edited 1 time in total.

obcd
Posts: 917
Joined: Sun Jul 29, 2012 9:06 pm

Re: USB - the Elephant in our Room

Thu Aug 09, 2012 9:13 pm

You could take the usb voltage from before the main polyfuse, since both ports have their own fuse.
Like that, you don't need an extra fuse for the soc.
It would suprise me that in case of a short the soc will survive and the fuse will trip. So you could even ask yourself, what is it protecting. Maybe it trips fast enough to protect the supply?
Are the pcb tracks to the usb connectors thick enough for 500mA? If so, you could bridge the main polyfuse with a zero ohm resistor or a wire, and solder 2 500mA polyfuses over the usb ones.
As told before, this will void your warranty. It could make things a little more stable as it will remove the voltage drop over the main polyfuse and will make the TP1 - TP2 voltage closer to 5V (unless you are using a 5.2V adapter)

p4trykx
Posts: 127
Joined: Wed Jan 11, 2012 2:55 pm

Re: USB - the Elephant in our Room

Thu Aug 09, 2012 9:41 pm

A see the voltage advices all over the forum. But is the precise voltage so crucial? I imagine that majority of electronics operate at 3.3V so those ~5V are dropped by a regulator. I'm not an electronic engineer. I have only experience with some Attinys and 1-wire devise which seem to be very tolerable.

rspitz
Posts: 55
Joined: Tue Jul 31, 2012 7:25 pm

Re: USB - the Elephant in our Room

Thu Aug 09, 2012 9:57 pm

gsh wrote:[...]there is a deficiency in the driver which means we're limited currently to a maximum of 8 periodic endpoints, this is because the driver reserves a channel (of which there are eight) for each periodic endpoint. Now I believe that for each hub port you have at least one interrupt endpoint so once you get to seven hub ports then you run out of channels!
Just got bitten by this: A D-Link DUB-H7 (which does have success stories on the "working devices list", but also some failure reports) connected to my RPi as only USB device and nothing connected to its ports except the Pi itself (for power via a USB-to-MicroUSB cable) gives the following result:

Code: Select all

lsusb -v | grep Transfer
          Transfer Type            Interrupt
          Transfer Type            Interrupt
          Transfer Type            Interrupt
          Transfer Type            Bulk
          Transfer Type            Bulk
          Transfer Type            Interrupt
          Transfer Type            Interrupt
          Transfer Type            Interrupt
          Transfer Type            Interrupt
          Transfer Type            Interrupt
Plugging in my first PL2303 adapter worked, I could read data off of it. But after plugging in the second one and stopping/restarting the data flow on the first one, I got the following error in dmesg:

Code: Select all

[ 3541.604279] INFO:: periodic_channel_available: Total channels: 8, Periodic: 5, Non-periodic: 3
[ 3541.604296]
[ 3541.604317] INFO:: schedule_periodic: No host channel available for periodic transfer.
[ 3541.604329]
[ 3541.604411] ERROR::dwc_otg_hcd_urb_enqueue:518: DWC OTG HCD URB Enqueue failed adding QTD. Error status -4008
[ 3541.604426]
[ 3541.604499] pl2303 ttyUSB0: pl2303_open - failed submitting interrupt urb, error -4008

I wonder how any 7-Port hubs could be made to work with a RPi, see the success stories. Anyway, I'll return the DUB-H7 and get a recommended 4-port Hub.

obcd
Posts: 917
Joined: Sun Jul 29, 2012 9:06 pm

Re: USB - the Elephant in our Room

Thu Aug 09, 2012 10:00 pm

The core of modern cpu's and the memory can even run on lower voltages like 2.5 or 1.8.
The Pi doesn't seem to like it if the voltage goes belong 4.85V. There are also the connected usb devices. There is a protection polyfuse on the usb ports that also causes a small voltage drop. Due to that, the voltage that arrives on connected devices can become even lower. Some usb to micro usb cables have very thin wires, and this can also cause a voltage drop. I assume some low cost adapters which are basically intended as device chargers don't deliver a very stable voltage, since for charging a battery that isn't very important. So yes, the Pi is rather strict upon it's supply voltage.
Let's just say that the idea of using a micro usb power plug so that any universal 5V supply with such a plug could be used didn't work out as expected. I have the RS proposed adapter which is rated at 1.2 Amps and doesn't even cost 10 euro, and I can recommend it. I have a nice 5.02 volts between TP1 and TP2.

drgeoff
Posts: 7443
Joined: Wed Jan 25, 2012 6:39 pm

Re: USB - the Elephant in our Room

Thu Aug 09, 2012 10:08 pm

abishur wrote:Ah, that raises an important distinction here. *Active* PS/2 convertors (which are extremely hit and miss even on my Windows Box) have a fairly good chance of working. *Passive* convertors PS/2 are much more sporadic, depend on the keyboard or mouse to have the ability to act as a USB device to begin with, and, from what I'm hearing, must be used with a powered USB hub (or the USB currant work around that Lob has worked out)
I'm not convinced there is a marked difference in the chances of working. Mahhjong says that PS/2 keyboards won't work down to as a voltage as USB keyboards and that is why they are more problemmatic. I very much doubt that the active converters do other than pass the 5 volt input they get from the USB side on to the PS/2 keyboard side. So whether an active converter or passive adapter is used, the low voltage kicker will apply.

secretagent
Posts: 36
Joined: Wed Mar 07, 2012 10:09 am

Re: USB - the Elephant in our Room

Thu Aug 09, 2012 10:12 pm

jamesh wrote:What interesting is that this driver was supplied by Synopsis, and not by the Foundation or Broadcom. The Synopsis Verilog is used quite a lot in the field, as is this driver. And yet, the problem is only really coming to light now. And yet, looks who's getting all the grief....
I could be wrong but I think in the vast majority of the cases this usb core has been used as a device and not as host, which is important for several reasons:

The responsibilities of a USB device are significantly smaller than those of the host, so more complex code is required for the host driver than for the device driver. And of course with more complex code the probability of bugs is a lot higher.

The device part of the driver is probably more mature as it has had much more opportunity for the problems to be discovered and fixed by now.

The device only connects to one host, whereas the host may need to handle many devices and it has been observed that at least some of the problems here seem to be related to a higher number of devices being connected. This distinction also applies to cases where the core is used as a host but in the majority of the use cases only one device (e.g. a usb storage device) is being used.

obcd
Posts: 917
Joined: Sun Jul 29, 2012 9:06 pm

Re: USB - the Elephant in our Room

Thu Aug 09, 2012 10:50 pm

So, the foundation designed the Pi with a Broadcom Soc as central hart.
As Eben and others of the foundation work at Broadcom, it's a logical choice.
What I don't understand is how I need to place synopsis, verilog and the driver in the picture.
(It's just curiousity.) If I am correct, verilog is a language used to create fpga designs, and probably chip designs as well? The driver is the piece of software that connects the hardware to the OS...?Could someone please fill in the missing pieces or is that a company secret? (Sorry for going a little of topic.)

asb
Forum Moderator
Forum Moderator
Posts: 853
Joined: Fri Sep 16, 2011 7:16 pm
Contact: Website

Re: USB - the Elephant in our Room

Thu Aug 09, 2012 10:57 pm

obcd wrote:So, the foundation designed the Pi with a Broadcom Soc as central hart.
As Eben and others of the foundation work at Broadcom, it's a logical choice.
What I don't understand is how I need to place synopsis, verilog and the driver in the picture.
(It's just curiousity.) If I am correct, verilog is a language used to create fpga designs, and probably chip designs as well? The driver is the piece of software that connects the hardware to the OS...?Could someone please fill in the missing pieces or is that a company secret? (Sorry for going a little of topic.)
The BCM2835 is the SoC used in the Raspberry Pi. Broadcom chose to license intellectual property from Synopsys for the USB controller (DesignWare USB 2.0 OTG Controller). This is the block of hardware used on the chip, and they also provide a driver. As others have pointed out, the host mode is used more rarely which is partly why so many problems have cropped up despite the fact it's a widely used piece of IP.

obcd
Posts: 917
Joined: Sun Jul 29, 2012 9:06 pm

Re: USB - the Elephant in our Room

Thu Aug 09, 2012 11:20 pm

Thanks for clearing that up.
So basically, other arm based designs could be using the same synopsis usb otg hardware and driver?
I understand most of them are found in consumer devices like smartphones, tablets, gpses, mp3 players,..all systems that only need an usb device port. Maybe occasionally someone will connect an usb memory device to a tablet or a 3G stick, but I don't see many connecting a hub and multiple devices to their tablet. This very well explains why the issues were not seen before. I assume a model A is showing the same behavour so that we can rule out the extra hub chip with it's integrated ethernet adapter as being responsable for the missing packets? (Sorry, to lazy to look up the number in the schematics.)

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 9660
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: USB - the Elephant in our Room

Fri Aug 10, 2012 1:35 am

Yeah, I forgot about those "passive USB adapters", these are a very special case.
In this case the keyboard that can be used with such adapters is designed as an USB keyboard, but it was designed in a time that USB slots on PC's were actually rare, and perhaps even more important PC's equipped with USB often had a BIOS that couldn't cope with USB keyboards (so you could not set your BIOS using an USB keyboard).
So someone came up with the idea to create a hybrid USB\PS/2 keyboard, one that had a PS/2 connector, but with a "passive adapter" you could re-wire the "PS/2 wires" as an USB keyboard connector.
Probably there was a mechanism the adapter employed to tell the keyboard whether to behave as an USB or as a PS/2 keyboard, and the electronics inside the keyboard could support both protocols.

Main point is that these "PS/2" keyboards were actually designed to be valid USB keyboards, you could use them with USB, but in an "emergency" (no USB port left, or when trying to set the BIOS) you could transform them to a PS/2 compatible keyboard.

These are designed to operate at 4.4 (or 5.0) volt, so will work fine on a "PI-port".

Real PS/2 keyboards were designed in a time that all the digital logic still worked with 5V, and contained a commercial microcontroller (most often a 8051 derivate) designed to work with 5V (+- 5%). So these do not work with the USB standard (for single current unit devices) of 4.4V.

That is the story, and that is why passive adapter "PS/2" keyboards should work, but "real PS/2 keyboard powered by an active converter" (that just wires the power it gets through to the PS/2 port) do not.


I was one of the first persons commenting on the effects the current polyfuses would have on peripherals, and I still think it's unfortunate they (can) have such high resistances, but still, after much investigations into the logic behind using them I cannot fault the logic of the use of them.
I can see that many people have been "bitten" by this design choice, but IMHO the PI is designed to offer exactly the functionality that fullfils its purpose (but indeed little more) .
If you use it only with a suitable wired USB keyboard and mouse the polyfuses matter very little, as these devices normally draw much less than 100mA, and (therefore) are designed to work with voltages as low as 4.4 Volt. Logically, and according to what the FAQ says, if you want to connect more than these two devices (the FAQ mentions storage mediums and communication adapters) then logically you must use a powered hub for that, and then the power use and voltage compatibility for devices connected thusly also matter very little, as the hub should be able to provide ample power, at the right voltage of 5V (+- 5%). A well designed powered hub also should not backfeed, but that is another matter.
There may at the moment be situations where when following the above scenario there are still problems. But AFAIK these are mainly caused by some USB stack errors (software) and these issues are being worked on.

Real PS/2 keyboards were never designed according to USB spec's, so a combination of an approved adapter and an un-approved peripheral logically can only be an un-approved hybrid, which may, or may not work on an USB system.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 18192
Joined: Sat Jul 30, 2011 7:41 pm

Re: USB - the Elephant in our Room

Fri Aug 10, 2012 8:48 am

obcd wrote:Thanks for clearing that up.
So basically, other arm based designs could be using the same synopsis usb otg hardware and driver?
I understand most of them are found in consumer devices like smartphones, tablets, gpses, mp3 players,..all systems that only need an usb device port. Maybe occasionally someone will connect an usb memory device to a tablet or a 3G stick, but I don't see many connecting a hub and multiple devices to their tablet. This very well explains why the issues were not seen before. I assume a model A is showing the same behavour so that we can rule out the extra hub chip with it's integrated ethernet adapter as being responsable for the missing packets? (Sorry, to lazy to look up the number in the schematics.)
I think that pretty much covers it!
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Please direct all questions to the forum, I do not do support via PM.

User avatar
RaTTuS
Posts: 9587
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK

Re: USB - the Elephant in our Room

Fri Aug 10, 2012 8:50 am

rspitz wrote:
gsh wrote:[...]there is a deficiency in the driver which means we're limited currently to a maximum of 8 periodic endpoints, this is because the driver reserves a channel (of which there are eight) for each periodic endpoint. Now I believe that for each hub port you have at least one interrupt endpoint so once you get to seven hub ports then you run out of channels!
Just got bitten by this: A D-Link DUB-H7 (which does have success stories on the "working devices list", but also some failure reports) connected to my RPi as only USB device and nothing connected to its ports except the Pi itself (for power via a USB-to-MicroUSB cable) gives the following result:

Code: Select all

lsusb -v | grep Transfer
          Transfer Type            Interrupt
          Transfer Type            Interrupt
          Transfer Type            Interrupt
          Transfer Type            Bulk
          Transfer Type            Bulk
          Transfer Type            Interrupt
          Transfer Type            Interrupt
          Transfer Type            Interrupt
          Transfer Type            Interrupt
          Transfer Type            Interrupt
Plugging in my first PL2303 adapter worked, I could read data off of it. But after plugging in the second one and stopping/restarting the data flow on the first one, I got the following error in dmesg:

Code: Select all

[ 3541.604279] INFO:: periodic_channel_available: Total channels: 8, Periodic: 5, Non-periodic: 3
[ 3541.604296]
[ 3541.604317] INFO:: schedule_periodic: No host channel available for periodic transfer.
[ 3541.604329]
[ 3541.604411] ERROR::dwc_otg_hcd_urb_enqueue:518: DWC OTG HCD URB Enqueue failed adding QTD. Error status -4008
[ 3541.604426]
[ 3541.604499] pl2303 ttyUSB0: pl2303_open - failed submitting interrupt urb, error -4008

I wonder how any 7-Port hubs could be made to work with a RPi, see the success stories. Anyway, I'll return the DUB-H7 and get a recommended 4-port Hub.
see
http://www.raspberrypi.org/phpBB3/viewt ... 17#p145839
does that help
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

rspitz
Posts: 55
Joined: Tue Jul 31, 2012 7:25 pm

Re: USB - the Elephant in our Room

Fri Aug 10, 2012 9:33 am

Too late :o The parcel with the DUB-H7 just left the house! But thanks for the pointer, I just might have tried the patch, especially since this model does not backfeed power to the RPi through its uplink port, which seems to be an issue with many cheap powered hubs.


jeffhaddow
Posts: 118
Joined: Thu Jun 14, 2012 1:50 pm

Re: USB - the Elephant in our Room

Sun Aug 12, 2012 10:01 pm

I found this advice on the FAQ part of the main Raspbery Pi site

-------------------------------------------------------------------
How do you connect more than two USB devices?

Use a hub to increase the number of ports. Some keyboards have hubs built in which would work well
-------------------------------------------------------------------

Don't you think that this should be reviewed at least!!?

All the best
Jeff

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 9660
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: USB - the Elephant in our Room

Sun Aug 12, 2012 11:46 pm

jeffhaddow wrote:I found this advice on the FAQ part of the main Raspbery Pi site

-------------------------------------------------------------------
How do you connect more than two USB devices?

Use a hub to increase the number of ports. Some keyboards have hubs built in which would work well
-------------------------------------------------------------------

Don't you think that this should be reviewed at least!!?

All the best
Jeff
I think so, at least the A1048 apple keyboards which have two USB ports built in are reported not to work.

Perhaps this was intended to be valid for the Model-A, which I suppose would be given a single higher rated polyfuse, for its lone USB port. As it doesn't have the LAN9512 chip to power and only one USB port, with the same 700mA adapter it would have about 400mA left over for the USB port, not just 200mA for two ports. At least I hope they will implement a 400mA polyfuse, it would probably solve a lot of power problems.

The wiki does say that these keyboards do not work with the PI.

Unfortunately us humble moderators do not have the power to edit the FAQ.

Return to “Troubleshooting”

Who is online

Users browsing this forum: No registered users and 41 guests