Discussion:
using multiple USB cards with port audio
(too old to reply)
Bellamy Baron
2018-09-06 13:27:37 UTC
Permalink
Hi Ranjan,

Use "device path" to rename each card. Device path basically defines which
USB port the card is plugged into. Run ls -la /sys/class/sound/ to list
cards and their device pathes, then write new name to card's id attribute.

For example:

$ ls -la /sys/class/sound/
total 0
drwxr-xr-x 2 root root 0 May 27 17:48 .
drwxr-xr-x 34 root root 0 May 27 17:48 ..
lrwxrwxrwx 1 root root 0 May 27 17:48 card1 ->
../../devices/pci0000:00/0000:00:1a.0/usb3/3-1/3-1:1.0/sound/card1
lrwxrwxrwx 1 root root 0 May 27 17:48 card2 ->
../../devices/pci0000:00/0000:00:1a.0/usb3/3-2/3-2:1.0/sound/card2
lrwxrwxrwx 1 root root 0 May 27 17:48 card3 ->
../../devices/pci0000:00/0000:00:1a.1/usb4/4-1/4-1:1.0/sound/card3
lrwxrwxrwx 1 root root 0 May 27 17:48 card4 ->
../../devices/pci0000:00/0000:00:1a.1/usb4/4-2/4-2:1.0/sound/card4
--
--------------------------------------------------------------------------------------------------------
Bellamy
Specialist - iWYZE
Office: 75 Helen Joseph Street, JHB
web: https://www.iwyze.co.za
https://www.iwyze.co.za/products/car-insurance


I ran the pa_devs program to get the device lists. Then I changed the
device id in inputParameters.device = 1 to 14 but only one device works
which is the default. Either the laptop mic works when USB soundcard is not
connected or the Sound card works when connected but not the laptop mic and
speakers.I am attaching the output of pa_devs program (which gives me
result.txt).

On Sat, Jan 16, 2016 at 10:37 PM, Robert Bielik <robert.bielik at dirac.se>
* Hi Ranjan,
*>>* It is perfectly doable. Just use Pa_OpenStream on each of the different
*>* devices. Note that each of the streams will need to have their own
*>* callback.
*>>* Regards
*>* /Robert
*>>>* Den 2016-01-16 kl. 17:26, skrev Ranjan:
*>>* Hello,
*>>* I want to connect multiple USB sound cards and use them with portaudio
*>* simultaneously. How shall I do this?I searched online but could not find
*>* any useful information.Someone please help.
*>>* Regards
*>>>* _______________________________________________
*>* Portaudio mailing listPortaudio at
lists.columbia.eduhttps://lists.columbia.edu/mailman/listinfo/portaudio
<http://lists.columbia.edu/mailman/listinfo/portaudio>
*>>>>* _______________________________________________
*>* Portaudio mailing list
*>* Portaudio at lists.columbia.edu <http://lists.columbia.edu>
*>* https://lists.columbia.edu/mailman/listinfo/portaudio
<https://lists.columbia.edu/mailman/listinfo/portaudio>
*>-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.columbia.edu/pipermail/portaudio/attachments/20160116/299859ca/attachment.html>
-------------- next part --------------
PortAudio version number = 1899
PortAudio version text = 'PortAudio V19-devel (built Jun 15 2013 03:22:45)'
Number of devices = 17
--------------------------------------- device #0
Name = 'Microsoft Sound Mapper - Input'
Host API = 'MME'
Max inputs = 2, Max outputs = 0
Default low input latency = 0.0900
Default low output latency = 0.0900
Default high input latency = 0.1800
Default high output latency = 0.1800
Default sample rate = 44100.00
Supported standard sample rates
for half-duplex 16 bit 2 channel input =
8000.00, 9600.00, 11025.00, 12000.00,
16000.00, 22050.00, 24000.00, 32000.00,
44100.00, 48000.00, 88200.00, 96000.00,
192000.00
--------------------------------------- device #1
[ Default Input ]
Name = 'Microphone (Realtek High Defini'
Host API = 'MME'
Max inputs = 2, Max outputs = 0
Default low input latency = 0.0900
Default low output latency = 0.0900
Default high input latency = 0.1800
Default high output latency = 0.1800
Default sample rate = 44100.00
Supported standard sample rates
for half-duplex 16 bit 2 channel input =
8000.00, 9600.00, 11025.00, 12000.00,
16000.00, 22050.00, 24000.00, 32000.00,
44100.00, 48000.00, 88200.00, 96000.00,
192000.00
--------------------------------------- device #2
Name = 'Microphone (2- USB PnP Sound De'
Host API = 'MME'
Max inputs = 2, Max outputs = 0
Default low input latency = 0.0900
Default low output latency = 0.0900
Default high input latency = 0.1800
Default high output latency = 0.1800
Default sample rate = 44100.00
Supported standard sample rates
for half-duplex 16 bit 2 channel input =
8000.00, 9600.00, 11025.00, 12000.00,
16000.00, 22050.00, 24000.00, 32000.00,
44100.00, 48000.00, 88200.00, 96000.00,
192000.00
--------------------------------------- device #3
Name = 'Microsoft Sound Mapper - Output'
Host API = 'MME'
Max inputs = 0, Max outputs = 2
Default low input latency = 0.0900
Default low output latency = 0.0900
Default high input latency = 0.1800
Default high output latency = 0.1800
Default sample rate = 44100.00
Supported standard sample rates
for half-duplex 16 bit 2 channel output =
8000.00, 9600.00, 11025.00, 12000.00,
16000.00, 22050.00, 24000.00, 32000.00,
44100.00, 48000.00, 88200.00, 96000.00,
192000.00
--------------------------------------- device #4
[ Default Output ]
Name = 'Speakers (2- USB PnP Sound Devi'
Host API = 'MME'
Max inputs = 0, Max outputs = 2
Default low input latency = 0.0900
Default low output latency = 0.0900
Default high input latency = 0.1800
Default high output latency = 0.1800
Default sample rate = 44100.00
Supported standard sample rates
for half-duplex 16 bit 2 channel output =
8000.00, 9600.00, 11025.00, 12000.00,
16000.00, 22050.00, 24000.00, 32000.00,
44100.00, 48000.00, 88200.00, 96000.00,
192000.00
--------------------------------------- device #5
Name = 'Speakers (Realtek High Definiti'
Host API = 'MME'
Max inputs = 0, Max outputs = 2
Default low input latency = 0.0900
Default low output latency = 0.0900
Default high input latency = 0.1800
Default high output latency = 0.1800
Default sample rate = 44100.00
Supported standard sample rates
for half-duplex 16 bit 2 channel output =
8000.00, 9600.00, 11025.00, 12000.00,
16000.00, 22050.00, 24000.00, 32000.00,
44100.00, 48000.00, 88200.00, 96000.00,
192000.00
--------------------------------------- device #6
[ Default 'Windows DirectSound' Input ]
Name = 'Primary Sound Capture Driver'
Host API = 'Windows DirectSound'
Max inputs = 2, Max outputs = 0
Default low input latency = 0.1200
Default low output latency = 0.0000
Default high input latency = 0.2400
Default high output latency = 0.0000
Default sample rate = 44100.00
Supported standard sample rates
for half-duplex 16 bit 2 channel input =
8000.00, 9600.00, 11025.00, 12000.00,
16000.00, 22050.00, 24000.00, 32000.00,
44100.00, 48000.00, 88200.00, 96000.00,
192000.00
--------------------------------------- device #7
Name = 'Microphone (Realtek High Definition Audio)'
Host API = 'Windows DirectSound'
Max inputs = 2, Max outputs = 0
Default low input latency = 0.1200
Default low output latency = 0.0000
Default high input latency = 0.2400
Default high output latency = 0.0000
Default sample rate = 44100.00
Supported standard sample rates
for half-duplex 16 bit 2 channel input =
8000.00, 9600.00, 11025.00, 12000.00,
16000.00, 22050.00, 24000.00, 32000.00,
44100.00, 48000.00, 88200.00, 96000.00,
192000.00
--------------------------------------- device #8
Name = 'Microphone (2- USB PnP Sound Device)'
Host API = 'Windows DirectSound'
Max inputs = 2, Max outputs = 0
Default low input latency = 0.1200
Default low output latency = 0.0000
Default high input latency = 0.2400
Default high output latency = 0.0000
Default sample rate = 44100.00
Supported standard sample rates
for half-duplex 16 bit 2 channel input =
8000.00, 9600.00, 11025.00, 12000.00,
16000.00, 22050.00, 24000.00, 32000.00,
44100.00, 48000.00, 88200.00, 96000.00,
192000.00
--------------------------------------- device #9
[ Default 'Windows DirectSound' Output ]
Name = 'Primary Sound Driver'
Host API = 'Windows DirectSound'
Max inputs = 0, Max outputs = 2
Default low input latency = 0.0000
Default low output latency = 0.1200
Default high input latency = 0.0000
Default high output latency = 0.2400
Default sample rate = 44100.00
Supported standard sample rates
for half-duplex 16 bit 2 channel output =
8000.00, 9600.00, 11025.00, 12000.00,
16000.00, 22050.00, 24000.00, 32000.00,
44100.00, 48000.00, 88200.00, 96000.00,
192000.00
--------------------------------------- device #10
Name = 'Speakers (2- USB PnP Sound Device)'
Host API = 'Windows DirectSound'
Max inputs = 0, Max outputs = 2
Default low input latency = 0.0000
Default low output latency = 0.1200
Default high input latency = 0.0000
Default high output latency = 0.2400
Default sample rate = 44100.00
Supported standard sample rates
for half-duplex 16 bit 2 channel output =
8000.00, 9600.00, 11025.00, 12000.00,
16000.00, 22050.00, 24000.00, 32000.00,
44100.00, 48000.00, 88200.00, 96000.00,
192000.00
--------------------------------------- device #11
Name = 'Speakers (Realtek High Definition Audio)'
Host API = 'Windows DirectSound'
Max inputs = 0, Max outputs = 2
Default low input latency = 0.0000
Default low output latency = 0.1200
Default high input latency = 0.0000
Default high output latency = 0.2400
Default sample rate = 44100.00
Supported standard sample rates
for half-duplex 16 bit 2 channel output =
8000.00, 9600.00, 11025.00, 12000.00,
16000.00, 22050.00, 24000.00, 32000.00,
44100.00, 48000.00, 88200.00, 96000.00,
192000.00
--------------------------------------- device #12
[ Default 'Windows WASAPI' Output ]
Name = 'Speakers (2- USB PnP Sound Device)'
Host API = 'Windows WASAPI'
Max inputs = 0, Max outputs = 2
Default low input latency = 0.0000
Default low output latency = 0.0030
Default high input latency = 0.0000
Default high output latency = 0.0100
Default sample rate = 44100.00
Supported standard sample rates
for half-duplex 16 bit 2 channel output =
44100.00
--------------------------------------- device #13
Name = 'Speakers (Realtek High Definition Audio)'
Host API = 'Windows WASAPI'
Max inputs = 0, Max outputs = 2
Default low input latency = 0.0000
Default low output latency = 0.0030
Default high input latency = 0.0000
Default high output latency = 0.0100
Default sample rate = 48000.00
Supported standard sample rates
for half-duplex 16 bit 2 channel output =
48000.00
--------------------------------------- device #14
[ Default 'Windows WASAPI' Input ]
Name = 'Microphone (Realtek High Definition Audio)'
Host API = 'Windows WASAPI'
Max inputs = 2, Max outputs = 0
Default low input latency = 0.0030
Default low output latency = 0.0000
Default high input latency = 0.0102
Default high output latency = 0.0000
Default sample rate = 44100.00
Supported standard sample rates
for half-duplex 16 bit 2 channel input =
44100.00
--------------------------------------- device #15
Name = 'Microphone (2- USB PnP Sound Device)'
Host API = 'Windows WASAPI'
Max inputs = 1, Max outputs = 0
Default low input latency = 0.0030
Default low output latency = 0.0000
Default high input latency = 0.0100
Default high output latency = 0.0000
Default sample rate = 44100.00
Supported standard sample rates
for half-duplex 16 bit 1 channel input =
44100.00
--------------------------------------- device #16
[ Default 'Windows WDM-KS' Input, Default 'Windows WDM-KS' Output ]
Name = 'USB PnP Sound Device'
Host API = 'Windows WDM-KS'
Max inputs = 1, Max outputs = 2
Default low input latency = 0.0107
Default low output latency = 0.0107
Default high input latency = 0.0853
Default high output latency = 0.0853
Default sample rate = 48000.00
Supported standard sample rates
for half-duplex 16 bit 1 channel input =
44100.00, 48000.00
Supported standard sample rates
for half-duplex 16 bit 2 channel output =
44100.00, 48000.00
Supported standard sample rates
for full-duplex 16 bit 1 channel input, 2 channel output =
44100.00, 48000.00
----------------------------------------------


[Portaudio] using multiple USB cards with port audio
Ranjan infibit at gmail.com
Sat Jan 16 12:10:52 EST 2016
Previous message: [Portaudio] using multiple USB cards with port audio
Next message: [Portaudio] using multiple USB cards with port audio
Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I ran the pa_devs program to get the device lists. Then I changed the
device id in inputParameters.device = 1 to 14 but only one device works
which is the default. Either the laptop mic works when USB soundcard is not
connected or the Sound card works when connected but not the laptop mic and
speakers.I am attaching the output of pa_devs program (which gives me
result.txt).

On Sat, Jan 16, 2016 at 10:37 PM, Robert Bielik <robert.bielik at dirac.se>
Hi Ranjan,
It is perfectly doable. Just use Pa_OpenStream on each of the different
devices. Note that each of the streams will need to have their own
callback.
Regards
/Robert
Hello,
I want to connect multiple USB sound cards and use them with portaudio
simultaneously. How shall I do this?I searched online but could not find
any useful information.Someone please help.
Regards
_______________________________________________
Portaudio mailing listPortaudio at lists.columbia.eduhttps://lists.columbia.edu/mailman/listinfo/portaudio
_______________________________________________
Portaudio mailing list
Portaudio at lists.columbia.edu
https://lists.columbia.edu/mailman/listinfo/portaudio
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.columbia.edu/pipermail/portaudio/attachments/20160116/299859ca/attachment.html>
-------------- next part --------------
PortAudio version number = 1899
PortAudio version text = 'PortAudio V19-devel (built Jun 15 2013 03:22:45)'
Number of devices = 17
--------------------------------------- device #0
Name = 'Microsoft Sound Mapper - Input'
Host API = 'MME'
Max inputs = 2, Max outputs = 0
Default low input latency = 0.0900
Default low output latency = 0.0900
Default high input latency = 0.1800
Default high output latency = 0.1800
Default sample rate = 44100.00
Supported standard sample rates
for half-duplex 16 bit 2 channel input =
8000.00, 9600.00, 11025.00, 12000.00,
16000.00, 22050.00, 24000.00, 32000.00,
44100.00, 48000.00, 88200.00, 96000.00,
192000.00
--------------------------------------- device #1
[ Default Input ]
Name = 'Microphone (Realtek High Defini'
Host API = 'MME'
Max inputs = 2, Max outputs = 0
Default low input latency = 0.0900
Default low output latency = 0.0900
Default high input latency = 0.1800
Default high output latency = 0.1800
Default sample rate = 44100.00
Supported standard sample rates
for half-duplex 16 bit 2 channel input =
8000.00, 9600.00, 11025.00, 12000.00,
16000.00, 22050.00, 24000.00, 32000.00,
44100.00, 48000.00, 88200.00, 96000.00,
192000.00
--------------------------------------- device #2
Name = 'Microphone (2- USB PnP Sound De'
Host API = 'MME'
Max inputs = 2, Max outputs = 0
Default low input latency = 0.0900
Default low output latency = 0.0900
Default high input latency = 0.1800
Default high output latency = 0.1800
Default sample rate = 44100.00
Supported standard sample rates
for half-duplex 16 bit 2 channel input =
8000.00, 9600.00, 11025.00, 12000.00,
16000.00, 22050.00, 24000.00, 32000.00,
44100.00, 48000.00, 88200.00, 96000.00,
192000.00
--------------------------------------- device #3
Name = 'Microsoft Sound Mapper - Output'
Host API = 'MME'
Max inputs = 0, Max outputs = 2
Default low input latency = 0.0900
Default low output latency = 0.0900
Default high input latency = 0.1800
Default high output latency = 0.1800
Default sample rate = 44100.00
Supported standard sample rates
for half-duplex 16 bit 2 channel output =
8000.00, 9600.00, 11025.00, 12000.00,
16000.00, 22050.00, 24000.00, 32000.00,
44100.00, 48000.00, 88200.00, 96000.00,
192000.00
--------------------------------------- device #4
[ Default Output ]
Name = 'Speakers (2- USB PnP Sound Devi'
Host API = 'MME'
Max inputs = 0, Max outputs = 2
Default low input latency = 0.0900
Default low output latency = 0.0900
Default high input latency = 0.1800
Default high output latency = 0.1800
Default sample rate = 44100.00
Supported standard sample rates
for half-duplex 16 bit 2 channel output =
8000.00, 9600.00, 11025.00, 12000.00,
16000.00, 22050.00, 24000.00, 32000.00,
44100.00, 48000.00, 88200.00, 96000.00,
192000.00
--------------------------------------- device #5
Name = 'Speakers (Realtek High Definiti'
Host API = 'MME'
Max inputs = 0, Max outputs = 2
Default low input latency = 0.0900
Default low output latency = 0.0900
Default high input latency = 0.1800
Default high output latency = 0.1800
Default sample rate = 44100.00
Supported standard sample rates
for half-duplex 16 bit 2 channel output =
8000.00, 9600.00, 11025.00, 12000.00,
16000.00, 22050.00, 24000.00, 32000.00,
44100.00, 48000.00, 88200.00, 96000.00,
192000.00
--------------------------------------- device #6
[ Default 'Windows DirectSound' Input ]
Name = 'Primary Sound Capture Driver'
Host API = 'Windows DirectSound'
Max inputs = 2, Max outputs = 0
Default low input latency = 0.1200
Default low output latency = 0.0000
Default high input latency = 0.2400
Default high output latency = 0.0000
Default sample rate = 44100.00
Supported standard sample rates
for half-duplex 16 bit 2 channel input =
8000.00, 9600.00, 11025.00, 12000.00,
16000.00, 22050.00, 24000.00, 32000.00,
44100.00, 48000.00, 88200.00, 96000.00,
192000.00
--------------------------------------- device #7
Name = 'Microphone (Realtek High Definition Audio)'
Host API = 'Windows DirectSound'
Max inputs = 2, Max outputs = 0
Default low input latency = 0.1200
Default low output latency = 0.0000
Default high input latency = 0.2400
Default high output latency = 0.0000
Default sample rate = 44100.00
Supported standard sample rates
for half-duplex 16 bit 2 channel input =
8000.00, 9600.00, 11025.00, 12000.00,
16000.00, 22050.00, 24000.00, 32000.00,
44100.00, 48000.00, 88200.00, 96000.00,
192000.00
--------------------------------------- device #8
Name = 'Microphone (2- USB PnP Sound Device)'
Host API = 'Windows DirectSound'
Max inputs = 2, Max outputs = 0
Default low input latency = 0.1200
Default low output latency = 0.0000
Default high input latency = 0.2400
Default high output latency = 0.0000
Default sample rate = 44100.00
Supported standard sample rates
for half-duplex 16 bit 2 channel input =
8000.00, 9600.00, 11025.00, 12000.00,
16000.00, 22050.00, 24000.00, 32000.00,
44100.00, 48000.00, 88200.00, 96000.00,
192000.00
--------------------------------------- device #9
[ Default 'Windows DirectSound' Output ]
Name = 'Primary Sound Driver'
Host API = 'Windows DirectSound'
Max inputs = 0, Max outputs = 2
Default low input latency = 0.0000
Default low output latency = 0.1200
Default high input latency = 0.0000
Default high output latency = 0.2400
Default sample rate = 44100.00
Supported standard sample rates
for half-duplex 16 bit 2 channel output =
8000.00, 9600.00, 11025.00, 12000.00,
16000.00, 22050.00, 24000.00, 32000.00,
44100.00, 48000.00, 88200.00, 96000.00,
192000.00
--------------------------------------- device #10
Name = 'Speakers (2- USB PnP Sound Device)'
Host API = 'Windows DirectSound'
Max inputs = 0, Max outputs = 2
Default low input latency = 0.0000
Default low output latency = 0.1200
Default high input latency = 0.0000
Default high output latency = 0.2400
Default sample rate = 44100.00
Supported standard sample rates
for half-duplex 16 bit 2 channel output =
8000.00, 9600.00, 11025.00, 12000.00,
16000.00, 22050.00, 24000.00, 32000.00,
44100.00, 48000.00, 88200.00, 96000.00,
192000.00
--------------------------------------- device #11
Name = 'Speakers (Realtek High Definition Audio)'
Host API = 'Windows DirectSound'
Max inputs = 0, Max outputs = 2
Default low input latency = 0.0000
Default low output latency = 0.1200
Default high input latency = 0.0000
Default high output latency = 0.2400
Default sample rate = 44100.00
Supported standard sample rates
for half-duplex 16 bit 2 channel output =
8000.00, 9600.00, 11025.00, 12000.00,
16000.00, 22050.00, 24000.00, 32000.00,
44100.00, 48000.00, 88200.00, 96000.00,
192000.00
--------------------------------------- device #12
[ Default 'Windows WASAPI' Output ]
Name = 'Speakers (2- USB PnP Sound Device)'
Host API = 'Windows WASAPI'
Max inputs = 0, Max outputs = 2
Default low input latency = 0.0000
Default low output latency = 0.0030
Default high input latency = 0.0000
Default high output latency = 0.0100
Default sample rate = 44100.00
Supported standard sample rates
for half-duplex 16 bit 2 channel output =
44100.00
--------------------------------------- device #13
Name = 'Speakers (Realtek High Definition Audio)'
Host API = 'Windows WASAPI'
Max inputs = 0, Max outputs = 2
Default low input latency = 0.0000
Default low output latency = 0.0030
Default high input latency = 0.0000
Default high output latency = 0.0100
Default sample rate = 48000.00
Supported standard sample rates
for half-duplex 16 bit 2 channel output =
48000.00
--------------------------------------- device #14
[ Default 'Windows WASAPI' Input ]
Name = 'Microphone (Realtek High Definition Audio)'
Host API = 'Windows WASAPI'
Max inputs = 2, Max outputs = 0
Default low input latency = 0.0030
Default low output latency = 0.0000
Default high input latency = 0.0102
Default high output latency = 0.0000
Default sample rate = 44100.00
Supported standard sample rates
for half-duplex 16 bit 2 channel input =
44100.00
--------------------------------------- device #15
Name = 'Microphone (2- USB PnP Sound Device)'
Host API = 'Windows WASAPI'
Max inputs = 1, Max outputs = 0
Default low input latency = 0.0030
Default low output latency = 0.0000
Default high input latency = 0.0100
Default high output latency = 0.0000
Default sample rate = 44100.00
Supported standard sample rates
for half-duplex 16 bit 1 channel input =
44100.00
--------------------------------------- device #16
[ Default 'Windows WDM-KS' Input, Default 'Windows WDM-KS' Output ]
Name = 'USB PnP Sound Device'
Host API = 'Windows WDM-KS'
Max inputs = 1, Max outputs = 2
Default low input latency = 0.0107
Default low output latency = 0.0107
Default high input latency = 0.0853
Default high output latency = 0.0853
Default sample rate = 48000.00
Supported standard sample rates
for half-duplex 16 bit 1 channel input =
44100.00, 48000.00
Supported standard sample rates
for half-duplex 16 bit 2 channel output =
44100.00, 48000.00
Supported standard sample rates
for full-duplex 16 bit 1 channel input, 2 channel output =
44100.00, 48000.00
----------------------------------------------
Loading...