All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kai Heng Feng <kai.heng.feng@canonical.com>
To: Lukas Wunner <lukas@wunner.de>
Cc: "Pali Rohár" <pali.rohar@gmail.com>,
	"Takashi Iwai" <tiwai@suse.de>,
	mjg59@srcf.ucam.org, dvhart@infradead.org, andy@infradead.org,
	"Mario Limonciello" <mario.limonciello@dell.com>,
	alsa-devel@alsa-project.org,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	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
Date: Thu, 26 Apr 2018 15:52:08 +0800	[thread overview]
Message-ID: <A9269F25-2239-4E3C-A3B3-FFDD69A90DD0@canonical.com> (raw)
In-Reply-To: <20180424211347.GA18258@wunner.de>


> On Apr 25, 2018, at 5:13 AM, Lukas Wunner <lukas@wunner.de> wrote:
>
> 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 <pali.rohar@gmail.com> wrote:
>>> On Monday 23 April 2018 16:04:55 Kai Heng Feng wrote:
>>>>> On Apr 20, 2018, at 8:10 PM, Takashi Iwai <tiwai@suse.de> 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.

Looks like I hit a new bug: the discrete GFX and its audio controller never  
enters to D3.
The GFX can enter to D3 with my prosed patch.

>
> 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?

Yes this is the intention.

Kai-Heng

>
> Thanks,
>
> Lukas

WARNING: multiple messages have this Message-ID (diff)
From: Kai Heng Feng <kai.heng.feng@canonical.com>
To: Lukas Wunner <lukas@wunner.de>
Cc: mjg59@srcf.ucam.org, alsa-devel@alsa-project.org,
	"Mario Limonciello" <mario.limonciello@dell.com>,
	"Takashi Iwai" <tiwai@suse.de>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	platform-driver-x86@vger.kernel.org,
	"Pali Rohár" <pali.rohar@gmail.com>,
	dvhart@infradead.org, andy@infradead.org
Subject: Re: [PATCH v4 3/3] ALSA: hda: Disabled unused audio controller for Dell platforms with Switchable Graphics
Date: Thu, 26 Apr 2018 15:52:08 +0800	[thread overview]
Message-ID: <A9269F25-2239-4E3C-A3B3-FFDD69A90DD0@canonical.com> (raw)
In-Reply-To: <20180424211347.GA18258@wunner.de>


> On Apr 25, 2018, at 5:13 AM, Lukas Wunner <lukas@wunner.de> wrote:
>
> 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 <pali.rohar@gmail.com> wrote:
>>> On Monday 23 April 2018 16:04:55 Kai Heng Feng wrote:
>>>>> On Apr 20, 2018, at 8:10 PM, Takashi Iwai <tiwai@suse.de> 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.

Looks like I hit a new bug: the discrete GFX and its audio controller never  
enters to D3.
The GFX can enter to D3 with my prosed patch.

>
> 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?

Yes this is the intention.

Kai-Heng

>
> Thanks,
>
> Lukas
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

  reply	other threads:[~2018-04-26  7:52 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-20  9:44 [PATCH v4 1/3] dell-led: Change dell-led.h to dell-common.h Kai-Heng Feng
2018-04-20  9:44 ` [PATCH v4 2/3] platform/x86: dell-*: Add interface for switchable graphics status query Kai-Heng Feng
2018-04-23 13:43   ` Andy Shevchenko
2018-04-23 13:43     ` Andy Shevchenko
2018-04-20  9:44 ` [PATCH v4 3/3] ALSA: hda: Disabled unused audio controller for Dell platforms with Switchable Graphics Kai-Heng Feng
2018-04-20 12:10   ` [alsa-devel] " Takashi Iwai
2018-04-23  8:04     ` Kai Heng Feng
2018-04-23  8:04       ` Kai Heng Feng
2018-04-23  8:08       ` [alsa-devel] " Pali Rohár
2018-04-23  8:08         ` Pali Rohár
2018-04-23  8:18         ` [alsa-devel] " Kai Heng Feng
2018-04-23  8:18           ` Kai Heng Feng
2018-04-23  8:29           ` [alsa-devel] " Pali Rohár
2018-04-24 21:13           ` Lukas Wunner
2018-04-26  7:52             ` Kai Heng Feng [this message]
2018-04-26  7:52               ` Kai Heng Feng
2018-05-02  7:44               ` [alsa-devel] " Lukas Wunner
2018-04-23 13:52   ` Andy Shevchenko
2018-04-24 16:26 ` [PATCH v4 1/3] dell-led: Change dell-led.h to dell-common.h Takashi Iwai
2018-04-24 16:26   ` Takashi Iwai
2018-04-26  7:25   ` Kai Heng Feng
2018-04-26  7:25     ` Kai Heng Feng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=A9269F25-2239-4E3C-A3B3-FFDD69A90DD0@canonical.com \
    --to=kai.heng.feng@canonical.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=andy@infradead.org \
    --cc=dvhart@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lukas@wunner.de \
    --cc=mario.limonciello@dell.com \
    --cc=mjg59@srcf.ucam.org \
    --cc=pali.rohar@gmail.com \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.