5

I am attempting to Submit ISOCHRONOUS URB in Android NDK in C.

usbdevfs_urb&   urbRequest      = *(usbdevfs_urb*)malloc( 384 );
urbRequest.type                 = USBDEVFS_URB_TYPE_ISO;
urbRequest.endpoint             = mpEndpoint->GetEndpointAddress();//mpEndpoint->GetEndpointIndex();
urbRequest.status               = 0;
urbRequest.flags                = USBDEVFS_URB_ISO_ASAP;
urbRequest.buffer               = pData;
urbRequest.buffer_length        = 0;
urbRequest.actual_length        = 0;
urbRequest.start_frame          = 0;
urbRequest.number_of_packets    = 1;
urbRequest.error_count          = 0;
urbRequest.signr                = SIGRTMIN;
urbRequest.usercontext          = pData;

usbdevfs_iso_packet_desc* pIsoPacketDesc    = &urbRequest.iso_frame_desc[0];
pIsoPacketDesc->length          = 384;
pIsoPacketDesc->actual_length   = 0;
pIsoPacketDesc->status          = 0;



ioctl( fd, USBDEVFS_SUBMITURB, &usbRequest);

In the above code, I want to set SIGRTMIN signal for urbRequest.signr. So that i can get the SIGRTMIN signal on URB completion and i can call REAP URB after

But in Android i am not getting the SIGRTMIN signal at all. Instead my app gets killed without any exception

is there any way i can use SIGRTMIN signal for submitting URB in Android?

Note: I tried using SIGUSR1 and SIGUSR2 signals but ART is catching those signals

is there anyway to do isochronous, interrupt, bulk transfer (using non blocking asynchronous IO) in Android?

  • I assume this is related to your other question (https://stackoverflow.com/q/53481948/632035)? Answering here pointing at the other is probably fine, since the `EINVAL` does explain why this isn't working. – Dan Albert Nov 28 '18 at 17:15
  • But why EINVAL (Invalid Argument)? does that mean its not supported. I need an official info which i am not getting. If i can't use any signal to know URB completion then what's the alternative. Please help – sunder kandasamy Nov 29 '18 at 04:25
  • Well, my first assumption was that it's because bionic reserves a small range of real time signals. This is accounted for by `SIGRTMIN`, but if you're using an old NDK it's possible that it doesn't do that. Taking another look at this though I don't think it's related since I don't think `ioctl` knows anything about that, so never mind. – Dan Albert Nov 30 '18 at 00:42

0 Answers0