fosstodon.org is one of the many independent Mastodon servers you can use to participate in the fediverse.
Fosstodon is an invite only Mastodon instance that is open to those who are interested in technology; particularly free & open source software. If you wish to join, contact us for an invite.

Administered by:

Server stats:

9.9K
active users

#libusb

0 posts0 participants0 posts today

Considering the Windows editor for my GiT Core won't run on neither Wine nor any VM, I've spent the past few days trying to reverse engineer its USB protocol, in order to write a basic editor for Linux of my own. It's been interesting so far to play with (I can already kinda talk to the device), especially coming from the perspective of a network developer, but I have some doubts on how communication works in general: is there anyone around here that can clarify a few points?

Any LIBUSB Async (linux) experts here? I want to improve speed between usbsid and PC. Unfortunately I am running into race conditions causing packets from device to pc misalign, e.g. the callback gets called more then expected, or too late. Async send and sync on read is too slow.
#libusb #async

Can anyone recommend a #framework that allows relatively easy cross-platform (#Android, #Windows, #Linux) development?
Needs to be able to:
- Open #USB webcam stream
- Call #ffmpeg
- Send USB vendor control transfers (or calls to #libusb)
- GUI

:BoostOK:

I really don't want to write code two times (and dislike Android app dev), but recently realized that I'd really like for my upcoming #P2Pro viewer to run on Android too.

But if there is no such thing, I'll stick to desktop only for now :/

Continued thread

With libusb_get_bus_number(), and libusb_get_port_numbers(), one can easily construct a path like /sys/bus/usb/devices/{BUS}-{PORTS} to access the string descriptors as "product", "manufacturer", and "serial" (if present). And /sys/bus/usb/devices/{BUS}-{PORTS}:{CONFIGNUM}-{INTERFACENUM} has "interface" for the interface string descriptor (if present).

Annoying. libusb requires you to open a device before reading string descriptors (necessitating you have read/write permission because libusb only opens devices RW).

On modern Linux (and I believe on Windows and OSX) this is not actually necessary and makes enumeration and reporting errors to users that much more complicated than need be.

This feature has been discussed, but there has been no forward motion, it seems:
github.com/libusb/libusb/issue

GitHubGetting the serial number without opening the device handle · Issue #866 · libusb/libusbBy mcuee
Continued thread

Yesterday I've learned what USB filter drivers are on Windows and that it's apparently pretty easy to install libusb0 as one. (Thanks @patagona)

Having done that, my initial plan worked on the second try. I can now send the command for switching the color palette, wohoo \o/

I only needed to make sure that I send the USB control transfers after the video capture has already been started, otherwise the call to #libusb will just hang indefinitely for whatever reason.

Als Hardware-Nerd hat man es schwer. Da habe ich nun meine kleinen #Atmel #attiny85 hier und kann sie auch prima für USB-Übertragung einsetzen, wenn ich nur Ahnung von der anderen Seite hätte, sei es Win oder Linux. Es gibt die #libusb API, aber nix für mich, welcher weder in C noch in Python zuhause ist sondern eher am Lötkolben. Den Traum, #USB ähnlich behandeln zu können wie #RS232 habe ich wohl ausgeträumt. 😢

Continued thread

Mein POS-Kundendisplay läuft nun auch unter Linux.
Es reicht schon, das Gerät mit #PyUSB über #libusb aufzumachen, die erste (und einzige) Konfiguration zu aktivieren und die seriellen Daten auf den per Wireshark ermittelten #USB-Endpoint zu schreiben.

Ich muss jetzt noch mal abwarten ob irgendwann der Puffer platzt weil ich keine Daten abhole, aber bisher funktioniert es und so viel hat ein #Display eh nicht zu erzählen.

@overflo