Skip to content

Native linux backend based on usbfs #122

@badicsalex

Description

@badicsalex

Hi,

TL;DR: Would you like to see a PR which uses usbfs ioctl's directly, even if it is not feature complete?

I've been using hidapi with good results for one of my projects. Unfortunately I have to port it to Android, and while I managed to do it with the libusb backend, but the build process is horrible, the licensing issues with libusb are worrying, and worst of all, the data comes in 5ms bursts (while it worked well on PC with the raw hidapi lib with almost exactly 1ms timings).

I suspect these bursts are caused by libusb and hidapi both making a thread (for a lot of back-and-forth sync-async conversions), and using mutexes and barriers to communicate, confusing the scheduler on the phone.

Right now I'm experimenting with using the USBDEVFS_BULK ioctl (which can actually also do interrupt transfers), and the code is turning out to be super simple. If it solves my jitter issues, I'll probably move to this solution for both android and linux. But it would be great to keep hidapi as it worked well in the past, and is also cross-platform.

I see that #27 has been open for a while, and this would be an even lower level replacement (albeit one that actually supports Android's restrictive permission model).

What do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions