[pulseaudio-discuss] [PATCH v2] bluetooth: Add support for automatic switch between hsp and a2dp profiles

Tanu Kaskinen tanu.kaskinen at linux.intel.com
Sun Nov 2 04:44:53 PST 2014


On Fri, 2014-10-31 at 14:22 +0100, Pali Rohár wrote:
> On Friday 31 October 2014 13:40:57 Tanu Kaskinen wrote:
> > On Fri, 2014-10-31 at 13:07 +0100, Pali Rohár wrote:
> > > Ok, what about adding new bool parameter to this module
> > > (which will be off by default) to use also heuristic when
> > > application does not specify media.role?
> > 
> > Do you have a real use case (not something that you are able
> > to imagine, but something that either you or someone else
> > really needs)? I'm hesitant to accept any more heuristics
> > than really necessary, because this is not how I think
> > routing policy "should" be implemented, but the way I think
> > routing policy "should" be implemented takes so much work
> > that it doesn't make sense to ask you to do it.
> > 
> 
> Yes I have real use case. I'm using alsa based application for 
> voice calls and obviously it does not (and cannot) set media.role 
> because it is not pulse application.

Here's how I'd like to solve the "can't set media.role" problem: the
application should ship a configuration file that tells PulseAudio how
to recognize the application's streams (by the executable name
probably), and what the media role should be for those streams. If the
application developers for some reason refuse to do this, or if the
application isn't maintained any more, we could add the configuration
file ourselves to a repository containing that sort of configuration
files (I'd prefer an external git repository to keep the clutter out of
the main PulseAudio repository, but I don't feel too strongly about
that).

We'd then need a module that reads those configuration files.
module-augment-properties could perhaps be extended to do that.

Hmm, actually in most cases it's enough if the application ships
a .desktop file and sets the role there. IIRC Arun advocated this
approach. There may still be cases where the separate configuration file
approach works better (e.g. when the application will never ship
a .desktop file for some reason).

> I and also there are other people who want to use bluetooth 
> microphone as primary recording device. But when if no 
> application want to record sound it is the best to switch back to 
> a2dp mode for better output quality. And manually switching 
> profiles is pain.
> 
> Another use case is when there is no sound card with recording 
> capability or it is integrated sound card is configured to 
> output-only mode, because user does not have any microphone 
> plugged in.

For these cases I think the option in module-bluetooth-policy is ok.

> > So yes, adding another parameter to module-bluetooth-policy
> > should be fine if there's real need for it. In a separate
> > patch, please, because I'd like to merge the
> > by-media-role-only heuristic first.
> > 
> 
> Ok. I will send move heuristic into new patch and send two v3 
> patches.

-- 
Tanu




More information about the pulseaudio-discuss mailing list