From nobody Sun Mar 30 17:48:55 2025 X-Original-To: multimedia@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ZQhZv67zTz5rpHW for ; Sun, 30 Mar 2025 17:48:55 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ZQhZv2FYPz3SDC for ; Sun, 30 Mar 2025 17:48:55 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1743356935; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JM++IRgIPgosayoRF/TegM0tjFRA8PAimUtdDlvM8gM=; b=xYzAxGqJgeLl7yUxQRL6vdE7xiHDTwjeAG0LynVbMaVc16ejsx9cILCJnLVWwPT0+nqr2b RiRdB/5WVLKvJo4yE4ciakcW+RwLbRxdstmc70GVoxFftp4IBmLVqzDzDGrBJ2xmE5ZhPR oG8pG3NNjrxfvjARc8RMiaBvPkujVBTvxdVI2SUs9ZC+uebpH2pBlxPNSy9n8jhTg8AHxj iZjE/aGfpF3/R14IZsNAJYXzRM+QIt7e6WWS1NNgbRiXt8waLxCPxdnSsVYIbfhNKgvpMB ApZppQGqR/0TZjNi+3fPfh9UnJXTxPpGYSocqUwzgPyvf1X5axF0yc0UfkJwhw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1743356935; a=rsa-sha256; cv=none; b=pMlh7/9ntYo+/ThrKN1B4OE8MtClJOuBuiFNKd7UTxqJh7GXh57YqRxvTFm/1Bsbyggsbw 8Y3Iia2EKFm9Qfo/dhz6DkunjuFu9CcClFFyWa2hnpU8l4kFTA7j9qQzMg+4nfizROr99k T2OW/fTgPFg9nSUTeO3hYtxxTeth+UTArLwGfpq1nrMibjgNpYaAKxk/2TemAqclS+CpQO 75uqvzJMy/vmLAxRNZJw3ZLfQv+R1UT+SIqaADYW6Tc1DZvR9DOs9jfImNT/xPzSWa9NIs LxXd/RyDzD3+zAo/5mnc80HYJLn7Foeuo68K4EY5K0kfJjHggEBj5R9BLeOG7A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1743356935; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JM++IRgIPgosayoRF/TegM0tjFRA8PAimUtdDlvM8gM=; b=PEu9DmFCOAef6JFWcqVrLTCuH5PXjkkfuVNlE2Pzz2wcipfLiKDQrgT0j0ktglvH13H1sU x4tA1tOMjzuDItFyGz4+j54g4N3zSw4zHMb74LR49MqnkAPpJzlc8cilg/AI1MuxrivIRk 6fte1+is4V4Z+35dAtDjJCCefHfz80ddYmHILEjX200wvOQuiVuXdFNzFFfxZ5dRnnsPhv BwRCoK3Qiimb2zcFcWmjipz8RCU9uyf+JCQRuISsxAWPivbpp9XWTxOT6BDyC53G0xM/FM ojWIx1SrOy51ftKpmG2qErdALwFHk/O4YqeniC1PulLs2Qg1dSC8ebT2YFgaNA== 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 4ZQhZv19Zqz1P03 for ; Sun, 30 Mar 2025 17:48:55 +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 52UHmspw019944 for ; Sun, 30 Mar 2025 17:48:54 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from bugzilla@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 52UHmsag019943 for multimedia@FreeBSD.org; Sun, 30 Mar 2025 17:48:54 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: bugzilla set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: multimedia@FreeBSD.org Subject: [Bug 157050] OSS implementation lacks AFMT_FLOAT Date: Sun, 30 Mar 2025 17:48:55 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 9.0-CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: commit-hook@FreeBSD.org X-Bugzilla-Status: Closed X-Bugzilla-Resolution: Overcome By Events X-Bugzilla-Priority: Normal X-Bugzilla-Assigned-To: multimedia@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Multimedia discussions List-Archive: https://lists.freebsd.org/archives/freebsd-multimedia List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-multimedia@FreeBSD.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D157050 --- Comment #7 from commit-hook@FreeBSD.org --- A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=3De1bbaa71d62c8681a576f9f5bedf475c7= 541bd35 commit e1bbaa71d62c8681a576f9f5bedf475c7541bd35 Author: Christos Margiolis AuthorDate: 2025-03-30 17:45:38 +0000 Commit: Christos Margiolis CommitDate: 2025-03-30 17:45:38 +0000 sound: Implement AFMT_FLOAT support Even though the OSS manual [1] advises against using AFMT_FLOAT, there are applications that expect the sound driver to support it, and might not work properly without it. This patch adds AFMT_F32_LE|BE (as well as AFMT_FLOAT for OSS compatibility) in sys/soundcard.h and implements AFMT_F32_LE|BE <-> AFMT_S32_LE|BE conversion functions. As a result, applications can write/read floats to/from sound(4), but internally, because sound(4) works with integers, we convert floating point samples to integer ones, before doing any processing. The reason for encoding/decoding IEEE754s manually, instead of using fpu_kern(9), is that fpu_kern(9) is not supported by all architectures, and also introduces significant overhead. The IEEE754 encoding/decoding implementation has been written by Ariff Abdullah [2]. [1] http://manuals.opensound.com/developer/AFMT_FLOAT.html [2] https://people.freebsd.org/~ariff/utils/ieee754.c PR: 157050, 184380, 264973, 280612, 281390 Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D47638 sys/dev/sound/pcm/channel.c | 4 +++ sys/dev/sound/pcm/feeder_chain.c | 2 ++ sys/dev/sound/pcm/feeder_rate.c | 4 +++ sys/dev/sound/pcm/feeder_volume.c | 2 ++ sys/dev/sound/pcm/pcm.h | 67 +++++++++++++++++++++++++++++++++++= ++-- sys/dev/sound/pcm/sound.h | 13 +++++--- sys/sys/soundcard.h | 8 +++++ tests/sys/sound/pcm_read_write.c | 6 ++++ 8 files changed, 98 insertions(+), 8 deletions(-) --=20 You are receiving this mail because: You are the assignee for the bug.=