Received: by 10.192.165.148 with SMTP id m20csp5125694imm; Tue, 24 Apr 2018 14:15:08 -0700 (PDT) X-Google-Smtp-Source: AIpwx48Y13eMOxDjHILQq+Fvkt40Ti6GPnAESkYtCjncqEkI8Bpd7epFpy0gsZSbj2DHuOkbVjRB X-Received: by 10.99.128.73 with SMTP id j70mr21912997pgd.12.1524604508006; Tue, 24 Apr 2018 14:15:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524604507; cv=none; d=google.com; s=arc-20160816; b=0YM74mTaTUg1Wtsy4prHHPlCao85SCNEigTXhctPSCcdbusNBHvBr+qL1rabJ9R93u Ij5S2FHNjjHeQJYA87sU+Fsx4jfbBsU+KGmYSrxKkTOGnM3Nf4G9fc7jNB0R+6Uo+Obl k4RLpLRElIzCUkfcSklC3EHqECiH7X1OEzVp2hTMLWt5NqSGQzQPmha3cukzRGAC/BFS cQWRd3ohtic6fwkOwmFp6yO9+BzObOV52FWGT4nDu1aN0afX9mqfAUwumOEAA0lJpoBp nRr5AaYcN5+ugbbF5AzqLB8Mn7AYQamSrRXnI4e9hfTLO2Zv/1R0OibNG31J9I4kIBJ8 EWJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=8hZNdRJY97G/q38eGFM2lpJEetf+ECd96EZ1ERsOdgQ=; b=BZFvQgZmXbqZIrYsSQ7FoqPC3Mv6uZqaoL+IxOwNc4X7cCzVyvY082Ftz5H2U21zij 3mq6AfFDhvtuocErXpxFZ2RQ4LFXF52NIJoXzt6Ytnud0GL42Te3hJaFTOPvI/dftyF/ q2B/KgS3y6M98+Mz6myGHUQy80rUzRkSEwKyvPl4Cog+5M66qjpOrxVxhLrFhk6r0AQv JyfeM/3gExHE2Cw2SGgzLiimxHA+mWgFnSHV1VUhW3vz2NQc/xQqp5ogpxSVfGtkGqgv kgIkhy+OciGJSsXl268i3Wx+BQg7NNhs3XHBbK78H9iy3wHWBM9WxUX5DJ5lDAOAoGJR Ugsw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z12si11641012pgv.226.2018.04.24.14.14.52; Tue, 24 Apr 2018 14:15:07 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751404AbeDXVNw (ORCPT + 99 others); Tue, 24 Apr 2018 17:13:52 -0400 Received: from bmailout3.hostsharing.net ([176.9.242.62]:40339 "EHLO bmailout3.hostsharing.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750841AbeDXVNu (ORCPT ); Tue, 24 Apr 2018 17:13:50 -0400 Received: from h08.hostsharing.net (h08.hostsharing.net [83.223.95.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.hostsharing.net", Issuer "COMODO RSA Domain Validation Secure Server CA" (not verified)) by bmailout3.hostsharing.net (Postfix) with ESMTPS id 3E268100D941B; Tue, 24 Apr 2018 23:13:48 +0200 (CEST) Received: by h08.hostsharing.net (Postfix, from userid 100393) id C3F1F1D37B; Tue, 24 Apr 2018 23:13:47 +0200 (CEST) Date: Tue, 24 Apr 2018 23:13:47 +0200 From: Lukas Wunner To: Kai Heng Feng Cc: Pali =?iso-8859-1?Q?Roh=E1r?= , Takashi Iwai , mjg59@srcf.ucam.org, dvhart@infradead.org, andy@infradead.org, Mario Limonciello , alsa-devel@alsa-project.org, Linux Kernel Mailing List , platform-driver-x86@vger.kernel.org Subject: Re: [alsa-devel] [PATCH v4 3/3] ALSA: hda: Disabled unused audio controller for Dell platforms with Switchable Graphics Message-ID: <20180424211347.GA18258@wunner.de> References: <20180420094432.13133-1-kai.heng.feng@canonical.com> <20180420094432.13133-3-kai.heng.feng@canonical.com> <20180423080844.yh6ndicpu6mwy336@pali> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 23, 2018 at 04:18:35PM +0800, Kai Heng Feng wrote: > >On Apr 23, 2018, at 4:08 PM, Pali Rohár wrote: > >On Monday 23 April 2018 16:04:55 Kai Heng Feng wrote: > >>>On Apr 20, 2018, at 8:10 PM, Takashi Iwai wrote: > >>>On Fri, 20 Apr 2018 11:44:32 +0200, Kai-Heng Feng wrote: > >>>>Now it's a typical discrete-only system. HDMI audio comes from AMD audio > >>>>controller, others from Intel audio controller. > >>>> > >>>>When SG is enabled, the unused AMD audio contoller still exposes its > >>>>sysfs, so userspace still opens the control file and stream. If > >>>>userspace tries to output sound through the stream, it hangs the system. > >>> > >>>Hm, could you give more information about how it hangs? > >> > >>Well, I should say "it hangs the userspace process" instead. > >> > >>$ speaker-test -t wav -c 2 -D hw:CARD=HDMI,DEV=3 > >>...and it just stopped. Can't Ctrl+C to break it. > > > >So userspace process cannot be killed at all? Then it is different bug > >in kernel and disabling pci device is just a workaround. Not a real fix. > > > >I would propose to find out what happen and why it cannot be killed > >(probably it stuck somewhere in kernel) and fix it properly. > > That's because the audio device got runtime suspended by the graphics. > > In this case, if we really want to use the the discrete audio, then we also > need to wake up the graphics. > The discrete audio is totally useless when SG is enabled, so my approach is > just to disable it. I don't quite follow, that should be fixed by commit 07f4f97d7b4b ("vga_switcheroo: Use device link for HDA controller") which landed in v4.17-rc1. My understanding was that with SG enabled, the external DP/HDMI ports are muxed to the Intel GPU, so audio can only be streamed to external displays by the Intel HDA, not by the HDA integrated into the discrete AMD/Nvidia GPU. Audio streamed to the latter would essentially end up in a blackhole. And preventing the user from seeing such useless audio devices was the sole purpose of this commit. Am I missing something? Thanks, Lukas