3

I want to record audio from multiple input devices using ALSA and Pulseaudio. More precisely, I want to play UltraStar Deluxe. It is a game using SDL. As far as I can tell, it supports ALSA only. Everything is working fine as long as I simply use the virtual ALSA "pulse" device for output and input. Unfortunately, this only allows one input device, but I want to record from three independent (USB) microphones. Downmixing the three sources into one is not an option.

https://wiki.archlinux.de/title/Pulseaudio#Mehrere_PulseAudio_ALSA_Ger.C3.A4te suggests to define an additional ALSA PCM by adding

pcm.<pcmname> {
  type pulse
  device <devicename>
}

to my ~/.asoundrc. Unfortunately, I cannot work out what to use for the pulseaudio device name. I tried with what I guess it the pulseaudio name alsa_card.usb-0d8c_C-Media_USB_Audio_Device-00-Device. arecord -L shows the additional virtual ALSA PCM, but fails to record from it giving the error message ALSA lib pcm_pulse.c:752:(pulse_prepare) PulseAudio: Unable to create stream: Entität nicht vorhanden (that last german bit translates to something along Entity not existant). The virtual ALSA PCM does not show in UltraStar Deluxe.

How can I achieve this? Is it possible at all? I use Pulseaudio for everything else and it works fine. Without Pulseaudio working with many programs is cumbersome and audio is flaky.

Here is the output of pacmd list-cards:

4 card(s) available.
index: 0
... (HDMI Output Device stripped)
index: 1
name: <alsa_card.pci-0000_00_1b.0>
driver: <module-alsa-card.c>
owner module: 6
properties:
alsa.card = "0"
alsa.card_name = "HDA Intel PCH"
alsa.long_card_name = "HDA Intel PCH at 0xf6130000 irq 48"
alsa.driver_name = "snd_hda_intel"
device.bus_path = "pci-0000:00:1b.0"
sysfs.path = "/devices/pci0000:00/0000:00:1b.0/sound/card0"
device.bus = "pci"
device.vendor.id = "8086"
device.vendor.name = "Intel Corporation"
device.product.id = "1e20"
device.product.name = "7 Series/C210 Series Chipset Family High Definition Audio Controller"
device.form_factor = "internal"
device.string = "0"
device.description = "Internes Audio"
module-udev-detect.discovered = "1"
device.icon_name = "audio-card-pci"
profiles:
input:analog-stereo: Analog Stereo Eingang (priority 60, available: unknown)
output:analog-stereo: Analog Stereo Ausgang (priority 6000, available: unknown)
output:analog-stereo+input:analog-stereo: Analog Stereo Duplex (priority 6060, available: unknown)
output:analog-surround-40: Analog Surround 4.0 Ausgang (priority 700, available: unknown)
output:analog-surround-40+input:analog-stereo: Analog Surround 4.0 Ausgang + Analog Stereo Eingang (priority 760, available: unknown)
output:analog-surround-41: Analog Surround 4.1 Ausgang (priority 800, available: unknown)
output:analog-surround-41+input:analog-stereo: Analog Surround 4.1 Ausgang + Analog Stereo Eingang (priority 860, available: unknown)
output:analog-surround-50: Analog Surround 5.0 Ausgang (priority 700, available: unknown)
output:analog-surround-50+input:analog-stereo: Analog Surround 5.0 Ausgang + Analog Stereo Eingang (priority 760, available: unknown)
output:analog-surround-51: Analog Surround 5.1 Ausgang (priority 800, available: unknown)
output:analog-surround-51+input:analog-stereo: Analog Surround 5.1 Ausgang + Analog Stereo Eingang (priority 860, available: unknown)
output:iec958-stereo: Digital Stereo (IEC958) Ausgang (priority 5500, available: unknown)
output:iec958-stereo+input:analog-stereo: Digital Stereo (IEC958) Ausgang + Analog Stereo Eingang (priority 5560, available: unknown)
off: Aus (priority 0, available: unknown)
active profile: <output:analog-stereo>
sinks:
alsa_output.pci-0000_00_1b.0.analog-stereo/#0: Internes Audio Analog Stereo
sources:
alsa_output.pci-0000_00_1b.0.analog-stereo.monitor/#0: Monitor of Internes Audio Analog Stereo
ports:
analog-input: Analoge Eingabe (priority 10000, latency offset 0 usec, available: unknown)
  properties:

analog-input-microphone: Mikrofon (priority 8700, latency offset 0 usec, available: no)
  properties:
    device.icon_name = "audio-input-microphone"
analog-input-linein: Line In (priority 8100, latency offset 0 usec, available: no)
  properties:

analog-output: Analoge Ausgabe (priority 9900, latency offset 0 usec, available: unknown)
  properties:

iec958-stereo-output: Digitaler Ausgang (S/PDIF) (priority 0, latency offset 0 usec, available: unknown)
  properties:

index: 2
name: <alsa_card.usb-0d8c_C-Media_USB_Audio_Device-00-Device>
driver: <module-alsa-card.c>
owner module: 7
properties:
alsa.card = "1"
alsa.card_name = "C-Media USB Audio Device"
alsa.long_card_name = "C-Media USB Audio Device at usb-0000:00:1d.0-1.5, full speed"
alsa.driver_name = "snd_usb_audio"
device.bus_path = "pci-0000:00:1d.0-usb-0:1.5:1.0"
sysfs.path = "/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.5/2-1.5:1.0/sound/card1"
udev.id = "usb-0d8c_C-Media_USB_Audio_Device-00-Device"
device.bus = "usb"
device.vendor.id = "0d8c"
device.vendor.name = "C-Media Electronics, Inc."
device.product.id = "0008"
device.product.name = "C-Media USB Audio Device   "
device.serial = "0d8c_C-Media_USB_Audio_Device"
device.string = "1"
device.description = "C-Media USB Audio Device   "
module-udev-detect.discovered = "1"
device.icon_name = "audio-card-usb"
profiles:
input:analog-mono: Analog Mono Eingang (priority 1, available: unknown)
output:analog-stereo: Analog Stereo Ausgang (priority 6000, available: unknown)
output:analog-stereo+input:analog-mono: Analog Stereo Ausgang + Analog Mono Eingang (priority 6001, available: unknown)
output:iec958-stereo: Digital Stereo (IEC958) Ausgang (priority 5500, available: unknown)
output:iec958-stereo+input:analog-mono: Digital Stereo (IEC958) Ausgang + Analog Mono Eingang (priority 5501, available: unknown)
off: Aus (priority 0, available: unknown)
active profile: <input:analog-mono>
sources:
alsa_input.usb-0d8c_C-Media_USB_Audio_Device-00-Device.analog-mono/#1: C-Media USB Audio Device    Analog Mono
ports:
analog-input-microphone: Mikrofon (priority 8700, latency offset 0 usec, available: unknown)
  properties:
    device.icon_name = "audio-input-microphone"
analog-output: Analoge Ausgabe (priority 9900, latency offset 0 usec, available: unknown)
  properties:

iec958-stereo-output: Digitaler Ausgang (S/PDIF) (priority 0, latency offset 0 usec, available: unknown)
  properties:

index: 3
name: <alsa_card.usb-0d8c_C-Media_USB_Audio_Device-00-Device_1>
driver: <module-alsa-card.c>
owner module: 8
properties:
alsa.card = "2"
alsa.card_name = "C-Media USB Audio Device"
alsa.long_card_name = "C-Media USB Audio Device at usb-0000:00:1d.0-1.6, full speed"
alsa.driver_name = "snd_usb_audio"
device.bus_path = "pci-0000:00:1d.0-usb-0:1.6:1.0"
sysfs.path = "/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.6/2-1.6:1.0/sound/card2"
udev.id = "usb-0d8c_C-Media_USB_Audio_Device-00-Device_1"
device.bus = "usb"
device.vendor.id = "0d8c"
device.vendor.name = "C-Media Electronics, Inc."
device.product.id = "0008"
device.product.name = "C-Media USB Audio Device   "
device.serial = "0d8c_C-Media_USB_Audio_Device"
device.string = "2"
device.description = "C-Media USB Audio Device   "
module-udev-detect.discovered = "1"
device.icon_name = "audio-card-usb"
profiles:
input:analog-mono: Analog Mono Eingang (priority 1, available: unknown)
output:analog-stereo: Analog Stereo Ausgang (priority 6000, available: unknown)
output:analog-stereo+input:analog-mono: Analog Stereo Ausgang + Analog Mono Eingang (priority 6001, available: unknown)
output:iec958-stereo: Digital Stereo (IEC958) Ausgang (priority 5500, available: unknown)
output:iec958-stereo+input:analog-mono: Digital Stereo (IEC958) Ausgang + Analog Mono Eingang (priority 5501, available: unknown)
off: Aus (priority 0, available: unknown)
active profile: <input:analog-mono>
sources:
alsa_input.usb-0d8c_C-Media_USB_Audio_Device-00-Device_1.analog-mono/#2: C-Media USB Audio Device    Analog Mono
ports:
analog-input-microphone: Mikrofon (priority 8700, latency offset 0 usec, available: unknown)
  properties:
    device.icon_name = "audio-input-microphone"
analog-output: Analoge Ausgabe (priority 9900, latency offset 0 usec, available: unknown)
  properties:

iec958-stereo-output: Digitaler Ausgang (S/PDIF) (priority 0, latency offset 0 usec, available: unknown)
  properties:

Regards

Hermann

1

I figured it out myself. I was wrong to assume the "device" option would need a device name. Instead, a source (or sink, depending what you are trying to achive) name is needed. This for example gives me ALSA access to an individual microphone handled by pulseaudio:

pcm.pulse_mic1 {
  type pulse
  device alsa_input.usb-0d8c_C-Media_USB_Audio_Device-00-Device.analog-mono
}
ctl.pulse_mic1 {
  type pulse
  device alsa_input.usb-0d8c_C-Media_USB_Audio_Device-00-Device.analog-mono
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.