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
_______________________________________________
pulseaudio-discuss mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss

Reply via email to