Re: [pulseaudio-discuss] Changing Volume on Streams ( not Sinks )

2019-07-30 Thread Tanu Kaskinen
On Mon, 2019-07-29 at 10:24 -0700, Brian Bulkowski wrote:
> Thank you Georg!
> 
> About 12 hours ago I figured it out too. 
> pa_context_set_sink_input_volume() is the function I was looking for, 
> and I was mistakenly using pa_context_set_sink_volume_by_index(), an 
> obvious flaw on my part.
> 
> The other way to get a sink-input id directly from a Stream, you don't 
> need to list them all and find what you're looking for. That would be 
> 'pa_stream_get_index'.
> 
> I would suggest adding a single sentence to the doc set ---
> 
> 'pa_stream_get_index' should note that what is returned is a 'sink 
> input' or 'source output' id, depending on the type of stream. The note 
> there says "useful for functions such as" which are functions that take 
> those kinds of IDs, but a little clarity would be helpful.
> 
> If there was a description somewhere in the doc set about the 4 
> different id spaces ( more? ), at a higher level, that would be really 
> great. That finally clicked for me when I was looking at pacmd/pactl and 
> seeing how that tool lists things, see the different IDs and what you 
> can do with them. It doesn't really fit in any of the higher level 
> sections, because it applies to both simple and async and others
> 
> I like PulseAudio quite a bit -- can I give back by trying to write up a 
> page?

By a page, do you mean a new page or section in the doxygen
documentation? Yes, documentation patches are very welcome!

-- 
Tanu

https://www.patreon.com/tanuk
https://liberapay.com/tanuk

___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss

Re: [pulseaudio-discuss] Changing Volume on Streams ( not Sinks )

2019-07-29 Thread Brian Bulkowski

Thank you Georg!

About 12 hours ago I figured it out too. 
pa_context_set_sink_input_volume() is the function I was looking for, 
and I was mistakenly using pa_context_set_sink_volume_by_index(), an 
obvious flaw on my part.


The other way to get a sink-input id directly from a Stream, you don't 
need to list them all and find what you're looking for. That would be 
'pa_stream_get_index'.


I would suggest adding a single sentence to the doc set ---

'pa_stream_get_index' should note that what is returned is a 'sink 
input' or 'source output' id, depending on the type of stream. The note 
there says "useful for functions such as" which are functions that take 
those kinds of IDs, but a little clarity would be helpful.


If there was a description somewhere in the doc set about the 4 
different id spaces ( more? ), at a higher level, that would be really 
great. That finally clicked for me when I was looking at pacmd/pactl and 
seeing how that tool lists things, see the different IDs and what you 
can do with them. It doesn't really fit in any of the higher level 
sections, because it applies to both simple and async and others


I like PulseAudio quite a bit -- can I give back by trying to write up a 
page?


Thanks!

On 7/29/2019 12:21 AM, Georg Chini wrote:

On 28.07.19 19:44, Brian Bulkowski wrote:
I posted yesterday, twice, about how the "stream get sink id" was 
going to solve my problems.


In 10.0 ( the distro version on Debian Stretch on the Raspberry PI ), 
the "sink ID" returned from that call is not a valid sink ID and 
doesn't do anything good.


I am hoping this call is more functional ( does anything functional ) 
in later revs, so I'm onward to upgrading to 12.2 or similar, before 
embarking on creating lots of extra Sinks in the configuration system.


-brian


Hi Brian,

first, let me clarify the terminology pulseaudio is using:

- The term "sink" is used for for an audio output, for example your
speakers connected to your internal sound card or an USB or
Bluetooth device.

- The term "sink input" refers to an individual stream. A sink input
can be connected to a sink. Then the stream will play on your
output device.

To list sink inputs, the function pa_context_get_sink_input_info_list()
can be used. Then the volume can be changed with
pa_context_set_sink_input_volume().

For complete documentation see
https://freedesktop.org/software/pulseaudio/doxygen/

The functions I referenced above can be found at
https://freedesktop.org/software/pulseaudio/doxygen/introspect_8h.html

Regards
 Georg


___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss

Re: [pulseaudio-discuss] Changing Volume on Streams ( not Sinks )

2019-07-29 Thread Georg Chini

On 28.07.19 19:44, Brian Bulkowski wrote:
I posted yesterday, twice, about how the "stream get sink id" was 
going to solve my problems.


In 10.0 ( the distro version on Debian Stretch on the Raspberry PI ), 
the "sink ID" returned from that call is not a valid sink ID and 
doesn't do anything good.


I am hoping this call is more functional ( does anything functional ) 
in later revs, so I'm onward to upgrading to 12.2 or similar, before 
embarking on creating lots of extra Sinks in the configuration system.


-brian


Hi Brian,

first, let me clarify the terminology pulseaudio is using:

- The term "sink" is used for for an audio output, for example your
speakers connected to your internal sound card or an USB or
Bluetooth device.

- The term "sink input" refers to an individual stream. A sink input
can be connected to a sink. Then the stream will play on your
output device.

To list sink inputs, the function pa_context_get_sink_input_info_list()
can be used. Then the volume can be changed with
pa_context_set_sink_input_volume().

For complete documentation see
https://freedesktop.org/software/pulseaudio/doxygen/

The functions I referenced above can be found at
https://freedesktop.org/software/pulseaudio/doxygen/introspect_8h.html

Regards
 Georg

___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss

Re: [pulseaudio-discuss] Changing Volume on Streams ( not Sinks )

2019-07-27 Thread Brian Bulkowski
Answering my own question, it seems that a Stream ( from the client API 
perspective ) creates a new Sink Input under the covers. Each Stream 
ends up with a unique Sink, which combine further down the line.


The ID of that Sink Input can be grabbed with pa_stream_get_index, after 
it is up and running ( probably valid right after the stream connect 
callback ), and that index can be used to set volume.


Whew, I think this has saved me a ton of work, although the amount of 
time spent finding the solution was kinda high :-) Hopefully this thread 
helps someone else in the same situation.


Regards

-brian

___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss