Return-Path: MIME-Version: 1.0 In-Reply-To: <1358878703-8100-2-git-send-email-jprvita@openbossa.org> References: <1358878703-8100-1-git-send-email-jprvita@openbossa.org> <1358878703-8100-2-git-send-email-jprvita@openbossa.org> Date: Fri, 25 Jan 2013 15:35:08 +0200 Message-ID: Subject: Re: [PATCH BlueZ 1/2] avctp: Create ignore quirk From: Luiz Augusto von Dentz To: =?ISO-8859-1?Q?Jo=E3o_Paulo_Rechi_Vita?= Cc: "linux-bluetooth@vger.kernel.org" Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-bluetooth-owner@vger.kernel.org List-ID: Hi Joao, On Tue, Jan 22, 2013 at 8:18 PM, Jo?o Paulo Rechi Vita wrote: > Create a quirk to be able to accept and trow away certain keys. > --- > profiles/audio/avctp.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/profiles/audio/avctp.c b/profiles/audio/avctp.c > index 61890cc..f7e607e 100644 > --- a/profiles/audio/avctp.c > +++ b/profiles/audio/avctp.c > @@ -58,7 +58,8 @@ > #include "avctp.h" > #include "avrcp.h" > > -#define QUIRK_NO_RELEASE 1 << 0 > +#define QUIRK_NO_RELEASE 1 << 0 > +#define QUIRK_IGNORE 1 << 1 > > /* Message types */ > #define AVCTP_COMMAND 0 > @@ -287,6 +288,11 @@ static size_t handle_panel_passthrough(struct avctp *session, > > key_quirks = session->key_quirks[key_map[i].avc]; > > + if (key_quirks & QUIRK_IGNORE) { > + DBG("AV/C: ignoring %s %s", key_map[i].name, status); > + break; > + } > + > if (key_quirks & QUIRK_NO_RELEASE) { > if (!pressed) { > DBG("AV/C: Ignoring release"); > -- > 1.7.11.7 In the end I think we should just accept the commands normally, let me quote the recommendations (RD=Rendering Device MP=Media Player): "Recommendation 16: If volume is changed on the RD, the RD should not send an AVRCP volume command to the MP device. Motivation 16: Sending an AVRCP volume command to the MP may cause the MP to send again an AVRCP volume command to the RD device which could lead to an endless loop of AVRCP volume commands. Recommendation 17: If a device receives an AVRCP volume command, it shall not send back an AVRCP volume command. Motivation 17: This will also ensure that endless loop does not happen with existing devices which do not comply with the recommendation." So there is nothing against the RD accepting the Volume Up/Down it should just no send it back. -- Luiz Augusto von Dentz