[pulseaudio-discuss] Setting the volume via API has no effect

Tanu Kaskinen tanu.kaskinen at linux.intel.com
Sun Aug 24 02:23:55 PDT 2014


On Wed, 2014-08-20 at 10:52 -0300, Hugo Osvaldo Barrera wrote:
> On 2014-08-20 06:52, Glenn Golden wrote:
> > Hugo Osvaldo Barrera <hugo at barrera.io> [2014-08-20 09:37:17 -0300]:
> > > 
> > > Am I going something wrong, or have I hit a bug?
> > > 
> > 
> > Hugo, fwiw: There's a comandline utility called ponymix
> > 
> >     https://github.com/falconindy/ponymix
> > 
> > written by Dave Reisner, which performs get- and set- volume operations.
> > It looks to be well structured and written, although not a lot of comments.
> > Perhaps you may be able to use that code as a guide for how to do what
> > you're trying to do with the API.
> > 
> > (The only reason I'm mentioning this is that I happen to be playing around
> > with ponymix myself right now. Sounded like it might be something you'd
> > be interested in.)
> > 
> > HTH,
> > 
> > Glenn
> > 
> 
> Huh, this actually helped a lot more than expected. Thanks!
> I replaced pa_context_set_sink_input_volume with pa_context_set_sink_volume_by_index.
> 
> I'm still not sure (even by looking at the documentation) what the other one
> does, or what the difference between both functions are. Is that just me,
> because I'm a novice in this, or could the doc be improved a slight bit?

This trouble would have been avoided if you had known the meaning of
terms "sink" (an output device) and "sink input" (a playback stream). We
currently lack proper explanations for the terms, but at least [1] says
this:

"Sink inputs and source outputs are the representations of the client
ends of streams inside the server. I.e. they connect a client stream to
one of the global sinks or sources."

Suggestions are welcome regarding where to put an overview of PulseAudio
concepts so that you would have read it before putting a
pa_context_set_sink_input_volume() call in your code.

[1] http://freedesktop.org/software/pulseaudio/doxygen/introspect.html

-- 
Tanu



More information about the pulseaudio-discuss mailing list