osama_adel
Posts: 7
Joined: Thu Feb 26, 2015 2:06 pm

Slow boot time when using all usb ports

Thu Feb 26, 2015 2:18 pm

Hi,

I am working on some project at which I need to connect 2 USB cams and 2 Arduino UNO to the raspberry pi AND use them all at booting. But actually, just by connecting them and not running anything at start up, the boot time increases dramatically !

Is there any connection between the USB ports on my RPi B+ and the boot time ? because when I unplug everything and power the raspberry it just boot fast and nice !!

I know that the boot time is long because I try to access the raspberry using Putty and it refuses the connection for as long as it boots, as I assume. If this is not correct, I have added a shell script statement in /etc/rc.local so it runs an application which runs the USB cams, and it takes too long from powering the raspberry pi on till the USB cam lights up.

So, any idea about the reasons and how can I fix that ?

3corey2
Posts: 85
Joined: Sun Feb 15, 2015 2:59 am

Re: Slow boot time when using all usb ports

Thu Feb 26, 2015 3:05 pm

could this be the time it takes to register the usb's? like when i plug a usb into my desktop and it takes a while to pop up in the bottom right of my screen, is that about how long the delay is? or is it real real bad. :?:
ras pi 2, gotta love it.

User avatar
RaTTuS
Posts: 10498
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK
Contact: Twitter YouTube

Re: Slow boot time when using all usb ports

Thu Feb 26, 2015 3:10 pm

dmesg
will help here - give you times
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

osama_adel
Posts: 7
Joined: Thu Feb 26, 2015 2:06 pm

Re: Slow boot time when using all usb ports

Thu Feb 26, 2015 3:29 pm

3corey2 wrote:could this be the time it takes to register the usb's? like when i plug a usb into my desktop and it takes a while to pop up in the bottom right of my screen, is that about how long the delay is? or is it real real bad. :?:
Hmmmmm .. yes , I think it takes almost the same time as connecting a new usb device for the first time on Windows but each time the system boots.

Actually using a stopwatch, I measured that it takes about 2.5 minutes to boot, and this is not massively bad but I need a faster booting time.

So any idea ?

DirkS
Posts: 10015
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Slow boot time when using all usb ports

Thu Feb 26, 2015 3:31 pm

So any idea ?
See RaTTuS post above.

User avatar
RaTTuS
Posts: 10498
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK
Contact: Twitter YouTube

Re: Slow boot time when using all usb ports

Thu Feb 26, 2015 3:33 pm

see dmesg
i.e.
http://paste.debian.net/157582/
[sudo apt-get update && sudo apt-get install pastebinit
dmesg| pastebinit
]
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

osama_adel
Posts: 7
Joined: Thu Feb 26, 2015 2:06 pm

Re: Slow boot time when using all usb ports

Thu Feb 26, 2015 8:19 pm

Code: Select all

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Initializing cgroup subsys cpu
[    0.000000] Initializing cgroup subsys cpuacct
[    0.000000] Linux version 3.12.35+ ([email protected]) (gcc version 4.8.3 20                                                                                        140303 (prerelease) (crosstool-NG linaro-1.13.1+bzr2650 - Linaro GCC 2014.03) )                                                                                         #730 PREEMPT Fri Dec 19 18:31:24 GMT 2014
[    0.000000] CPU: ARMv6-compatible processor [410fb767] revision 7 (ARMv7), cr                                                                                        =00c5387d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT nonaliasing instruc                                                                                        tion cache
[    0.000000] Machine: BCM2708
[    0.000000] cma: CMA: reserved 8 MiB at 1b800000
[    0.000000] Memory policy: ECC disabled, Data cache writeback
[    0.000000] On node 0 totalpages: 114688
[    0.000000] free_area_init_node: node 0, pgdat c06282a0, node_mem_map c06d900                                                                                        0
[    0.000000]   Normal zone: 896 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 114688 pages, LIFO batch:31
[    0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[    0.000000] pcpu-alloc: [0] 0
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pag                                                                                        es: 113792
[    0.000000] Kernel command line: dma.dmachans=0x7f35 bcm2708_fb.fbwidth=656 b                                                                                        cm2708_fb.fbheight=416 bcm2708.boardrev=0x10 bcm2708.serial=0x93c0def7 smsc95xx.                                                                                        macaddr=B8:27:EB:C0:DE:F7 bcm2708_fb.fbswap=1 bcm2708.disk_led_gpio=47 bcm2708.d                                                                                        isk_led_active_low=0 sdhci-bcm2708.emmc_clock_freq=250000000 vc_mem.mem_base=0x1                                                                                        ec00000 vc_mem.mem_size=0x20000000  dwc_otg.lpm_enable=0 console=tty1 root=/dev/                                                                                        mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait ip=192.168.1.6
[    0.000000] PID hash table entries: 2048 (order: 1, 8192 bytes)
[    0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
[    0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
[    0.000000] Memory: 439492K/458752K available (4530K kernel code, 243K rwdata                                                                                        , 1352K rodata, 143K init, 701K bss, 19260K reserved)
[    0.000000] Virtual kernel memory layout:
[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
[    0.000000]     fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
[    0.000000]     vmalloc : 0xdc800000 - 0xff000000   ( 552 MB)
[    0.000000]     lowmem  : 0xc0000000 - 0xdc000000   ( 448 MB)
[    0.000000]     modules : 0xbf000000 - 0xc0000000   (  16 MB)
[    0.000000]       .text : 0xc0008000 - 0xc05c6c94   (5884 kB)
[    0.000000]       .init : 0xc05c7000 - 0xc05eaff4   ( 144 kB)
[    0.000000]       .data : 0xc05ec000 - 0xc0628de0   ( 244 kB)
[    0.000000]        .bss : 0xc0628dec - 0xc06d85e8   ( 702 kB)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] Preemptible hierarchical RCU implementation.
[    0.000000] NR_IRQS:394
[    0.000000] sched_clock: 32 bits at 1000kHz, resolution 1000ns, wraps every 4                                                                                        294967ms
[    0.000000] Switching to timer-based delay loop
[    0.000000] Console: colour dummy device 80x30
[    0.000000] console [tty1] enabled
[    0.001183] Calibrating delay loop (skipped), value calculated using timer fr                                                                                        equency.. 2.00 BogoMIPS (lpj=10000)
[    0.001239] pid_max: default: 32768 minimum: 301
[    0.001757] Mount-cache hash table entries: 512
[    0.002605] Initializing cgroup subsys memory
[    0.002716] Initializing cgroup subsys devices
[    0.002753] Initializing cgroup subsys freezer
[    0.002782] Initializing cgroup subsys blkio
[    0.002929] CPU: Testing write buffer coherency: ok
[    0.003376] Setting up static identity map for 0xc0450a78 - 0xc0450ad4
[    0.005304] devtmpfs: initialized
[    0.021468] VFP support v0.3: implementor 41 architecture 1 part 20 variant b                                                                                         rev 5
[    0.023058] NET: Registered protocol family 16
[    0.028432] DMA: preallocated 4096 KiB pool for atomic coherent allocations
[    0.029071] cpuidle: using governor ladder
[    0.029116] cpuidle: using governor menu
[    0.029537] bcm2708.uart_clock = 0
[    0.031472] hw-breakpoint: found 6 breakpoint and 1 watchpoint registers.
[    0.031527] hw-breakpoint: maximum watchpoint size is 4 bytes.
[    0.031562] mailbox: Broadcom VideoCore Mailbox driver
[    0.031656] bcm2708_vcio: mailbox at f200b880
[    0.031758] bcm_power: Broadcom power driver
[    0.031795] bcm_power_open() -> 0
[    0.031818] bcm_power_request(0, 8)
[    0.532545] bcm_mailbox_read -> 00000080, 0
[    0.532592] bcm_power_request -> 0
[    0.532852] Serial: AMBA PL011 UART driver
[    0.533025] dev:f1: ttyAMA0 at MMIO 0x20201000 (irq = 83, base_baud = 0) is a                                                                                         PL011 rev3
[    0.555591] bio: create slab <bio-0> at 0
[    0.557040] SCSI subsystem initialized
[    0.557305] usbcore: registered new interface driver usbfs
[    0.557423] usbcore: registered new interface driver hub
[    0.557728] usbcore: registered new device driver usb
[    0.559158] Switched to clocksource stc
[    0.559534] FS-Cache: Loaded
[    0.559876] CacheFiles: Loaded
[    0.572243] NET: Registered protocol family 2
[    0.573734] TCP established hash table entries: 4096 (order: 3, 32768 bytes)
[    0.573910] TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
[    0.574034] TCP: Hash tables configured (established 4096 bind 4096)
[    0.574137] TCP: reno registered
[    0.574178] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.574231] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.574705] NET: Registered protocol family 1
[    0.575323] RPC: Registered named UNIX socket transport module.
[    0.575379] RPC: Registered udp transport module.
[    0.575407] RPC: Registered tcp transport module.
[    0.575432] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.576331] bcm2708_dma: DMA manager at f2007000
[    0.576481] bcm2708_gpio: bcm2708_gpio_probe c05f9f10
[    0.576931] vc-mem: phys_addr:0x00000000 mem_base=0x1ec00000 mem_size:0x20000                                                                                        000(512 MiB)
[    0.578264] audit: initializing netlink socket (disabled)
[    0.578382] type=2000 audit(0.550:1): initialized
[    0.744233] VFS: Disk quotas dquot_6.5.2
[    0.744602] Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    0.746915] FS-Cache: Netfs 'nfs' registered for caching
[    0.748503] NFS: Registering the id_resolver key type
[    0.748666] Key type id_resolver registered
[    0.748703] Key type id_legacy registered
[    0.749565] msgmni has been set to 874
[    0.751574] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 2                                                                                        52)
[    0.751952] io scheduler noop registered
[    0.751999] io scheduler deadline registered (default)
[    0.752352] io scheduler cfq registered
[    0.753601] BCM2708FB: allocated DMA memory 5bc00000
[    0.753696] BCM2708FB: allocated DMA channel 0 @ f2007000
[    0.758870] Console: switching to colour frame buffer device 82x26
[    0.763829] bcm2708-dmaengine bcm2708-dmaengine: Load BCM2835 DMA engine driv                                                                                        er
[    0.765610] uart-pl011 dev:f1: no DMA platform data
[    0.767676] vc-cma: Videocore CMA driver
[    0.769055] vc-cma: vc_cma_base      = 0x00000000
[    0.770503] vc-cma: vc_cma_size      = 0x00000000 (0 MiB)
[    0.771814] vc-cma: vc_cma_initial   = 0x00000000 (0 MiB)
[    0.782261] brd: module loaded
[    0.788670] loop: module loaded
[    0.790484] vchiq: vchiq_init_state: slot_zero = 0xdb800000, is_master = 0
[    0.792830] Loading iSCSI transport class v2.0-870.
[    0.795193] usbcore: registered new interface driver smsc95xx
[    0.796702] dwc_otg: version 3.00a 10-AUG-2012 (platform bus)
[    0.998492] Core Release: 2.80a
[    0.999930] Setting default values for core params
[    1.001203] Finished setting default values for core params
[    1.202487] Using Buffer DMA mode
[    1.203804] Periodic Transfer Interrupt Enhancement - disabled
[    1.205093] Multiprocessor Interrupt Enhancement - disabled
[    1.206380] OTG VER PARAM: 0, OTG VER FLAG: 0
[    1.207683] Dedicated Tx FIFOs mode
[    1.209367] WARN::dwc_otg_hcd_init:1042: FIQ DMA bounce buffers: virt = 0xdbc                                                                                        14000 dma = 0x5bc14000 len=9024
[    1.212009] FIQ FSM acceleration enabled for :
[    1.212009] Non-periodic Split Transactions
[    1.212009] Periodic Split Transactions
[    1.212009] High-Speed Isochronous Endpoints
[    1.217137] dwc_otg: Microframe scheduler enabled
[    1.217215] WARN::hcd_init:473: FIQ at 0xc0329458
[    1.218566] WARN::hcd_init:474: FIQ ASM at 0xc0329708 length 36
[    1.220004] WARN::hcd_init:500: MPHI regs_base at 0xdc806000
[    1.221369] dwc_otg bcm2708_usb: DWC OTG Controller
[    1.222713] dwc_otg bcm2708_usb: new USB bus registered, assigned bus number                                                                                         1
[    1.224105] dwc_otg bcm2708_usb: irq 32, io mem 0x00000000
[    1.225442] Init: Port Power? op_state=1
[    1.226711] Init: Power Port (0)
[    1.228282] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[    1.229688] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=                                                                                        1
[    1.231022] usb usb1: Product: DWC OTG Controller
[    1.232303] usb usb1: Manufacturer: Linux 3.12.35+ dwc_otg_hcd
[    1.233578] usb usb1: SerialNumber: bcm2708_usb
[    1.235686] hub 1-0:1.0: USB hub found
[    1.237084] hub 1-0:1.0: 1 port detected
[    1.238809] dwc_otg: FIQ enabled
[    1.238827] dwc_otg: NAK holdoff enabled
[    1.238836] dwc_otg: FIQ split-transaction FSM enabled
[    1.238855] Module dwc_common_port init
[    1.239390] usbcore: registered new interface driver usb-storage
[    1.240997] mousedev: PS/2 mouse device common for all mice
[    1.242907] bcm2835-cpufreq: min=700000 max=700000 cur=700000
[    1.244294] bcm2835-cpufreq: switching to governor powersave
[    1.245531] bcm2835-cpufreq: switching to governor powersave
[    1.246806] sdhci: Secure Digital Host Controller Interface driver
[    1.248039] sdhci: Copyright(c) Pierre Ossman
[    1.249621] DMA channels allocated for the MMC driver
[    1.289223] Load BCM2835 MMC driver
[    1.291988] sdhci-pltfm: SDHCI platform and OF driver helper
[    1.293291] ledtrig-cpu: registered to indicate activity on CPUs
[    1.294653] hidraw: raw HID events driver (C) Jiri Kosina
[    1.296124] usbcore: registered new interface driver usbhid
[    1.297432] usbhid: USB HID core driver
[    1.299431] TCP: cubic registered
[    1.301817] Initializing XFRM netlink socket
[    1.306250] NET: Registered protocol family 17
[    1.309805] Key type dns_resolver registered
[    1.318513] registered taskstats version 1
[    1.322039] vc-sm: Videocore shared memory driver
[    1.323396] [vc_sm_connected_init]: start
[    1.328996] [vc_sm_connected_init]: end - returning 0
[    1.356968] mmc0: host does not support reading read-only switch. assuming wr                                                                                        ite-enable.
[    1.361625] mmc0: new high speed SDHC card at address 1234
[    1.363666] mmcblk0: mmc0:1234 SA08G 7.21 GiB
[    1.366781]  mmcblk0: p1 p2
[    1.429368] Indeed it is in host mode hprt0 = 00021501
[    1.609305] usb 1-1: new high-speed USB device number 2 using dwc_otg
[    1.610881] Indeed it is in host mode hprt0 = 00001101
[    1.809565] usb 1-1: New USB device found, idVendor=0424, idProduct=9514
[    1.811022] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[    1.813281] hub 1-1:1.0: USB hub found
[    1.814817] hub 1-1:1.0: 5 ports detected
[    2.089324] usb 1-1.1: new high-speed USB device number 3 using dwc_otg
[    2.189582] usb 1-1.1: New USB device found, idVendor=0424, idProduct=ec00
[    2.191068] usb 1-1.1: New USB device strings: Mfr=0, Product=0, SerialNumber                                                                                        =0
[    2.195393] smsc95xx v1.0.4
[    2.252881] smsc95xx 1-1.1:1.0 eth0: register 'smsc95xx' at usb-bcm2708_usb-1                                                                                        .1, smsc95xx USB 2.0 Ethernet, b8:27:eb:c0:de:f7
[    2.401867] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
[    2.489322] usb 1-1.2: new high-speed USB device number 4 using dwc_otg
[    2.616235] usb 1-1.2: New USB device found, idVendor=0ac8, idProduct=3500
[    2.617902] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber                                                                                        =3
[    2.619542] usb 1-1.2: Product: A4 TECH HD PC Camera
[    2.621125] usb 1-1.2: Manufacturer: A4 TECH
[    2.622614] usb 1-1.2: SerialNumber: MI1320_SOC
[    2.859319] usb 1-1.4: new high-speed USB device number 5 using dwc_otg
[    2.986326] usb 1-1.4: New USB device found, idVendor=0ac8, idProduct=3500
[    2.987958] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber                                                                                        =3
[    2.989548] usb 1-1.4: Product: A4 TECH HD PC Camera
[    2.991024] usb 1-1.4: Manufacturer: A4 TECH
[    2.992451] usb 1-1.4: SerialNumber: MI1320_SOC
[    3.877978] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0x4DE                                                                                        1
[    3.899229] IP-Config: Guessing netmask 255.255.255.0
[    3.901198] IP-Config: Complete:
[    3.902668]      device=eth0, hwaddr=b8:27:eb:c0:de:f7, ipaddr=192.168.1.6, m                                                                                        ask=255.255.255.0, gw=255.255.255.255
[    3.905550]      host=192.168.1.6, domain=, nis-domain=(none)
[    3.907014]      bootserver=255.255.255.255, rootserver=255.255.255.255, root                                                                                        path=
[    6.992161] EXT4-fs (mmcblk0p2): recovery complete
[    7.001529] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. O                                                                                        pts: (null)
[    7.004551] VFS: Mounted root (ext4 filesystem) on device 179:2.
[    7.007455] devtmpfs: mounted
[    7.009573] Freeing unused kernel memory: 140K (c05c7000 - c05ea000)
[    8.467669] udevd[158]: starting version 175
[    9.519674] bcm2708_spi bcm2708_spi.0: master is unqueued, this is deprecated
[    9.599421] bcm2708_spi bcm2708_spi.0: SPI Controller at 0x20204000 (irq 80)
[   10.078801] media: Linux media interface: v0.10
[   10.203892] Linux video capture interface: v2.00
[   10.331422] uvcvideo: Found UVC 1.00 device A4 TECH HD PC Camera (0ac8:3500)
[   10.374279] input: A4 TECH HD PC Camera as /devices/platform/bcm2708_usb/usb1                                                                                        /1-1/1-1.2/1-1.2:1.0/input/input0
[   10.405697] uvcvideo: Found UVC 1.00 device A4 TECH HD PC Camera (0ac8:3500)
[   10.469692] input: A4 TECH HD PC Camera as /devices/platform/bcm2708_usb/usb1                                                                                        /1-1/1-1.4/1-1.4:1.0/input/input1
[   10.594898] usbcore: registered new interface driver uvcvideo
[   10.596793] USB Video Class driver (1.1.1)
[  111.134887] usbcore: registered new interface driver snd-usb-audio
[  113.648967] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[  114.152117] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[  127.228161] Adding 102396k swap on /var/swap.  Priority:-1 extents:2 across:2                                                          134012k SSFS
This was the output of "dmesg"
So as shown,

Code: Select all

[   10.596793] USB Video Class driver (1.1.1)
[  111.134887] usbcore: registered new interface driver snd-usb-audio
Here things go crazy, so what is this ?!!

User avatar
DougieLawson
Posts: 36544
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Slow boot time when using all usb ports

Thu Feb 26, 2015 8:33 pm

Do you have a cable connected to your eth0? Because with ip=192.168.1.6 in your /boot/cmdline.txt you can get a boot delay of 120 seconds if the eth0 interface doesn't come up active during boot.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

osama_adel
Posts: 7
Joined: Thu Feb 26, 2015 2:06 pm

Re: Slow boot time when using all usb ports

Fri Feb 27, 2015 1:46 pm

Yes, the eth0 is always connected. So why wouldn't it be active during boot ?
My laptop detects a network (when I connect the RPi directly to it) just after powering on the RPi by just seconds, doesn't this mean that the ethernet interface in the raspberry is active by then ?

User avatar
RaTTuS
Posts: 10498
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK
Contact: Twitter YouTube

Re: Slow boot time when using all usb ports

Fri Feb 27, 2015 1:54 pm

lsusb | pastebinit
lsusb -v | pastebinit
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

Return to “Troubleshooting”