Regulate process volume with base OSS subsystem

redranteis

New Member


Messages: 4

Hello everyone,
just a quick question. Is it possibile to change a process' volume with base OSS subsystem?
For example, if I cat sndstat I get every process that is currently using sound: can I change
every process' volume or only the process itself can change it (via ioctls presumably)?
Thanks in advance.
 

oops

Member

Reaction score: 33
Messages: 69

Code:
$ sysctl hw.snd.verbose=2
$ mkdir -p ~/bin
$ fetch -o ~/bin/ https://people.freebsd.org/~ariff/utils/appsmixer
$ chmod +x ~/bin/appsmixer
$ appsmixer
wine (dsp0.vp0):
        Mixer pcm      is currently set to  45:45
mpv (dsp0.vp1):
        Mixer pcm      is currently set to  45:45
firefox (dsp0.vp2):
        Mixer pcm      is currently set to  45:45
$ appsmixer firefox 100
firefox (dsp0.vp0):
        Setting the mixer pcm from 45:45 to 100:100.
 
OP
R

redranteis

New Member


Messages: 4

Code:
$ sysctl hw.snd.verbose=2
$ mkdir -p ~/bin
$ fetch -o ~/bin/ https://people.freebsd.org/~ariff/utils/appsmixer
$ chmod +x ~/bin/appsmixer
$ appsmixer
wine (dsp0.vp0):
        Mixer pcm      is currently set to  45:45
mpv (dsp0.vp1):
        Mixer pcm      is currently set to  45:45
firefox (dsp0.vp2):
        Mixer pcm      is currently set to  45:45
$ appsmixer firefox 100
firefox (dsp0.vp0):
        Setting the mixer pcm from 45:45 to 100:100.
Well, I didn't notice that with mixer(8) I could have used /dev/dspN.vp* and /dev/dspN.vr* to regulate each process' volume. That is exactly what I was searching. Thanks.
 

Mjölnir

Daemon

Reaction score: 1,483
Messages: 2,114

Is it possibile to change a process' volume with base OSS subsystem?
For example, if I cat sndstat I get every process that is currently using sound: can I change every process' volume or only the process itself can change it (via ioctls presumably)?
Yes, this can be done by the so-called virtual private sound channels (VPC). Unfortunately, not all mixer applications handle that correctly. The major DEs should be fine in this regard.
sysctl dev.pcm|fgrep vchan
 
Top