3

The Pulseaudio FAQ shows how to explicitly load an ALSA sink module with a channel map. This works, but also involves disabling the device autodetection modules, which I don't want to do.

There is, in the "sound" settings, a "mode" option for each output device that appears to configure the channel map PulseAudio uses for that device. It has options such as "Analog Stereo Output" and "Analog Surround 5.1 Output". This seems like the way to go if the goal is to not break the default configuration, which for the most part, works really well.

The issue is that my speakers really are just stereo, but I still have 6 more outputs I'd like to use somehow. I suppose they could be exposed as additional sinks. Or, if I can get these additional channels exposed as "aux0, aux1, ...", I can use module-remap-sink to make them appear as additional sinks.

I also have eight analog inputs and 2 digital inputs, and no "mode" setting seems to expose them all.

So the question is: where are these "modes" configured? Or, are there any other good solutions to this problem?

1

The examples here helped me:

https://wiki.archlinux.org/index.php/PulseAudio/Examples#Simultaneous_HDMI_and_Analog_Output

I ended up with the following in ~/.config/pulse/default.pa:

# http://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/Modules/#index12h3
# https://wiki.archlinux.org/index.php/PulseAudio/Examples#Simultaneous_HDMI_and_Analog_Output
# remix=no is required, otherwise it will turn 2-channel sound into 4-channel sound and send it to all master channels
load-module module-remap-sink sink_name=headphones remix=no master=alsa_output.pci-0000_00_1b.0.analog-surround-40 channels=2 master_channel_map=front-left,front-right channel_map=front-left,front-right sink_properties=device.description=Headphones
load-module module-remap-sink sink_name=speakers remix=no master=alsa_output.pci-0000_00_1b.0.analog-surround-40 channels=2 master_channel_map=rear-left,rear-right   channel_map=front-left,front-right sink_properties=device.description=Speakers

# sending output to this goes to both
# replacing "0" with "alsa_output.pci-0000_00_1b.0.analog-surround-40" might work, but this also does
update-sink-proplist 0 device.description="Both"

# this renames the virtual streams, which show up in KMix.  It's handy, since KMix can't show more than one sink for master volume in the popup
update-sink-input-proplist 0 media.name="Headphones"
update-sink-input-proplist 1 media.name="Speakers"

Replace your device names (the master=...) as necessary.

NOTE: You must first copy /etc/pulse/default.pa to ~/.config/pulse/default.pa and then edit it, because pulseaudio doesn't read from the system-wide file at all if the user's file exists. Henceforth you must merge any changes from the system-wide file into your personal one. Alternatively you could just edit the system-wide file, but then it could be overwritten by updates, which would throw all your work away! (Or maybe dpkg would prompt you to manually merge them, but what if you didn't notice? (Insert recommendation for etckeeper here.))

There is also an example here:

http://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/Modules/#index12h3

But it uses the aux channels, which is more confusing. Using remix=no makes that unnecessary.

Now I have no idea what your definition of a kludge is, but you should be able to use these examples plus the PA Wiki or a bit of googling to get you the rest of the way. For your extra channels, the wiki lists this:

Channel map. A list of comma-separated channel names. The currently defined channel names are: left, right, mono, center, front-left, front-right, front-center, rear-center, rear-left, rear-right, lfe, subwoofer, front-left-of-center, front-right-of-center, side-left, side-right, aux0, aux1 to aux15, top-center, top-front-left, top-front-right, top-front-center, top-rear-left, top-rear-right, top-rear-center, (Default depends on the number of channels and the driver)

By the way, the pacmd tool takes the exact same commands as the default.pa file, so you can make changes interactively, then paste the working commands into default.pa, just without pacmd in each one. Be advised, you might have to do some things slightly differently, like unloading some modules first, compared to doing it in default.pa, since pulseaudio is already running. I spent some time hair-pulling over this. (:v)

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.