irimi
Posts: 8
Joined: Thu Jul 12, 2012 10:32 am

USB bulk transfer timeout trouble [solved]

Tue Jul 02, 2013 8:56 pm

Hi,

I trying to run PyDPFon my Pi but it fails due to bulk write timeout errors:

Code: Select all

File "dpflib_py.py", line 240, in _emulate_scsi
    ret = self._handle.bulkWrite(ENDPT_OUT, outdata,1000)
usb.USBError: Connection timed out
resp.

Code: Select all

root@myPi:~/pydpf/display# python dpflib_py.py 
DPF Device 0x1908:0x102 found at /dev/bus/usb/001/007
Display = Pearl DPF in landscape mode:
        X resolution = 320
        Y resolution = 240
Error bulk write
The code is using pyusb. But same problem with my C-code based implementation.

I'm using http://openwrt.org distri but with some modifications to switch to hardfloat and newer kernel.

The interesting thing is that I was able to reproduce the problem with
- recent raspbian wheezy version with kernel 3.6.11 hard / softfloat
- kernel 3.8.x (hf),
- kernel 3.9.8 even with latest commit(hf)

BUT NOT WITH kernel version 3.3.8 which is part of openwrt attitude adjustment release openwrt attitude adjustment release.
With that kernel version the transfer time is MUCH faster, no time-outs occur.

As far I know there are some known problems with raspberry's usb implementation, maybe this information helps !?
Last edited by irimi on Sat Aug 10, 2013 12:31 pm, edited 1 time in total.

ricpersi
Posts: 2
Joined: Thu Jul 04, 2013 7:57 am

Re: USB bulk transfer timeout trouble

Thu Jul 04, 2013 8:02 am

Hi irimi,

I'm trying to get openwrt compiled with kernel 3.6. Do you mind sharing how you got it compiled with newer kernel versions than 3.3?

Thanks a lot in advance.

irimi
Posts: 8
Joined: Thu Jul 12, 2012 10:32 am

Re: USB bulk transfer timeout trouble

Thu Jul 04, 2013 6:12 pm

I just did this dirty hack:
  • - checkout trunk version
    - edit target/linux/brcm2708/Makefile and change kernel version here to your desired 3.6.11
    - copy a new kernel base config to target/linux/brcm2708/config3.6 (e.g. copy old 3.3)
    - remove 880-* patch in target/linux/generic/3.6-patches

    - get https://github.com/raspberrypi/linux/ar ... -3.6.y.zip, unzip it, then rename directory linux-3.6.11 ,
    re-create tar cf linux-3.6.11 && xz linux.3.6.11 to get this archive: linux-3-6-11.tar.xz and move that archive to your dl directory.

    - finally rebuild image with make V=99 (and optional when kernel config prompt occurs, check / update your kernel config in target/...brcm2708/config3.6
Keep in mind to update firmware ;-)

gsh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1557
Joined: Sat Sep 10, 2011 11:43 am

Re: USB bulk transfer timeout trouble

Thu Jul 04, 2013 6:35 pm

Are there any errors in dmesg?
--
Gordon Hollingworth PhD
Raspberry Pi - Director of Software Engineering

irimi
Posts: 8
Joined: Thu Jul 12, 2012 10:32 am

Re: USB bulk transfer timeout trouble

Fri Jul 05, 2013 2:21 pm

No, dmesg output is clean. I can see on the DPF the bulk transfer is started successfully, but it is veeeery slooow: the graphic on the DPF is built line by line and finally breaks when display update is 50% completed with time-out, after about 2-3s.

In normal case (i.e. with kernel 3.3.8) transfer time is <1s and the DPF's display update can't be recognized.

Hence from my point of view recent driver's implementation is too slow !?

irimi
Posts: 8
Joined: Thu Jul 12, 2012 10:32 am

USB bulk transfer timeout trouble [solved]]

Sat Aug 10, 2013 12:30 pm

I recompiled the 3.6.11 kernel with latest USB changes yesterday and problem is solved now.

A big "Thank you" to popcornmix !

Return to “Troubleshooting”