hippy
Posts: 5959
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: USB - the Elephant in our Room

Sat Aug 18, 2012 9:02 pm

obcd wrote:Maybe people who try to advertise the Pi as an unfinished development board should read the FAQ here and show me the Paragraph that explains why the Pi's usb problems should not give us a reason to complain.
If my interpretation of the state of affairs is correct then my reading of things is that "it doesn't work" is not a valid complaint, merely commentary on how it is.

What it doesn't do may mean you can't promote it at work, may make it 'entirely useless' for some cases or by some definitions, but that it would be anything else was never promised.

There may be a valid complaint that such a situation was not understood when you made your purchase.

I believe purchasers should be fully away of the situation before purchase and it should be explained in simple, blunt terms and leave no one in any doubt what that means and I don't believe it currently is. But that's just my opinion.

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

Re: USB - the Elephant in our Room

Sat Aug 18, 2012 9:47 pm

The one thing I needed to prove I was wrong is just one more happy customer story.
So maybe the Olimex linux boards are worse? Thanks for the warning.
I couldn't find a statement on their website that you could do pretty much the same with it as your desktop pc.
Besides that, what confuses me is that you choose the board without ethernet or wifi and complain about the fact that it only has 1 usb port and isn't compatible with ethernet and wifi devices...? At least it looks like the Olimex boards are truly development boards, with a totally open hardware and software, freely usable in other designs.
It's all little off topic.
The real problem I am worried about is if the Pi usb will ever work reliable? Another problem is the fact nobody knows what setup should work and what setup is troublesome. The best we can narrow it down right now is : If you don't use the Pi usb ports or Pi analog audio output (but that's another story), you will be very happy with your Pi. If you start using those ports, be prepared things might not work as you expect, and due to the fact that the Pi is a development board, the issues you see might never get fixed. So, if a device or combination of devices doesn't work, just try others untill it does using some good old fashion trial and error method. Why the hell did I study so long? It's all fuzzy logic now...

fredjam
Posts: 83
Joined: Thu Jul 19, 2012 3:19 am
Location: London UK

Re: USB - the Elephant in our Room

Sun Aug 19, 2012 1:03 am

Its very easy to sit on the sidelines and tear your hair out and be a prophet of doom.
'Oh woe is me, the raspberry pi doesn't work and may never work'. In fact there is
no reason to suppose that the problems won't be sorted out. All it needs is some
patience. If you can't bear the fact that the pi isn't already perfect then please give up,
sell it on ebay and get your money back and go and do something else.

Pointing out problems is one thing, incessant whining is something else. If you
can't help sort out the problems then at least please stop whining. .
.

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

Re: USB - the Elephant in our Room

Sun Aug 19, 2012 3:27 am

Indeed.

And to that end, I'm going to delete any more 'whining' posts on this thread. I'm going to leave the thread up for people to post valid bug reports and information they think might be useful to fix the problem.

So, be warned. You post may be deleted without warning, and I suggest interested participants read up on concern trolling, which is banned here.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5331
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: USB - the Elephant in our Room

Sun Aug 19, 2012 11:59 am

I've ported to microframe scheduler to 2.94 and added a cmdline switch to turn it on/off. By default it is disabled. Add this to cmdline.txt to enable:
dwc_otg.microframe_schedule=1

This is the source patch referenced in the github issue that can fix the:
INFO:: schedule_periodic: No host channel available for periodic transfer

error when too many periodic endopoints are present. If you've been suffering this issue, then please enable the option and test.
Even if you don't have the issue, I'd like as many people as possible to enable it, and report that it doesn't break anything new, as I'd like to make this a default option soon.

You can get this updated kernel from rpi-update.

dpws
Posts: 9
Joined: Sat Aug 18, 2012 2:11 pm

Re: USB - the Elephant in our Room

Sun Aug 19, 2012 12:39 pm

A couple of questions:
Are you using WiFi exclusively for your network connection?
Are you using a hub? Most likely you are.
If you unplug your WiFi adapter does your HDD stay connected?
The Pi is plugged directly into my router via ethernet, so no usb wifi adapter. It's plugged into a harddrive which contains a hub (Iomega MiniMax), so I'm not quite sure how that would work in terms of I/O! The bottleneck in data transfer is, in fact, nothing to do with the Pi: It's between my Macbook and my router.

blavery
Posts: 95
Joined: Sun Jul 01, 2012 2:57 am
Location: QLD. Australia

Re: USB - the Elephant in our Room

Sun Aug 19, 2012 1:11 pm

dom wrote:I've ported to microframe scheduler to 2.94
You can get this updated kernel from rpi-update.
With or without the option in cmdline.txt, this upgrade seems to have killed my python / GPIO functions:

Code: Select all

#!/usr/bin/python
import time
import RPi.GPIO as GPIO
GPIO.setup(3, GPIO.OUT)
It's that last line that now totally locks the pi.
This script (and some more lines, obviously) was working 30 minutes ago before rpi-update.
Using RPi.GPIO-0.3.1a
Configuration = x11vnc on lan, but composite display also. Nothing on usb. (ie half-headless!)

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5331
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: USB - the Elephant in our Room

Sun Aug 19, 2012 1:57 pm

blavery wrote: With or without the option in cmdline.txt, this upgrade seems to have killed my python / GPIO functions:
I expect that's unrelated to USB changes. We've also recently moved to a newer kernel (3.2.27) which may have some issue with the gpio driver.
Probably best to create a github issue.

greypower
Posts: 92
Joined: Sat Jan 07, 2012 10:00 am

Re: USB - the Elephant in our Room

Sun Aug 19, 2012 2:12 pm

@dom:

Have upgraded as above to : Linux raspberrypi 3.2.27+ #12 PREEMPT Sun Aug 19 12:28:17 BST 2012 armv6l GNU/Linux

and tested against a 7-port hub with wifi adaptor, keyboard, mouse, memory stick and disc drive. This gives 12 periodic endpoint of type "interrupt".
All seems OK. I can use all devices. (Previously, the hub + wifi adaptor only required 8 interrupt endpoints. So adding keyboard was a "no-no")

There seems to be no "untoward" messages in /var/syslog - but what do I know, I'm a noob!

Many thanks for the Herculean effort - Good stuff!

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5331
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: USB - the Elephant in our Room

Sun Aug 19, 2012 2:17 pm

greypower wrote: and tested against a 7-port hub with wifi adaptor, keyboard, mouse, memory stick and disc drive. This gives 12 periodic endpoint of type "interrupt".
All seems OK. I can use all devices. (Previously, the hub + wifi adaptor only required 8 interrupt endpoints. So adding keyboard was a "no-no")
Excellent news. Thanks for the report.

lostintime
Posts: 29
Joined: Sun Jul 22, 2012 7:30 am

Re: USB - the Elephant in our Room

Sun Aug 19, 2012 2:18 pm

jamesh wrote:
lostintime wrote:
jamesh wrote:What makes you think that this will go unresolved? There are very clever people working on it right now. Please keep your unfounded allegations to yourself.
Did you read the last two sentences in the first paragraph of my response to you? Here it is again:
lostintime wrote:There are other devices which utilize the same USB controller as the Raspberry Pi and in the past there have been efforts made to fix the bugs in the vendor-supplied driver for this controller and also to replace it with a new driver written from scratch. So far nobody has achieved very much and it stands to reason that this situation will not change.
It isn't an allegation, it's a prediction and I stand by it. Prove me wrong, please.
Did those people have access to the RTL of the silicon? I don't believe so.
That's the extent to which this stuff is being investigated.
Ralink had as much access as Broadcom have. I don't think they use the Synopsys USB controller any more.

User avatar
NickT
Posts: 271
Joined: Mon May 21, 2012 10:43 am
Location: UK

Re: USB - the Elephant in our Room

Sun Aug 19, 2012 3:06 pm

This latest build seems to be a great improvement from my perspective. My only issue of concern before had been that once LXDE had been started, there was no wifi connectivity. I had a work around for it with 'post-up ifdown eth0; echo -n '1-1.1:1.0' > /sys/bus/usb/drivers/smsc95xx/unbind' in the wlan0 section of interfaces, so it was never really a show stopper.

Now that line can be removed, so both wlan0 and lan0 can be up at the same time. Midori works and I can ping bbc.co.uk with only a small (6%) packet loss, which I'm prepared to attribute to a dirty and crowded wifi environment round where I live.

I'm running Raspbian 3.2.27+ #12 PREEMPT and my little LED flasher GPIO C program in Geany still works OK.

Well done all!

Aydan
Posts: 693
Joined: Fri Apr 13, 2012 11:48 am
Location: Germany, near Lake Constance

Re: USB - the Elephant in our Room

Sun Aug 19, 2012 4:54 pm

Tested the new kernel & firmware.
No improvement for the staggered hub situation.
Mass storage performance abysmal on 2nd level hub.
Don't have anything else connected. This one is running headless

Regards
Aydan

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5331
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: USB - the Elephant in our Room

Sun Aug 19, 2012 4:59 pm

Aydan wrote:Tested the new kernel & firmware.
No improvement for the staggered hub situation.
Mass storage performance abysmal on 2nd level hub.
Don't have anything else connected. This one is running headless
Can you confirm if you added:
dwc_otg.microframe_schedule=1
to cmdline.txt?

Aydan
Posts: 693
Joined: Fri Apr 13, 2012 11:48 am
Location: Germany, near Lake Constance

Re: USB - the Elephant in our Room

Sun Aug 19, 2012 5:39 pm

dom wrote:
Aydan wrote:Tested the new kernel & firmware.
No improvement for the staggered hub situation.
Mass storage performance abysmal on 2nd level hub.
Don't have anything else connected. This one is running headless
Can you confirm if you added:
dwc_otg.microframe_schedule=1
to cmdline.txt?
Oh, right.
No I didn't use that option. will try again with it.

Aydan
Posts: 693
Joined: Fri Apr 13, 2012 11:48 am
Location: Germany, near Lake Constance

Re: USB - the Elephant in our Room

Sun Aug 19, 2012 5:47 pm

Linux raspberrypi 3.2.27+ #12 PREEMPT Sun Aug 19 12:28:17 BST 2012 armv6l GNU/Linux

Just tested with dwc_otg.microframe_schedule=1

Code: Select all

dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait dwc_otg.microframe_schedule=1
no improvement for me.

Code: Select all

[    0.146463] vc-mem: mm_vc_mem_size      = 0x10000000 (256 MiB)
[    0.146995] hw-breakpoint: found 6 breakpoint and 1 watchpoint registers.
[    0.147061] hw-breakpoint: maximum watchpoint size is 4 bytes.
[    0.147106] mailbox: Broadcom VideoCore Mailbox driver
[    0.147220] bcm2708_vcio: mailbox at f200b880
[    0.147331] bcm_power: Broadcom power driver
[    0.147378] bcm_power_open() -> 0
[    0.147410] bcm_power_request(0, 8)
[    0.648106] bcm_mailbox_read -> 00000080, 0
[    0.648152] bcm_power_request -> 0
[    0.648183] Serial: AMBA PL011 UART driver
[    0.648372] dev:f1: ttyAMA0 at MMIO 0x20201000 (irq = 83) is a PL011 rev3
[    0.961731] console [ttyAMA0] enabled
[    0.990621] bio: create slab <bio-0> at 0
[    0.996239] SCSI subsystem initialized
[    1.000282] usbcore: registered new interface driver usbfs
[    1.006087] usbcore: registered new interface driver hub
[    1.011718] usbcore: registered new device driver usb
[    1.017881] Switching to clocksource stc
[    1.037784] FS-Cache: Loaded
[    1.041104] CacheFiles: Loaded
[    1.060693] NET: Registered protocol family 2
[    1.065749] IP route cache hash table entries: 2048 (order: 1, 8192 bytes)
[    1.074289] TCP established hash table entries: 8192 (order: 4, 65536 bytes)
[    1.081741] TCP bind hash table entries: 8192 (order: 3, 32768 bytes)
[    1.088478] TCP: Hash tables configured (established 8192 bind 8192)
[    1.094903] TCP reno registered
[    1.098082] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    1.104008] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    1.110862] NET: Registered protocol family 1
[    1.116298] RPC: Registered named UNIX socket transport module.
[    1.122478] RPC: Registered udp transport module.
[    1.127211] RPC: Registered tcp transport module.
[    1.131977] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    1.138756] bcm2708_dma: DMA manager at cc808000
[    1.143576] bcm2708_gpio: bcm2708_gpio_probe c05ec3f8
[    1.149224] vc-mem: Videocore memory driver
[    1.154392] audit: initializing netlink socket (disabled)
[    1.159907] type=2000 audit(0.770:1): initialized
[    1.264514] VFS: Disk quotas dquot_6.5.2
[    1.268733] Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    1.276795] FS-Cache: Netfs 'nfs' registered for caching
[    1.283444] msgmni has been set to 366
[    1.289805] io scheduler noop registered
[    1.293955] io scheduler deadline registered (default)
[    1.299331] io scheduler cfq registered
[    1.303550] BCM2708FB: registering framebuffer ([email protected])
[    1.309756] bcm2708_fb_set_par info(cb8f7000) 656x416 (656x416), 0, 16
[    1.311805] BCM2708FB: start = cc900000,4d385000 width=656, height=416, bpp=16, pitch=1312 size=545792 success=0
[    1.315746] Console: switching to colour frame buffer device 82x26
[    1.350140] BCM2708FB: register framebuffer (0)
[    1.357590] kgdb: Registered I/O driver kgdboc.
[    1.376435] brd: module loaded
[    1.388108] loop: module loaded
[    1.394500] vcos: [1]: vchiq_init_state: slot_zero = 0xffd80000, is_master = 0
[    1.404928] vcos: [1]: vchiq_init_state: called
[    1.412802] vcos: [1]: vchiq: initialised - version 2 (min 2), device 253.0
[    1.423026] usbcore: registered new interface driver smsc95xx
[    1.431131] cdc_ncm: 04-Aug-2011
[    1.436887] usbcore: registered new interface driver cdc_ncm
[    1.444931] dwc_otg: version 2.94b 27-OCT-2011 (rev 01-DEC-2011) (platform bus)
[    1.655028] Core Release: 2.80a
[    1.660475] Setting default values for core params
[    1.667761] Finished setting default values for core params
[    1.876134] Using Buffer DMA mode
[    1.881825] Periodic Transfer Interrupt Enhancement - disabled
[    1.890137] Multiprocessor Interrupt Enhancement - disabled
[    1.898194] OTG VER PARAM: 0, OTG VER FLAG: 0
[    1.905109] Dedicated Tx FIFOs mode
[    1.911101] dwc_otg: Microframe scheduler enabled
[    1.911163] dwc_otg bcm2708_usb: DWC OTG Controller
[    1.918469] dwc_otg bcm2708_usb: new USB bus registered, assigned bus number 1
[    1.928175] dwc_otg bcm2708_usb: irq 75, io mem 0x00000000
[    1.936049] Init: Port Power? op_state=1
[    1.942315] Init: Power Port (0)
[    1.947944] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[    1.957137] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.966762] usb usb1: Product: DWC OTG Controller
[    1.973853] usb usb1: Manufacturer: Linux 3.2.27+ dwc_otg_hcd
[    1.981963] usb usb1: SerialNumber: bcm2708_usb
[    1.989772] hub 1-0:1.0: USB hub found
[    1.995915] hub 1-0:1.0: 1 port detected
[    2.002837] Module dwc_common_port init
[    2.003243] usbcore: registered new interface driver uas
[    2.010667] Initializing USB Mass Storage driver...
[    2.018071] usbcore: registered new interface driver usb-storage
[    2.026322] USB Mass Storage support registered.
[    2.033422] usbcore: registered new interface driver libusual
[    2.041810] mousedev: PS/2 mouse device common for all mice
[    2.049625] cpuidle: using governor ladder
[    2.055931] cpuidle: using governor menu
[    2.062117] sdhci: Secure Digital Host Controller Interface driver
[    2.070366] sdhci: Copyright(c) Pierre Ossman
[    2.077073] bcm_power_open() -> 1
[    2.082842] Registered led device: mmc0::
[    2.084321] mmc0: SDHCI controller on BCM2708_Arasan [platform] using platform's DMA
[    2.096607] mmc0: BCM2708 SDHC host at 0x20300000 DMA 2 IRQ 77
[    2.105044] sdhci-pltfm: SDHCI platform and OF driver helper
[    2.114426] Registered led device: led0
[    2.114894] usbcore: registered new interface driver usbhid
[    2.122783] usbhid: USB HID core driver
[    2.130531] TCP cubic registered
[    2.136140] Initializing XFRM netlink socket
[    2.144888] NET: Registered protocol family 17
[    2.156986] Registering the dns_resolver key type
[    2.164237] VFP support v0.3: implementor 41 architecture 1 part 20 variant b rev 5
[    2.186525] Waiting for root device /dev/mmcblk0p2...
[    2.202074] Indeed it is in host mode hprt0 = 00021501
[    2.221158] mmc0: new high speed SDHC card at address 0001
[    2.242685] mmcblk0: mmc0:0001 00000 7.60 GiB
[    2.251017]  mmcblk0: p1 p2
[    2.325663] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[    2.338531] VFS: Mounted root (ext4 filesystem) on device 179:2.
[    2.348436] Freeing init memory: 204K
[    2.412071] usb 1-1: new high-speed USB device number 2 using dwc_otg
[    2.421112] Indeed it is in host mode hprt0 = 00001101
[    2.642382] usb 1-1: New USB device found, idVendor=0424, idProduct=9512
[    2.653177] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[    2.663914] hub 1-1:1.0: USB hub found
[    2.670297] hub 1-1:1.0: 3 ports detected
[    2.952229] usb 1-1.1: new high-speed USB device number 3 using dwc_otg
[    3.082620] usb 1-1.1: New USB device found, idVendor=0424, idProduct=ec00
[    3.097409] usb 1-1.1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[    3.110839] smsc95xx v1.0.4
[    3.188090] smsc95xx 1-1.1:1.0: eth0: register 'smsc95xx' at usb-bcm2708_usb-1.1, smsc95xx USB 2.0 Ethernet, b8:27:eb:fa:20:94
[    3.302424] usb 1-1.3: new high-speed USB device number 4 using dwc_otg
[    3.414166] usb 1-1.3: New USB device found, idVendor=05e3, idProduct=0608
[    3.439503] usb 1-1.3: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[    3.459372] usb 1-1.3: Product: USB2.0 Hub
[    3.467586] hub 1-1.3:1.0: USB hub found
[    3.481718] hub 1-1.3:1.0: 4 ports detected
[    3.782425] usb 1-1.3.4: new high-speed USB device number 5 using dwc_otg
[    3.894120] usb 1-1.3.4: New USB device found, idVendor=05e3, idProduct=0608
[    3.912022] usb 1-1.3.4: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[    3.937803] usb 1-1.3.4: Product: USB2.0 Hub
[    3.952819] hub 1-1.3.4:1.0: USB hub found
[    3.968318] hub 1-1.3.4:1.0: 4 ports detected
[    5.328635] bcm2708_i2c bcm2708_i2c.0: BSC0 Controller at 0x20205000 (irq 79)
[    5.407956] bcm2708_spi bcm2708_spi.0: SPI Controller at 0x20204000 (irq 80)
[    5.481392] bcm2708_i2c bcm2708_i2c.1: BSC1 Controller at 0x20804000 (irq 79)
[   12.583780] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[   12.948439] ### snd_bcm2835_alsa_probe c05ecaf8 ############### PROBING FOR bcm2835 ALSA device (0):(1) ###############
[   12.964133] Creating card...
[   12.969441] Creating device/chip ..
[   12.975913] Adding controls ..
[   12.981258] Registering card ....
[   12.996354] bcm2835 ALSA CARD CREATED!
[   13.008677] ### BCM2835 ALSA driver init OK ###
[   13.063541] i2c /dev entries driver
[   20.701313] smsc95xx 1-1.1:1.0: eth0: link up, 100Mbps, full-duplex, lpa 0xCDE1
[   25.092698] Bluetooth: Core ver 2.16
[   25.101819] NET: Registered protocol family 31
[   25.104009] Bluetooth: HCI device and connection manager initialized
[   25.104048] Bluetooth: HCI socket layer initialized
[   25.104065] Bluetooth: L2CAP socket layer initialized
[   25.104161] Bluetooth: SCO socket layer initialized
[   25.152942] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[   25.153008] Bluetooth: BNEP filters: protocol multicast
[   25.167391] Bluetooth: RFCOMM TTY layer initialized
[   25.167448] Bluetooth: RFCOMM socket layer initialized
[   25.167467] Bluetooth: RFCOMM ver 1.11
[   25.624756] Adding 102396k swap on /var/swap.  Priority:-1 extents:1 across:102396k SS
[   45.032893] usb 1-1.3.4.4: new high-speed USB device number 6 using dwc_otg
[   45.134928] usb 1-1.3.4.4: New USB device found, idVendor=1307, idProduct=0165
[   45.134981] usb 1-1.3.4.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[   45.135003] usb 1-1.3.4.4: Product: USB Mass Storage Device
[   45.135021] usb 1-1.3.4.4: Manufacturer: USBest Technology
[   45.135036] usb 1-1.3.4.4: SerialNumber: 0812045624a26e
[   45.150925] scsi0 : usb-storage 1-1.3.4.4:1.0
[   46.143957] scsi 0:0:0:0: Direct-Access                               0.00 PQ: 0 ANSI: 2
[   46.148824] sd 0:0:0:0: [sda] 15794176 512-byte logical blocks: (8.08 GB/7.53 GiB)
[   46.149706] sd 0:0:0:0: [sda] Write Protect is off
[   46.149758] sd 0:0:0:0: [sda] Mode Sense: 00 00 00 00
[   46.150751] sd 0:0:0:0: [sda] Asking for cache data failed
[   46.150782] sd 0:0:0:0: [sda] Assuming drive cache: write through
[   46.163421] sd 0:0:0:0: [sda] Asking for cache data failed
[   46.163474] sd 0:0:0:0: [sda] Assuming drive cache: write through
[   46.275252]  sda: sda1
[   46.394439] sd 0:0:0:0: [sda] Asking for cache data failed
[   46.394474] sd 0:0:0:0: [sda] Assuming drive cache: write through
[   46.394513] sd 0:0:0:0: [sda] Attached SCSI removable disk
[email protected]:~# lsusb -t
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=dwc_otg/1p, 480M
    |__ Port 1: Dev 2, If 0, Class=hub, Driver=hub/3p, 480M
        |__ Port 1: Dev 3, If 0, Class=vend., Driver=smsc95xx, 480M
        |__ Port 3: Dev 4, If 0, Class=hub, Driver=hub/4p, 480M
            |__ Port 4: Dev 5, If 0, Class=hub, Driver=hub/4p, 480M
                |__ Port 4: Dev 6, If 0, Class=stor., Driver=usb-storage, 480M
[email protected]:~# hdparm -tT /dev/sda

/dev/sda:
 Timing cached reads:   292 MB in  2.01 seconds = 145.42 MB/sec
 Timing buffered disk reads:   2 MB in 30.90 seconds =  66.28 kB/sec
[email protected]:~# dmesg | tail
[   46.150751] sd 0:0:0:0: [sda] Asking for cache data failed
[   46.150782] sd 0:0:0:0: [sda] Assuming drive cache: write through
[   46.163421] sd 0:0:0:0: [sda] Asking for cache data failed
[   46.163474] sd 0:0:0:0: [sda] Assuming drive cache: write through
[   46.275252]  sda: sda1
[   46.394439] sd 0:0:0:0: [sda] Asking for cache data failed
[   46.394474] sd 0:0:0:0: [sda] Assuming drive cache: write through
[   46.394513] sd 0:0:0:0: [sda] Attached SCSI removable disk
[   77.583824] usb 1-1.3.4.4: reset high-speed USB device number 6 using dwc_otg
[  120.545044] usb 1-1.3.4.4: reset high-speed USB device number 6 using dwc_otg
[email protected]:~#
but not worse than before either:

Code: Select all

[email protected]:~# hdparm -tT /dev/sda

/dev/sda:
 Timing cached reads:   294 MB in  2.01 seconds = 146.35 MB/sec
 Timing buffered disk reads:  76 MB in  3.04 seconds =  24.98 MB/sec
[email protected]:~# lsusb -t
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=dwc_otg/1p, 480M
    |__ Port 1: Dev 2, If 0, Class=hub, Driver=hub/3p, 480M
        |__ Port 1: Dev 3, If 0, Class=vend., Driver=smsc95xx, 480M
        |__ Port 3: Dev 4, If 0, Class=hub, Driver=hub/4p, 480M
            |__ Port 4: Dev 5, If 0, Class=hub, Driver=hub/4p, 480M
            |__ Port 3: Dev 7, If 0, Class=stor., Driver=usb-storage, 480M
[email protected]:~# dmesg | tail
[  176.590551] sd 1:0:0:0: [sda] Write Protect is off
[  176.590606] sd 1:0:0:0: [sda] Mode Sense: 00 00 00 00
[  176.591511] sd 1:0:0:0: [sda] Asking for cache data failed
[  176.591542] sd 1:0:0:0: [sda] Assuming drive cache: write through
[  176.603275] sd 1:0:0:0: [sda] Asking for cache data failed
[  176.603326] sd 1:0:0:0: [sda] Assuming drive cache: write through
[  176.715217]  sda: sda1
[  176.836054] sd 1:0:0:0: [sda] Asking for cache data failed
[  176.836107] sd 1:0:0:0: [sda] Assuming drive cache: write through
[  176.836133] sd 1:0:0:0: [sda] Attached SCSI removable disk

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

Re: USB - the Elephant in our Room

Sun Aug 19, 2012 5:55 pm

dom wrote:I've ported to microframe scheduler to 2.94 and added a cmdline switch to turn it on/off. By default it is disabled. Add this to cmdline.txt to enable:
dwc_otg.microframe_schedule=1

This is the source patch referenced in the github issue that can fix the:
INFO:: schedule_periodic: No host channel available for periodic transfer

error when too many periodic endopoints are present. If you've been suffering this issue, then please enable the option and test.
Even if you don't have the issue, I'd like as many people as possible to enable it, and report that it doesn't break anything new, as I'd like to make this a default option soon.

You can get this updated kernel from rpi-update.
Hello dom
To try this fix do we need to put rpi-update as a command in the command line, and then add dwc_otg.microframe_schedule=1 to cmdline.txt to enable it?

Two questions where is the file "cmdline.txt" ? And how do you disable it if it is not helpful?

All the best
Jeff

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

Re: USB - the Elephant in our Room

Sun Aug 19, 2012 6:02 pm

cmdline.txt is in the /boot folder
rpi-update shouldn't be added to that file, just the dwc_otg.microframe_schedule=1
basically, sudo apt-get rpi-update and sudo apt-get rpi-upgrade should do the trick. It does renew the kernel, but not to the latest one.
So, I found the location of the files on the eLinux site and copied them manually to the /boot folder.
You will need to manually install the kernel modules as well I think.

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

Re: USB - the Elephant in our Room

Sun Aug 19, 2012 6:09 pm

obcd wrote:cmdline.txt is in the /boot folder
rpi-update shouldn't be added to that file, just the dwc_otg.microframe_schedule=1
basically, sudo apt-get rpi-update and sudo apt-get rpi-upgrade should do the trick. It does renew the kernel, but not to the latest one.
So, I found the location of the files on the eLinux site and copied them manually to the /boot folder.
You will need to manually install the kernel modules as well I think.
Manually installing the kernel modules is beyond my expertise so I think I'll wait till the cure is a bit less hands on. By the way, many thanks to all the software engineers for their hard work on this one.

All the best
Jeff

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5331
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: USB - the Elephant in our Room

Sun Aug 19, 2012 6:12 pm

obcd wrote:So, I found the location of the files on the eLinux site and copied them manually to the /boot folder.
You will need to manually install the kernel modules as well I think.
Running
sudo rpi-update
http://elinux.org/R-Pi_Troubleshooting# ... g_firmware
is the easier way of doing this.

lingon
Posts: 118
Joined: Fri Aug 26, 2011 7:31 am

Re: USB - the Elephant in our Room

Sun Aug 19, 2012 6:55 pm

I updated to the latest kernel:
Linux raspberrypi 3.2.27+ #12 PREEMPT Sun Aug 19 12:28:17 BST 2012 armv6l GNU/Linux
and added the option rootwait dwc_otg.microframe_schedule=1 to the file
/boot/cmdline

cat /proc/cmdline
dma.dmachans=0x3c bcm2708_fb.fbwidth=1920 bcm2708_fb.fbheight=1200 bcm2708.boardrev=0x2 bcm2708.serial=0xfaa5f269 smsc95xx.macaddr=B8:27:EB:A5:F2:69 dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait dwc_otg.microframe_schedule=1

When starting X11 and having a powered hub connected with a keyboard the network still works!
Thanks, for this bugfix, it is really great!
I have a powered 7-port DELTACO hubm which internally consists of two 4-port hubs:
lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp.
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 004: ID 04ca:0050 Lite-On Technology Corp.
Bus 001 Device 005: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB
Bus 001 Device 006: ID 046d:c016 Logitech, Inc. Optical Wheel Mouse
Bus 001 Device 007: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB

Previously when I had my hub connected to a keyboard I used to see error messages like
[ 44.936929] smsc95xx 1-1.1:1.0: eth0: Failed to read register index 0x00000114
[ 49.936807] smsc95xx 1-1.1:1.0: eth0: Failed to write register index 0x00000114
[ 54.936634] smsc95xx 1-1.1:1.0: eth0: Failed to read register index 0x00000114
[ 59.936558] smsc95xx 1-1.1:1.0: eth0: Failed to read register index 0x00000118
and
[ 231.506965] smsc95xx 1-1.1:1.0: eth0: kevent 4 may have been dropped
[ 231.514966] smsc95xx 1-1.1:1.0: eth0: kevent 4 may have been dropped
[ 231.522961] smsc95xx 1-1.1:1.0: eth0: kevent 4 may have been dropped
but these are all gone now. :-)

The only regression I have seen so far is that cached reads are somewhat slower according to hdparm:

uname -a
Linux raspberrypi 3.1.9+ #272 PREEMPT Tue Aug 7 22:51:44 BST 2012 armv6l GNU/Linux

sudo hdparm -Tt /dev/mmcblk0p2

/dev/mmcblk0p2:
Timing cached reads: 302 MB in 2.00 seconds = 150.91 MB/sec
Timing buffered disk reads: 50 MB in 3.06 seconds = 16.32 MB/sec

while I get for
Linux raspberrypi 3.2.27+ #12 PREEMPT Sun Aug 19 12:28:17 BST 2012 armv6l GNU/Linux
/dev/mmcblk0p2:
Timing cached reads: 258 MB in 2.01 seconds = 128.66 MB/sec
Timing buffered disk reads: 52 MB in 3.02 seconds = 17.23 MB/sec

The actual reads are bit faster on the other hand.

PaulCheffus
Posts: 381
Joined: Tue May 29, 2012 2:51 pm
Location: Lincolnshire UK

Re: USB - the Elephant in our Room

Sun Aug 19, 2012 7:38 pm

Hi

This latest update seems to have upset my keyboard - Logitech k400. It has been working well apart from the odd repeated keystroke but after doing the Rpi-update this evening it will not work unless I reboot the Pi several times and then it works until I reboot again.

Uname -a
Linux raspberrypi 3.2.27+ #12 PREEMPT Sun Aug 19 qw:28:17 BST 2012 armv61 GNU/Linux

Vcgencmd
Aug 17 2012 23:48:58
Version 332044 (release)

Cheers

Paul
Procrastination - The Thief of Time.

MarcinM
Posts: 6
Joined: Sun Aug 19, 2012 7:27 pm

Re: USB - the Elephant in our Room

Sun Aug 19, 2012 7:48 pm

Yes, I have USB problems. With USB cameras, storage, WiFi. Even keyboard and mouse reset from time to time. Everything gets worse when connected to a HUB. I've measured the mythical 5V and it turned out to be about 4.9V. Then I decided to check if there is a distortion on 5V. Connected a scope and it turned out to be flat. Really flat. But then I've checked 3.3V... This one IS distorted. Voltage drops to as low as 2.85V. It's relatively quiet when there are no USB devices and no network traffic. It gets worse with USB devices connected.
I've put pictures here: http://marcin.homedns.org/~marcin/pic.html. The page is hosted on the Pi that's being measured so it may not be accessible from time to time...

Can somebody with more experience check if that may be the problem?

I've tried few caps in different places without any noticeable change. (few hundreds uF, nF and pF).
Probes were connected to P1. 3.3V looks the same measured directly on RG2.

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

Re: USB - the Elephant in our Room

Sun Aug 19, 2012 8:19 pm

dom wrote:
obcd wrote:So, I found the location of the files on the eLinux site and copied them manually to the /boot folder.
You will need to manually install the kernel modules as well I think.
Running
sudo rpi-update
http://elinux.org/R-Pi_Troubleshooting# ... g_firmware
is the easier way of doing this.
Many thanks - I have to report that for the first time since I recieved my RPi on the 12th June, I am able to use the 13-port USB hub and the wired ethernet connection is still working!!

I installed the new kernal by following the links above and used rpi-update. (I had to install git-core before it would work) But did not find it too hard to follow the links from the weblink above.

Again Thanks for the time you've put in on this

All the best
Jeff :D

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

Re: USB - the Elephant in our Room

Sun Aug 19, 2012 8:22 pm

PS I also put the piece of script into the /boot/cmdline.txt

Jeff

Return to “Troubleshooting”