From: Banerjee, T. S. (MU-Student) <ts...@ma...> - 2013-06-26 21:15:08
|
Hi, Trying again.. I am a newbie in linux so I'd really appreciate your help. I am using libusb-1.0.9 which I compiled from source on a Debian 6.0.7 machine. To give you a better idea of the project, I am trying to hook up a Dreamplug using a Kinect so I need the libusb to interact with the Kinect device. To do that, from my function I call : dev->depth.pkt_size = DEPTH_PKTDSIZE; dev->depth.synced = 0; dev->depth.flag = 0x70; dev->depth.valid_frames = 0; dev->depth.stf = 0; res = fnusb_start_iso(&dev->usb_cam, &dev->depth_isoc, depth_process, 0x82, DEPTH_NUM_XFERS, PKTS_PER_XFER, DEPTH_PKTBUF); This in turn links to usb_libusb10.c int fnusb_start_iso(fnusb_dev *dev, fnusb_isoc_stream *strm, fnusb_iso_cb cb, int ep, int xfers, int pkts, int len) { freenect_context *ctx = dev->parent->parent; int ret, i; strm->parent = dev; strm->cb = cb; strm->num_xfers = xfers; strm->pkts = pkts; strm->len = len; strm->buffer = (uint8_t*)malloc(xfers * pkts * len); strm->xfers = (struct libusb_transfer**)malloc(sizeof(struct libusb_transfer*) * xfers); strm->dead = 0; strm->dead_xfers = 0; uint8_t *bufp = strm->buffer; for (i=0; i<xfers; i++) { printf("Creating EP %02x transfer #%d\n", ep, i); strm->xfers[i] = libusb_alloc_transfer(pkts); libusb_fill_iso_transfer(strm->xfers[i], dev->dev, ep, bufp, pkts * len, pkts, iso_callback, strm, 0); libusb_set_iso_packet_lengths(strm->xfers[i], len); ret = libusb_submit_transfer(strm->xfers[i]); . . . After linking this to the libusb-1.0.9 source code, it goes to io.c Unfortunately, there is a seg fault inside io.c at struct libusb_context *ctx = TRANSFER_CTX(transfer); The debug statements indicate that it reaches inside the function and then seg faults on this line. I tried initializing the pointer to NULL and also have been playing around with the packet parameters in the hope that if there is a stack overflow, that should help. Any suggestions? Thanks, Tanvi |