[Linux] How to detect speaker mode?


I’d like to detect the speaker mode the user has setup. There doesn’t appear to be any way to do that. I’ve tried parsing all output types and devices and checking getDriverCaps, all return STEREO. Alsa has a bunch of surroundX.X devices regardless of whether the system is setup for surround sound or not.

Is there any way to detect the user’s speaker mode setup on linux? Is the only option to make the user set the desired speaker mode themself to match their system? If that is the case can I rely on the default devices to be capable of whatever speaker mode they have setup on their system?



As far as I am aware there is no standard way to configure the default ALSA speaker mode. There are several ALSA drivers exposed for default surround configurations, I think it is standard to select one of those.

ALSA configurations can be hacked up to do all sorts of things, my recommendation would be to not assume anything about the users setup and present them with the choice.