[pulseaudio-discuss] How to set media role variable ??

sathishkumar sivagurunathan sathish1000 at gmail.com
Wed Nov 20 07:57:00 PST 2013

Thanks Tanu for the detailed reply..

A) I would great if whatever I am intending to do could be added to
pulseaudio. But I feel what I need to do is already implemented in the
module "Module-role-cork" --> Essentially priority assignment between the
streams played by pulseaudio.

B) The only differentiator is that instead of the (media player or skype)
application assigning the media.role variable, I want the Audio Manager or
Routing system (to which the other applications like skype and media player
register) to manage assignment of this variable..

C) I have a question in this regard. I have listed it below.

So "*if I can keep the Module-role-cork running by adding it to the
default.pa <http://default.pa> file, I hope that assignment of the media
role variable will take care of priority (what is to be corked and
uncorked).*" -- Is this assumption right ??

D) So the module intent to write has the following aim :-

     Based on the Audio Manager or routing mechanism status, media.role
priority of the particular audio stream needs to be assigned..

*E) I have a few doubts in my mind abt the way in which the module can be
called*. In your reply, you have mentioned that the module can call and
consult the Audio Manager. Is the other way possible. In order words,

*Is their by any chance the module can loaded from my routing mechanism
code itself.. *

>From the simple test I could carry out, the command line arguments for this
prioritizing functionality seems to go like this
  "*pactl load-module <module-name>*". Is there by any chance I can load
these modules from a C++ program.

F) I also tried to carry out a few simple test to check how the routing
works in pulse audio when media player is playing when a phone call over
skype arrives.. But in ubuntu 12.10, the MODULE-ROLE-CORK command doesnt
seem to working. I am using pulseaudio 2.0.

I had tried in ubuntu 12.04 LTS. the module "MODULE-CORK-MUSIC-ON-PHONE"
seems to be working good for me (pulseaudio 1.1). *Is that I should upgrade
to the latest ubuntu version 13.10 and check..*

G) The command format I used in pulseaudio 2.0 to load the
"module-role-cork" is like this

*    pactl load-module module-role-cork trigger_roles="phone"

    Is this the right way to do this..


On 19 November 2013 16:03, Tanu Kaskinen <tanu.kaskinen at linux.intel.com>wrote:

> On Tue, 2013-11-19 at 14:57 +0530, sathishkumar sivagurunathan wrote:
> > Thanks Tanu,
> >
> > What I want to do is something like this.
> >
> > 1) The task is very similar to the module-role-cork.. Ex:- when a call
> > comes from skype, if I am playing rhythmbox, it should pause and after I
> > finish the call, it should restart. The skype and rhythmbox are managed
> by
> > a Audio Manager.
> >
> > 2) The applications that I use (like skype and rhythmbox) might not have
> > the media role property.
> >
> > 3) In such a case, how to assign media roles to them..
> >
> > 4) The Audio Manager or routing engine has the information about the
> media
> > role variable..
> >
> > The above points are the things I want to acheive..
> >
> > *" Essentially, if I write a module, it should take the media role
> > information from Audio Manager and set the media role variable in pulse
> > audio.."*
> >
> > Is this what you implied when you replied you have to write a module
> > (written within quotes and faced in bold)??
> Well, I had no knowledge of there being any Audio Manager software, so
> naturally I didn't imply that the module would take information from
> such software, but if there must be a separate Audio Manager, then yes,
> the module would take input from the Audio Manager and set the media
> role variables according to the input.
> > Are there any other ways to do
> > it ??
> I assume that the information about how to map streams to media roles is
> pretty static, so perhaps the module doesn't need to have a connection
> to the Audio Manager. Instead, the module could have its own
> configuration file that tells how to map streams to media roles. But if
> you want to keep the configuration in the Audio Manager, then the module
> should connect to the Audio Manager.
> Note that upstream PulseAudio doesn't support writing out-of-tree
> modules, so if you want to write a module, you need to modify
> PulseAudio. One option is to modify the build system so that the
> internal headers are installed so that they're available to external
> code - this is what e.g. Tizen and Sailfish do to facilitate their
> custom PulseAudio modules. If you don't need to keep your module
> separate from the PulseAudio source, you can of course add the module
> directly to the PulseAudio sources, so the build system doesn't need to
> be modified (except to the extent that it builds your module).
> The optimal solution would be that you would upstream your module, so
> you wouldn't have to maintain a modified version PulseAudio, you
> wouldn't have to port the module whenever you update PulseAudio, and
> also other people than you would get benefit from the module. This
> option requires that you convince us that it makes sense for us to take
> and maintain your module. If this is what you want, then we need to
> discuss the details of what the module does.
> --
> Tanu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/pulseaudio-discuss/attachments/20131120/4cb0efae/attachment-0001.html>

More information about the pulseaudio-discuss mailing list