1

I am watching this example of how to add simultaneous mode support to pulseaudio. The example shows (see below) how to add just one device which is hardware's one :P

### Load analog device
load-module module-alsa-sink device=hw:0,0
load-module module-combine-sink sink_name=combined
set-default-sink combined

So my question is...

How to add two (?or more) devices and how to add virtual device(s)?

EDIT:


I tried the instruction to combine two sinks as :

$pacmd load-module module-combine-sink sink_name=combined2 sink_properties=device.description="Combined with a null sink" slaves=combined,MyTestSink

but it throws Module load failed. Something's wrong with the syntax or what can be wrong here? I have the combined and MyTestSink names on $pacmd list-sinks output ...


Thanks

1

The example looks incomplete. You use the slaves option to add several sinks to the combined sink:

load-module module-combine-sink sink_name=combination-sink sink_properties=device.description=myCombinationSink slaves=sink1,sink2[,...] channels=2

where sink1 etc. are the sinks you want to combine.

Also, usually you don't need to load modules for ALSA hardware, they should be loaded automatically.

Use list-sinks to get a list of available sinks (or use pavucontrol if you prefer a GUI).

Edit

hw:0,0 is an ALSA name for a device. The module-alsa-* modules make ALSA devices available as Pulseaudio sources and sinks. When you use other Pulseaudio modules which refer to existing sources/sinks, you use of course the Pulseaudio names (see pacmd list-sinks etc., without the angular brackets). The ALSA names are not relevant in Pulseaudio.

I'm not sure what you mean by "virtual devices". Pulseaudio has sources and sinks, of various different kinds. Some of those correspond to physical hardware available via ALSA, some of those correspond to streaming audio on the network, some of those correspond to physical Bluetooth devices (not via ALSA), and some of those are neither. Pulseaudio doesn't care what they are, they are just sources and sinks, and none of them is called "virtual".

Edit

Sink names on my system:

$ pacmd list-sinks | grep name:
name: <alsa_output.pci-0000_00_1b.0.analog-stereo>
name: <alsa_output.usb-Roland_UA-25EX-00.analog-stereo>

$ pactl list short sinks
0       alsa_output.pci-0000_00_1b.0.analog-stereo      module-alsa-card.c     s16le 2ch 44100Hz        IDLE
1       alsa_output.usb-Roland_UA-25EX-00.analog-stereo module-alsa-card.c     s16le 2ch 44100Hz        RUNNING

So, on my system:

pacmd load-module module-combine-sink sink_name=combined sink_properties=device.description=CombinedSink slaves=alsa_output.pci-0000_00_1b.0.analog-stereo,alsa_output.usb-Roland_UA-25EX-00.analog-stereo

To repeat: No, you cannot use names like hw:1 for Pulseaudio. These are ALSA names for ALSA devices accessed through ALSA libraries. You can use them in Pulseaudio in exactly one place, namely when an ALSA module (module-alsa-devices or module-aslsa-card) is loaded that makes the ALSA devices available to Pulseaudio. Everywhere else you use the Pulseaudio sink names obtained from the list commands above (or by loading modules that provide sinks like module-null-sink and giving them names).

Edit

I'm not sure what you mean by "absolute name". The name is whatever the module that provides the sink chooses to set. It can often be specified as a parameter when the module is loaded, or it can be chosen by the module when it's not specified, like it is done for the ALSA sinks (using the hardware location) when the modules are loaded by default when Pulseaudio starts. But all this doesn't matter: Just look at what sinks you have, and use the right one. And if you load additional modules, name the sink, if you like.

  • Thank you. It's very interesting. So the slaves=sink0,sink1..sinkN channels=N not sure... what format should I use the hw:0,0 or virtual device name or...? I mean what if I want to combine hardware's (build-in) headphones and virtual devices at the same time to have them simultaneous? what exactly identificators should I use to point to hardware and virtual devices? – user390525 May 13 '18 at 12:01
  • I could see configuration snippet as load-module module-null-sink for example. So can such kind of null sink be included to the simultaneous items list by using the instruction wiki.archlinux.org/index.php/PulseAudio/… ? – user390525 May 15 '18 at 23:59
  • No, I mean what id-s should I use in the example you give slaves=sink0,sink1..sinkN channels=N? Should it be sink names or what? And can I have something like this slaves=sink0,hw:1,0..sinkN for example? Give more details please – user390525 May 19 '18 at 21:46
  • Its a bit confusing... So the sink name must be an absolute one? I mean if I have load-module module-null-sink sink_name=myNullSink0 can I use ...sink_properties=device.description="Combined Sink" slaves=myNullSink0... ? Comment please – user390525 May 21 '18 at 20:14
  • 1
    Hm, I copied this from my notes, and it looks like the quotes and spaces in the description don't work anymore for some reason. Try a device description without spaces and quotes, e.g. sink_properties=device.description=CombinedSink. – dirkt Jun 12 '18 at 3:59

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.