-1

I'm successfully rendering audio with alsa, however I'm completely incapable of determining the channel mapping. As various sources have stated, I'm calling snd_pcm_get_chmap after the hw & sw params are set and the device is prepared.

snd_config_get_string returns 'pulse' for this device which I'm presuming means it's an alsa/pulseaudio bridge for want of a better term.

Calling snd_strerror(errno) after snd_pcm_get_chmap fails is returning 'Socket operation on non-socket'. I should probably add that I'm debugging remotely from Visual Studio 2017 as that may be related.

I'd really like to be able to get the channel mapping. Any suggestions appreciated.

1 Answers1

0

Pulse audio's list of ALSA issues states that it isn't currently possible to obtain the channel map. https://www.freedesktop.org/wiki/Software/PulseAudio/Backends/ALSA/Issues/

There's no way to query the active channel map for a device

  • Consolidating comments I made here: 1. Coming late to this question but I wonder if the pulse audio guys have seen this: https://docs.kernel.org/sound/designs/channel-mapping-api.html -- seems this documentation was introduced to the Linux kernel tree in 2012. 2. Following up, I did find some alsa lib code that seems to retrieve the map from the ctl interface. Maybe actual implementation differs by kernel driver. https://github.com/alsa-project/alsa-lib/blob/7f2d6c3aac3505ceee4b0d3e8b3ca423ce29b070/src/pcm/pcm_hw.c#L1320 3. I was indeed able to query the channel map on my own machine. – asveikau Nov 14 '22 at 20:48