caerandir
Posts: 131
Joined: Tue Dec 18, 2012 11:26 am
Location: Bonn, Germany

dwc_otg.speed=1 breaks network and USB

Sun Feb 17, 2013 8:28 pm

Hi all,

trying to fix problems I have with a USB webcam I included dwc_otg.speed=1 in /boot/cmdline.txt. As a result, USB did not work at all (keyboard, mouse, all dead, even when connected to the direct USB ports without hub). Network also was down, i.e. the three LEDs where on, LNK even blinking when trying to ssh into the Pi, but to no avail. Then suddenly the three network LEDs went off for a second to come back then. That was the point that I thought: Maybe I DO have a power problem and digged out a very good switching power supply that brings 5V at 3A and *added* it to the existing cheap 5V 1.2A supply - so power *really* was no issue any more (I also tried things without the 1.2A in case it was a lemon). Effect stays the same. I downloaded the most recent Raspbian image (2013-02-09-wheezy-raspbian.zip), effect the same. Removing dwc_otg.speed=1 brought things back to normal (network OK, USB kindof working - the issues I had before stay, even with added power supply).

If you ask what kind of issues I have with USB that made me do dwc_otg.speed=1:
  • TV card has faulty sound an picture (see earlier post of mine)
  • bluetooth dongle not working properly (see earlier post...)
  • webcam works, but once in a while image gets distorted
  • RS232 to USB adapter works well, but "swollows" a byte once in a while
I know that USB is not the best currently and it is worked on, but I must say I yet have not found any USB device to work properly at all except for mouse and keyboard.

Back to my issue: Any idea whats wrong with dwc_otg.speed=1? Am I missing something?

Thanks for help!

Caerandir

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

Re: dwc_otg.speed=1 breaks network and USB

Sun Feb 17, 2013 9:45 pm

As you probably know, dwc_otg.speed=1 makes the Pi usb ports 1.1 speed instead of 2.0 speed.
I have seen reports from other people trying it and claiming nothing worked anymore afterwards.
Some say it fixes missing keys and stuck keys on troublesome keyboards.
In my case, it fixes a 4 port serial adapter which basically is an usb 1.1 hub with 4 ftdi chips connected to it's 4 usb ports.
Some usb devices really require 2.0 speed. They won't work if the bus is set to 1.1
Some stuff like the ethernet port and usb keyboard / mice should keep working, even on a usb 1.1 port.
I can understand this answer isn't very helpfull. I hope it can help someone else to explain what is going wrong.

caerandir
Posts: 131
Joined: Tue Dec 18, 2012 11:26 am
Location: Bonn, Germany

Re: dwc_otg.speed=1 breaks network and USB

Tue Feb 19, 2013 9:40 pm

Hi obcd,

thanks for your post - it actually hinted me on a stupid thing: I never tested starting up the Pi with dwc_otg.speed=1 without any connected USB device - and that did the trick! Without any USB thing attached network comes up properly and I can ssh into the PI. To my surprise it is both, the keyboard AND the mouse that break the USB & network (both if plugged in from the beginning or later after system is up), but both in a different fashion:

The keyboard (a Sysgration K28 DE/Elan branded as "Medion K28") just breaks USB & network beyond help - only reboot helps. Network LEDs stay alight.
The mouse (a Sysgration USB Optical Mouse/Avago branded as "Medion AGM-946") breaks things "reversibly", i.e. if I remove it, after a while network comes back. With the mouse attached, network LEDs go off once in a while.

Other USB devices can be attached without such strong side-effects, however, none works.

I must say, USB with the Pi is rather frustrating.

Thanks for your post, it helped!

Himbeeren
Posts: 4
Joined: Fri Feb 22, 2013 12:03 pm

Re: dwc_otg.speed=1 breaks network and USB

Fri Feb 22, 2013 12:31 pm

Up until the last firmware update the following entry in /boot/cmdline.txt perfectly cured all my pi/usb instabilities:

Code: Select all

dwc_otg.speed=1 dwc_otg.microframe_schedule=1 dwc_otg.fiq_fix_enable=1 dwc_otg.lpm_enable=0 smsc95xx.turbo_mode=N sdhci-bcm2708.sync_after_dma=0 sdhci-bcm2708.enable_llm=1 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait
After the last update it would suddenly not boot anymore, complain about a possibility of broken usb cables etc. It took me a long time to find out that it was - just as you mentioned in your post - the mouse being plugged in (one of my keyboards continued working while my mice did not). As soon as I plug in a mouse, everything else stops working, the light on a usb stick goes out etc.

Maybe someone has already talked to hexxeh about this and can help?

Himbeeren
Posts: 4
Joined: Fri Feb 22, 2013 12:03 pm

Re: dwc_otg.speed=1 breaks network and USB

Sat Feb 23, 2013 7:44 am

One addition: with all of above entries and only the dwc_otg.speed=1 setting left out my pi is still stable (or has been for two days now). So may I ask whether using the very latest firmware helps with your webcam problem (without the 1.1 speed entry, then)?

caerandir
Posts: 131
Joined: Tue Dec 18, 2012 11:26 am
Location: Bonn, Germany

Re: dwc_otg.speed=1 breaks network and USB

Sat Feb 23, 2013 12:39 pm

Hi Himbeeren,

thanks for your hints! I did apt-get update/upgrade and rpi-update and changed my cmdline.txt according to your suggestion (leaving out speed=1), and - well, better, but still not good. The webcam is much more stable, and I think I am running now into a CPU problem (I see load goes to 100%, and as soon as I add load to the CPU images get distorted). That I think I can fix and I guess that the webcam issue may turn out solved, so thank you very much! What still does not work properly is the TV card.

And, I added another device to my USB zoo: An GWCtech AA1570 USB 7.1 Sound Card (branded as Conrad AA 1570). That actually works nearly perfect with dwc_otg.speed=1 (puredata reports audio i/o errors, but sound is stable and good), but without speed=1 it stutters and is hardly usable.

I will continue testing and twiddling around with your cmdline.txt - I'll keep you posted!

Thanks again.

caerandir
Posts: 131
Joined: Tue Dec 18, 2012 11:26 am
Location: Bonn, Germany

Re: dwc_otg.speed=1 breaks network and USB

Mon Feb 25, 2013 9:52 pm

Here´s an update. I tried around removing and adding the variuos changes you made to the cmdline.txt - but I must say it does not make so much of a difference. I can say that the latest firmware made a huge difference - the webcam runs smoother since then. But still, it does not run properly: With xawtv I see image distortions every few seconds. When I add further USB traffic, like moving the mouse, things go from bad to worse - the image distortions are much more frequent.

Next try I gave motion. This produces a CPU load of about 30% max. But I get image errors every few seconds also:

Code: Select all

[1] Started stream webcam server in port 8081
Corrupt JPEG data: premature end of data segment
[1] File of type 8 saved to: /tmp/motion/01-20130225221351.swf
[1] File of type 1 saved to: /tmp/motion/01-20130225221351-00.jpg
[1] File of type 1 saved to: /tmp/motion/01-20130225221351-01.jpg
[1] File of type 1 saved to: /tmp/motion/01-20130225221352-00.jpg
[1] File of type 1 saved to: /tmp/motion/01-20130225221352-01.jpg
[1] File of type 1 saved to: /tmp/motion/01-20130225221353-00.jpg
[1] File of type 1 saved to: /tmp/motion/01-20130225221353-01.jpg
[1] File of type 1 saved to: /tmp/motion/01-20130225221354-00.jpg
[1] File of type 1 saved to: /tmp/motion/01-20130225221354-01.jpg
[1] File of type 1 saved to: /tmp/motion/01-20130225221355-00.jpg
[1] File of type 1 saved to: /tmp/motion/01-20130225221355-01.jpg
Corrupt JPEG data: premature end of data segment
[1] File of type 1 saved to: /tmp/motion/01-20130225221356-00.jpg
[1] File of type 1 saved to: /tmp/motion/01-20130225221356-01.jpg
Corrupt JPEG data: premature end of data segment
[1] File of type 1 saved to: /tmp/motion/01-20130225221357-00.jpg
[1] File of type 1 saved to: /tmp/motion/01-20130225221357-01.jpg
[1] File of type 1 saved to: /tmp/motion/01-20130225221358-00.jpg
[1] File of type 1 saved to: /tmp/motion/01-20130225221358-01.jpg
[1] File of type 1 saved to: /tmp/motion/01-20130225221359-00.jpg
[1] File of type 1 saved to: /tmp/motion/01-20130225221359-01.jpg
[1] File of type 1 saved to: /tmp/motion/01-20130225221400-00.jpg
[1] File of type 1 saved to: /tmp/motion/01-20130225221400-01.jpg
[1] File of type 1 saved to: /tmp/motion/01-20130225221401-00.jpg
[1] File of type 1 saved to: /tmp/motion/01-20130225221401-01.jpg
[1] File of type 1 saved to: /tmp/motion/01-20130225221402-00.jpg
[1] File of type 1 saved to: /tmp/motion/01-20130225221402-01.jpg
[1] File of type 1 saved to: /tmp/motion/01-20130225221403-00.jpg
[1] File of type 1 saved to: /tmp/motion/01-20130225221404-00.jpg
Corrupt JPEG data: premature end of data segment
Corrupt JPEG data: premature end of data segment
Corrupt JPEG data: premature end of data segment
Corrupt JPEG data: premature end of data segment
Corrupt JPEG data: 14191 extraneous bytes before marker 0xd9
JPEG datastream contains no image
[1] Video device fatal error - Closing video device
[1] Closing video device /dev/video0
[1] Retrying until successful connection with camera
[1] cap.driver: "ov519"
[1] cap.card: "USB Camera"
[1] cap.bus_info: "usb-bcm2708_usb-1.2"
[1] cap.capabilities=0x85000001
[1] - VIDEO_CAPTURE
[1] - READWRITE
[1] - STREAMING
[1] Config palette index 8 (YU12) doesn't work.
[1] Supported palettes:
[1] 0: JPEG (JPEG)
[1] Selected palette JPEG
[1] Test palette JPEG (320x240)
[1] Using palette JPEG (320x240) bytesperlines 320 sizeimage 29390 colorspace 00000007
[1] found control 0x00980900, "Brightness", range 0,255
[1]     "Brightness", default 127, current 127
[1] found control 0x00980902, "Saturation", range 0,255
[1]     "Saturation", default 127, current 127
[1] mmap information:
[1] frames=4
[1] 0 length=32768
[1] 1 length=32768
[1] 2 length=32768
[1] 3 length=32768
[1] Using V4L2
Corrupt JPEG data: 6215 extraneous bytes before marker 0xd9
So one can see that there are data losses inbetween. At the end of the capture above it becomes so bad that motion restarts its connection to the camera. Again, I get more errors when adding USB traffic, CPU still well below 50%.

The USB Soundcard and TV card show the same behaviour as before.

I am not an expert (far from it), but to me it looks like the Pi is not quick enough to handle the interrupts from USB and does not grab data fast enough from the buffers so they get overwritten once in a while. But this is just a wild shot.

By the way: I fianlly measured my TP1/TP2 volatge: its stable at 4.87V - this should be fine according to the Wiki.

caerandir
Posts: 131
Joined: Tue Dec 18, 2012 11:26 am
Location: Bonn, Germany

Re: dwc_otg.speed=1 breaks network and USB

Tue Feb 26, 2013 8:50 pm

Next update: Two devices that made problems before now work smoothly, both far from demanding with respect to USB bandwidth. First is the Conrad Relais Card, which has an "onboard" USB to RS232 converter that until recently "swallowed" bytes once in a while. This one now works stable. lsusb reports the converter as follows:

Code: Select all

Bus 001 Device 016: ID 10c4:ea60 Cygnal Integrated Products, Inc. CP210x UART Bridge / myAVR mySmartUSB light
So with the very careful reservation that I only send four bytes across the line to the Relais Card at each switching instruction, it seems that this RS232 converter works fine together with the current firmware.
The other device is the Velleman K8055 experimental board that announces itself at lsusb like this:

Code: Select all

Bus 001 Device 018: ID 10cf:5500 Velleman Components, Inc. 8055 Experiment Interface Board (address=0)
This one works also now properly in contrast to the old firmware, where every now and then a command sequence would return "Could not open the k8055". This I can still reproduce when I connect the K8055 to my powered USB hub, so I guess the hub is not the best device either. It reports to lsusb as:

Code: Select all

Bus 001 Device 005: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB
It is branded as "hama 00078489". Do not buy this one...

southafricanrob
Posts: 31
Joined: Wed Sep 18, 2013 12:54 pm

Re: dwc_otg.speed=1 breaks network and USB

Wed Sep 18, 2013 12:59 pm

hi caerandir - have you any experience with sending optical audio into the GWC sound box? I want to send audio through USB (from the pi) and optical audio from another device, haven't found anyone whose tried this yet through.

Return to “Troubleshooting”