Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp220118lqo; Thu, 9 May 2024 18:59:40 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUoTSkIEdhBkpTFC9eWScx9ZYo5qUDvxjz3p0Jn5/NjgDVZES+a6nhl8YVfVawuB6tqThcphGt7kr+snuhIJgacdSHmBLCzRqxSl8epqw== X-Google-Smtp-Source: AGHT+IEvdGcsDa0GUTwJ+eVLXf3h5duWqijXDYdFjYOSULqnrnaH+8Lj07L38eQ+gJ5gLkwODip6 X-Received: by 2002:a05:6a20:565b:b0:1a7:919f:2b60 with SMTP id adf61e73a8af0-1afde0f3a28mr1520406637.37.1715306380172; Thu, 09 May 2024 18:59:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715306380; cv=pass; d=google.com; s=arc-20160816; b=H2V4gceBMi7332fM/1ifGRUFzLo9yzvzG87797cgunQPhBU43tv+HxYfbuZ/kI/G9k cbRkR+nFd1u3j9sFjJBXo4iwcoDOKXh5vi2IC+/r6lxb5/7ajdThyCiJqMdkzVaYOCCx h1Wiqpaa4fb4kDhmdsr+DbnCqyH+5y4qFXJnytY204wr7BTnOreY5QhlZT22GroczDkD Cb8R1v7v3RydF8vBjWbyS5tXFkYXVuxhe9ilTpI5yn4jLcZeOkxXhuahkIl+GUoPH1T7 Fm0DMIQyNHIsdUUqIEIKgKWt8VDqUIm6QfRLXUsnvXrmWPMHHbnajGisLLhcHxPwVGvv vQLA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=HoBD5zVuFawBkUAyLBD9w7loTcZHJu6pK4sKTR7IxUk=; fh=3eVbvXVT2F7w23cFT6imnzbn3TO4xlidhy25820AHtI=; b=snOBEC14KkE0RPRKt0W+m1d9BJkoR3jUxj37f3neHhE5s4AHLNOmMWpJC5i8s2n2cG oXCLzs8kKBDhQd/VWOPtOihhr97Pu78OydTsDICnWHa6CJysBuvHTUvJPmWZrNVCsKoy bQc+d2CHQeRtWwwf4l8af9AzpRU3WQks6ug2/99sQXXk1zPGidaT1tBicMEojigzagP/ hG9ARyYWwy7I0JEgD8UbEt/MWDtT88YgWDYCtxUkVc2YGmeyuYrseu3a+OoWxpQroXL8 i740ERoz6z0fRMj/kCRa0aUIIpGxkVBmOmxxKr+6vQ6Ervkbo5WZhAEDFGBBr6PbU5EG ackw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=X45PQWYL; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-174840-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-174840-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d9443c01a7336-1ef0b9cf3d3si27036115ad.96.2024.05.09.18.59.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 May 2024 18:59:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-174840-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=X45PQWYL; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-174840-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-174840-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 9EFA728480B for ; Thu, 9 May 2024 19:57:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 80F4B8564E; Thu, 9 May 2024 19:56:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="X45PQWYL" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DB16084DF9; Thu, 9 May 2024 19:56:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715284584; cv=none; b=B5HJlnTO4FpV8ViiqpJQjrwFUZO6z4blNgVmsZIDNS1o/Zz9CxddRy6fZkR7z3nEG7vbBraZzlLomTWeVnvSkBMmNzuJP3awvjdhVQaqSUnirsTM+H6yh8F3KUM04MHSKr7ZGqcM809t492oykGxSZCMddPrSIsVEf4kTNfBYXY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715284584; c=relaxed/simple; bh=3epbr7u3CfAFndEOsNu4jNNDKiPVR3FkG4nsSdqrrb0=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=gw73TYnPnfborNAqxSeszn2etjLuZCuyAYYKbvaLB5N7j39/cxx2hlU8X2bgsX9bLHAhIME3jiDpgIMGKF0r5mVWjWDTTC+ec7+nIDwqjDpEezYoleAfWmbCQBj9gTCHqYmXLCivAIkSVi4sdhY5QvsZdDr/brX374PfkBKR1f0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=X45PQWYL; arc=none smtp.client-ip=192.198.163.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1715284583; x=1746820583; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=3epbr7u3CfAFndEOsNu4jNNDKiPVR3FkG4nsSdqrrb0=; b=X45PQWYLUDbpOYU7CYbi7yQgiGacA06ELZN7ilLyVD879dKj7+5cglvs dRiyyzwLWO7UY8d7gl3KMtqljdKhf6khF/P0q0Am4lTbUcdKSutOTdnku X8PyIy/WQclIeXtxXFC+vaMcJIn+wkzxTIo7zrNixrhnH1URWiVSML3fL QYA58tJScoSxaQOpaJ9UC4/MPYugrK+ln4O0IcERHLERkgYH0LG5tNFdK h/MGG0T2D6EDq6HJLnpOjFObefsi8YRUFfZ1h36g7GG65DLErUH81tCtI FcAyn2a751fqf2GsJfzC/DqppthHFJIRqWfeAcDWBN/yp+Zif8M81w/iv A==; X-CSE-ConnectionGUID: w132kA1ZS5600QJC9VBOUg== X-CSE-MsgGUID: v1Mj2OJNQRizWojE0IsRMw== X-IronPort-AV: E=McAfee;i="6600,9927,11068"; a="11454276" X-IronPort-AV: E=Sophos;i="6.08,148,1712646000"; d="scan'208";a="11454276" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 May 2024 12:56:23 -0700 X-CSE-ConnectionGUID: mB+YzDLqRz6/iJpx7j2KHg== X-CSE-MsgGUID: J9w1UCm6QO6uAg+td9Am0g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,148,1712646000"; d="scan'208";a="34213110" Received: from ajunnare-mobl.amr.corp.intel.com (HELO [10.213.181.85]) ([10.213.181.85]) by orviesa004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 May 2024 12:56:20 -0700 Message-ID: Date: Thu, 9 May 2024 08:07:36 -0500 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v21 27/39] ASoC: Introduce SND kcontrols to select sound card and PCM device To: Wesley Cheng , srinivas.kandagatla@linaro.org, mathias.nyman@intel.com, perex@perex.cz, conor+dt@kernel.org, corbet@lwn.net, lgirdwood@gmail.com, andersson@kernel.org, krzk+dt@kernel.org, gregkh@linuxfoundation.org, Thinh.Nguyen@synopsys.com, broonie@kernel.org, bgoswami@quicinc.com, tiwai@suse.com, bagasdotme@gmail.com, robh@kernel.org, konrad.dybcio@linaro.org Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-sound@vger.kernel.org, linux-usb@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-doc@vger.kernel.org, alsa-devel@alsa-project.org References: <20240507195116.9464-1-quic_wcheng@quicinc.com> <20240507195116.9464-28-quic_wcheng@quicinc.com> <54b79b7b-49e6-418e-9a6b-11bcbada8398@linux.intel.com> <3390ef12-67dd-9474-21fb-b8df35fff546@quicinc.com> Content-Language: en-US From: Pierre-Louis Bossart In-Reply-To: <3390ef12-67dd-9474-21fb-b8df35fff546@quicinc.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 5/8/24 19:10, Wesley Cheng wrote: > Hi Pierre, > > On 5/7/2024 2:26 PM, Pierre-Louis Bossart wrote: >> >> >> On 5/7/24 14:51, Wesley Cheng wrote: >>> Add SND kcontrol to SOC USB, which will allow for userpsace to determine >>> which USB card number and PCM device to offload.  This allows for >>> userspace >>> to potentially tag an alternate path for a specific USB SND card and PCM >>> device.  Previously, control was absent, and the offload path would be >>> enabled on the last USB SND device which was connected.  This logic will >>> continue to be applicable if no mixer input is received for specific >>> device >>> selection. >>> >>> An example to configure the offload device using tinymix: >>> tinymix -D 0 set 'USB Offload Playback Route Select' 1 0 >>> >>> The above command will configure the offload path to utilize card#1 >>> and PCM >>> stream#0. >> >> I don't know how this is usable in practice. Using card indices is >> really hard to do, it depends on the order in which devices are >> plugged-in... > > How are the existing mechanisms handling USB audio devices, or what is > the identifier being used? Well it's a mess, that's why I asked. There are configuration work-arounds to make sure that 'local' accessories are handled first and get repeatable card indices. But between USB devices I guess the rule is 'anything goes'. Even if there are two devices connected at boot, the index allocation will depend on probe order. The card names are not necessarily super-useful either, i.e. yesterday I was confused by an USB card named "CODEC" without any details.