[PATCH 2/3] bluetooth: Set initial profile priority based on profile state

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Mikel,

On Fri, Aug 17, 2012 at 6:07 PM, Mikel Astiz <mikel.astiz.oss at gmail.com> wrote:
> Hi Luiz,
>
> On Fri, Aug 17, 2012 at 4:21 PM, Luiz Augusto von Dentz
> <luiz.dentz at gmail.com> wrote:
>> From: Luiz Augusto von Dentz <luiz.von.dentz at intel.com>
>>
>> This means only profiles on PA_BT_AUDIO_STATE_PLAYING state will have
>> bigger priority than 'Off'.
>> ---
>>  src/modules/bluetooth/module-bluetooth-device.c | 8 +++++---
>>  1 file changed, 5 insertions(+), 3 deletions(-)
>>
>> diff --git a/src/modules/bluetooth/module-bluetooth-device.c b/src/modules/bluetooth/module-bluetooth-device.c
>> index 6e3f81e..af56302 100644
>> --- a/src/modules/bluetooth/module-bluetooth-device.c
>> +++ b/src/modules/bluetooth/module-bluetooth-device.c
>> @@ -2140,7 +2140,7 @@ static int add_card(struct userdata *u, const pa_bluetooth_device *device) {
>>         we are loaded with profile="hsp", for instance */
>>      if (pa_bluetooth_uuid_has(device->uuids, A2DP_SINK_UUID)) {
>>          p = pa_card_profile_new("a2dp", _("High Fidelity Playback (A2DP)"), sizeof(enum profile));
>> -        p->priority = 10;
>> +        p->priority = device->audio_sink_state * 10;
>
> I have an alternative patchset (to be submitted soon) that addressed
> the same problem in a different way (and with a bigger scope). I would
> like you to consider this approach before using state-dependant port
> priorities.

iirc you had a series that did this in discovery which prevent the
card to be loaded if not playing which could prevent some use cases,
anyway the card loading always take into account the profile priority
(port priority is latter done according to profile priority) so you
gonna have to touch that code if you want to do things differently.


-- 
Luiz Augusto von Dentz


[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux