Forcefully change a program's volume

John W jwdevel at gmail.com
Thu Apr 21 20:32:33 UTC 2011


Hi,

I'm aware that in FreeBSD 8+ there is the VPC (Volume Per Channel)
feature which allows separate programs to have separate sound volumes.

But suppose there is a (bad) program that does not let me control its
volume from within its interface.
Is there a way for me to control it at the OS level?

In other words, I'm trying to perform these steps:

    Given the program X:
    1) Find out what channel(s) X is using
    2) Forcibly modify the VPC settings for those channels

Is it possible?
I realize there are probably issues where if X opens/closes new
channels on the fly it might be hard to keep track of, but is the
underlying support even there?

I imagine if I can open the appropriate device, I can use the
SNDCTL_DSP_SETPLAYVOL ioctl. But how do I open the appropriate device?

Thanks
-John


More information about the freebsd-questions mailing list