Skip to content

bluez5: refcount transport acquire and release, let it manage fd

P V requested to merge pvir/pipewire:sco-share-fd-2 into master

Backends don't necessarily allow for opening the same device multiple times, and it shouldn't be necessary.

WIP: Native HSP backend is not tested (no hardware right now)

Since source and sink are not necessarily both running at the same time, refcount the transport acquire/release so that it knows to close the fd only when no source/sink is running.

Let the transport manage the fd lifecycle, also closing it once it is not needed.

Don't return the fd from acquire(), since each transport is associated with a single socket fd.


Alternative to !336 (closed).

With this, duplex sort of works e.g. Jitsi calls on mSBC can be managed (BCM20702A1+hsphfpd). This doesn't always work though, as there seem to be bugs, as (also on master) playback frequently hangs. E.g. on HFP, starting playback in rhythmbox while something else is playing often hangs playback, and similar issue seems to often prevent duplex i/o from starting. Not clear to me whether it is issue in how sco-sink/source manage the i/o which seems quite possible, or some other issue in them.

Edited by P V

Merge request reports