[pulseaudio-discuss] Problems trying to connecf HFP device

Franz Glauber franzec05 at gmail.com
Wed Mar 2 03:29:27 PST 2011


On Tue, Mar 1, 2011 at 5:30 PM, Franz Glauber <franzec05 at gmail.com> wrote:
> On Tue, Mar 1, 2011 at 4:49 PM, Tanu Kaskinen <tanuk at iki.fi> wrote:
>> On Tue, 2011-03-01 at 18:01 +0000, Colin Guthrie wrote:
>>> >> I'm not sure why there would be such a big pause at the connection
>>> >> stage. Does the big pause only happen when the BT device is connected?
>>> >> e.g. if it's not connected, the connection is quick?
>>> >
>>> > Yep, only when the device is connected. Otherwise it's pretty quick.
>>>
>>> Very odd. I'm not sure why such a thing would affect the connection phase.
>>>
>>> I'll have to defer to cleverer people than I.... any ideas clever people?
>>
>> This sounds a lot like a bug that I've heard to exist in
>> module-bluetooth-device. The module does something in the main thread
>> that in some situations can block for a long time. The connection
>> handling should be moved to a separate thread (or perhaps to the IO
>> thread).
>
> Now that you mention it, makes sense, as I got it half-working once,
> and I don't know how and I couldn't reproduce anymore. Seems to be a
> threading issue somehow.

Taking a glance on the code, it seems that it fails on:

thread_func -> start_stream_fd

and fails around line 804 on

if (service_expect(u, &msg.rsp, sizeof(msg), BT_START_STREAM,
sizeof(msg.start_rsp)) < 0)
        return -1;

I don't know, I keep thinking this looks like a BT issue. If you check
the BT log, it really doesn't reply the message (at least it seems so
to me).
Also, if you look at the last block of log on my first message you'll
notice that the timeout occurs AFTER the error on the IO thread is
issued (due to lack of response from BT)

<snip>
D: module-bluetooth-device.c: Received BT_ERROR <- BT_START_STREAM
E: module-bluetooth-device.c: Received error condition: Input/output
error *translated back to english
D: module-bluetooth-device.c: IO thread failed
D: module-suspend-on-idle.c: Sink bluez_sink.88_88_00_B9_CC_DD becomes
idle, timeout in 5 seconds.
D: module-suspend-on-idle.c: Source bluez_source.88_88_00_B9_CC_DD
becomes idle, timeout in 5 seconds.
</snip>

-- 
Franz

http://ciudaddelpico.com



More information about the pulseaudio-discuss mailing list