<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
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.<br>
<br>
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?<br>
<br>
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 :)<br>
<br>
Matt<br>
<br>
<br>
<br>
Colin Guthrie wrote:
<blockquote cite="mid:g3qdfb$se6$1@ger.gmane.org" type="cite">
  <pre wrap="">Hi,

Jerome Haltom wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">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?
    </pre>
  </blockquote>
  <pre wrap=""><!---->
Not sure to be honest.

  </pre>
  <blockquote type="cite">
    <pre wrap="">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.
    </pre>
  </blockquote>
  <pre wrap=""><!---->
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.

  </pre>
  <blockquote type="cite">
    <pre wrap="">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.
    </pre>
  </blockquote>
  <pre wrap=""><!---->
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:
<a class="moz-txt-link-freetext" href="http://colin.guthr.ie/git/pulseaudio/tree/src/modules/module-remap-sink.c">http://colin.guthr.ie/git/pulseaudio/tree/src/modules/module-remap-sink.c</a>

Hope this helps (and is vaguely correct!)


Col

_______________________________________________
pulseaudio-discuss mailing list
<a class="moz-txt-link-abbreviated" href="mailto:pulseaudio-discuss@mail.0pointer.de">pulseaudio-discuss@mail.0pointer.de</a>
<a class="moz-txt-link-freetext" href="https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss">https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss</a>
  </pre>
</blockquote>
</body>
</html>