Linux bluetooth development
 help / color / mirror / Atom feed
From: Simon Mikuda <simon.mikuda@streamunlimited.com>
To: linux-bluetooth@vger.kernel.org
Cc: Simon Mikuda <simon.mikuda@streamunlimited.com>
Subject: [PATCH BlueZ 1/3] shared/vcp: Notify Volume State on Mute
Date: Tue, 24 Nov 2026 15:35:59 +0100	[thread overview]
Message-ID: <20261124143601.245340-1-simon.mikuda@streamunlimited.com> (raw)

A Mute operation on the Volume Control Point sets Mute and increments
Change_Counter, but unlike every other operation it does not notify
Volume State. A client that keeps Change_Counter from the notifications
then writes its next operation with a stale value and gets Invalid
Change Counter.

Fixes: b8a113ecbabc ("shared/vcp: Add initial code for handling VCP")
Assisted-by: Claude:claude-opus-5-5
---
 src/shared/vcp.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/shared/vcp.c b/src/shared/vcp.c
index c7f74956e..d19bd9210 100644
--- a/src/shared/vcp.c
+++ b/src/shared/vcp.c
@@ -861,6 +861,9 @@ static uint8_t vcs_mute(struct bt_vcs *vcs, struct bt_vcp *vcp,
 	vstate->mute = 0x01;
 	vstate->counter = -~vstate->counter; /*Increment Change Counter*/
 
+	gatt_db_attribute_notify(vdb->vcs->vs, (void *)vstate,
+				 sizeof(struct vol_state),
+				 bt_vcp_get_att(vcp));
 	return 0;
 }
 

base-commit: 1608f836188610aabeff5a3164169ebe0360e443
-- 
2.43.0


             reply	other threads:[~2026-11-24 14:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-24 14:35 Simon Mikuda [this message]
2026-11-24 14:36 ` [PATCH BlueZ 2/3] shared/vcp: Keep Change_Counter on operations that change nothing Simon Mikuda
2026-11-24 14:36 ` [PATCH BlueZ 3/3] unit/test-vcp: Add tests for Volume State changes Simon Mikuda
2026-11-24 20:43 ` [BlueZ,1/3] shared/vcp: Notify Volume State on Mute bluez.test.bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261124143601.245340-1-simon.mikuda@streamunlimited.com \
    --to=simon.mikuda@streamunlimited.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox