[pulseaudio-discuss] External Volume Controls
Matthew Patterson
matt at v8zman.com
Tue Jun 24 08:52:50 PDT 2008
I can't really help much with the problem, but I thought I would toss in
a little bit of knowledge. I asked the list about volume control
range/linearity a few weeks ago because I thought it was software based.
Lennart replied that whenever possible pulse uses the hardware control
built into the sound device. Thus you should get better volume control
than you were thinking just by using the normal controls.
I also thought I would throw in that I have spent the last few months
assembling a whole home audio system with 5 stereo zones that used pulse
audio plus some custom python and php code to provide a audio multiplex
switch. I actually just finished adding the 5th zone and it all scales
wonderfully (pulse is well built!). I don't think it is really along the
lines of what you are looking for because all my code just talks to the
command line interface (like pacmd) but I am perfectly happy to share code?
Colin, Lennart: Is there a place where pulse users can post their open
source projects based on pulse? That might inspire me to clean up my
code and make it not horrendous :)
Matt
Colin Guthrie wrote:
> Hi,
>
> Jerome Haltom wrote:
>
>> So the question is has anybody done anything like this? If so, what did
>> you end up with? Does any existing code exist for something like this?
>>
>
> Not sure to be honest.
>
>
>> If not, what pointers do ya'll suggest I use to accomplish it? At most I
>> am sort of thinking that I'd have to develop a PulseAudio module which
>> would expose a virtual sink for each real sink, somehow having the
>> volume adjustment stuff actually manipulate the amp.
>>
>
> Yeah that's probably the right approach. I'm not 100% sure, but I'd
> imagine module-remap-sink would be a good place to start. It just remaps
> channel of an existing sink so I think it would be a good template. I've
> not actually looked at the code tho', so someone more faimilar please
> pipe up if you know better.
>
> You'd probably just have catch the volume control messages in
> sink_process_msg() and do your magic, and pass everything else on to the
> real underlying sink.
>
>
>> Perhaps software for virtual sinks already exists, where you can map
>> channels from one sink to another sink, and do silly stuff like callouts
>> to external applications for volume adjustment, and I could just wire
>> that up. Sort of doubt it, though.
>>
>
> Certainly the first part yeah - module-remap-sink :)
>
> AFAIK it can't do callouts for other stuff - you'd have to write that
> in. It would be nicer if it was all self contained tho', shelling out is
> pretty nasty - you'd want some form of non-blocking asynchronous comms
> going on rather than waiting for an external app. I'd say that's more or
> less a requirement. Remap sink would seem to piggy back on to the thread
> of the underlying sink, so if you had no option but to shell out you'll
> have to create a new thread for this with an async message queue (or
> two?) to tell that thread what you want it to do (and to feed back).
> It's all a bit of a headfuk at first (I still don't get it fully!) as
> you have to constantly think about keeping things lock free and
> zero-copy! (tho' the latter shouldn't affect you).
>
> PA.org is down right now as are Lennart's other sites... I guess he has
> some issues right now. I'd point you at the wiki if it was up.
>
> The code for remap-sink can be seen in the meantime on my clone here:
> http://colin.guthr.ie/git/pulseaudio/tree/src/modules/module-remap-sink.c
>
> Hope this helps (and is vaguely correct!)
>
>
> Col
>
> _______________________________________________
> pulseaudio-discuss mailing list
> pulseaudio-discuss at mail.0pointer.de
> https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/pulseaudio-discuss/attachments/20080624/cc438bd8/attachment.htm>
More information about the pulseaudio-discuss
mailing list