Skip to content

a2dp-source: fix stutter + clock + etc

P V requested to merge pvir/pipewire:a2dp-source-fix into master

Make a2dp clock advance at the correct rate.

Revert back to accumulating to a single buffer before sending it out. What it did previously seemed hard to get to work properly with e.g. aptx which produces block of varying sizes on decoding.

Don't force a2dp-source to be driver, because it won't advance clock if the device is not sending data, and possibly blocks other streams.

Release the transport if it went idle, ensuring that the fd is closed, and add safeguards we won't double-acquire/release it.

This can occur if the device pauses the playback. The transport may also activate again later on, and in this case we need to reacquire a new fd. Not closing the old fd causes problems in this case.

However, apparently the BlueZ Release() call fails if the transport is idle. We just ignore the error and downgrade the error message; it might not be safe to not call Release() because the idle property update is async.


This MR fixes the a2dp-source stuttering and other issues for playback from my phone; tested on sbc and aptx.

Might be also nice to implement the AVDTP delay reporting, but it appears BlueZ only supports receiving delay reports, not sending them.

Edited by P V

Merge request reports