From owner-freebsd-arm@freebsd.org Thu Aug 15 11:46:39 2019 Return-Path: Delivered-To: freebsd-arm@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B1874CE88C for ; Thu, 15 Aug 2019 11:46:39 +0000 (UTC) (envelope-from per@hedeland.org) Received: from outbound1f.eu.mailhop.org (outbound1f.eu.mailhop.org [52.28.59.28]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 468Pmt561tz3GBd for ; Thu, 15 Aug 2019 11:46:38 +0000 (UTC) (envelope-from per@hedeland.org) ARC-Seal: i=1; a=rsa-sha256; t=1565869596; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=c0EASnvXL5XV3XrjuMSeDmV/avwuSlEOPZzxAXWp6uxg+GrcCJcFt31L7K6GYZcDAFm+cCPs28uAy K1hnkZxLT6CyWGCNgpDPMmC7ibM8QuHpeflBRRI6dm+CrxOoHycVvA7Z8GEIQhSsPKpEfWvdqANaVu uSX8Vh3Y1617o02rG5hPo8OKPPBilArj7Vz2Oav27wkVeOJfa2vmI81oyOtASUxcC6K7P1KJHwPLtN fqnKc2bdmkiBYSQq+YR3KfyV0wZw06vj3hct9nNQEM9vqzMdKT3W0u7tzO8+NTfp2ZnEDKxlREdC/x LHnVqkeE0EU66qC4luF1W3a2lC4q2+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:content-type:in-reply-to:mime-version:date: message-id:from:references:cc:to:subject:dkim-signature:from; bh=JpZgwlv5CuMNVAFA7HhPvp2E29d7pOU1oIYQrKyvvrM=; b=XgG4cmq8+9hxIrwwLxVHMGCMH/JLF60IWqsURf/nRoXvfLaQMQp9pmem57YjOoZGyDeSC1nMJk2kG sy40WFAn66A/iWfkedtYnw40YHABJqcFZ6NRSrSPCp+VVq3TFR3Nt19BHihtdgmbILxsnM3akEaSZI BqGC6sygd97iW2kJT0Z8QcS5NdPRw6SRQoD/S3WZDY8WZjAUExQVdLNHYslwFnbXwn82hDSZKeSgWw xLt9OYz9EZrmTCnGCw88gbkkDRSg7zw2W14dXl5PPm4OYzOfOQI8h57ghKOcIqvFsc3Wbo2ZxuoHy+ pxMVPVmf2CgYlR+NO49HEv9GrUdiJDQ== ARC-Authentication-Results: i=1; outbound2.eu.mailhop.org; spf=none smtp.mailfrom=hedeland.org smtp.remote-ip=81.228.157.209; dmarc=none header.from=hedeland.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:content-type:in-reply-to:mime-version:date: message-id:from:references:cc:to:subject:from; bh=JpZgwlv5CuMNVAFA7HhPvp2E29d7pOU1oIYQrKyvvrM=; b=aD54f5lhfFEnswGxSVTlG1WqZkqZAH4Hiz88wIO2gNDAbDSFJRMR+JE9XO5M1b5KMTLDO5EzGFKCA k+P1xSUNVsrzVBmer+YixvQk8HHX4+COGHA1MVZxRbM5hh1aVYXUCR73TfpMVh+irS3vrlnfWOUPf/ p3VRxebxH6hNSlGkKnFEn26ZPlV5Dv/Z3WkOMpX4zuDtl5GyenoPvJnprN3EW4pOZ9gSqDdY5gTgnc x/0kP4m0u5LWufKeAfvEkaEdM2r4oxOFTZrozf1+zZ7tSGEkDix8DQ6D9O2s72HaH/L+Z7akAhPwJW tpie2nsILne+Y+68LEvlmHN0xmUdxUQ== X-MHO-RoutePath: cGVyaGVkZWxhbmQ= X-MHO-User: 540bab10-bf52-11e9-a204-f5e3bb5d0a28 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 81.228.157.209 X-Mail-Handler: DuoCircle Outbound SMTP Received: from hedeland.org (unknown [81.228.157.209]) by outbound2.eu.mailhop.org (Halon) with ESMTPSA id 540bab10-bf52-11e9-a204-f5e3bb5d0a28; Thu, 15 Aug 2019 11:46:34 +0000 (UTC) Received: from pluto.hedeland.org (pluto.hedeland.org [10.1.1.5]) by tellus.hedeland.org (8.15.2/8.15.2) with ESMTPS id x7FBkWCc042201 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Thu, 15 Aug 2019 13:46:32 +0200 (CEST) (envelope-from per@hedeland.org) Subject: Re: Is it a good idea to use a usb-serial adapter for PPS? Yes, it is. To: Ian Lepore Cc: freebsd-arm@freebsd.org References: <69a9bed3-4d0a-f8f6-91af-a8f7d84ee307@hedeland.org> <345bae77417c2495f55799b4c7ca2784f4ece9ed.camel@freebsd.org> <7312032d-2908-9414-0445-6b442c3a02e5@hedeland.org> <523b6f0a0fa5f2aeec298fa74df25d3c4af66acc.camel@freebsd.org> From: Per Hedeland Message-ID: <0426fc8b-5398-d8ab-561e-7823c24403a5@hedeland.org> Date: Thu, 15 Aug 2019 13:46:32 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <523b6f0a0fa5f2aeec298fa74df25d3c4af66acc.camel@freebsd.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 468Pmt561tz3GBd X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=outbound.mailhop.org header.s=dkim-high header.b=aD54f5lh; dmarc=none; spf=none (mx1.freebsd.org: domain of per@hedeland.org has no SPF policy when checking 52.28.59.28) smtp.mailfrom=per@hedeland.org X-Spamd-Result: default: False [-5.53 / 15.00]; RCVD_TLS_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[outbound.mailhop.org:s=dkim-high]; HAS_XOIP(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[hedeland.org]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[outbound.mailhop.org:+]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[28.59.28.52.list.dnswl.org : 127.0.20.0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; RECEIVED_SPAMHAUS_PBL(0.00)[209.157.228.81.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; IP_SCORE(-1.25)[ipnet: 52.28.0.0/16(-4.87), asn: 16509(-1.35), country: US(-0.05)]; ASN(0.00)[asn:16509, ipnet:52.28.0.0/16, country:US]; MID_RHS_MATCH_FROM(0.00)[]; SUBJECT_HAS_QUESTION(0.00)[]; ARC_ALLOW(-1.00)[i=1] X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Aug 2019 11:46:39 -0000 On 2019-08-09 22:17, Ian Lepore wrote: > On Fri, 2019-08-09 at 21:36 +0200, Per Hedeland wrote: >> On 2019-08-09 17:28, Ian Lepore wrote: >>> On Thu, 2019-08-08 at 22:26 +0200, Per Hedeland wrote: >>>> On 2019-08-07 18:53, Ross Alexander wrote: >>>>> In Message-ID: < >>>>> B9EFA4D4-C1AD-4181-B421-F6BD53434FA5@dons.net.au>, >>>>> someone wrote [sorry, attrib trail is a little blurry ed.]: >>>>> >>>>>>> Most people are not worried about their kernel clock being >>>>>>> 200 >>>>>>> microseconds off from UTC, even if they're using the PPS >>>>>>> signal >>>>>>> from a >>>>>>> GPS receiver. So I think most people should feel >>>>>>> completely at >>>>>>> ease >>>>>>> using a USB serial adapter as the input device for a PPS >>>>>>> signal. >>>>> >>>>> Some people do worry, although getting PPS to work over USB is >>>>> a >>>>> fine >>>>> first step and I'm grateful for the breadcrumb trail. >>>> >>>> For those that do worry, you can of course tell ntpd to correct >>>> for a >>>> semi-fixed offset (via the 'time1' option to the 'fudge' command) >>>> - >>>> once you know how large the offset is... More important is a low >>>> jitter, and 20-30 microseconds seems quite good. [snip] >> Would you object to >> me posting an article with a *link* to your message >> (i.e. >> https://lists.freebsd.org/pipermail/freebsd-arm/2019-August/020263.html >> ) >> in the newsgroup? > > It might be better to use the link to the copy I sent to the freebsd- > usb list, since it's more directly on-topic: > > https://lists.freebsd.org/pipermail/freebsd-usb/2019-August/016078.html > > I also think it would be wise to add a caveat that the results are for > FreeBSD. I would expect linux performance to be similar. But for > Windows, all bets are off; Windows drivers for usb-serial devices are > said to vary wildly in quality depending on the vendor. OK, I took it to the newsgroup, and while the initial comments were pretty much "it's impossible to get good results via USB" even though your test seemed to show that it wasn't, after some discussion it seems quite strange to me too that you get a pretty much fixed offset and low jitter, since the USB communication including DCD/CTS detection is apparently based on polling from the host. I have a theory that your making the kernel clock be based on the 10 MHz clock also ended up locking the USB poll frequency to that clock, and thus to the PPS signal - this would certainly explain the result. Do you think this is a possibility? Would it be possible for you to re-run the test without modifying the kernel clock? (I do understand that the results will be harder to interpret with the drift, and ntpd's correction of it, coming into play.) --Per