Commit: a14d59725ef35d91b8504770046c701d0a2efe07
Parent: 0845b8f6ef2ac004b1c953cf4fe4ca3458cd8e36
Author: Pauli Virtanen <pav@iki.fi>
Committer: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Date: 2024-11-04 19:54:30
Tree: 07b5b2079d4d078325a865fd2eac7fed04f959ff

transport: don't disconnect A2DP if canceling Acquire() with Release() User can cancel transport acquire by calling Release() while Acquire() is in progress. This calls a2dp_cancel() which sends AVDTP_ABORT_CMD, forcing AVDTP state transition to IDLE, and A2DP profile disconnects. However, Release()/Acquire() should only result to transitions between STREAMING/OPEN. The expected behavior is that either these calls return error, or they block until the target state is reached. Fix by: Release() during pending Acquire() first sends error reply to the Acquire. Then it waits for START to complete, then sends SUSPEND, and after that completes, then it replies. This also fixes SetConfiguration() after canceled Acquire(), which previously did not work due to AVDTP disconnect. Now it does START/SUSPEND -> CLOSE -> reconfigure.

Diffstat

M profiles/audio/transport.c | 159 ++++++++++++++++++++++++++++++++++++++++- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

1 files changed, 127 insertions(+), 32 deletions(-)

View Full Diff | Patch