libusb performance on 8.1

2011-01-19 Thread Daniel O'Connor
[re-sent from the correct address]

Hi,
I am building a USB interface to a radar data acquisition chassis based on the 
Cypress CY7C68013A.

While doing some speed testing I find that FreeBSD does ~4Mb/sec, but Linux 
does 17Mb/sec & OS X does 8-10Mb/sec.

It is using libusb-1.0 with the async API in a threaded app. I spawn a thread 
which sites in the following loop:

   while (!child_exit) {
tout.tv_sec = 0;
tout.tv_usec = 10;
libusb_handle_events_timeout(ctx, &tout);
   }
   ugsio_cancelusb();

The parent thread is the rest of the program which and handles reading data out 
of the completed transfers and forwarding them to the data processing children 
and re-submitting them to the USB stack.

I keep 8 transactions of 512 bytes each in flight. The device itself holds up 
to 4 packets in a FIFO until the PC is ready. Increasing the number of 
transactions in flight has no effect on performance.

Does anyone have a suggestion as to how I can look at improving performance? 
Deploying Linux is not really an option :)

The Linux PC is..
Linux fpgawork 2.6.32-28-generic #55-Ubuntu SMP Mon Jan 10 23:42:43 UTC 2011 
x86_64 GNU/Linux
The CPU is a Core 2 E6400 @ 2.13GHz on a Gigabyte 965P-DS3 rev 1 
(http://www.gigabyte.com/products/product-page.aspx?pid=2314#ov) which has an 
ICH8 chipset.

The FreeBSD PC is..
FreeBSD aumond8.gsoft.com.au 8.1-RELEASE FreeBSD 8.1-RELEASE #0: Mon Jul 19 
02:55:53 UTC 2010 r...@almeida.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC 
 i386
The CPU is a Core 2 E7500 @ 2.93GHz on a Supermicro C2SBA+ 
(http://www.supermicro.com/products/motherboard/Core/G33/C2SBA_.cfm) which has 
an ICH9 chipset.

Any patches welcome!

Thanks.
--
Daniel O'Connor software and network engineer
for Genesis Software - http://www.gsoft.com.au
"The nice thing about standards is that there
are so many of them to choose from."
  -- Andrew Tanenbaum
GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C






___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


libusb performance on 8.1

2011-01-19 Thread Daniel O'Connor
Hi,
I am building a USB interface to a radar data acquisition chassis based on the 
Cypress CY7C68013A.

While doing some speed testing I find that FreeBSD does ~4Mb/sec, but Linux 
does 17Mb/sec & OS X does 8-10Mb/sec.

It is using libusb-1.0 with the async API in a threaded app. I spawn a thread 
which sites in the following loop:

while (!child_exit) {
tout.tv_sec = 0;
tout.tv_usec = 10;
libusb_handle_events_timeout(ctx, &tout);
}
ugsio_cancelusb();

The parent thread is the rest of the program which and handles reading data out 
of the completed transfers and forwarding them to the data processing children 
and re-submitting them to the USB stack.

I keep 8 transactions of 512 bytes each in flight. The device itself holds up 
to 4 packets in a FIFO until the PC is ready. Increasing the number of 
transactions in flight has no effect on performance.

Does anyone have a suggestion as to how I can look at improving performance? 
Deploying Linux is not really an option :)

The Linux PC is..
Linux fpgawork 2.6.32-28-generic #55-Ubuntu SMP Mon Jan 10 23:42:43 UTC 2011 
x86_64 GNU/Linux
The CPU is a Core 2 E6400 @ 2.13GHz on a Gigabyte 965P-DS3 rev 1 
(http://www.gigabyte.com/products/product-page.aspx?pid=2314#ov) which has an 
ICH8 chipset.

The FreeBSD PC is..
FreeBSD aumond8.gsoft.com.au 8.1-RELEASE FreeBSD 8.1-RELEASE #0: Mon Jul 19 
02:55:53 UTC 2010 r...@almeida.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC 
 i386
The CPU is a Core 2 E7500 @ 2.93GHz on a Supermicro C2SBA+ 
(http://www.supermicro.com/products/motherboard/Core/G33/C2SBA_.cfm) which has 
an ICH9 chipset.

Any patches welcome!

Thanks.

--
Daniel O'Connor software and network engineer
for Genesis Software - http://www.gsoft.com.au
"The nice thing about standards is that there
are so many of them to choose from."
  -- Andrew Tanenbaum
GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C






___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


page fault on device disconnect

2011-01-19 Thread Marcin Wisnicki
I've accidentally cut power to my self-powered USB hdd enclosure with
UFS+gjournal on GELI.
The enclosure also acts as a hub and has single usb memory stick plugged
in but not mounted.

I kind of expected to have panic in VFS as is typical in such situations
but instead it happened earlier in the stack:

ugen3.2:  at usbus3 (disconnected)
uhub4: at uhub3, port 1, addr 2 (disconnected)


Fatal trap 12: page fault while in kernel mode
cpuid = 0; apic id = 00
fault virtual address   = 0xea7820aa
fault code  = supervisor read, page not present
instruction pointer = 0x20:0xc0710d64
stack pointer   = 0x28:0xe4239afc
frame pointer   = 0x28:0xe4239b0c
code segment= base 0x0, limit 0xf, type 0x1b
= DPL 0, pres 1, def32 1, gran 1
processor eflags= interrupt enabled, resume, IOPL = 0
current process = 15 (usbus3)
trap number = 12
panic: page fault
cpuid = 0
KDB: stack backtrace:
db_trace_self_wrapper(c076c1d5,d31206e,2c66000a,70797420,78302065,...) at 
db_trace_self_wrapper+0x26
kdb_backtrace(c078804a,0,c075dd75,e42399a8,0,...) at kdb_backtrace+0x2a
panic(c075dd75,c0788d33,c3e43438,1,1,...) at panic+0x117
trap_fatal(c119,ea782000,1,0,c3e432d0,...) at trap_fatal+0x325
trap_pfault(0,0,9ed23521,c3e432d0,c3d82000,...) at trap_pfault+0x250
trap(e4239abc) at trap+0x453
calltrap() at calltrap+0x6
--- trap 0xc, eip = 0xc0710d64, esp = 0xe4239afc, ebp = 0xe4239b0c ---
bus_dma_tag_destroy(ea78207a,c44767d0,c4476400,c44c10a0,e4239b44,...) at 
bus_dma_tag_destroy+0x14
usb_dma_tag_unsetup(c4476400,0,c09cc592,491,c44764b0,...) at 
usb_dma_tag_unsetup+0x3e
usbd_transfer_unsetup_sub(c3e60dd4,0,c09cc592,4f0,0,...) at 
usbd_transfer_unsetup_sub+0xa0
usbd_transfer_unsetup(c44c10a0,1,c44c1200,1,0,...) at 
usbd_transfer_unsetup+0x1ad
uhub_detach(c44c1200,c3d8f860,c079b618,e4239bc4,c0527199,...) at 
uhub_detach+0x3a
device_detach(c44c1200,c09cbde6,c4466bd0,1,2,...) at device_detach+0x68
usb_detach_device(c447d000,ff,2,c447d0f0,c447d000,...) at usb_detach_device+0x3f
usb_unconfigure(c44c9600,c09bb1f0,c3fda440,7f2,c3e60c78,...) at 
usb_unconfigure+0x36
usb_free_device(c447d000,0,1,10,c3e60dd4,...) at usb_free_device+0x18a
uhub_explore(c3eba400,0,c09cb510,f7,c3e60d5c,...) at uhub_explore+0x128
usb_bus_explore(c3e60d5c,c3e60dd4,c09cc4e1,6c,c3e60d0c,...) at 
usb_bus_explore+0xb8
usb_process(c3e60cfc,e4239d28,492,18080458,3019040,...) at usb_process+0xaa
fork_exit(c09c5890,c3e60cfc,e4239d28) at fork_exit+0x90
fork_trampoline() at fork_trampoline+0x8
--- trap 0, eip = 0, esp = 0xe4239d60, ebp = 0 ---
Uptime: 30d19h59m54s
(da0:umass-sim0:0:0:0): SYNCHRONIZE CACHE(10). CDB: 35 0 0 0 0 0 0 0 0 0
(da0:umass-sim0:0:0:0): SCSI sense: Error code 0x3e


# FreeBSD 8.2-PRERELEASE #0: Sun Dec 19 19:59:25 CET 2010

It's not really important to me but if someone wants to work on it
I can provide more info.

___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


Re: gphoto2 and canon ixus 960is

2011-01-19 Thread Jens Jahnke
On Wed, 19 Jan 2011 15:39:54 +0100
Hans Petter Selasky  wrote:

HPS> Have you correctly given permission to the
HPS> corresponding /dev/ugenX.Y device?

Do'h. Stupid me!
I've set some devfs-rules so /dev/ugen* and /dev/usb* are +rw for group
operator and now it works.

Thanks,

Jens

-- 
19. Hartung 2011, 16:18
Homepage : http://www.jan0sch.de

Bride, n.:
A woman with a fine prospect of happiness behind her.
-- Ambrose Bierce, "The Devil's Dictionary"


pgpkyaV45BG8n.pgp
Description: PGP signature


Re: gphoto2 and canon ixus 960is

2011-01-19 Thread Hans Petter Selasky
> 
> Have you correctly given permission to the corresponding /dev/ugenX.Y
> device?

Also check /dev/usbX.Y

--HPS
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


Re: gphoto2 and canon ixus 960is

2011-01-19 Thread Hans Petter Selasky
On Wednesday 19 January 2011 13:17:21 Jens Jahnke wrote:
> Hi,
> 
> I just tried to import photos from my canon ixus 960is and but it is
> not recognized.
> 
> Output from /var/log/messages:
> Jan 19 13:10:14 magni kernel: ugen7.2:  at usbus7
> Jan 19 13:10:14 magni root: Unknown USB device: vendor 0x04a9 product
> 0x315f bus uhub7
> 
> I found some hints on the ml archives from several years back and tried
> the following command line:
> jens@magni:~% gphoto2 --debug --debug-logfile=gphoto2.log --camera
> "Canon Digital IXUS 960 IS (PTP mode)" --port "usb:" -l
> *** Fehler ***
> Ein Fehler trat in der IO-Bibliothek auf (»Falsche Parameter«): Keine
> Fehlerbeschreibung verfügbar. *** Fehler (-2: »Falsche Parameter«)
> ***
> 
> The log file from gphoto2 is attached.
> 
> Output of `uname -a`:
> FreeBSD magni.rostock.home 8.1-RELEASE FreeBSD 8.1-RELEASE #0: Mon Jul
> 19 02:36:49 UTC 2010
> r...@mason.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  amd64
> 
> Any ideas?

Have you correctly given permission to the corresponding /dev/ugenX.Y device?

--HPS
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"


gphoto2 and canon ixus 960is

2011-01-19 Thread Jens Jahnke
Hi,

I just tried to import photos from my canon ixus 960is and but it is
not recognized.

Output from /var/log/messages:
Jan 19 13:10:14 magni kernel: ugen7.2:  at usbus7
Jan 19 13:10:14 magni root: Unknown USB device: vendor 0x04a9 product
0x315f bus uhub7

I found some hints on the ml archives from several years back and tried
the following command line:
jens@magni:~% gphoto2 --debug --debug-logfile=gphoto2.log --camera
"Canon Digital IXUS 960 IS (PTP mode)" --port "usb:" -l 
*** Fehler ***  
Ein Fehler trat in der IO-Bibliothek auf (»Falsche Parameter«): Keine
Fehlerbeschreibung verfügbar. *** Fehler (-2: »Falsche Parameter«)
***  

The log file from gphoto2 is attached.

Output of `uname -a`:
FreeBSD magni.rostock.home 8.1-RELEASE FreeBSD 8.1-RELEASE #0: Mon Jul
19 02:36:49 UTC 2010
r...@mason.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  amd64

Any ideas?

Regards,

Jens

-- 
19. Hartung 2011, 13:04
Homepage : http://www.jan0sch.de

Larkinson's Law:
All laws are basically false.


gphoto2.log
Description: Binary data


pgpGvVm8iaWle.pgp
Description: PGP signature