Commit: e77884accdb22268eb65374fc96c35d9f8788d32
Parent: 1474c11618bc1092f7dd4b304d3768ce9da02b13
Author: Pauli Virtanen <pav@iki.fi>
Committer: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Date: 2025-02-03 23:16:04
Tree: dd7602f162e5bb10f7ee57baa1ca39f767b64dff

shared/vcp: have only one volume change in flight at a time If bt_vcp_set_volume() is called again before the previous operation has completed, the requests get the same change counter, and all except the first one fail. Fix by waiting until the current request completes, and if volume was set again during waiting, send a new request with the latest pending volume value. In this definition, bt_vcp_set_volume() will skip over intermediate volume updates if they are done too rapidly. Send only volume requests that change the value to a different one than last notification we have seen: in this case the request either fails, or succeeds and generates a new notification. In theory this guarantees we always exit waiting, but safeguard it with a timeout.

Diffstat

M src/shared/vcp.c | 86 ++++++++++++++++++++++++++++++++++++++++- - - -

1 files changed, 82 insertions(+), 4 deletions(-)

View Full Diff | Patch