0

We have a USB accessory that uses the Open Accessory Protocol to send USB data packets to an App running on Android smart phones. This works very well when the Android device is running Jelly Bean (JB) or Ice Cream Sandwich (ICS), but gives the following errors with devices running Kitkat:

1) Data packets sent by the accessory aren’t received by the App. For some reason the low level USB interface on the device isn’t providing these packets to the Application. 2) Packets that are delivered to the App are sometimes corrupt or incomplete, e.g. we’re seeing corrupt packets or partially delivered packets.

We have now modified our accessory software to make sure that every USB data packet is transmitted as a multiple of 64 bytes. This wasn’t necessary on JB or ICS, but has made some improvement to the Kitkat interface. But we are still missing the majority of data packets.

Has anyone had any experience of interfacing to Kitkat via the AOAP? Has anyone had problems with USB data communications with Kitkat that are not present with Jelly Bean or Ice Cream Sandwich?

1 Answers1

0

I guess you are running in Full Speed configuration. If so, your bMaxPacketSize will be 64bytes. USB Bulk Transfer requires a Zero Length Packet(ZLP) after sending packets which are multiples of your bMaxPacketSize to end the communication. Check out this link. This solution might work for issue 1.

Are you also making use of USB Audio Class. Compare the bMaxPacketSize of the Isochronous Endpoint with that of the space allocated for the PIPE of this endpoint. See if it's overlapping with that of Bulk Transfer OUT Endpoint PIPE. Some Android phones Audio Class bMaxPacketSize is defined as 364 bytes, which is more than enough to achieve 44.1Khz Sampling Frequency. Ideally only ~192 bytes is required to achieve this. Some host USB Audio Class driver might have only reserved 256 bytes, and they might not have looked at bMaxPacketSize when they enumerate the PIPE. So do look out for this. I have faced this issue. The bMaxPacketSize of Nexus phone is 364 bytes. Maybe this is the cause for data corruption.

Community
  • 1
  • 1