Hi Fr?d?ric, On Tue, Sep 6, 2011 at 4:48 PM, Dalleau, Frederic <frederic.dalleau at intel.com> wrote: > Hi Luiz, > >>> An HandsfreeGateway connects RFCOMM and then SCO. A card appears in >>> PA and can be used. If for some reason, SCO is disconnected, >>> module-bluetooth-device is unloaded. The card will disappear, even >>> if RFCOMM is still connected. After that, it is not possible to >>> connect SCO again from PA. > >> IMO in such cases we should set the profile to "Off" to indicate the >> profile is not working properly, then the ui can either retry or >> switch to another profile e.g. A2DP. > > I'm having a look at this part, and it appears that the module is unloaded > from the IO thread. It is not possible to simply call pa_card_set_profile() > from this context. A workaround is to listen to "state" property changes > and change card profile to "Off" in the DBUS handler if state goes to > "Disconnected". This seems to work, but I'm wondering if there is > another solution. > Do you have any suggestions? Good point, I also wonder if there is any way to signal the main thread to switch the profile since the current one stopped working, waiting for a D-Bus signal may take too long so I would try to avoid this workaround. -- Luiz Augusto von Dentz