[pulseaudio-discuss] Ask for help about pulseaudio bluez-device module

cy517375685 cy517375685 at gmail.com
Fri Sep 21 06:37:43 UTC 2018


Hi pulseaudio community,
​
I am a developer who want to use module-bluez-device to transport my android devices' audio data to linux server.And i already did it, i could use webrtc native lib to capture the a2dp_source's audio data.
​
​But what confuse me is that when bluetooth transport state change from playing to idle, a2dp_source will disappear, which led to webrtc's audio device capture module change to use another sound device like microphone of my linux server.
​
And if bluetooth state change from idle to playing(play a music on the android), a new a2dp_source show up, but webrtc's audio capture module wouldn't change to use the new a2dp_source, that is my problem.
​
When i connect to my android device, and execute pactl list sources, a2dp_source state is SUSPENDED and id is 96(Source #96).
​
Then i play a music in my android, the a2dp_source state change to RUNNING.

After that i stop music in my android, the a2dp_source state will keep for maybe 3 seconds, and finally disappear.
​
If i play music in my android again, a new a2dp_source show up with id 98 and state is RUNING.

I tracked the invoke stack after bluez transport state changing from playing to idle.

PA_BLUETOOTH_HOOK_TRANSPORT_STATE_CHANGED(playing to idle)​
↓
pa_card_profile_set_available(cp, PA_AVAILABLE_UNKNOWN)[module-bluez5-device.c]
↓
profile_available_hook_callback[module-bluetooth-policy.c]
↓
find_best_profile[module-bluetooth-policy.c]
if (card->active_profile.available == PA_AVAILABLE_UNKNOWN && anyotherProfile.available == PA_AVAILABLE_YES) {
//change to anyotherProfile
}
At here,anyotherProfile = off
↓
set_profile_cb & stop_thread [module-bluez5-device.c]
↓
a2dp_source disappear

If i am right, what resolution do you think is best should i take?


Best regards,
Yang Chen

Sent from YoMail for Gmail
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/pulseaudio-discuss/attachments/20180921/0fd26513/attachment.html>


More information about the pulseaudio-discuss mailing list