Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* ALSA -> pulseaudio channel mapping, what is it (and why?)
@ 2019-05-03 18:05 frederik
  2019-05-06 11:04 ` [alsa-devel] " Tanu Kaskinen
  0 siblings, 1 reply; 3+ messages in thread
From: frederik @ 2019-05-03 18:05 UTC (permalink / raw)
  To: alsa-devel; +Cc: pulseaudio-discuss, georg

Dear ALSA developers,

I ran into a problem which seems to be caused by some lines in
"alsa-plugins-1.1.8/pulse/pcm_pulse.c".

The problem is that if I create a 6-channel PulseAudio device, and
then I configure an ALSA device in ~/.asoundrc to output to the
PulseAudio device, the channels of the ALSA device are mixed together
in various ways and don't correspond 1-1 with the channels of the
PulseAudio device.

I find this to be counter-intuitive. If I wanted channels to be mixed
and remapped in various ways, I would use the PulseAudio module
module-remap-sink on the PulseAudio side, since AFAICT ALSA does not
support named channels. I would not expect remixing to happen in the
ALSA->Pulse bridge, since the relevant PCM plugin contains no channel
map parameter.

I don't even know what channel map I should give the PulseAudio device
in order to prevent remixing from occurring. The file pcm_pulse.c
contains the lines:

        for (c = pcm->ss.channels; c > 0; c--)
                if (pa_channel_map_init_auto(&map, c, PA_CHANNEL_MAP_ALSA))
                        break;

This refers to a macro in /usr/include/pulse/channelmap.h:

    /** \cond fulldocs */
        PA_CHANNEL_MAP_ALSA,
        /**< The default mapping used by ALSA. This mapping is probably
         * not too useful since ALSA's default channel mapping depends on
         * the device string used. */
    /** \endcond */

The comment says that the ALSA mapping is "not too useful" - so why
are we using it? Also, how do I find out what it is, if it "depends on
the device string used"?

My preference would simply be to have a 1-1 channel map in pcm_pulse,
so that a PulseAudio device with 6 channels will turn into an ALSA
device with THE SAME 6 CHANNELS. No mixing. Mixing is confusing in
this context, and seems undocumented outside of the code.

I tried using aux0 thru aux5 as the PulseAudio channel map, to prevent
geometry-based remixing. However, this results in silence - apparently
none of the 6 ALSA channels end up going anywhere. That was also
unexpected. Since I am playing 6-channel audio to a 6-channel device,
which emulates another 6-channel device, I would have thought that the
channel mapping wouldn't be complicated. Instead, it appears that the
PulseAudio sink needs to have channels with specific names in order to
receive data from ALSA.

Can we fix this, or improve the user experience?

Thanks,

Frederick

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-05-07  0:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-03 18:05 ALSA -> pulseaudio channel mapping, what is it (and why?) frederik
2019-05-06 11:04 ` [alsa-devel] " Tanu Kaskinen
2019-05-07  0:48   ` frederik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox