From owner-freebsd-multimedia@freebsd.org Fri Dec 4 01:55:24 2020 Return-Path: Delivered-To: freebsd-multimedia@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 3F6244B7488 for ; Fri, 4 Dec 2020 01:55:24 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.nyi.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 4CnG4X16hyz3M3m for ; Fri, 4 Dec 2020 01:55:24 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id 265884B7487; Fri, 4 Dec 2020 01:55:24 +0000 (UTC) Delivered-To: multimedia@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 262454B71F0 for ; Fri, 4 Dec 2020 01:55:24 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CnG4X0WQnz3Lrv for ; Fri, 4 Dec 2020 01:55:24 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 04E212347D for ; Fri, 4 Dec 2020 01:55:24 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 0B41tNP0038946 for ; Fri, 4 Dec 2020 01:55:23 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 0B41tNst038945 for multimedia@FreeBSD.org; Fri, 4 Dec 2020 01:55:23 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: multimedia@FreeBSD.org Subject: [Bug 251125] audio/jack: update to jack2 or add new port audio/jack2 Date: Fri, 04 Dec 2020 01:55:21 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ports & Packages X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: dev@submerge.ch X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: multimedia@FreeBSD.org X-Bugzilla-Flags: maintainer-feedback? X-Bugzilla-Changed-Fields: attachments.created Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Dec 2020 01:55:24 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D251125 --- Comment #42 from Florian Walpen --- Created attachment 220234 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D220234&action= =3Dedit Handle non-power-of-2 sized buffers on the OSS side Hi Goran, not there yet, but we're getting closer to "generally working" territory. Could you test the above patch applied to your repo, both with 4= 55 and standard periods like 512, and ignorehwbuf disabled? Background (someone correct me if I'm wrong): * Fragment size (=3D=3D block size) is always 2^N in FreeBSD (minus 3byte rounding) * Fragment count is also a 2^N number * Some hardware requires odd jack2 periods to achieve 2^N buffer sizes (24= bit, 18in18out) * Some hardware cannot achieve 2^N buffer sizes (10in12out) * Writes (reads) of exactly fragment size may be desirable, but not strict= ly necessary * jack2 setting "ignorehwbuf" is not read from settings, always set to true The current execution path with "ignorehwbuf" set handles non-2^N buffer si= zes by adjusting the jack2 period written per cycle, but fails to update the ac= tual buffer size - thus we write garbage to OSS in that case. Also the adjustmen= t is uncoordinated between in and out channels, fails completely for asymmetric channel counts. What this patch supposedly does: * Preserve current behavior for 2^N buffer sizes * Only adjust the jack2 period if "ignorehwbuf" is set (yes, funny name) * Update buffer size in that case * Asymmetric channel counts are still broken with "ignorehwbuf" * Otherwise allow non-2^N buffer sizes * Ignore fragment size for reads and writes in that case * Request more but smaller fragments (same total size) Not sure about using smaller fragments, it seemed to help with jitter tolerance, but I'm not totally convinced that the fragment size works like I think it does. --=20 You are receiving this mail because: You are the assignee for the bug.=