Hi all, my name is Rodrigo, first time writting here.
 
I work at a company that have a product that supports some USB devices 
(telephony) that each one has a HID and an AUDIO interface.
Currently using pyudev (and pjsua), on linux, I can traverse the USB tree 
(ancestors/children) to make a relation between the hid and the audio device 
(it is needed to get an id from pjsua to be able to answer/hangup calls, and 
other events according the connected device).

As we are improving our codebase, and making it multiplatform (at least 
linux/macos at the moment), we decided to use hid and pyusb to manage the 
devices. It is already working great, I can list, read and write all events we 
use with hid (and using pyusb to get additional information about the devices).

But I'm failling at making the relation between the hid and the audio devices. 
Example:

$ lsusb
Bus 001 Device 009: ID 08bb:2912 Texas Instruments PCM2912A Audio Codec
Bus 001 Device 010: ID 1222:facb
Bus 001 Device 008: ID 0451:2046 Texas Instruments, Inc. TUSB2046 Hub

In this snippet, is listed the usb device hub (008), the desired audio device 
(009) and the hid device (010). 

As mentioned before, on pyudev, given an device, I can access its 
ancestors/children and navigate to find the device I need (note that I can have 
multiple devices with same id/product connected at the same time). All audio 
data is managed by pjsua, I just need to know that the hid device 010 is 
related to the audio device 009 (the user shouldn't be aware and do not have 
control about it).

Is there anyway to navigate the usb device tree with pyusb (from 010 access 008 
and them 009)? A simple solution I though is to manually keep some info about 
the sound device that is related to the hid device, and look on the nearest 
devices on the same bus, but it doesn't seem strong to me. Another option is to 
still use pyudev to make this relation, but will not work on macos.

Any ideas, anyone?

Thank you for this awesome API!

Rodrigo Oliveira

_______________________________________________
pyusb-users mailing list
pyusb-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pyusb-users

Reply via email to