Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libusb support for isochronous transfer on Windows composite device #1227

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

yomei-o
Copy link

@yomei-o yomei-o commented Jan 1, 2023

I succeed to work a UVC webcam on Windows.
But current version of libusb and libuvc do not work UVC .
The UVC Camera uses isochronous transfer and it is composite device.
Current libusb does not support isochronous transfer on Windows composite device.
So I fixed it.
And I tested two UVC devices. (isochronous transfer device and bulk transfer device)

libuvc on Windows #12

Windows Isochronous Transfer Issue with both libusbk and WinUSB libusb/libusb#1104

WinUSB ISO packet backend is broken in multiple ways libusb/libusb#909

@mcuee mcuee added windows isoc isochronous transfer, especially under Windows labels Jan 1, 2023
@mcuee mcuee mentioned this pull request Jan 7, 2023
@@ -2581,7 +2590,10 @@ static int winusbx_claim_interface(int sub_api, struct libusb_device_handle *dev
struct libusb_context *ctx = HANDLE_CTX(dev_handle);
struct winusb_device_handle_priv *handle_priv = get_winusb_device_handle_priv(dev_handle);
struct winusb_device_priv *priv = usbi_get_device_priv(dev_handle->dev);
bool is_using_usbccgp = (priv->apib->id == USB_API_COMPOSITE);

//bool is_using_usbccgp = (priv->apib->id == USB_API_COMPOSITE);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please do not leave commented out code. If this line is no longer needed then remove it entirely.

handle_priv->interface_handle[iface].dev_handle = handle_priv->interface_handle[0].dev_handle;
{
HANDLE h_proc=NULL;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit. spaces around =

{
HANDLE h_proc=NULL;
HANDLE h_out = NULL;
h_proc = GetCurrentProcess();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

another nit. you just set this to NULL then set it to GetCurrentProcess(); please set this at the declaration.

@hjelmn
Copy link
Member

hjelmn commented Jan 10, 2023

I know nothing about the windows backend but this looks reasonable. Address the comments and I will see about merging this.

@@ -1409,6 +1409,15 @@ static int set_composite_interface(struct libusb_context *ctx, struct libusb_dev
priv->usb_interface[interface_number].path = dev_interface_path;
priv->usb_interface[interface_number].apib = &usb_api_backend[api];
priv->usb_interface[interface_number].sub_api = sub_api;

{
int ii;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just "i" is the norm for such loop counters. "i" can also be thought of as a very short form of "interfaces".

@tormodvolden
Copy link
Contributor

The commit message needs to be fixed.

bool is_using_usbccgp = (priv->apib->id == USB_API_COMPOSITE);

//bool is_using_usbccgp = (priv->apib->id == USB_API_COMPOSITE);
bool is_using_usbccgp = false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The value is checked on line 2610 but I don't see it possibly changed in between.

Copy link
Contributor

@tormodvolden tormodvolden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain in words what these changes are doing?

@mcuee
Copy link
Member

mcuee commented Jan 25, 2023

@yomei-o

Please help to address the comments . Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
isoc isochronous transfer, especially under Windows windows
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants