Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp3953568ybl; Mon, 26 Aug 2019 03:12:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqyuzWHzBYHHDqHjJCPE1z1exOSKYhGkZqTZNPfpUJxXTmSQvaZOAzOsrDpaDzqcDXf8ncnz X-Received: by 2002:a63:5107:: with SMTP id f7mr10882150pgb.4.1566814342247; Mon, 26 Aug 2019 03:12:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566814342; cv=none; d=google.com; s=arc-20160816; b=fHD6iTNm6mfmEuv/9S4bJ7B9mSbbl8hgFceIx3NTzqxAQXi2RaCbXK47igvBQ9qKE8 xkV/zesfLOWk3fd6NKFaVSRlKWoeO8MGJ0BFCZdIYfdjeDUWnbaIyjyYGL76zc2GCgkP SCGZlV4PRG1YeTCCrU+s9OBwFDu7N1lKzsFv/yCX2aaTuRHQXNaE4322pvLMyVaKDhFs R0Vgw0sTQ8C2V3uunuBWD13RxjronSiSYvs0xqchHCyuwOpTsREoaSwNWvnVDv9vj6sZ aRp2jeRC5eJ7h2gCVdbOMUPTuVIskU8xWFNBOFmDtiyOp69KiBzSkH6okupbf+DbVeS3 752g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=0e8rI6csadbpI9hF/1H0WuciLZJiYzd48jgfPspvsFs=; b=zkG44OLlVMY4m6CaBwT2vLs9Gt+Fs+OAPLR+sssUdgVfOvSdlcRwkRJZDMt5ZphyWZ /WGc5C9rma7D1fM53r/uNYAd5JSlYVNRuxYsEM5GjeCPmq2zPijrlooRWaPCADjba+CF 9mU9jUz0GkFfVMISP/NGUq5kkeObYBWbUZZoof0aJsSQoOl14xqKcT9tWb02e0kaFULM BkncDSwuIjV9Hg7qvDWwu4ot6m1d8uDoPDD4QtqUve0RyWswRBn2bCBg0oxqMGxotceR LyH4QcGOcedsLeesYHJvQ8RW8FDoqPoVvlYpCVaaZfmYIS6rP3pKW6J8/s2cL87cajjk BFRQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h6si9280692pjq.93.2019.08.26.03.12.07; Mon, 26 Aug 2019 03:12:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730671AbfHZJJ2 (ORCPT + 99 others); Mon, 26 Aug 2019 05:09:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35748 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730398AbfHZJJ1 (ORCPT ); Mon, 26 Aug 2019 05:09:27 -0400 Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1691581F07 for ; Mon, 26 Aug 2019 09:09:27 +0000 (UTC) Received: by mail-ed1-f72.google.com with SMTP id z2so9226931ede.2 for ; Mon, 26 Aug 2019 02:09:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=0e8rI6csadbpI9hF/1H0WuciLZJiYzd48jgfPspvsFs=; b=W5Ja3E5SN2QVWEZbvOOpzTtHbf0x+LpBx9TCPaHm2eoXhJoZWAC3IPV76VwR1xPNAL gcaAAxnoVpBTElTZfscSXJ5CtN6/fBKhET/UQROw4yJv8VnwJnCZcV8s4wrXNU0CzD83 3VmRBrDoUBiWA2ifSJgK0xA9fDNPf/E0aTZ29YISx62W2zPWc3GjN2X1r5TwxA1UNJMb FWxbe6p4Dch2yZNCZiG/mkSTmORzh/HVA7tUZu6i93fQ54aTjuNrE6dSpj+hHTJ0WdQj I/WPPZwZi0hs2xfHcKNKnu/s7n3d2B/kjyHWNnBtUZ6t4Y52Q9+FI9LKAgNA3Q4eNnq8 Iz1A== X-Gm-Message-State: APjAAAVUvksCV7guRWEkIgfl9DEbgO7PbWmBNswywHmN6fRlMvdPyz9X cxa2hA/mauBTbGBILwxz4IA40z0zs/xWx+HhX7jZ+ik0ukX5pdR39rfdL4co99UXuvLQ0/ZzGr/ RxCURa+/Nrev8tYLzAEKahcsG X-Received: by 2002:a17:906:5282:: with SMTP id c2mr15163044ejm.259.1566810565519; Mon, 26 Aug 2019 02:09:25 -0700 (PDT) X-Received: by 2002:a17:906:5282:: with SMTP id c2mr15163037ejm.259.1566810565379; Mon, 26 Aug 2019 02:09:25 -0700 (PDT) Received: from shalem.localdomain (84-106-84-65.cable.dynamic.v4.ziggo.nl. [84.106.84.65]) by smtp.gmail.com with ESMTPSA id w19sm1168567edt.41.2019.08.26.02.09.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 26 Aug 2019 02:09:24 -0700 (PDT) Subject: Re: [PATCH] ASoC: es8316: limit headphone mixer volume To: Daniel Drake Cc: Katsuhiro Suzuki , Mark Brown , David Yang , alsa-devel@alsa-project.org, Linux Kernel References: <20190824210426.16218-1-katsuhiro@katsuster.net> <943932bf-2042-2a69-c705-b8e090e96377@redhat.com> From: Hans de Goede Message-ID: Date: Mon, 26 Aug 2019 11:09:24 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 26-08-19 04:53, Daniel Drake wrote: > On Mon, Aug 26, 2019 at 1:38 AM Hans de Goede wrote: >> On 24-08-19 23:04, Katsuhiro Suzuki wrote: >>> This patch limits Headphone mixer volume to 4 from 7. >>> Because output sound suddenly becomes very loudly with many noise if >>> set volume over 4. > > That sounds like something that should be limited in UCM. > >> Higher then 4 not working matches my experience, see this comment from >> the UCM file: alsa-lib/src/conf/ucm/codecs/es8316/EnableSeq.conf : >> >> # Set HP mixer vol to -6 dB (4/7) louder does not work >> cset "name='Headphone Mixer Volume' 4" > > What does "does not work" mean more precisely? IIRC garbled sound. > I checked the spec, there is indeed something wrong in the kernel driver here. > The db scale is not a simple scale as the kernel source suggests. > > Instead it is: > 0000 – -12dB > 0001 – -10.5dB > 0010 – -9dB > 0011 – -7.5dB > 0100 – -6dB > 1000 – -4.5dB > 1001 – -3dB > 1010 – -1.5dB > 1011 – 0dB > > So perhaps we can fix the kernel to follow this table and then use UCM > to limit the volume if its too high on a given platform? Yes that sounds like the right thing to do. Katsuhiro can you confirm that using this table allows using the full scale ? note that the full scale now has 9 steps rather then 8. Regards, Hans