Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp120617lqo; Thu, 9 May 2024 14:44:41 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVw//gsgO/cgwQLLgZ2/Bf3CN0B8qX03HtpHqFFvm4W29UMBFu79jivGqFGnZzVFUu71y548RD3y3XH1WH6u0IOxaDKttJ6RDvYtVx9kw== X-Google-Smtp-Source: AGHT+IFOSXEsGcd2CQ5b5h6kHmiUnej0dy+24KY10cxD36BhQRaZVUQtBEIdJnDQiXq/6V2ZeEMu X-Received: by 2002:a05:6e02:12e2:b0:36c:4688:85aa with SMTP id e9e14a558f8ab-36cc1487727mr11489265ab.10.1715291081654; Thu, 09 May 2024 14:44:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715291081; cv=pass; d=google.com; s=arc-20160816; b=uX9a4LKqIsP7c57ub1o55uSwLub9QSPJobP1AvBtKr2jouodWXopEwkqsIp8vWhKwu ZxL4aJ8MNA519LzxC+U1N1P89a+pPTmzpM5ApoWVR2fGT2qroTx96tgdXgVvc8y3atVJ xBBPhd5Po7kBdYUWVq4HPrlqddUdVZ9sWt6I8td0MLTgEHcXYEzn/4syX3MnVY27olpF SLERym8bIOspIlFrfYMxvRCIu4DgpYS6j71qerqr+Ks7xsYgh8nPVnK4wQHsirW6j6S2 oJvtJyEiWC9b8X4s6AiaCaDO5qtMLrr+QwPjuvK4nQDq/d208k1Tywkh2EGWwJ7dtZJa HWVA== 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=cIukUmTAz21I3U9U4WGeVwO7Ge0VeW/gUAEvuX3Cztc=; fh=iRZivtppW/TNTAfzyCFB4Ao7jKoLfwnwVSfzppsNZsY=; b=QeTBkLBwNxszf/RyDo8BPMgNEXUL+xMtkJQTIjgTb8mk7o9/S1WoP+3C+LqQfBnzqF +scqmFACSr8NToA2G/ZiUq8cOagFPlCBQ6RET5ZO/efQky0TELd4vm5hIakqD+kXw6lZ dszh39GgZMuCnpODBlwBetT1noDaU+PdQkAvfYxk53mqdiM+lp72D8RsVvFUZ83l5fIt 61tILYajlDykPjRVoz+zV0mJ0KTbF9gdqFNoAs5V5cFue/FfhpZfu634qv1qYypS3wKh WWU0oaQnoG5iKOLXsmEB707qYVVYXOOQAVeCwfDk218X2pM5AiTWdCxjAsM9ECAmkw3A MJDA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=LI9r2ZDo; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-174997-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-174997-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-6341180e267si2102148a12.530.2024.05.09.14.44.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 May 2024 14:44:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-174997-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=LI9r2ZDo; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-174997-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-174997-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.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 3495F282BE0 for ; Thu, 9 May 2024 21:34:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B4A131292C8; Thu, 9 May 2024 21:34:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="LI9r2ZDo" Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (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 22D7385C5E; Thu, 9 May 2024 21:34:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715290473; cv=none; b=SZ6Mb/ttoZ/zOvt4iralrrWEYq5+KgJKph0cDRcVKwGUziD1tSmeFTVuJKCWbZ8QIoI7cz/ucnk4xnWJarPaOycyTTeUl43/hoHpOpFvIlcwAnYlH7pxUQKs6vFi8G8+C5WhaWKdLQl9shsLzg+RLYv7RvzABymzBN7c6M7/DrE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715290473; c=relaxed/simple; bh=DMClA2EG4om7tUuZOout4+5pUV7yCTXmqNhHE4600xM=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=csa6fCgUv9fF8ZEjNxY/qcefXwrQnJ4KZlrBrqDh5GI6doF+u+ULFrEPDoexDfaX/K4lbBSMairkAwBvtYJAO9CyCiBeivwzsja4YvWRGKl6N9hFxE39I3Pk1QRexoPpMYmc2rIL7NoCrxgdaJ/vRwNBPzCnYaepsPFgMMMJDOI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=LI9r2ZDo; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 449KtB8X012405; Thu, 9 May 2024 21:34:07 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= message-id:date:mime-version:subject:to:cc:references:from :in-reply-to:content-type:content-transfer-encoding; s= qcppdkim1; bh=cIukUmTAz21I3U9U4WGeVwO7Ge0VeW/gUAEvuX3Cztc=; b=LI 9r2ZDod4f1CfRw0lzzeck32b+xIyPiWNzUzL70jaE0GWi79OrRqe7hiTMCQnshjR M+YlIEWTxolltwsRLJ54IH3eQAVAfx6gcOgoYnTbqddSIGXfr4qbfsg6nT68hFqO QD+/f7xVKlSdtjj19rpQSd71bm2wPqoPodM2bvcyFL0IrobV0qXFffIAnj3Ryx4J JkuENjg/HdYm0UBiz4/P7WlHIMudK0ofQWhMMPONf+EumzP5KCSW7HoT6VWYJtZN zWuTKpTSAZ6kshg6Mmp5jHEUYmxIwgY55lQPpGltrPb6wjXOMB58KgHKcBKe7MS2 WRXOLrTOkp1Gwm7T7XUw== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3y09f5unjr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 09 May 2024 21:34:07 +0000 (GMT) Received: from nalasex01b.na.qualcomm.com (nalasex01b.na.qualcomm.com [10.47.209.197]) by NALASPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 449LY6PO000667 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 9 May 2024 21:34:06 GMT Received: from [10.71.112.114] (10.80.80.8) by nalasex01b.na.qualcomm.com (10.47.209.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Thu, 9 May 2024 14:34:05 -0700 Message-ID: Date: Thu, 9 May 2024 14:34:01 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH v21 09/39] ASoC: qcom: qdsp6: Introduce USB AFE port to q6dsp To: Pierre-Louis Bossart , , , , , , , , , , , , , , , , CC: , , , , , , References: <20240507195116.9464-1-quic_wcheng@quicinc.com> <20240507195116.9464-10-quic_wcheng@quicinc.com> <9bd1ec72-71ea-4a1c-b795-af6e7687ca07@linux.intel.com> <0a4d7c2b-ac7d-7bd4-f97e-db60944a1d39@quicinc.com> <726e7006-30b4-4525-84c8-4fb2ef380994@linux.intel.com> Content-Language: en-US From: Wesley Cheng In-Reply-To: <726e7006-30b4-4525-84c8-4fb2ef380994@linux.intel.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01b.na.qualcomm.com (10.47.209.197) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: ElA1DleWGwoZYGAQNwZNxyKuF9wVF_HB X-Proofpoint-ORIG-GUID: ElA1DleWGwoZYGAQNwZNxyKuF9wVF_HB X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.650,FMLib:17.11.176.26 definitions=2024-05-09_12,2024-05-09_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 adultscore=0 phishscore=0 suspectscore=0 bulkscore=0 clxscore=1015 priorityscore=1501 impostorscore=0 mlxscore=0 lowpriorityscore=0 malwarescore=0 mlxlogscore=576 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2405010000 definitions=main-2405090152 Hi Pierre, On 5/9/2024 5:54 AM, Pierre-Louis Bossart wrote: > > > >>> Wait, is this saying you will have exactly one PCM device/FE DAI >>> connected to the USB BE DAI exposed in patch 11? >>> >>>> +    SND_SOC_DAPM_MIXER("USB Mixer", SND_SOC_NOPM, 0, 0, >>>> +               usb_mixer_controls, >>>> +               ARRAY_SIZE(usb_mixer_controls)), >>>> + >>> >>> And then what is the role of the USB mixer if you only have one input? >>> >>> I must be missing something. >>> >> >> Not sure if this is a QCOM specific implementation, but the way the DT >> is defined for the USB offload path is as follows: >> >>     usb-dai-link { >>         link-name = "USB Playback"; >> >>         cpu { >>             sound-dai = <&q6afedai USB_RX>; >>         }; >> >>         codec { >>             sound-dai = <&usbdai USB_RX>; >>         }; >> >>         platform { >>             sound-dai = <&q6routing>; >>         }; >>     }; >> >> Based on our DT parser helper API (qcom_snd_parse_of()) this isn't going >> to create a PCM device.  The PCM devices are created for nodes that >> don't have a codec and platform defined: >> >>     mm1-dai-link { >>         link-name = "MultiMedia1"; >>         cpu { >>             sound-dai = <&q6asmdai      MSM_FRONTEND_DAI_MULTIMEDIA1>; >>         }; >>     }; >> >> The ASM path is the entity that defines the number of PCM devices that >> is created for the QC ASoC platform card, and is where the actual PCM >> data is sent over to the DSP.  So there could be several PCM devices >> that can use the USB BE DAI. > > ok, but then how would this work with the ALSA controls reporting which > PCM device can be used? I didn't see a mechanism allowing for more than > one offloaded device, IIRC the control reported just ONE PCM device number. With respects to the PCM devices exposed by the ASoC card, the USB Mixer controls which "Multimedia" (ASM) path can be routed to the USB BE DAI. The kcontrols you are mentioning are controlling which USB card and USB PCM device to execute the offloading on. As of now, at least for the QCOM implementation, we support only offloading on one path/USB interface. I can't comment on how other offloading solutions look like, but we pass the USB PCM and card index as part of our AFE port open command (done from USB BE DAI). This will result in a USB QMI message back (from ADSP) to our USB SND offload driver, which carries all the information about the selected card and PCM index to execute offloading on. One thing I can do is to actually make the kcontrols for selecting the PCM and card devices to look at the num_supported_streams. This would at least allow for vendors that have support for more potential offloading streams to select more than one. Thanks Wesley Cheng