After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 743220 - bluetooth modules need to track transport state
bluetooth modules need to track transport state
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal normal
: 1.5.90
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-01-20 00:28 UTC by Nick Stoughton
Modified: 2015-08-16 13:36 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
State tracking for avdtp (17.45 KB, patch)
2015-01-20 00:28 UTC, Nick Stoughton
none Details | Review
State tracking patch v2 (17.45 KB, patch)
2015-03-02 22:15 UTC, Nick Stoughton
none Details | Review

Description Nick Stoughton 2015-01-20 00:28:05 UTC
Created attachment 294938 [details] [review]
State tracking for avdtp

The avdtpsrc and avdtpsink plugins use the MediaTransport1 interface from bluez, which includes a property "State":

string State [readonly]

  Indicates the state of the transport. Possible
  values are:
    "idle": not streaming
    "pending": streaming but not acquired
    "active": streaming and acquired

The source and sink modules should track this, since if the state ever falls below "active" the transport must be re-acquired (which includes updating the file descriptor used to transfer data).

Attached is a patch that has been tested in the avdtpsrc module and appears to work correctly. I would appreciate wider review.

Note that this patch removes support for bluez4 (I don't have any easy way to develop or test on bluez4, and the property management is significantly different n bluez4).

It also moves from the low-level libdbus interface to glib gdbus, using generated code from gdbus-codegen for the introspection to the MediaTransport1 interface. This is a lot simpler, with all the nasty complexities of property cache management handled by the generated code.
Comment 1 Nick Stoughton 2015-03-02 22:15:25 UTC
Created attachment 298351 [details] [review]
State tracking patch v2

I just noticed a bug in this patch ... I decrement the ref count of a GVariant without having first incremented it. This leads to mysterious assertion failures at a much later point when the underlying variant is actually freed (and presumably to a risk that the entire application could crash if it attempted to use it after the erroneous decrement).

Patch updated.
Comment 2 Arun Raghavan 2015-06-11 13:34:58 UTC
Sorry about the delay in looking at this, I'll try to get to this in the next day or two.
Comment 3 Nick Stoughton 2015-06-11 13:38:17 UTC
Thanks Arun; we are using this in shipping product at present, so it has been fairly well tested at this point!
Comment 4 Arun Raghavan 2015-07-03 10:25:33 UTC
I made some minor fixes to the first patch and pushed them both out. Thanks, Nick!