[pulseaudio-discuss] Channel-level volume control

Colin Guthrie gmane at colin.guthr.ie
Tue Jul 13 12:35:39 PDT 2010


'Twas brillig, and Alex Karpinski at 13/07/10 19:32 did gyre and gimble:
> On Jul 13, 2010, at 2:12 PM, Colin Guthrie wrote:
> 
>> 'Twas brillig, and Alex Karpinski at 13/07/10 18:53 did gyre and
>> gimble:
>>> Long question short: Is it possible the volume for an individual
>>> channel on an individual sink-input?
>> 
>> Yes. Just use pavucontrol and make sure you press the button that
>> allows individual channel volume control.
> 
> Thanks for the advice. I guess I should have added to the short
> version a little more. I need a way to incorporate this into a
> script. Seeing pavucontrol was what made me think pulse would work so
> well for this, I just figured that there was some other way of doing
> what it does, or at least a library, but I haven't been able to find
> a python library or command-line tool that won't simply lump both
> channels into one.

Yeah, the closest you can get is pactl:

pactl [options] set-sink-input-volume SINKINPUT VOLUME

But as you say this just lumps it into one volume, not per-channel volumes.

Not sure on the status of python volumes, but git master now has a dbus
based protocol, and while I've not looked at it, I'd imagine it supports
per-channel volume control. With this in mind, it *may* be possible to
write a script based on dbus-send that would work, but I have to stress
that I've not looked at this at all.

If you don't have any luck here, it shouldn't be too hard to adapt pactl
to accept a comma separated list of volumes instead and/or write your
own simple client app in C.

For a simpler approach, if you have amixer, perhaps you can use that to
set the independent volumes via alsa->pulse bridge that is likely in
place. This will only work for full sinks, rather than a sink input, but
perhaps you can use a redundant remap-sink for that purpose and only use
that sink for the streams you want to change? You may need to set the
PULSE_SINK variable. This is a pretty hick solution tho' :s

Col

-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
  Mandriva Linux Contributor [http://www.mandriva.com/]
  PulseAudio Hacker [http://www.pulseaudio.org/]
  Trac Hacker [http://trac.edgewall.org/]




More information about the pulseaudio-discuss mailing list