question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Identify different instances of same device

See original GitHub issue

I am using several USB audio interfaces through a USB hub, but every time I turn on or re-plug it, it seems like the device Ids and their order changes. Is it possible to map the device to its physical location using sounddevice?

For example, I have this:

>>> sd.query_devices()
   0 USB PnP Sound Device: Audio (hw:0,0), ALSA (1 in, 2 out)
   1 USB PnP Sound Device: Audio (hw:1,0), ALSA (1 in, 2 out)
   2 bcm2835 ALSA: IEC958/HDMI (hw:2,1), ALSA (0 in, 8 out)
   3 bcm2835 ALSA: IEC958/HDMI1 (hw:2,2), ALSA (0 in, 8 out)
   4 USB PnP Sound Device: Audio (hw:3,0), ALSA (1 in, 2 out)
   5 USB PnP Sound Device: Audio (hw:4,0), ALSA (1 in, 2 out)
   6 sysdefault, ALSA (128 in, 128 out)
   7 front, ALSA (0 in, 2 out)
   8 surround40, ALSA (0 in, 2 out)
   9 iec958, ALSA (0 in, 2 out)
  10 spdif, ALSA (1 in, 2 out)
* 11 default, ALSA (128 in, 128 out)
  12 dmix, ALSA (0 in, 2 out)

and from the terminal I can find the physical connection for each USB dongle:

$ lsusb -t
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=dwc_otg/1p, 480M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/5p, 480M
        |__ Port 1: Dev 3, If 0, Class=Vendor Specific Class, Driver=smsc95xx, 480M
        |__ Port 2: Dev 9, If 0, Class=Hub, Driver=hub/4p, 480M
            |__ Port 3: Dev 12, If 2, Class=Audio, Driver=snd-usb-audio, 12M
            |__ Port 3: Dev 12, If 0, Class=Audio, Driver=snd-usb-audio, 12M
            |__ Port 3: Dev 12, If 3, Class=Human Interface Device, Driver=usbhid, 12M
            |__ Port 3: Dev 12, If 1, Class=Audio, Driver=snd-usb-audio, 12M
            |__ Port 1: Dev 10, If 3, Class=Human Interface Device, Driver=usbhid, 12M
            |__ Port 1: Dev 10, If 1, Class=Audio, Driver=snd-usb-audio, 12M
            |__ Port 1: Dev 10, If 2, Class=Audio, Driver=snd-usb-audio, 12M
            |__ Port 1: Dev 10, If 0, Class=Audio, Driver=snd-usb-audio, 12M
            |__ Port 4: Dev 13, If 1, Class=Audio, Driver=snd-usb-audio, 12M
            |__ Port 4: Dev 13, If 2, Class=Audio, Driver=snd-usb-audio, 12M
            |__ Port 4: Dev 13, If 0, Class=Audio, Driver=snd-usb-audio, 12M
            |__ Port 4: Dev 13, If 3, Class=Human Interface Device, Driver=usbhid, 12M
            |__ Port 2: Dev 11, If 2, Class=Audio, Driver=snd-usb-audio, 12M
            |__ Port 2: Dev 11, If 0, Class=Audio, Driver=snd-usb-audio, 12M
            |__ Port 2: Dev 11, If 3, Class=Human Interface Device, Driver=usbhid, 12M
            |__ Port 2: Dev 11, If 1, Class=Audio, Driver=snd-usb-audio, 12M

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
gustavovelascohcommented, Jan 22, 2020

Thanks for your reply. I just send a message to their mailing list. I hope to get some hints from there. I’ll post back if I found any solution.

1reaction
mgeiercommented, Jan 21, 2020

I think this is a known issue of PortAudio (and there may be work in progress for fixing this?). You should ask at their mailing list: http://portaudio.com/contacts.html.

The sounddevice module just gets the list of devices from PortAudio, there is nothing we can make on the Python side …

Read more comments on GitHub >

github_iconTop Results From Across the Web

Multiple Instances of the Same Device (Device Mngr)/Crash ...
I decided I'd install the components from a thumb drive by transferring the files from my laptop. Needless to say the disk probably...
Read more >
Identifying Device instance path - ManageEngine
You can identify the Device Instance ID of a device by following the steps mentioned below: Search for Device Manager in the control...
Read more >
same device multiple entries - Apple Community
We understand you're seeing a device listed on your account multiple times and want to know what happens if you remove the repeated...
Read more >
Multiple instances of same device appearing in Azure AD
Hello guys, We have recently pushed out Conditional access in our company and few devices are failing to access company resources.
Read more >
How to use single platform driver for multiple instances of the ...
Make sure each device occupies its own global data structure, by using static array and minor id to distinguish with each other. Also,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found