Get master sound volume in C in Linux
问题 I'm trying to retrieve (and probably later set) the master sound volume in Linux. I'm using PulseAudio, but ideally it should work for ALSA too. I found this very helpful post on how to set the volume, and from that I was able to deduce the existence of snd_mixer_selem_get_playback_volume() to retrieve the current setting. However on my system, this seems to be giving me wrong readings - where mixer programs show 100%, this tops out at about 66%. If I open pavucontrol I can see the volume for