220 26232 <53eaa67d-eec5-4ee1-bea2-848394b4f069@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: ross.bencina@gmail.com
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Any interest to adding audio support to the std library?
Date: Fri, 10 Jun 2016 01:06:31 -0700 (PDT)
Lines: 75
Approved: news@gmane.org
Message-ID: <53eaa67d-eec5-4ee1-bea2-848394b4f069@isocpp.org>
References: <5751B06A.4080501@mail1.stofanet.dk> <5290948.va25uYNizX@tjmaciei-mobl1>
 <CAEhD+6Ca=j3SaS5nC_Qe=6FGMdJLgpQd1LnGfiep8m9GrEU1jQ@mail.gmail.com>
 <1580229.cHEgQxCuA1@tjmaciei-mobl1> <CANh-dX=heKaWzvE+rk8FeCSTQyZ8-FR9UaGdam8quLaEuLJ=-A@mail.gmail.com>
 <62b7649a-5de5-4330-9bac-708375d36e2c@isocpp.org>
 <CAOcFa=fnWS=T2p6xgQ_EiCnVTmkSk_UrobDMYvXhaKi95cxrdQ@mail.gmail.com>
 <3c0fde91-671d-4751-955d-7b04cfa120bc@isocpp.org>
 <4922d8b8-7909-44a2-a24f-8dcf4090911f@isocpp.org>
 <fa20d105-71df-445b-a773-6de77ece5c09@isocpp.org>
 <f5465abe-f7e5-45c5-aa0b-92d5727bbfa6@isocpp.org>
 <83016a47-e902-4292-b109-652e811d17fb@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_2280_1813943857.1465545991756"
X-Trace: ger.gmane.org 1465546021 28191 80.91.229.3 (10 Jun 2016 08:07:01 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Fri, 10 Jun 2016 08:07:01 +0000 (UTC)
Cc: alexander.zywicki@gmail.com, ross.bencina@gmail.com
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBDWNJVP63IJBBCPK5G5AKGQEI6MAFWI@isocpp.org Fri Jun 10 10:07:01 2016
Return-path: <std-proposals+bncBDWNJVP63IJBBCPK5G5AKGQEI6MAFWI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-qk0-f200.google.com ([209.85.220.200])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDWNJVP63IJBBCPK5G5AKGQEI6MAFWI@isocpp.org>)
	id 1bBHT2-0004tv-ND
	for gclcip-std-proposals@m.gmane.org; Fri, 10 Jun 2016 10:07:00 +0200
Original-Received: by mail-qk0-f200.google.com with SMTP id l185sf128431987qkc.0
        for <gclcip-std-proposals@m.gmane.org>; Fri, 10 Jun 2016 01:07:00 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=date:from:to:cc:message-id:in-reply-to:references:subject
         :mime-version:x-original-sender:reply-to:precedence:mailing-list
         :list-id:x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=tmPAVt0xQZKkBx8x2Rm5UPRPHVW7EgESx9wwAJcUoUA=;
        b=QpE+hZInNxBwk4OHh6AU/1Bj/W73+mN8GiwGWgibFphbFSpxhUqAyqaeZqsrDVZD4M
         7I7J+PT+8rfC7c6jiL3D1cV/ibK7nfFyim+h/0fT5V13N7ivFSK6Y+j+ZFe7WYo2V17X
         5jEKvnNrCXIsaiuwwjGsvdGgyMLm6tihOAER/k9IaScICDl4447HZLsf2QDwP3C4OF+y
         CJjS5n6+Y8e3kiCYqNC2S0lAxUog3sakogW1eprgPe4l1xRLIZvRje+y6cR5ovw/P7ss
         Ig+eH2DBAFx5ku13P9rc7t5cHblPoVPG9xrvmm6prh7fMgo7lZna/2DunWLNHh0p04FS
         MvOg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=date:from:to:cc:message-id:in-reply-to:references:subject
         :mime-version:x-original-sender:reply-to:precedence:mailing-list
         :list-id:x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=tmPAVt0xQZKkBx8x2Rm5UPRPHVW7EgESx9wwAJcUoUA=;
        b=SWxLDZ75WkhsRME0wG3ihidqrHCGZm5fUJZnUv8ZFZqufqGpcOmazfvMxSxLFE1oXl
         5v/fhM9YN0vhxCpuqRhUqgetuAp9nhf/LwBo+jlZkvuv/veqLxkHbibdt1H0Vn4mvLlC
         4/oN+ctvK2BrcP2Uu81czHJcJSKKt2JrSGsz33CgJRH8/MXhycUTUtyZT47UoOA5OunN
         7jo78Lx1EBht9LDReU1ewwcwkjjlQTGuGPyuE0IJCv3PyYhCAaL+mTtE4ZlvjfG0o1//
         iP5Uk6OdKfRi/KiVbUdnQW6JKNSWPXVsbtw4PoN7nLCHun6pcYYyvs23QsK/Zupl841A
         hmlA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:date:from:to:cc:message-id:in-reply-to
         :references:subject:mime-version:x-original-sender:reply-to
         :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post
         :list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=tmPAVt0xQZKkBx8x2Rm5UPRPHVW7EgESx9wwAJcUoUA=;
        b=dhcGiyKdeblPIy+W9RJnz42aTZU3AT2CYPIekczBm0rVJ+8B4LT+bKzEVRHmUmh1nm
         zlCbErZ22tZyXCgWRETh9+h2QDAqKiyYTAnGoJjd67nW2ysVaVIGMD2TQHmLayS2aRGr
         zAvyDFbnQCNrxKoXiXRTiOlKjoHXEXuUeer0S9Vt4zEzP7vjIUHeKOu+27PMX5+vFrwB
         xxr/1PrHS2BiLZ1wxlzjIuoZ+X3jkOPrF4gWOfHm8dX+EpPtoi/dYbhS8/HFGU7V/0bl
         l+k0TEVw+JP3uNK0kDROLmZSjzETvt2PttU7cLnqA7dEpX5u+NOa6okEM64uhweHXduk
         i9CQ==
X-Gm-Message-State: ALyK8tKTih1GTMIulaoaUOnfi1piGWFfi3HpStTHKBRgtwPdjInar/vm3b7x006NBXz0VA==
X-Received: by 10.31.15.148 with SMTP id 142mr400343vkp.13.1465546019680;
        Fri, 10 Jun 2016 01:06:59 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.36.228.201 with SMTP id o192ls152186ith.31.gmail; Fri, 10 Jun
 2016 01:06:33 -0700 (PDT)
X-Received: by 10.36.213.134 with SMTP id a128mr19922itg.8.1465545992620;
        Fri, 10 Jun 2016 01:06:32 -0700 (PDT)
In-Reply-To: <83016a47-e902-4292-b109-652e811d17fb@isocpp.org>
X-Original-Sender: ross.bencina@gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Spam-Checked-In-Group: std-proposals@isocpp.org
X-Google-Group-Id: 399137483710
List-Post: <https://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <https://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <https://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:26232
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/26232>

------=_Part_2280_1813943857.1465545991756
Content-Type: multipart/alternative; 
	boundary="----=_Part_2281_1375421992.1465545991756"

------=_Part_2281_1375421992.1465545991756
Content-Type: text/plain; charset=UTF-8

> Do you have any suggestions as far as an explicit notion of time should 
be in this context?

It needs to be a monotonic system clock.

And you need to be able to correlate it with your i/o buffers.

But you can not assume (as I think you have) that i/o buffers represent a 
contiguous stream of samples, because there can be dropped buffers, and you 
need to represent this. (btw. this is another example of how real-time 
audio is not like an iostream).

Something I forgot earlier: each DAC or ADC may be running in a different 
clock domain. The CPU time is usually another clock domain. So you have 
multiple drifting clocks. One consequence of this is that you can't make 
simplifying assumptions that e.g. 44100 samples elapsed is exactly 1 second 
of system monotonic time. That's why you need timestamps associated with 
the buffers, so that the client can estimate the actual sample rate.


-- 
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/53eaa67d-eec5-4ee1-bea2-848394b4f069%40isocpp.org.

------=_Part_2281_1375421992.1465545991756
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">&gt;=C2=A0<span style=3D"color: rgb(136, 136, 136);">Do yo=
u have any suggestions as far as an explicit notion of time should be in th=
is context?</span><div><span style=3D"color: rgb(136, 136, 136);"><br></spa=
n></div><div><span style=3D"color: rgb(136, 136, 136);">It needs to be a mo=
notonic system clock.</span></div><div><br></div><div>And you need to be ab=
le to correlate it with your i/o buffers.</div><div><br></div><div>But you =
can not assume (as I think you have) that i/o buffers represent a contiguou=
s stream of samples, because there can be dropped buffers, and you need to =
represent this. (btw. this is another example of how real-time audio is not=
 like an iostream).</div><div><br></div><div>Something I forgot earlier: ea=
ch DAC or ADC may be running in a different clock domain. The CPU time is u=
sually another clock domain. So you have multiple drifting clocks. One cons=
equence of this is that you can&#39;t make simplifying assumptions that e.g=
.. 44100 samples elapsed is exactly 1 second of system monotonic time. That&=
#39;s why you need timestamps associated with the buffers, so that the clie=
nt can estimate the actual sample rate.</div><div><br></div><div><br></div>=
</div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/53eaa67d-eec5-4ee1-bea2-848394b4f069%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/53eaa67d-eec5-4ee1-bea2-848394b4f069=
%40isocpp.org</a>.<br />

------=_Part_2281_1375421992.1465545991756--

------=_Part_2280_1813943857.1465545991756--

.
