Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp4171610imm; Mon, 30 Jul 2018 09:50:23 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcAXbkWBMmS3NwDs46bI+RVmsZdC57OPtD0SrzdtA92FETIXWPhMlGhqDcjvaR9nNH3458x X-Received: by 2002:aa7:86d7:: with SMTP id h23-v6mr18641356pfo.132.1532969423058; Mon, 30 Jul 2018 09:50:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532969423; cv=none; d=google.com; s=arc-20160816; b=g175XENAAkNndPYzw+Yrc1PfQ66B6InKTgbSOia7UUWxtDTymF0TOxjpGPD3cSzOZm YEielx9A0zgkAa0d/KboFFMk3pkfVDtB8VNCl4r44O4HbByllL8E9lttuv25JdS8S340 HixnjaQ6rKHKp8qU65i9jkT+mVU9Ew4L47fXs4tLQM6tTJ95ng5R8eBApi74oNiQLevG c9/fmHKLXGtmXqu5xkAeuFTACSBKWOIa4jwxXm+9tL2so/1436zO1gF3ozvLUn3Jz16f lOxKYMzsPOdiTVM07P7RxGfG0JSpUt5i/arqhZCDHVTEtzHtSTv+4l2hF9H5Mow30WVp qqjw== 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:arc-authentication-results; bh=0MhC04/4RaOVDjSwXQHfhZIa1mf54552j/cGNhP412k=; b=bzZCXAKQ9yUYNmDOy2IK/YDFNlboD25SFyS47RFY0raZBX7Ee5nqav7zFORUCHkkMn GQpiROe6EUdHO2ShBhIl+Zp24e+esWn5iY1R5yn/4qRhkeAUwhT7Fc1B2kky5bGTtwIs DGMpTV3YlhBft649ZmLpM6lRzEOjAcwLc5VJZxPAwR/IBaHhsEykbpaV9UxeXpMQgmzD XyRSI10hA7MSSpcFo2MU8vt2OwP7YA7gZZENaj2ThenJ1WGhFcbM0+9qs4H7vh3dLJsT i9rpP2GIhg1ZkFILjQNfRRgYResN1j7LFDsEfPm5NEfjz2oRMzrz75ch/diS4dw5vTDB BlRA== 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=codethink.co.uk Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v123-v6si11467280pfb.324.2018.07.30.09.50.08; Mon, 30 Jul 2018 09:50:23 -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=codethink.co.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727478AbeG3SYe (ORCPT + 99 others); Mon, 30 Jul 2018 14:24:34 -0400 Received: from imap1.codethink.co.uk ([176.9.8.82]:44730 "EHLO imap1.codethink.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726752AbeG3SYe (ORCPT ); Mon, 30 Jul 2018 14:24:34 -0400 Received: from [148.252.241.226] (helo=[10.35.4.113]) by imap1.codethink.co.uk with esmtpsa (Exim 4.84_2 #1 (Debian)) id 1fkBLc-0002Sj-TX; Mon, 30 Jul 2018 17:48:41 +0100 Subject: Re: [PATCH v2 4/4] ALSA: usb-audio: Operate UAC3 Power Domains in PCM callbacks To: Takashi Iwai Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org References: <20180719112215.4219-1-jorge.sanjuan@codethink.co.uk> <20180730092336.18741-1-jorge.sanjuan@codethink.co.uk> <20180730092336.18741-5-jorge.sanjuan@codethink.co.uk> <95e003a2-0cc2-6ce1-b330-0a4fa3643386@codethink.co.uk> From: Jorge Message-ID: <88a51510-598d-3a95-ab29-138ff317312e@codethink.co.uk> Date: Mon, 30 Jul 2018 17:48:40 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 30/07/18 17:12, Takashi Iwai wrote: > On Mon, 30 Jul 2018 18:09:38 +0200, > Jorge wrote: >> >> >> >> On 30/07/18 14:13, Takashi Iwai wrote: >>> On Mon, 30 Jul 2018 11:23:36 +0200, >>> Jorge Sanjuan wrote: >>>> >>>> Make use of UAC3 Power Domains associated to an Audio Streaming >>>> path within the PCM's logic. This means, when there is no audio >>>> being transferred (pcm is closed), the host will set the Power Domain >>>> associated to that substream to state D1. When audio is being transferred >>>> (from hw_params onwards), the Power Domain will be set to D0 state. >>>> >>>> This is the way the host lets the device know which Terminal >>>> is going to be actively used and it is for the device to >>>> manage its own internal resources on that UAC3 Power Domain. >>>> >>>> Note the resume method now sets the Power Domain to D1 state as >>>> resuming the device doesn't mean audio streaming will occur. >>> >>> I guess we need the power state transition to D0 also in prepare >>> callback. The recovery from suspend doesn't need hw_params call but >>> just prepare -> trigger. >> >> Right! Shouldn't it then be enough to just go to D0 on .prepare? I,e. >> Move the state transition from .hw_params to .prepare. > > Does the power domain transition needed for setting the format, EP, > etc done in set_format()? If yes, we need D0 in hw_parmas as well. Ok. That's a good point. The Power Domain will affect the USB streaming terminals so a device may implement this in a way so it is not capable to set_formats properly. I'll make sure the Power Domain is always set to D0 *before* attempting to set_format. Thanks! Jorge > > > thanks, > > Takashi >