From patchwork Mon Oct 20 10:15:37 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Henningsson X-Patchwork-Id: 5104051 X-Patchwork-Delegate: tiwai@suse.de Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id CFE1D9F374 for ; Mon, 20 Oct 2014 10:16:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CA71420179 for ; Mon, 20 Oct 2014 10:16:00 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id F163F20166 for ; Mon, 20 Oct 2014 10:15:57 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 5FE232606FC; Mon, 20 Oct 2014 12:15:56 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NO_DNS_FOR_FROM, RCVD_IN_DNSWL_NONE,UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id BB9462605A2; Mon, 20 Oct 2014 12:15:44 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 95B812605C1; Mon, 20 Oct 2014 12:15:43 +0200 (CEST) Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) by alsa0.perex.cz (Postfix) with ESMTP id C04942605A2 for ; Mon, 20 Oct 2014 12:15:37 +0200 (CEST) Received: from hd9483857.selulk5.dyn.perspektivbredband.net ([217.72.56.87] helo=[192.168.8.102]) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1XgA01-0005Kq-AD; Mon, 20 Oct 2014 10:15:37 +0000 Message-ID: <5444E0C9.70200@canonical.com> Date: Mon, 20 Oct 2014 12:15:37 +0200 From: David Henningsson User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Takashi Iwai References: <1413466426-2672-1-git-send-email-david.henningsson@canonical.com> <543FDFDE.7040800@canonical.com> <5444ABDA.7070207@canonical.com> <5444DD02.1070608@canonical.com> In-Reply-To: Cc: Raymond Yau , alsa-devel@alsa-project.org, ruedi@battle-eggs.de Subject: Re: [alsa-devel] [RFC PATCH 1/2] ALSA: hda - Fix "PCM" name being used on one DAC when there are two DACs X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP On 2014-10-20 12:02, Takashi Iwai wrote: > At Mon, 20 Oct 2014 11:59:30 +0200, > David Henningsson wrote: >> >> >> >> On 2014-10-20 11:55, Raymond Yau wrote: >>> >>> >> >>> >> >>> >> > > >>> >> > > >> > >>> >> > > >> > In the scenario where there is one "Line Out", one "Speaker" >>> >> and one >>> >> > > >> > "Headphone", and there are only two DACs, two outputs will >>> >> share a DAC. >>> >> > > >> > Currently any mixer on such a DAC will get the "PCM" name, >>> >> which is >>> >> > > >> > misleading. Instead use "Headphone+LO" or "Speaker+LO" to >>> better >>> >> > > >> > specify what the volume actually controls. >>> >> > > >> >>> >> > > >> Are there any examples ? >>> >> > > >> >>> >> > > > >>> >> > > > I used "hda-emu >>> >> > > codecs/canonical/alc3226-dell-precision-m2800-ccert-201404-14986 -i >>> >> 1" when >>> >> > > developing the patches. >>> >> > > > >>> >> > > > I don't have any hardware available myself that exposes this >>> >> behavior, >>> >> > > but I can maybe fake one with hdajackretask, if that counts... >>> >> > > > >>> >> > > >>> >> > > How about adding these names to slaves of virtual master >>> >> volume/switch ? >>> >> > > >>> >> > > hdajackretask won't help if the topology of the codecs are >>> different >>> >> > > >>> >> > > Seem the badness still prevent the driver to support surround >>> 5.1 with >>> >> > > three rear panel jacks, internal speaker and front panel >>> headphone for >>> >> > > Thinkcenter A58 using alc662 >>> >> > > >>> >> > > >>> >> >>> https://www.mail-archive.com/alsa-user@lists.sourceforge.net/msg29203.html >>> >> > > >>> >> > > Why 3stack desktops with 6 channels codecs not using >>> >> "Headphone+LO" or >>> >> > > "Speaker+LO" ? >>> >> > >>> >> > The problem is just the lack of DACs, so it cannot cover all three >>> >> > outputs, no matter how the pins are chosen. That is, it's no 6 >>> >> > channels at all but 4 channels at most. >>> >> > >>> >> > >>> >> >>> >> http://shop.lenovo.com/us/en/desktops/thinkcentre/a-series/a58/ >>> >> >>> >> The technical specification of a58 >>> >> >>> >> 2 pin internal speaker connector >>> >> Alc662 5.1 >>> >> >>> >> https://bbs.archlinux.org/viewtopic.php?id=156433 >>> >> >>> >> Seem windows support surround 5.1 >>> > >>> > >>> > Raymond, there can certainly be cases which this patch does not cover >>> - after all, it's mostly a band aid given the lack of topology >>> information - but do you see cases where this patch actually causes a >>> *regression*? If so, could you point me to alsa-info for the machine >>> where this patch causes a regression? >>> > >>> >>> www.realtek.com.tw/products/productsView.aspx?Langid=1&PNid=24&PFid=27&Level=5&Conn=4 >>> >>> >>> I expect those desktop with 2+2 HD Audio codec support independent headphone >>> >>> This mean the driver should not create "Lineout+HP" Playback volume >>> >>> Line out and headphone cannot share same DAC >> >> I doubt that, but if they cannot share the same DAC, that needs to be >> addressed in a separate patch. This patch just deals with the naming, >> given that the previous logic has determined that headphone and Line out >> should share the same DAC. >> >> Takashi, are you planning to apply this patch? Or are you looking for >> more testing first? > > I'll test a bit more. I have a machine that is affected by this > issue, so I can test on a real machine. > > How about the changes in PA side, BTW? Is it ready? I will cook up a quick patch once you have merged. But there will not be any big regression: we already control the vmaster, which in turn controls the hw volume of the DAC. So I will expect things to just work, assume the new controls will be initialized correctly. I'm attaching an (untested) alsa-utils patch for that. From 002353dd6cba2622da748e91f9d8848ed2dc68d3 Mon Sep 17 00:00:00 2001 From: David Henningsson Date: Mon, 20 Oct 2014 12:12:57 +0200 Subject: [PATCH] alsactl init: Add init of "Headphone+LO" and "Speaker+LO" controls These two were recently added to the HDA driver, so make sure they are initialized correctly. Signed-off-by: David Henningsson --- alsactl/init/default | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/alsactl/init/default b/alsactl/init/default index 5fb0113..fe0511a 100644 --- a/alsactl/init/default +++ b/alsactl/init/default @@ -104,6 +104,16 @@ CTL{name}="Headphone Playback Switch",CTL{index}="1",CTL{do_search}=="1", \ CTL{values}="on" CTL{reset}="mixer" +CTL{name}="Headphone+LO Playback Volume",PROGRAM!="__ctl_search",GOTO="" +# if master volume control is present, turn headphone+LO volume to max +ENV{has_pmaster_vol}=="true",CTL{write}=="0dB",GOTO="" +ENV{has_pmaster_vol}=="true",CTL{write}=="100%",GOTO="" +CTL{write}!="$env{pvolume}",CTL{values}="$env{ppercent}" +LABEL="" +CTL{name}="Headphone+LO Playback Switch",CTL{do_search}=="1", \ + CTL{values}="on" + +CTL{reset}="mixer" CTL{name}="Speaker Playback Volume",PROGRAM!="__ctl_search",GOTO="" # if master volume control is present, turn speaker volume to max ENV{has_pmaster_vol}=="true",CTL{write}=="0dB",GOTO="" @@ -114,6 +124,16 @@ CTL{name}="Speaker Playback Switch",CTL{do_search}=="1", \ CTL{values}="on" CTL{reset}="mixer" +CTL{name}="Speaker+LO Playback Volume",PROGRAM!="__ctl_search",GOTO="" +# if master volume control is present, turn speaker+LO volume to max +ENV{has_pmaster_vol}=="true",CTL{write}=="0dB",GOTO="" +ENV{has_pmaster_vol}=="true",CTL{write}=="100%",GOTO="" +CTL{write}!="$env{pvolume}",CTL{values}="$env{ppercent}" +LABEL="" +CTL{name}="Speaker+LO Playback Switch",CTL{do_search}=="1", \ + CTL{values}="on" + +CTL{reset}="mixer" CTL{name}="Front Speaker Playback Volume",PROGRAM!="__ctl_search",GOTO="" # if master volume control is present, turn speaker volume to max ENV{has_pmaster_vol}=="true",CTL{write}=="0dB",GOTO="" -- 1.9.1