This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/DLPDLC-GUI: DLP LCR6500 & LCR9000 HiresLib

Part Number: DLPDLC-GUI
Other Parts Discussed in Thread: DLPC900

Tool/software: Linux

HI

According to the latest HiresLib, there are two questions to consult.
1、The new HiresLib supports Bulk mode, but it can only be used under Windows, and can provide support for libusb. (not good at USB)
2、If I need to control multiple DPLC900s, there is also a Serial_number in the HID interface that might be used to distinguish multiple DLPC900s. Is there any other way?
Byrob
  • Hi Byrob,

    1. DLPC900 only supports HID interface. You can also use libusb. Just follow the command structure as described in programmer's guide.
    2. If you are using libusb. It provides a unique bus number and device number for each device connected.

    -ykc
  • ykc,

    I tried to modify the HIDAPI code to implement multiple DLPC connections.

    When I plug in one DLP,the PC enumerates two HID devices (eg dev0, dev1), both of which can succeed usb_open(), but dev0 can use the LCR_ command normally.

    When I plug in two DLPs, the PC enumerates four HID devices (eg dev0, dev1, dev2, dev3), all of which can be usb_open() successfully, but none of them can use the LCR_ command.I tried using dev0/dev2 like this, usb_open can succeed, but I can't use the LCR_ command.

    Is there any way to make multiple DLPs working via USB?

    Byron
  • Hi Byron,

    Each DLPC900 presents 2 interfaces. The device that has Interface number = 0 and product string = 'DLPC900' is correct device out of two devices.
    You can also look at this python library project to see example to access multiple devices.
    github.com/.../dlpc900
    github.com/.../hid_usb.py

    -ykc
  • HI ykc

    Have you tried using the py library to open multiple dlpcs at the same time? I use the hidapi process just like the py library. I don't support multiple dlpcs to open at the same time.

    Byron

  • Hi Byron,

    Yes, I have used it to connect multiple devices.

    mydevice1 = open_device(filtered_dev_list, 0)

    mydevice2 = open_device(filtered_dev_list, 1)

    Can you send me your code in private?

    -ykc

  • ykc

    taht is ok,The code is for testing.

    Hardware connection:
    Host [OTG] -> HUB
    ->DEV0
    ->DEV1

    Use qt and develop under linux.

    Sometimes two DLPC900s can be connected at the same time, sometimes not, I feel that these problems are related to HUB.

    Byron
  • Hi Byron,



    I don't have linux. But below is example

    static hid_device *DevicePathList_G[10];
    int DevCount_G = 0;
    int USB_Open()
    {
        if(FakeConnection == FALSE)
        {
            struct hid_device_info *hid_info;
            hid_info = hid_enumerate(MY_VID, MY_PID);
            if(hid_info == NULL)
            {
                USBConnected = FALSE;
                return -1;
            }
    
            DeviceHandle = NULL;
    
            while (hid_info != null)
            {
                if (0 == hid_info->interface_number)
                {
                    DevicePathList_G[DevCount_G++] = hid_info->path;
                }
                hid_info = hid_info->next;
            }
            // Connect to device 0
            DeviceHandle = hid_open_path(DevicePathList_G[0]);
            if(DeviceHandle == NULL)
            {
                USBConnected = FALSE;
                return -1;
            }
        }
        USBConnected = TRUE;
        return 0;
    }






    Also you need to keep track of device attach/detach. For e.g initially 3 dlpc900 are connected (0-First, 1- Second, 2-Third). First one is removed. Now list will have 2 entries (0- Second 1-Third). See the "1 pos" entry in this list is third device not second device now.

    So you need to track attach/detach and maintain list properly so that you don't refer to wrong device due to attach/detach of USB.

    Also don't connect to wrong interface. That might hang the device.

    If you use libusb, it has a unique busnumber and port number for each device connected that you can match on attach/detach events to see which device got removed/attached.



    -ykc

  • ykc

    You can see my code snippet, I use map storage the hid_device and path handle。

    byron
  • ykc

    Forgot to say a key technical point, hid_open_path is successful, just use LCR_CMD, it will return -1 (libusb IO error) in write.

    Byron
  • Byron,

    Please try not open device where product string is not 'DLPC900'. This can hang entire device.

    -ykc
  • ykc

    I now use your recommended (0 == hid_info->interface_number) to filter.

    Post a screenshot for you

  • Can you print the full path of each device while listing.
    Also inside open API and read API.

    -ykc
  • ykc

    full path?  I don't understand very well.   Can you give key functions and variables?

    The position of -1 is actually I call LCR_GetFrmwVersion but only returns -1 in the internal hid_write failure.

    Give you some USB connection details:

    osrc@stretch-armhf:~/libusbtest$ lsusb -v

    Bus 001 Device 018: ID 0451:c900 Texas Instruments, Inc.
    Device Descriptor:
    bLength 18
    bDescriptorType 1
    bcdUSB 1.10
    bDeviceClass 0 (Defined at Interface level)
    bDeviceSubClass 0
    bDeviceProtocol 0
    bMaxPacketSize0 64
    idVendor 0x0451 Texas Instruments, Inc.
    idProduct 0xc900
    bcdDevice 0.00
    iManufacturer 1 Texas Instruments Inc.
    iProduct 2 DLPC900
    iSerial 3 C900
    bNumConfigurations 1
    Configuration Descriptor:
    bLength 9
    bDescriptorType 2
    wTotalLength 73
    bNumInterfaces 2
    bConfigurationValue 1
    iConfiguration 0
    bmAttributes 0xc0
    Self Powered
    MaxPower 0mA
    Interface Descriptor:
    bLength 9
    bDescriptorType 4
    bInterfaceNumber 0
    bAlternateSetting 0
    bNumEndpoints 2
    bInterfaceClass 3 Human Interface Device
    bInterfaceSubClass 0 No Subclass
    bInterfaceProtocol 0 None
    iInterface 2 DLPC900
    HID Device Descriptor:
    bLength 9
    bDescriptorType 33
    bcdHID 1.11
    bCountryCode 0 Not supported
    bNumDescriptors 1
    bDescriptorType 34 Report
    wDescriptorLength 29
    Report Descriptors:
    ** UNAVAILABLE **
    Endpoint Descriptor:
    bLength 7
    bDescriptorType 5
    bEndpointAddress 0x81 EP 1 IN
    bmAttributes 3
    Transfer Type Interrupt
    Synch Type None
    Usage Type Data
    wMaxPacketSize 0x0040 1x 64 bytes
    bInterval 1
    Endpoint Descriptor:
    bLength 7
    bDescriptorType 5
    bEndpointAddress 0x01 EP 1 OUT
    bmAttributes 3
    Transfer Type Interrupt
    Synch Type None
    Usage Type Data
    wMaxPacketSize 0x0040 1x 64 bytes
    bInterval 1
    Interface Descriptor:
    bLength 9
    bDescriptorType 4
    bInterfaceNumber 1
    bAlternateSetting 0
    bNumEndpoints 2
    bInterfaceClass 3 Human Interface Device
    bInterfaceSubClass 0 No Subclass
    bInterfaceProtocol 0 None
    iInterface 3 C900
    HID Device Descriptor:
    bLength 9
    bDescriptorType 33
    bcdHID 1.11
    bCountryCode 0 Not supported
    bNumDescriptors 1
    bDescriptorType 34 Report
    wDescriptorLength 29
    Report Descriptor: (length is 29)
    Item(Global): Usage Page, data= [ 0x00 0xff ] 65280
    (null)
    Item(Local ): Usage, data= [ 0x00 0xff ] 65280
    (null)
    Item(Main ): Collection, data= [ 0x01 ] 1
    Application
    Item(Global): Logical Minimum, data= [ 0x00 ] 0
    Item(Global): Logical Maximum, data= [ 0xff ] 255
    Item(Global): Report Size, data= [ 0x08 ] 8
    Item(Global): Report Count, data= [ 0x40 ] 64
    Item(Local ): Usage, data= [ 0x01 ] 1
    (null)
    Item(Main ): Input, data= [ 0x00 ] 0
    Data Array Absolute No_Wrap Linear
    Preferred_State No_Null_Position Non_Volatile Bitfield
    Item(Local ): Usage, data= [ 0x02 ] 2
    (null)
    Item(Main ): Output, data= [ 0x00 ] 0
    Data Array Absolute No_Wrap Linear
    Preferred_State No_Null_Position Non_Volatile Bitfield
    Item(Local ): Usage, data= [ 0x03 ] 3
    (null)
    Item(Main ): Feature, data= [ 0x02 ] 2
    Data Variable Absolute No_Wrap Linear
    Preferred_State No_Null_Position Non_Volatile Bitfield
    Item(Main ): End Collection, data=none
    Endpoint Descriptor:
    bLength 7
    bDescriptorType 5
    bEndpointAddress 0x82 EP 2 IN
    bmAttributes 2
    Transfer Type Bulk
    Synch Type None
    Usage Type Data
    wMaxPacketSize 0x0008 1x 8 bytes
    bInterval 0
    Endpoint Descriptor:
    bLength 7
    bDescriptorType 5
    bEndpointAddress 0x02 EP 2 OUT
    bmAttributes 2
    Transfer Type Bulk
    Synch Type None
    Usage Type Data
    wMaxPacketSize 0x0008 1x 8 bytes
    bInterval 0
    Device Status: 0x0001
    Self Powered

    Bus 001 Device 016: ID 0451:c900 Texas Instruments, Inc.
    Device Descriptor:
    bLength 18
    bDescriptorType 1
    bcdUSB 1.10
    bDeviceClass 0 (Defined at Interface level)
    bDeviceSubClass 0
    bDeviceProtocol 0
    bMaxPacketSize0 64
    idVendor 0x0451 Texas Instruments, Inc.
    idProduct 0xc900
    bcdDevice 0.00
    iManufacturer 1 Texas Instruments Inc.
    iProduct 2 DLPC900
    iSerial 3 C900
    bNumConfigurations 1
    Configuration Descriptor:
    bLength 9
    bDescriptorType 2
    wTotalLength 73
    bNumInterfaces 2
    bConfigurationValue 1
    iConfiguration 0
    bmAttributes 0xc0
    Self Powered
    MaxPower 0mA
    Interface Descriptor:
    bLength 9
    bDescriptorType 4
    bInterfaceNumber 0
    bAlternateSetting 0
    bNumEndpoints 2
    bInterfaceClass 3 Human Interface Device
    bInterfaceSubClass 0 No Subclass
    bInterfaceProtocol 0 None
    iInterface 2 DLPC900
    HID Device Descriptor:
    bLength 9
    bDescriptorType 33
    bcdHID 1.11
    bCountryCode 0 Not supported
    bNumDescriptors 1
    bDescriptorType 34 Report
    wDescriptorLength 29
    Report Descriptor: (length is 29)
    Item(Global): Usage Page, data= [ 0x00 0xff ] 65280
    (null)
    Item(Local ): Usage, data= [ 0x00 0xff ] 65280
    (null)
    Item(Main ): Collection, data= [ 0x01 ] 1
    Application
    Item(Global): Logical Minimum, data= [ 0x00 ] 0
    Item(Global): Logical Maximum, data= [ 0xff ] 255
    Item(Global): Report Size, data= [ 0x08 ] 8
    Item(Global): Report Count, data= [ 0x40 ] 64
    Item(Local ): Usage, data= [ 0x01 ] 1
    (null)
    Item(Main ): Input, data= [ 0x00 ] 0
    Data Array Absolute No_Wrap Linear
    Preferred_State No_Null_Position Non_Volatile Bitfield
    Item(Local ): Usage, data= [ 0x02 ] 2
    (null)
    Item(Main ): Output, data= [ 0x00 ] 0
    Data Array Absolute No_Wrap Linear
    Preferred_State No_Null_Position Non_Volatile Bitfield
    Item(Local ): Usage, data= [ 0x03 ] 3
    (null)
    Item(Main ): Feature, data= [ 0x02 ] 2
    Data Variable Absolute No_Wrap Linear
    Preferred_State No_Null_Position Non_Volatile Bitfield
    Item(Main ): End Collection, data=none
    Endpoint Descriptor:
    bLength 7
    bDescriptorType 5
    bEndpointAddress 0x81 EP 1 IN
    bmAttributes 3
    Transfer Type Interrupt
    Synch Type None
    Usage Type Data
    wMaxPacketSize 0x0040 1x 64 bytes
    bInterval 1
    Endpoint Descriptor:
    bLength 7
    bDescriptorType 5
    bEndpointAddress 0x01 EP 1 OUT
    bmAttributes 3
    Transfer Type Interrupt
    Synch Type None
    Usage Type Data
    wMaxPacketSize 0x0040 1x 64 bytes
    bInterval 1
    Interface Descriptor:
    bLength 9
    bDescriptorType 4
    bInterfaceNumber 1
    bAlternateSetting 0
    bNumEndpoints 2
    bInterfaceClass 3 Human Interface Device
    bInterfaceSubClass 0 No Subclass
    bInterfaceProtocol 0 None
    iInterface 3 C900
    HID Device Descriptor:
    bLength 9
    bDescriptorType 33
    bcdHID 1.11
    bCountryCode 0 Not supported
    bNumDescriptors 1
    bDescriptorType 34 Report
    wDescriptorLength 29
    Report Descriptor: (length is 29)
    Item(Global): Usage Page, data= [ 0x00 0xff ] 65280
    (null)
    Item(Local ): Usage, data= [ 0x00 0xff ] 65280
    (null)
    Item(Main ): Collection, data= [ 0x01 ] 1
    Application
    Item(Global): Logical Minimum, data= [ 0x00 ] 0
    Item(Global): Logical Maximum, data= [ 0xff ] 255
    Item(Global): Report Size, data= [ 0x08 ] 8
    Item(Global): Report Count, data= [ 0x40 ] 64
    Item(Local ): Usage, data= [ 0x01 ] 1
    (null)
    Item(Main ): Input, data= [ 0x00 ] 0
    Data Array Absolute No_Wrap Linear
    Preferred_State No_Null_Position Non_Volatile Bitfield
    Item(Local ): Usage, data= [ 0x02 ] 2
    (null)
    Item(Main ): Output, data= [ 0x00 ] 0
    Data Array Absolute No_Wrap Linear
    Preferred_State No_Null_Position Non_Volatile Bitfield
    Item(Local ): Usage, data= [ 0x03 ] 3
    (null)
    Item(Main ): Feature, data= [ 0x02 ] 2
    Data Variable Absolute No_Wrap Linear
    Preferred_State No_Null_Position Non_Volatile Bitfield
    Item(Main ): End Collection, data=none
    Endpoint Descriptor:
    bLength 7
    bDescriptorType 5
    bEndpointAddress 0x82 EP 2 IN
    bmAttributes 2
    Transfer Type Bulk
    Synch Type None
    Usage Type Data
    wMaxPacketSize 0x0008 1x 8 bytes
    bInterval 0
    Endpoint Descriptor:
    bLength 7
    bDescriptorType 5
    bEndpointAddress 0x02 EP 2 OUT
    bmAttributes 2
    Transfer Type Bulk
    Synch Type None
    Usage Type Data
    wMaxPacketSize 0x0008 1x 8 bytes
    bInterval 0
    Device Status: 0x0001
    Self Powered

    Bus 001 Device 013: ID 214b:7250
    Device Descriptor:
    bLength 18
    bDescriptorType 1
    bcdUSB 2.00
    bDeviceClass 9 Hub
    bDeviceSubClass 0 Unused
    bDeviceProtocol 1 Single TT
    bMaxPacketSize0 64
    idVendor 0x214b
    idProduct 0x7250
    bcdDevice 1.00
    iManufacturer 0
    iProduct 1 USB2.0 HUB
    iSerial 0
    bNumConfigurations 1
    Configuration Descriptor:
    bLength 9
    bDescriptorType 2
    wTotalLength 25
    bNumInterfaces 1
    bConfigurationValue 1
    iConfiguration 0
    bmAttributes 0xe0
    Self Powered
    Remote Wakeup
    MaxPower 100mA
    Interface Descriptor:
    bLength 9
    bDescriptorType 4
    bInterfaceNumber 0
    bAlternateSetting 0
    bNumEndpoints 1
    bInterfaceClass 9 Hub
    bInterfaceSubClass 0 Unused
    bInterfaceProtocol 0 Full speed (or root) hub
    iInterface 0
    Endpoint Descriptor:
    bLength 7
    bDescriptorType 5
    bEndpointAddress 0x81 EP 1 IN
    bmAttributes 3
    Transfer Type Interrupt
    Synch Type None
    Usage Type Data
    wMaxPacketSize 0x0001 1x 1 bytes
    bInterval 12
    Hub Descriptor:
    bLength 9
    bDescriptorType 41
    nNbrPorts 4
    wHubCharacteristic 0x00e0
    Ganged power switching
    Ganged overcurrent protection
    TT think time 32 FS bits
    Port indicators
    bPwrOn2PwrGood 50 * 2 milli seconds
    bHubContrCurrent 100 milli Ampere
    DeviceRemovable 0x00
    PortPwrCtrlMask 0xff
    Hub Port Status:
    Port 1: 0000.0100 power
    Port 2: 0000.0100 power
    Port 3: 0000.0100 power
    Port 4: 0000.0100 power
    Device Qualifier (for other device speed):
    bLength 10
    bDescriptorType 6
    bcdUSB 2.00
    bDeviceClass 9 Hub
    bDeviceSubClass 0 Unused
    bDeviceProtocol 0 Full speed (or root) hub
    bMaxPacketSize0 64
    bNumConfigurations 1
    Device Status: 0x0001
    Self Powered

    Bus 001 Device 012: ID 214b:7250
    Device Descriptor:
    bLength 18
    bDescriptorType 1
    bcdUSB 2.00
    bDeviceClass 9 Hub
    bDeviceSubClass 0 Unused
    bDeviceProtocol 1 Single TT
    bMaxPacketSize0 64
    idVendor 0x214b
    idProduct 0x7250
    bcdDevice 1.00
    iManufacturer 0
    iProduct 1 USB2.0 HUB
    iSerial 0
    bNumConfigurations 1
    Configuration Descriptor:
    bLength 9
    bDescriptorType 2
    wTotalLength 25
    bNumInterfaces 1
    bConfigurationValue 1
    iConfiguration 0
    bmAttributes 0xe0
    Self Powered
    Remote Wakeup
    MaxPower 100mA
    Interface Descriptor:
    bLength 9
    bDescriptorType 4
    bInterfaceNumber 0
    bAlternateSetting 0
    bNumEndpoints 1
    bInterfaceClass 9 Hub
    bInterfaceSubClass 0 Unused
    bInterfaceProtocol 0 Full speed (or root) hub
    iInterface 0
    Endpoint Descriptor:
    bLength 7
    bDescriptorType 5
    bEndpointAddress 0x81 EP 1 IN
    bmAttributes 3
    Transfer Type Interrupt
    Synch Type None
    Usage Type Data
    wMaxPacketSize 0x0001 1x 1 bytes
    bInterval 12
    Hub Descriptor:
    bLength 9
    bDescriptorType 41
    nNbrPorts 4
    wHubCharacteristic 0x00e0
    Ganged power switching
    Ganged overcurrent protection
    TT think time 32 FS bits
    Port indicators
    bPwrOn2PwrGood 50 * 2 milli seconds
    bHubContrCurrent 100 milli Ampere
    DeviceRemovable 0x00
    PortPwrCtrlMask 0xff
    Hub Port Status:
    Port 1: 0000.0507 highspeed power suspend enable connect
    Port 2: 0000.0100 power
    Port 3: 0000.0103 power enable connect
    Port 4: 0000.0103 power enable connect
    Device Qualifier (for other device speed):
    bLength 10
    bDescriptorType 6
    bcdUSB 2.00
    bDeviceClass 9 Hub
    bDeviceSubClass 0 Unused
    bDeviceProtocol 0 Full speed (or root) hub
    bMaxPacketSize0 64
    bNumConfigurations 1
    Device Status: 0x0001
    Self Powered

    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Device Descriptor:
    bLength 18
    bDescriptorType 1
    bcdUSB 2.00
    bDeviceClass 9 Hub
    bDeviceSubClass 0 Unused
    bDeviceProtocol 1 Single TT
    bMaxPacketSize0 64
    idVendor 0x1d6b Linux Foundation
    idProduct 0x0002 2.0 root hub
    bcdDevice 4.14
    iManufacturer 3 Linux 4.14.0-xilinx ehci_hcd
    iProduct 2 EHCI Host Controller
    iSerial 1 ci_hdrc.0
    bNumConfigurations 1
    Configuration Descriptor:
    bLength 9
    bDescriptorType 2
    wTotalLength 25
    bNumInterfaces 1
    bConfigurationValue 1
    iConfiguration 0
    bmAttributes 0xe0
    Self Powered
    Remote Wakeup
    MaxPower 0mA
    Interface Descriptor:
    bLength 9
    bDescriptorType 4
    bInterfaceNumber 0
    bAlternateSetting 0
    bNumEndpoints 1
    bInterfaceClass 9 Hub
    bInterfaceSubClass 0 Unused
    bInterfaceProtocol 0 Full speed (or root) hub
    iInterface 0
    Endpoint Descriptor:
    bLength 7
    bDescriptorType 5
    bEndpointAddress 0x81 EP 1 IN
    bmAttributes 3
    Transfer Type Interrupt
    Synch Type None
    Usage Type Data
    wMaxPacketSize 0x0004 1x 4 bytes
    bInterval 12
    Hub Descriptor:
    bLength 9
    bDescriptorType 41
    nNbrPorts 1
    wHubCharacteristic 0x0009
    Per-port power switching
    Per-port overcurrent protection
    TT think time 8 FS bits
    bPwrOn2PwrGood 10 * 2 milli seconds
    bHubContrCurrent 0 milli Ampere
    DeviceRemovable 0x00
    PortPwrCtrlMask 0xff
    Hub Port Status:
    Port 1: 0000.0503 highspeed power enable connect
    Device Status: 0x0001
    Self Powered

  • You should use new process. Otherwise all global variables will get corrupted.

    -ykc
  • For example.
    Pass an Agrument in main.c to list all dlpc900 devices.
    Pass an argument (Device number) in main.c that allows to start with one from the device list.
    Run 2 instances of dlpcontrol one with first device and other with second device.
    Then see if it is working or not. Make sure to power cycle boards if they are already stuck.

    -ykc
  • ykc

    I know that the problem stems from the HUB. I don't know how to solve it. If you can have suggestions, thank you very much.
  • I don't see it has anything to do with hub unless your hub is not usb compliant.
    You need to run separate processes otherwise hid lib and HiresLib both will have corruption problem.

    -ykc
  • ykc

    I don't understand the corruption problem. I have stored the data for each connection separately. The Enumerate stage uses a global variable to store the list of discovered devices but the data is separated from here.

    Byron
  • Hi Byron,

    Inside Hireslib uses global buffers for usb transfers.

    -ykc