Received: by 2002:a05:7412:518d:b0:e2:908c:2ebd with SMTP id fn13csp375053rdb; Thu, 5 Oct 2023 08:24:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEUyRWbxjzJ5rxHYhDNXWsbB2pZMuAWn1vXTgg6uQaIZmluY9EY9XjokFJnrKIauv62rEaR X-Received: by 2002:a17:90b:3843:b0:273:e42b:34c1 with SMTP id nl3-20020a17090b384300b00273e42b34c1mr4932707pjb.42.1696519439681; Thu, 05 Oct 2023 08:23:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696519439; cv=none; d=google.com; s=arc-20160816; b=0dtGIqsvW0vqS9QfFjN5IJEm3nnP+6/tGTvH7smozb9KqOuVTo/ORZ3N9VZtN9nFz2 Jr3uFIRwoNdTDZpKGQA1ZL7iV6Lfy5v7cqCxymMmDl15rHMILSiODDVm9oYK0k1mU7hd 0TgeTygswTCbnRiITBWYWCcWNGFAnNUMGxmItAGrMsgN6kdASEvQAZHBSSFmzbkW0nGG auKTdzWLQmPAdVU8XYiOSXm8yirTyev7wK2HhW3pjAllAxuI3fynVCJG2UXbv/ASSfbP GlOK57grn7IOwIFN/NDPNoDnBrnohc5fWGMW6tNHeeMOyS1ZoM8FSlwGo73nyCQx3DlM wFGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature:dkim-filter; bh=5tUjAAffC21PeqN5RCHFtO+dCZ7ZbDslD8JvlTNPOHk=; fh=oSoC/OWGC8OknYVkBWtr3sGb6QIdV/9pRn0HwqWj+DA=; b=QfiXMaBjNjXMldzptNPQTLadT6pj3yF4uY3jdtsgQgh04YUrK/DIW4exPYTE2jetcN hisZELMqczBaa6NVGlOa2He662/jN+6muTkOW9TO8MQJ2knSxtsasUX9l/hwF2ozXQBb OVxKKqnU4GTQ77EKQKALuW92F2Gsns80vQe01STHPaOBRShC2Rp623yN2a2/C1vrmEpo WM4f5rRs3NfYJoM350UyN02zbEXyW7F9sufhzMlnrHmb52s4sCRSRtHe6s+sULeUtL5u TP/kBCWkFN2ThO2/he+tWCClzKRJjrzNZpI1ezL6JWR8W1RF/KXQWmUP/dOUdcBtvNY9 M2ZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@perex.cz header.s=default header.b="RMC/XdI+"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=perex.cz Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id mq4-20020a17090b380400b002689d34ae8dsi4027329pjb.18.2023.10.05.08.23.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Oct 2023 08:23:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@perex.cz header.s=default header.b="RMC/XdI+"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=perex.cz Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 8A01A808E0CB; Thu, 5 Oct 2023 08:23:58 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233305AbjJEPXx (ORCPT + 99 others); Thu, 5 Oct 2023 11:23:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42662 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233375AbjJEPXQ (ORCPT ); Thu, 5 Oct 2023 11:23:16 -0400 Received: from mail1.perex.cz (mail1.perex.cz [77.48.224.245]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F4C8F3DD for ; Thu, 5 Oct 2023 07:33:37 -0700 (PDT) Received: from mail1.perex.cz (localhost [127.0.0.1]) by smtp1.perex.cz (Perex's E-mail Delivery System) with ESMTP id 01B862C80; Thu, 5 Oct 2023 09:23:56 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.perex.cz 01B862C80 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=perex.cz; s=default; t=1696490636; bh=5tUjAAffC21PeqN5RCHFtO+dCZ7ZbDslD8JvlTNPOHk=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=RMC/XdI+giZhjrbO60WuxY5G65Nvhs8t+MbQCl/unIEbm48UuP4o9PE3o+/LjD5ZY d7RwtIL/oz1qE8tFe9EeW9swhH4BRxUozQ45FjA9lZZrA5DIK878YGn9dSECse2xZo POvFdJkqYUojdZO8pOdxvrQmBLybjEfowmTkZWMc= Received: from [192.168.100.98] (unknown [192.168.100.98]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: perex) by mail1.perex.cz (Perex's E-mail Delivery System) with ESMTPSA; Thu, 5 Oct 2023 09:23:51 +0200 (CEST) Message-ID: Date: Thu, 5 Oct 2023 09:23:51 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH 1/2] ALSA: aloop: Add support for the non-interleaved access mode Content-Language: en-US To: Ivan Orlov , tiwai@suse.com Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org References: <20230927113555.14877-1-ivan.orlov0322@gmail.com> From: Jaroslav Kysela In-Reply-To: <20230927113555.14877-1-ivan.orlov0322@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_PASS,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Thu, 05 Oct 2023 08:23:58 -0700 (PDT) On 27. 09. 23 13:35, Ivan Orlov wrote: > The current version of the loopback driver supports interleaved access > mode only. This patch introduces support for the non-interleaved > access mode. > > When in the interleaved mode, the 'copy_play_buf' function copies data > from the playback to the capture buffer using one memcpy call. This call > copies samples for multiple, interleaved channels. > > In the non-interleaved mode we have multiple channel buffers, so we have > to perform multiple memcpy calls to copy samples channel after channel. > > Add new function called 'copy_play_buf_part_n', which copies a part of > each channel buffer from playback to capture. Modify the 'copy_play_buf' > to use the corresponding memory copy function(just memcpy / > copy_play_buf_part_n) depending on the access mode. > > Signed-off-by: Ivan Orlov Nice extension. Thank you. > +static void copy_play_buf_part_n(struct loopback_pcm *play, struct loopback_pcm *capt, > + unsigned int size, unsigned int src_off, unsigned int dst_off) I would probably prefer to have dst,src,size arguments to follow memcpy, but it's really nitpicking. Reviewed-by: Jaroslav Kysela Jaroslav -- Jaroslav Kysela Linux Sound Maintainer; ALSA Project; Red Hat, Inc.