Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1529639ybt; Thu, 9 Jul 2020 09:08:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwYlRbI8nehAvfW42m8TlMKvJJpMHqZ1Z09uZJ+8cHqURYW1ZphKxfnAHOca7/fH4lJbBCo X-Received: by 2002:a17:906:1f52:: with SMTP id d18mr44347229ejk.84.1594310880270; Thu, 09 Jul 2020 09:08:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594310880; cv=none; d=google.com; s=arc-20160816; b=D9mgMGzLzvwnDUQnG4Njsfen9Teulm5z0idtPnQNrwqNFYZPEwYHHAgp+gZQNZlnit Y1L0cWxpii/5PIIqphgkzo47csS/5w6drVGDXRJu1iBR+oLZQvLYfsn0v2Om5KXiPLAx qKRz7+rSfQmWjU9dgQRPBbvNhVgJukfjEIsn25JJRC+tvtYtn7k4CpY2VjrN9+95R6Np 3DFX0CTJPYmTBwD4aAMtAG1w8yiUVOj4Y8xB+srgKKvoJQMkDKsW0VERbdUcIyP8WO5E Iq9rs6E4WRZ/n5yj3ShHMJymTWeqh3o9gVwkYWSphVyGTzv23vjyeZoH1ZuAktzHQl4W KITg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:from:subject:mime-version :message-id:date:dkim-signature; bh=Y+kIbnGkHotm9lccHj/nLpbXHnZU4LZKnUryVen0AX4=; b=n/S5fBWKvMo1AQFPC+hxKQtyl2zl/sXjWKhjISfSte6mZ7nbMcnMe6SfXAseOk3GBr VsQAMBFDttO43+tlSndGOq6YTY/npbVNt1EE11ASr9uZRZcUNNwzRyBfuxF+pneIhhtj TjpQedeDbJp4pZsW32RyzkkqW1DzLKjxE59lLU7LC19zwYBpB1iIwqdBmbWCvTkAd4QF hPqqO2DVSP+/8Qbns6Mxgl9TmnrmA3dqbsarnLSLT9Y5CeAG/AFGecesRA3XQbNTCfRW 4k0bkR3E2cmhG3CFbh577RecD/jhW2roieYL7RWnHPcOcsYsMOd2wIr+ZMogNzD4Qwp+ NbPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=fbYJKts3; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x26si2177015ejs.276.2020.07.09.09.07.16; Thu, 09 Jul 2020 09:08:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=fbYJKts3; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727952AbgGIQGl (ORCPT + 99 others); Thu, 9 Jul 2020 12:06:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33616 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726357AbgGIQGl (ORCPT ); Thu, 9 Jul 2020 12:06:41 -0400 Received: from mail-pj1-x104a.google.com (mail-pj1-x104a.google.com [IPv6:2607:f8b0:4864:20::104a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E4CFC08C5CE for ; Thu, 9 Jul 2020 09:06:41 -0700 (PDT) Received: by mail-pj1-x104a.google.com with SMTP id g16so1999547pjz.3 for ; Thu, 09 Jul 2020 09:06:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=Y+kIbnGkHotm9lccHj/nLpbXHnZU4LZKnUryVen0AX4=; b=fbYJKts353khLfb+Q/WIRbn0JcADVkHtG3LnD05lA5wN9VzX5D4YX1ZXvuKurOUBNQ uC8WG5Avrv194R7bb+MOBFxw9NZklkPkbx3D6r6liEGwLJF1mDxMniixxQN4fpGffjoe 7XuJGPIZpq0KzwzELCxfABIWqYvy9UXcANbx0ZaxLM2vu1IeeFwcJmkfmtS4cEYJJEVK YXd2P+uDeVLqmfjE6AsI2vUBeOWbri6PknX1GlRRETOdadln+zM7IZxIDXzoKeJ0Nnfc rBs0+zK8N/Lk9zmYqZgEZKxDwEGIQ5ni0kmGjudzF3JqbYkUo3BwGnUjSDQrgu0YNIfS lfyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=Y+kIbnGkHotm9lccHj/nLpbXHnZU4LZKnUryVen0AX4=; b=lcHBEz2dbQV2TjBk6sweUZ4ljxNlcfngeXA1+2+JsCma9Z04sTro/QVkRt8zyv/8Oo f2bvwEpHc/zYDozKv3MA54TVyVQmIVaN3RJkTgxEpQLEnaUfk+3dxbaSwmv6wLalUtGF sf2sBIOZKs477dalOo6ZnArzZr9XLv/7tzWEePGsTyrQVkf9eo0JmhXWcmjhM22TnXUq M2kfqWzAXqvVeBHh6FVSvpZ26Lr6TH9Vlcb84/m4rmGxwsYOyXyUr6xq93r3+Ht4XohO XJDTSaCMQWKGTqXrt7Du1/jxcBRZ4lxCf3TZFgZFNyTuW0Btpc64LbamKnuKx2YxGi4A AXlg== X-Gm-Message-State: AOAM5306n+pR+CYDqRUX9nNmjVZunjm63kpXkuJy0FPeoFGA/S7jCAhH MzMAqlot6BhL1iVx3tN2Ysl0vtcPT731f/fWu/6fi60XiiNdcbpEpUnw/blgqqyk3BJTtela6y7 k+HrJebhCflwbkJtl3M/E2YTqQaUkpgWv8N7d0swGAAUAz1RfViLTHEssMgLiReraHyOWunaYCC oL X-Received: by 2002:a17:902:be0e:: with SMTP id r14mr28892156pls.309.1594310800664; Thu, 09 Jul 2020 09:06:40 -0700 (PDT) Date: Thu, 9 Jul 2020 09:06:37 -0700 Message-Id: <20200709090631.Bluez.v1.1.I6aa22c6e425e5b19c321c0768f50ca3fc2c090da@changeid> Mime-Version: 1.0 X-Mailer: git-send-email 2.27.0.383.g050319c2ae-goog Subject: [Bluez PATCH v1] audio/media - Fix volume sync between media and transport From: Yu Liu To: linux-bluetooth@vger.kernel.org Cc: Hsin-Yu Chao , sonnysasaka@chromium.org Content-Type: text/plain; charset="UTF-8" Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Hsin-Yu Chao A volume value is cached on the global media player object. And a check was used to NOT update volume to each transport if this value doesn't change. That is causing problem at disconnect then reconnect when the new constructed transport never receive update about the last used volume value. Reviewed-by: sonnysasaka@chromium.org Reviewed-by: hychao@chromium.org --- Changes in v1: - Initial change profiles/audio/media.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/profiles/audio/media.c b/profiles/audio/media.c index 993ecb3b3..92e363de9 100644 --- a/profiles/audio/media.c +++ b/profiles/audio/media.c @@ -1204,9 +1204,6 @@ static void set_volume(uint8_t volume, struct btd_device *dev, void *user_data) struct media_player *mp = user_data; GSList *l; - if (mp->volume == volume) - return; - mp->volume = volume; for (l = mp->adapter->endpoints; l; l = l->next) { -- 2.27.0.383.g050319c2ae-goog