BoS
Posts: 22
Joined: Fri Nov 15, 2013 1:02 pm

USB Isochronous Transfers: What is RPi Status?

Fri Dec 06, 2013 7:37 pm

Hi all,

I have had no replies to my questions on the status of USB isochronous transfers. Can someone within the development team for the kernel please tell me what the official stance is please?

Is it recognised that they don't work?
If so, is there a plan to support them?
Is it within the remit of the kernel team to fix this or is it within the dwc_otg code?
If that is the case, who supports that?

I have now tried both a model A and B with the same disappointing results. I would just like to know whether I should hang on and wait for support or whether I should just be throwing these modules in the bin.

I'm sorry if I sound a bit off, just frustrated that I can't progress with my project :-(

Thanks,

BoS

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

Re: USB Isochronous Transfers: What is RPi Status?

Fri Dec 06, 2013 7:47 pm

Yeah it's being worked on... What specifically are you having trouble with, I assume isochronous USB 1.1 transactions...
--
Gordon Hollingworth PhD
Raspberry Pi - Director of Software Engineering

BoS
Posts: 22
Joined: Fri Nov 15, 2013 1:02 pm

Re: USB Isochronous Transfers: What is RPi Status?

Fri Dec 06, 2013 7:52 pm

Thank you very much for replying. I am using a 2.0 only device hence why I can't try the 1.1 options I've seen in other posts.

Do you have a timeframe for a release?

Thanks,

BoS

BoS
Posts: 22
Joined: Fri Nov 15, 2013 1:02 pm

Re: USB Isochronous Transfers: What is RPi Status?

Thu Jan 30, 2014 9:34 am

Any update?

Thanks, BoS

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

Re: USB Isochronous Transfers: What is RPi Status?

Sat Feb 22, 2014 7:23 am

http://www.raspberrypi.org/forum/viewto ... 85#p509285

Please try this and see how it fares... (Please make sure you report back)...
--
Gordon Hollingworth PhD
Raspberry Pi - Director of Software Engineering

BoS
Posts: 22
Joined: Fri Nov 15, 2013 1:02 pm

Re: USB Isochronous Transfers: What is RPi Status?

Fri Feb 28, 2014 4:07 pm

Hi,

Thanks for posting the updated kernel information. I have tried with our application and I get the same result as before. I suspect because I'm using 2.0 isochronous transfer and that hasn't been implemented yet.

It's great news that the USB stack is being addressed. Is there a timeframe for the isochronous transfer to be implemented?

Thanks and best regards,

BoS

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

Re: USB Isochronous Transfers: What is RPi Status?

Fri Feb 28, 2014 4:23 pm

What is it you are trying to do, what bandwidth is the device (there's nothing wrong with USB2 isochronous, it's high bandwidth isochronous transfers that haven't yet been implemented)

What is the error you are seeing?

Gordon
--
Gordon Hollingworth PhD
Raspberry Pi - Director of Software Engineering

BoS
Posts: 22
Joined: Fri Nov 15, 2013 1:02 pm

Re: USB Isochronous Transfers: What is RPi Status?

Sat Mar 01, 2014 1:25 am

Sorry, didn't explain properly. I have a USB 2.0 only device (hi-speed) and the forum post said that hi-speed isochronous wasn't yet implemented.

I can control the device without any problems but as soon as I tell it to start sending data over the USB port I get a lot of transferred=0 messages (from libusb debug) - if I run the same code on a Linux machine, it works fine.

Hope that helps.

Best regards,

BoS

BoS
Posts: 22
Joined: Fri Nov 15, 2013 1:02 pm

Re: USB Isochronous Transfers: What is RPi Status?

Fri Jun 06, 2014 2:45 pm

Any update on this please?

Thanks,

BoS

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

Re: USB Isochronous Transfers: What is RPi Status?

Fri Jun 06, 2014 2:47 pm

Try again with latest rpi-update
--
Gordon Hollingworth PhD
Raspberry Pi - Director of Software Engineering

BoS
Posts: 22
Joined: Fri Nov 15, 2013 1:02 pm

Re: USB Isochronous Transfers: What is RPi Status?

Thu Jul 17, 2014 12:47 pm

Hi,

I just wanted to report back that I now seem to have data coming across and now the next job is to validate it. This is great, so thanks for continue to work on this.

Best regards,

BoS

thetechnobear
Posts: 8
Joined: Mon Mar 02, 2015 11:12 am

Re: USB Isochronous Transfers: What is RPi Status?

Sun Mar 08, 2015 9:57 pm

Is there any update on this?

Ive got (what appears to be ) the same problem as BoS....
what I can see, is I get iso return buffers filled with zeros.

to be precise:
the same code works for 2 different devices on a linux/PC platform with no issue.
on the PI
one device, which is USB 1.1 fills the buffers with zeros (incorrectly)
yet another device, USB 2.0, works correctly!

exactly the same code, build on libusb.
Ive, of course, checked things like packet size limitations (but as i say its working on the PC for both devices).
also I re-iterate libusb is return no errors, even with debug logging, its saying everything is completing fine...
I just dont get the data.

also (oddly) im finding libusb is returning 1/2 the number of bytes I request, and that the device is able to send in a packet.
(again of course verified on another platform)

I wondering... this thread implies a kernel fix, but was it only applied to 2.0 devices?

if so, its going to make the PI unusable for 1.10 devices using ISO transfers, and kill part of my project :(

EDIT: note, im using a PI2 , running the linaro distribution... I can test on raspbian , but my experience so far is linaro is futher on, than raspbian i.e unlikely to be better.
Raspberry PI2 running Raspbian & Linaro

mikesolem
Posts: 1
Joined: Mon Dec 21, 2015 12:35 am

Re: USB Isochronous Transfers: What is RPi Status?

Mon Dec 21, 2015 12:41 am

I have a similar problem as well.

My code runs fine on a Ubuntu based laptop, but does not work
correctly when running on the raspberry pi 2. I also tried it on a
raspberry pi 1 with the same problems.

The code below reads 16 bytes of data in isochronous mode (using
libusb). On the pi it says that it read 16 bytes, but it does not
actually write any data to the receive buffer.

The device I'm talking to is a dsPIC33e evaluation board.
http://www.microchip.com/Developmenttoo ... tarter+Kit
It is running their microphone example.

This is the simplest example I could come up with which shows the problem:

Code: Select all

/* Makefile */
/* all: */
/* 	gcc -g3 -std=gnu99 -c -o simple.o simple.c */
/* 	gcc -g3 -std=gnu99 -o simple simple.o -lusb-1.0 */

#include <unistd.h>
#include <stdio.h>
#include <string.h>
#include <libusb-1.0/libusb.h>

#define VID_TO_CLAIM    0x04d8
#define PID_TO_CLAIM    0x0065
#define ISOC_OUT_EP     0x06
#define ISOC_IN_EP      0x81
#define MAX_ISOC_PACKET_SIZE 16

struct isoc_trans
{
   struct libusb_transfer *transfer_buff;
   uint8_t isoc_buffer[MAX_ISOC_PACKET_SIZE];
};

struct isoc_trans transfer;


void isoc_transfer_completion_handler(struct libusb_transfer *the_transfer)
{
   printf("The isoc transfer has completed, status = %d\n", the_transfer->status);
   printf("length = %d\n", the_transfer->length);
   printf("actual_length = %d\n", the_transfer->actual_length);
   printf("num_iso_packets = %d\n", the_transfer->num_iso_packets);

   struct libusb_iso_packet_descriptor *desc =
      &the_transfer->iso_packet_desc[0];

   unsigned char* p = the_transfer->buffer;
   for(int j=0; j < desc->actual_length; ++j)
   {
      printf("%x ", *p);
      ++p;
   }
   printf("\n");
}

int main()
{
   // --------- Init USB and open device ---------
   int r = libusb_init(NULL);
   if (r < 0) 
   {
      printf("failed to init libusb\n");
      return (-1);
   }

   libusb_device_handle *devh = libusb_open_device_with_vid_pid(NULL,
                                                                VID_TO_CLAIM,
                                                                PID_TO_CLAIM);
   if(devh == 0) 
   {
      printf("libusb_open_device_with_vid_pid failed\n");
      return (-1);
   }

   r = libusb_set_configuration(devh, 1);
   if(r)
   {
      printf("libusb_set_configuration(devh, 1) failed with error %d\n", r);
      goto EXIT;
   }

   r = libusb_claim_interface(devh, 1);
   if (r < 0) 
   {
      printf("unable to claim interface 0 on usb device %d\n", r);
      libusb_close(devh);
      devh = NULL;
      return (r);
   }

   r = libusb_set_interface_alt_setting(devh, 1, 1);
   if(r)
   {
      printf("libusb_set_interface_alt_setting(devh, 1, 1) failed with error %d\n", r);
      goto EXIT;
   }
 

   // --------- Setup transfer data ---------
   memset(&transfer, 0, sizeof(transfer));
          transfer.isoc_buffer[0] = 42; // This should be overwritten when data is received

   transfer.transfer_buff = libusb_alloc_transfer(1);

   libusb_fill_iso_transfer(transfer.transfer_buff,
                            devh,
                            ISOC_IN_EP,
                            transfer.isoc_buffer,
                            MAX_ISOC_PACKET_SIZE,
                            1,
                            isoc_transfer_completion_handler,
                            &transfer,
                            1000);

   libusb_set_iso_packet_lengths(transfer.transfer_buff,
                                 MAX_ISOC_PACKET_SIZE);


   //  --------- Submmit the transfer
   r = libusb_submit_transfer(transfer.transfer_buff);
   if(r)
   {
      printf("libusb_submit_transfer failed with err = %d\n", r);
      goto EXIT;
   }

   libusb_handle_events(NULL);

   // --------- Cleanup ---------
EXIT:
   libusb_release_interface(devh, 1);
   libusb_close(devh);

   return 0;
}
Running this code will output this:
The isoc transfer has completed, status = 0
length = 16
actual_length = 0
num_iso_packets = 1
2a 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
The bottom line should be showing values other than zero. I verified
with a USB sniffer that non-zero data is on the bus. When I run the
code on the laptop, I see the correct data there.

Here is some version info:
[email protected] ~/teltec_tmp $ uname -a
Linux raspberrypi 4.1.13-v7+ #826 SMP PREEMPT Fri Nov 13 20:19:03 GMT 2015 armv7l GNU/Linux

[email protected] ~/teltec_tmp $ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 8 (jessie)"
NAME="Raspbian GNU/Linux"
VERSION_ID="8"
VERSION="8 (jessie)"
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

[email protected] ~/teltec_tmp $ dmesg | grep dwc_otg
[ 0.000000] Kernel command line: dma.dmachans=0x7f35 bcm2708_fb.fbwidth=1776 bcm2708_fb.fbheight=952 bcm2709.boardrev=0xa21041 bcm2709.serial=0x2c487395 smsc95xx.macaddr=B8:27:EB:48:73:95 bcm2708_fb.fbswap=1 bcm2709.disk_led_gpio=47 bcm2709.disk_led_active_low=0 sdhci-bcm2708.emmc_clock_freq=250000000 vc_mem.mem_base=0x3dc00000 vc_mem.mem_size=0x3f000000 dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p7 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
[ 1.256008] dwc_otg: version 3.00a 10-AUG-2012 (platform bus)
[ 1.699988] WARN::dwc_otg_hcd_init:1047: FIQ DMA bounce buffers: virt = 0xbac14000 dma = 0xfac14000 len=9024
[ 1.736205] dwc_otg: Microframe scheduler enabled
[ 1.768410] dwc_otg 3f980000.usb: DWC OTG Controller
[ 1.778009] dwc_otg 3f980000.usb: new USB bus registered, assigned bus number 1
[ 1.789973] dwc_otg 3f980000.usb: irq 32, io mem 0x00000000
[ 1.849320] usb usb1: Manufacturer: Linux 4.1.13-v7+ dwc_otg_hcd
[ 1.887377] dwc_otg: FIQ enabled
[ 1.887391] dwc_otg: NAK holdoff enabled
[ 1.887401] dwc_otg: FIQ split-transaction FSM enabled
[ 2.263091] usb 1-1: new high-speed USB device number 2 using dwc_otg
[ 2.803093] usb 1-1.1: new high-speed USB device number 3 using dwc_otg
[ 3.103111] usb 1-1.3: new low-speed USB device number 4 using dwc_otg
[ 3.393147] usb 1-1.5: new low-speed USB device number 5 using dwc_otg
[ 9.103077] usb 1-1.4: new full-speed USB device number 6 using dwc_otg
[ 4352.472418] usb 1-1.4: new full-speed USB device number 7 using dwc_otg
[ 4367.832475] usb 1-1.4: new full-speed USB device number 8 using dwc_otg
[604780.937022] usb 1-1.2: new full-speed USB device number 9 using dwc_otg
I've tried all the suggested fixes that I've seen online. None of them helped.
Anyone have any thoughts?

thetechnobear
Posts: 8
Joined: Mon Mar 02, 2015 11:12 am

Re: USB Isochronous Transfers: What is RPi Status?

Mon Dec 21, 2015 9:01 am

I logged a bug here : https://github.com/raspberrypi/linux/issues/903

but unfortunately as the devs don't have access to the device, they said it was difficult to really follow up.
but perhaps contains some ideas for you to try.
Raspberry PI2 running Raspbian & Linaro

Return to “Linux Kernel”

Who is online

Users browsing this forum: No registered users and 2 guests