From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-4.2 required=3.0 tests=AWL,BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, HTML_MESSAGE,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 4E2051F5AE for ; Sat, 11 Jul 2020 16:12:55 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1juI7M-0004We-Vk; Sat, 11 Jul 2020 16:12:48 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1juI7L-0004WV-8W for sox-users@lists.sourceforge.net; Sat, 11 Jul 2020 16:12:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Type:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Sender:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=tPoi7ndzPLbETDs7ggxQXgqmbGZKlPsFxQXR7j8Uq+k=; b=EhKGmAU9+IYEO1B8sN0L8vQ4O 5ZNecvUY1jWVT3bK4vtwypoFQALVDLsZ622yONHIDALlCusuf4Myai3flephoYMmtHreXUN/MQTee Fhwsi6M4ukRPO4HrHYpVoujpggwc0QiV28qkqWgWIFqHvdFFIStdv3DxN1kPAWrFKcwdo=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Type:To:Subject:Message-ID:Date:From:In-Reply-To:References: MIME-Version:Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=tPoi7ndzPLbETDs7ggxQXgqmbGZKlPsFxQXR7j8Uq+k=; b=WAhW/mAiuzIYRI5C/7Z0c6/Vqy 9mAvzJnT/FKkjowEVvwIJEnGxfwicbesJNnVDXzbj61hap6OlPVdHAjG7kmrxL7eOChCNyHtIrjuV dpYbBQs6GVt16Fkiq4pUPqZOoxMnuMdS8bR+vsu2GUB5T1sxPtqYXs2nYCqtGvtEpE6M=; Received: from mail-wm1-f44.google.com ([209.85.128.44]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.92.2) id 1juI7J-003Cyg-MC for sox-users@lists.sourceforge.net; Sat, 11 Jul 2020 16:12:47 +0000 Received: by mail-wm1-f44.google.com with SMTP id l17so9107830wmj.0 for ; Sat, 11 Jul 2020 09:12:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=tPoi7ndzPLbETDs7ggxQXgqmbGZKlPsFxQXR7j8Uq+k=; b=JdV2oqwtpDKDzBYpwwoIJuOC15ltlxNYfHD+dgvnnI8LML8Bow9adv24lfc8VTAvV2 ip5EFPq/rd/hafRDNiHZ1ZTB6Tb2ydAFkpTcZylB0VXlaeowJ0oNpM6y7nMzvnx9dqOk 7lX7xEXW/cXYta02tZqi0cUzrPeLVKzIlzEUr3JU+ei0pzFnLUN52XLkWM2NoljcA1DD tiyp1J1/kdIVhs7bmZ/0FURSC7yaVgE18QTd6szJpO+PnMaI4ETTQ0ZX1gBJJm71IalT gHE+AwLTJI9NmDH7dTjTj917/sojeq7CHt6Svyl7WAf4rELxswjSp3yF8aBkZ7Gt1xQg bH2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=tPoi7ndzPLbETDs7ggxQXgqmbGZKlPsFxQXR7j8Uq+k=; b=lrRT/Dzg/2SR3e/RLx1lhBz84/Ve7v6Tnl6NdGPo7xZtHzth/kOCchny6a21X2XFKO UdGSj6ylJVzdeMJnaMYVXDRPK4d2ozfwV2einswkKX/zqnaiswq9Jy5izTEbDGWyknVz HbigSGNKGkFZeDUy/JfE2ThPZo6Pm55d3sC4UDWhu4KdkkOfiFe2cUDm/LEJjNW9a/vv /lnX6J551qxdvxGTI+tkU5Lu+D1wXymDrrLwqUh2IqXxkG7baGJVvvXoaE8uUeRwG+Fe AXCrTa7zyyipHs29+FxmUgqfBzsHLfNqn06vfXLdG5BwNDAfCkN3dVePSB4Dv92Fzc0H MzVw== X-Gm-Message-State: AOAM533eR/pewKOW+rNmQ2GUWttLBTz2wg3MHLhViyl9le/n7U/K7DFQ oSXFkoD+HFMhKcjuuzFg7o1qsWTva0ud+mvhp1yMcQ== X-Google-Smtp-Source: ABdhPJy0l3VdaT1Rc2Yu8o7Zm4G+C22WXHT5ybJ6x2x8t1Z2WZVPZ0k9QWf3jQg5lISVRAkp5vJk/Us1+j4JoaGkOH4= X-Received: by 2002:a1c:4b08:: with SMTP id y8mr10484509wma.89.1594483959168; Sat, 11 Jul 2020 09:12:39 -0700 (PDT) MIME-Version: 1.0 References: <0713c9d8-7bdf-4b97-99b4-12e219e94d45@Spark> <9148e80a-8af7-4545-af62-bf4f3512aace@Spark> In-Reply-To: From: Steve Masters Date: Sat, 11 Jul 2020 17:12:32 +0100 Message-ID: To: sox-users@lists.sourceforge.net X-Headers-End: 1juI7J-003Cyg-MC Subject: Re: Loopback latency issue X-BeenThere: sox-users@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: sox-users@lists.sourceforge.net Content-Type: multipart/mixed; boundary="===============3020390307030878373==" Errors-To: sox-users-bounces@lists.sourceforge.net --===============3020390307030878373== Content-Type: multipart/alternative; boundary="000000000000fc840205aa2cb924" --000000000000fc840205aa2cb924 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I wonder if it's because the virtual pc doesn't have the same amount of processes running on it, nor physical data traffic, that your actual workstation has to deal with. Added to that, the memory available to it - not being used elsewhere - would improve perfoemance. Just my thinking. On Sat, 11 Jul 2020, 14:31 M=C3=A5ns Rullg=C3=A5rd, wrote: > Maxim Doumkine writes: > > > Hello everyone, > > > > We are trying to build a Sox based real-time sound altering app, and > we=E2=80=99ve > > got everything working on our LUbuntu 16.04 stations except for an issu= e > w > > latency. > > > > When we test it on actual hardware, we are having a latency of about 2 > > seconds, when we test it on our virtual machine the latency is more lik= e > > 250ms. > > > > sox -t pusleaudio default -t pulseaudio null pitch n > > Whenever we add the null loopback or aloop, we experience a delay. No > amount > > of config tinkering seems to affect this latency on an actual > workstation. > > The first thing I'd do is get rid of pulseaudio and access the ALSA > device directly. Even then, however, there are several places where > latency is added. You can find the ALSA buffer sizes currently uses by > examining /proc/asound/card0/pcm0p/sub0/hw_params (or whatever numbers > your system uses). The size (in bytes) of the main buffer in SoX is set > with the --buffer option. Some effects have additional internal buffers. > > -- > M=C3=A5ns Rullg=C3=A5rd > > > _______________________________________________ > Sox-users mailing list > Sox-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/sox-users > --000000000000fc840205aa2cb924 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I wonder if it's because the virtual pc doesn't h= ave the same amount of processes running on it, nor physical data traffic, = that your actual workstation has to deal with. Added to that, the memory av= ailable to it - not being used elsewhere - would improve perfoemance. Just = my thinking.=C2=A0

On Sat, 11 Jul 2020, 14:31 M=C3=A5ns Rullg=C3=A5rd, <<= a href=3D"mailto:mans@mansr.com">mans@mansr.com> wrote:
Maxim Doumkine <maxd@coregears.com> w= rites:

> Hello everyone,
>
> We are trying to build a Sox based real-time sound altering app, and w= e=E2=80=99ve
> got everything working on our LUbuntu 16.04 stations except for an iss= ue w
> latency.
>
> When we test it on actual hardware, we are having a latency of about 2=
> seconds, when we test it on our virtual machine the latency is more li= ke
> 250ms.
>
> sox -t pusleaudio default -t pulseaudio null pitch n
> Whenever we add the null loopback or aloop, we experience a delay. No = amount
> of config tinkering seems to affect this latency on an actual workstat= ion.

The first thing I'd do is get rid of pulseaudio and access the ALSA
device directly.=C2=A0 Even then, however, there are several places where latency is added.=C2=A0 You can find the ALSA buffer sizes currently uses b= y
examining /proc/asound/card0/pcm0p/sub0/hw_params (or whatever numbers
your system uses).=C2=A0 The size (in bytes) of the main buffer in SoX is s= et
with the --buffer option.=C2=A0 Some effects have additional internal buffe= rs.

--
M=C3=A5ns Rullg=C3=A5rd


_______________________________________________
Sox-users mailing list
Sox-users@lists.sourceforge.net
https://lists.sourceforge.net/lists= /listinfo/sox-users
--000000000000fc840205aa2cb924-- --===============3020390307030878373== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline --===============3020390307030878373== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Sox-users mailing list Sox-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sox-users --===============3020390307030878373==--