[pulseaudio-discuss] [RFC] Source Output Volumes
Colin Guthrie
gmane at colin.guthr.ie
Sun Jun 5 12:41:45 PDT 2011
'Twas brillig, and Arun Raghavan at 22/05/11 10:00 did gyre and gimble:
> On Fri, 2011-05-20 at 09:50 +0100, Colin Guthrie wrote:
>> Hello,
>>
>> As some of you know I've been working on restoring a little more
>> symmetry to our API to allow the adjustment of source output (capture
>> stream) volumes.
>
> This is really nice to have - thanks!
>
>> In the past, when stream volumes were added to sink inputs, it was
>> thought that this feature wouldn't be overly useful for capture streams
>> and while this argument still holds true, there is one feature that has
>> since been added to PA that would make it useful - flat volumes.
>>
>> Flat volumes allow for multiple streams to be connected to the same
>> device and when they differ in stream volume, the maximum one is chosen
>> and the h/w is set to that, with the difference in volume between the
>> streams applied in software. This in theory allows for optimum power
>> efficiency where the software stays out of the loop whenever possible.
>>
>> With flat volumes, adding per-stream volumes to capture streams makes sense.
>>
>> It does also simplify client code when they want to adjust their own
>> volumes, they don't have to implement their own asymmetry to deal with ours.
>>
>>
>> So I am proud to announce my work to try and achieve this. There are no
>> doubt still bugs, so a thorough review is very much appreciated.
> [...]
>
> I've not been able to test things extensively yet, but some comments:
>
> I've pushed a couple of patches on top of your tree, one trivial, one
> adds a set-source-output-volume to pactl at
> http://cgit.collabora.com/git/user/arun/pulseaudio.git/log/?h=master-source-volume
Cool, grabbed both of them now.
> 29cd2d78 capture: Add the passthrough format negitiation to capture
> streams.
> * There's typo in the commit message
Got it.
> * Just in case I forget, the fix we were discussion for ownwership of
> the formats idxset in pa_sink_input_new_data_set_formats() needs to be
> added to pa_source_output_new_data_set_formats() as well
Yeah I'm keeping this in mind but still not done anything yet... I think
you said you were going to change it? If so, I will be eternally
grateful if you patch my branch too :D
> * This is tangential to your work, but maybe we should just break
> compatibility with versions older than 0.9.20? (protocol version < 17)
> It'll make the code easier to read.
Sadly not. I think we really want to keep versions going back to at
least 15 for now. I say this because that's what quite a lot of these
little N900 Maemo thingies use if I'm not mistaken (well I think they
use 15.1 aka 16 which != our 16... thus intercommunicating with them is
a no-go unless we add a "protocol" option to daemon.conf to limit
ourselves to v15 as a common base... this was discussed the other day on
IRC).
> o94d2b5 capture: Implement per-stream volume control for capture
> streams.
> * I don't see the source output changes actually show up in the samples
> (I'm opening two gnome-volume-recorder instances, doing a pactl
> set-source-output-volume on one, but the levels are identical before and
> after). Is there a missing pa_volume_memchunk in pa_source_output_push()
> or am I just doing something stupid?
No I'm the one being stupid. I didn't actually do that bit... @s As it's
kidna important, I figured I'd add it in :D
I've folded those changes into the above commit.
> * module-echo-cancel.c - there's an s->volume inside #if 0
Still need to look at this one.
> * [Not actually from your changes] pa_source_process_msg() - does it
> matter that the order of detach and set state within thread inverted
> compared to sink-input?
I don't think it matters but it might be wise to try and make the code
more common?
> * Again, this is for later, but we should eventually stop suspending
> monitors and change the source format dynamically.
Aye for sure :)
> Will do some more extensive testing and port pulsesrc when I get some
> time as well.
Awesome!
I've pushed out a rebased tree now.
Col
--
Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/
Day Job:
Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
Mageia Contributor [http://www.mageia.org/]
PulseAudio Hacker [http://www.pulseaudio.org/]
Trac Hacker [http://trac.edgewall.org/]
More information about the pulseaudio-discuss
mailing list