If I wanted to know how much memory I was using, I could type:
Then I could just use grep or awk to extract the info from there. That's what I want to do with the current volume level of alsa. I would the volume level so I can print it out in my status bar (a dzen2 bar in i3 window manager). I understand that I could just run
and extract from there, but I don't want to call a program to do it as it's less efficient that way; the command to display it would be called about every 1/2 a second, and currently using awk to extract info from the aforementioned command is quite costly. There is a noticable difference in cpu usage when it is turned on, so I have it updating every second instead, and when I'm changing the volume levels it takes that second to refresh, which is undesirable.
I will be updating the statusbar to read a /dev/shm/volume file. I would still have to read the current volume into that file, but only when it changes (so not having to run that command every second), but I would still need to extract the volume, and I do want to do this efficiently.
I can see that there is a /proc/asound, but I've looked, and maybe I've missed something—entirely possible—but I've yet to find it. Maybe it is stored in ram? Hopefully not.