[pulseaudio-discuss] Connecting a phone over bluetooth

Mikel Astiz mikel.astiz.oss at gmail.com
Wed May 22 07:14:23 PDT 2013


Hi David,

On Wed, May 22, 2013 at 4:06 PM, David Henningsson
<david.henningsson at canonical.com> wrote:
> On 05/22/2013 03:35 PM, Mikel Astiz wrote:
>>
>> Hi David,
>>
>> On Wed, May 22, 2013 at 12:00 PM, David Henningsson
>> <david.henningsson at canonical.com> wrote:
>>>
>>> On 05/21/2013 05:18 PM, Mikel Astiz wrote:
>>>>
>>>>
>>>> Hi David,
>>>>
>>>> On Tue, May 21, 2013 at 3:55 PM, David Henningsson
>>>> <david.henningsson at canonical.com> wrote:
>>>>>
>>>>> Maybe Android 4.0 (or my version of bluez?) does not support relaying
>>>>> audio
>>>>> to (or from?) the phone?
>>>>
>>>>
>>>>
>>>> This should be working assuming BlueZ is configured properly. You
>>>> might need to configure BlueZ's audio.conf with:
>>>>
>>>> Enable=Media,Headset,Gateway,Sink,Source
>>>>
>>>> This might not be necessary if your BlueZ is patched which is probably
>>>> the
>>>> case.
>>>
>>>
>>>
>>> If this was not the case, there should not have been an
>>> AudioSource.Connect
>>> method at all, right?
>>
>>
>> Correct.
>>
>>>
>>>> Another possible issue is that you never connected the profiles. You
>>>> can try by calling the D-Bus AudioSource.Connect() (for A2DP) or
>>>
>>>
>>>
>>> When I do this, my phone lights up,
>>> the following is added to syslog,
>>> "bluetoothd[1066]: Connection refused (111)"
>>> and the call, after some time, returns
>>> "GDBus.Error:org.bluez.Error.Failed: Stream Setup Failed"
>>
>>
>> This is weird. Any chance you might have overlooked a confirmation UI
>> on the phone? Some phones prompt the user for incoming connections,
>> but this is nowadays less common.
>
>
> Thanks for the hint! There was a confirmation UI on the phone, but it didn't
> show up on the lock screen. When unlocked I could confirm, and play some
> audio through my laptop.
>
> Also the card showed up on the input side with "Phone" as port name and a
> correct device.description property, and profiles selectable between hfgw
> and a2dp. So all good there.

Sounds good!

>
> I don't know if we want to make this more user friendly, if so, not having
> to call dbus methods manually would be a good first step :-) I'm not sure if
> this is something to be done in some pairing/bluetooth UI rather than
> PulseAudio though.

This is already addressed in BlueZ 5. A single click on the bluetooth
UI would connect all profiles automatically, because it's single D-Bus
method call (i.e. Device1.Connect()). Similar solutions exist in BlueZ
but it is unfortunately limited to headsets (i.e. Audio.Connect()).

>
> (Another issue is the lack of good name & icon on the application tab in
> gnome volume control, but that's probably a UI thing more than PA/bluez
> thing.)
>
>>> I can't do much in the UI (Samsung). The two checkboxes saying something
>>> like "Use for phone sound" and "Use for media sound" are both checked.
>>
>>
>> This would be the first phone I know of that doesn't have a UI to
>> initiate connections to a headset (in this case, your laptop).
>
>
> Actually, if you check the checkbox again (even though it's already
> checked), that seems to cause it to connect. I'm still new to all of this,
> so sorry for using you as user support ;-)

No problem.

Cheers,
Mikel


More information about the pulseaudio-discuss mailing list